Overview
There are a set of customary assumptions used when calculating volatility of a financial time series.
Volatility in Finance
For some series, the mean, {% \mu %} is assumed to be zero. This is particularly true in finance. In that case the variance is then
{% variance = \frac{1}{n} \sum X_i^2 %}
Since the value of the mean is not calculated, the factor in the denominator is now {% n %}, rather than
{% n-1 %}
For most assets, the volatility is taken as the standard deviation of returns, typically calculated as the log return, or {% ln(\frac{P_{i}}{P_{i-1}}) %}
{% volatility =\sqrt{ \frac{1}{n} \times \sum_{i=n-size}^{size} ln(\frac{P_{i}}{P_{i-1}}) ^2 } %}