sigmaquant.performance.risk.annual_vola#
- sigmaquant.performance.risk.annual_vola(returns, frequency)#
Compute annualized volatility.
The function computes the sample standard deviation of periodic returns and scales it to annual frequency using the square-root- of-time rule.
- Parameters:
returns – Time series of periodic returns.
frequency – Frequency of the input data.
- Returns:
Annualized volatility.
- Return type:
float
Notes
NaN values are ignored. If fewer than two valid observations are available, NaN is returned.
Let \(r_t\) denote the periodic returns.
Define the sample standard deviation as:
\[s = \sqrt{ \frac{1}{T - 1} \sum_{t=1}^{T} (r_t - \bar{r})^2 }\]The annualized volatility estimator is:
\[\widehat{\sigma}_{ann} = s \sqrt{N}\]where \(N\) is the number of periods per year implied by
frequency.