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
- Standard
| Name | Type | Description | Default | Optional |
|---|---|---|---|---|
| data | None | List[Data] | ||
| The time series data as a list of data points. | None | None | ||
| target | None | str | ||
| The name of the column for which to calculate variance. | None | None | ||
| window | None | PositiveInt | ||
| The number of observations used for calculating the rolling measure. | 21 | True | ||
| index | None | str, optional | ||
| The name of the index column, default is "date". | date | True |
Returns