pastas.stats.signatures.cv_period_mean#
- cv_period_mean(series, normalize=False, freq='ME')[source]#
Coefficient of variation of the mean head over a period (default monthly).
- Parameters
series (pandas.Series) – Pandas Series with DatetimeIndex and head values.
normalize (bool, optional) – normalize the time series to values between zero and one.
freq (str, optional) – frequency to resample the series to by averaging.
- Returns
cv – Coefficient of variation of mean head resampled over a period (default monthly).
- Return type
Notes
Coefficient of variation of mean monthly heads, adapted after Hughes and James [1989]. The higher the coefficient of variation, the more variable the mean monthly head is throughout the year, and vice versa. The coefficient of variation is the standard deviation divided by the mean.
Examples
>>> import pandas as pd >>> from pastas.stats.signatures import cv_period_mean >>> series = pd.Series([1, 2, 3, 4, 5, 6], index=pd.date_range(start='2022-01-01', periods=6, freq='M')) >>> cv = cv_period_mean(series) >>> print(cv)