It’s common to compute realized volatility or the standard deviation of returns.
- The formula commonly uses daily closing prices (ie daily returns). That’s the 1 in the formula. However, we can sample the volatility using longer windows. If you chose 5 instead of 1 you are “sampling the volatility weekly instead of daily”.
- N represents the lookback. The larger the N the larger the sample size.
- Since volatility is only sampled on business days:
- a lookback that samples the vol weekly will have an N of about 52 in a year while a lookback that samples the vol daily will have 251 samples in a year
- the longer your sampling period, the smaller the sample size for a given lookback
A word on μ in the realized volatility formula
It is not uncommon for traders to discard μ which is equivalent to setting it to zero. The easiest way to appreciate why is to imagine a stock whose logreturn is exactly 2% per day. The daily deviation from the mean logreturn of +2% would be 0, in turn, rendering the realized volatility measure zero!
If a stock went up (or down) 2% per day and we concluded that volatility is zero, then it’s fair to say the measure is broken. By “de-trending” the formula by ignoring μ, you get a less biased measure.
In practice, this matters less over shorter lookbacks where the “drift” is a smaller component of the volatility. If your lookback periods are long, the drift becomes significant. If the SP500 has an annual drift of +9% with a standard deviation is 16% the drift is a substantial portion of the volatility.
The impact is an order of magnitude smaller for shorter lookbacks. On a daily basis the drift is 3 bps while the volatility is 100 bps.