Skip to main content

quantile

Calculate the rolling quantile of a target column within a given window size at a specified quantile percentage.

Quantiles are points dividing the range of a probability distribution into intervals with equal probabilities, or dividing the sample in the same way. This function is useful for understanding the distribution of data within a specified window, allowing for analysis of trends, identification of outliers, and assessment of risk..

obb.quantitative.rolling.quantile(data: Union[list, dict, pd.DataFrame, List[pd.DataFrame], pd.Series, List[pd.Series], numpy.ndarray, Data, List[Data]], target: str, window: int = 21, quantile_pct: float = 0.5, index: str = date)

Parameters​

NameTypeDescriptionDefaultOptional
dataNoneList[Data]
The time series data as a list of data points.NoneNone
targetNonestr
The name of the column for which to calculate the quantile.NoneNone
windowNonePositiveInt
The number of observations used for calculating the rolling measure.21True
quantile_pctNoneNonNegativeFloat, optional
The quantile percentage to calculate (e.g., 0.5 for median), default is 0.5.0.5True
indexNonestr, optional
The name of the index column, default is "date".dateTrue

Returns​



On this page