energy_analysis_toolbox.load_profiles.thresholds.hybrid_rel_std module#
Compute hybrid profiles based on deviations from the mean profile.
This module provides tools to calculate threshold profiles driven by a combination of standard deviation and relative thresholds derived from historical data. The thresholds are designed to adapt to variability in the data, balancing stability with tolerance for variability in consumption patterns.
- class energy_analysis_toolbox.timeseries.profiles.thresholds.hybrid_rel_std.HybridThreshold(offset_std: float = 3, offset_relative: float = 0.5, **kwargs)[source]#
Bases:
MeanProfileReturns the deviation from mean profile (hybrid std and relative thresholds).
- compute(history: Series, time: Timestamp, **kwargs) Series[source]#
Return a threshold profile.
The threshold profile is obtained using a user-defined relative variation from the mean profile built from history.
- Parameters:
history (pd.Series) – Consumption history used to computed the reference profile.
time (pd.Timestamp) – The time at which the profile is of interest. Only the information about the date is used in the passed timestamp.
- Returns:
profile (pd.Series) – Profile threshold with same resolution as the history data
Notes
The profile threshold is obtained as an hybrid between the std and arbitrary tshd profiles :
an average profile is computed from the rolling max of the history on a window centered on each slot with size
window.a std profile is computed from the history (without rolling max)
the returned profile is obtained as the max between :
the profile based on
tshd_stdstandard deviation over the mean profile (the std is computed from the data without rolling aggregation),the profile based on
(1 + tshd_rel)times the mean profile.
The idea behind this profile is to base the threshold on the data variability, but to still have a certain tolerance when the consumption is very stable in the (short) history.
The rolling max also artificially increases the mean value around slots where the consumption is high in order to account for the correlation between the consumption on consecutive slots : a certain “horizontal” dispersion of the consumption is relatively normal.