Skip to main content

variance

Calculate the rolling variance of a target column within a given window size.

Variance measures the dispersion of a set of data points around their mean. It is a key metric for assessing the volatility and stability of financial returns or other time series data over a specified rolling window.

obb.quantitative.rolling.variance(data: Union[list, dict, pd.DataFrame, List[pd.DataFrame], pd.Series, List[pd.Series], numpy.ndarray, Data, List[Data]], target: str, window: int = 21, 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 variance.NoneNone
windowNonePositiveInt
The number of observations used for calculating the rolling measure.21True
indexNonestr, optional
The name of the index column, default is "date".dateTrue

Returns​



On this page