how-to-calculate-volatility-correctly

Volatility is a highly important component in many different investment strategies, but it is also a measure that is not commonly understood, especially when looking at the calculation in detail. In this article we wanted to review the two different approaches of calculating volatility commonly encountered in the market or when looking at different fund factsheets. Investment returns mostly are calculated via a discrete or continuous approach, which will yield different risk and return statistics, based upon each approach that we see. One of the more commonly used approaches in the market is with volatility calculated based on discrete returns, thus

    \[PE_d(t-1,t) = \frac{P_t-P_{t-1}}{P_{t-1}}.\]

For this case, we will show that you have an inaccurate volatility output. We hope you will take some time and read through this article, to be better familiar with volatility calculations. Calculating volatility is not necessarily complex, but doing so without a full awareness of the underlying formulas and assumptions will run the risk of an inaccurate risk reporting for your investment strategy.

Also, if you’d like to read more about this topic and have future articles delivered conveniently to your inbox, please sign up for our newsletter.

Volatility Calculation – the correct way using continuous returns

Volatility is used as a measure of dispersion in asset returns. Thus, it describes the risk attached to an observed financial instrument and is equivalent to the standard deviation calculation well known from statistics. To understand how to calculate volatility correctly and why the commonly used procedure using discrete returns is inaccurate we first need to clarify some basics.

Statistical basics

Let’s assume X to be a one-dimensional discrete random variable taking values in \{x_1,x_2,...\} with f(x_i) the probability density function and F(x_i) the distribution function. X will describe the single-period continuous return of our financial asset and \{x_1,x_2,...\} the potential values X might realize. The information about the probability, that X realizes x_i, is given by f(x_i). The Variance of X is defined as the expected quadratic difference of the random variable’s realizations and the expected value of the random variable:

    \[Var[X] = E\left[(X-E[X])^2\right]\]

As the expected value of a discrete variable is the sum of all realizations times the probabiliy of this realization we get

    \[Var[X] = \sum_i \left( (x_i - E[X]) ^2 \cdot f(x_i) \right)\]

with E[X] the expected value of the random variable X. The standard deviation is derived by taking the square root of the variance, thus

    \[\sigma(X) = \sqrt{Var[X]}.\]

Application on a financial asset

When evaluating financial assets we do not have the luxury of knowing the random variable X representing how a single-period return is defined, thus we do not know anything about the potential values \{ x_1, x_2, ...\} the variable X might realize nor do we know what the probability of the realization of those values f(x_i) is. But we can look at the already realized returns we saw in the past. With this we are then able to estimate from those observations how X behaves, e.g. by estimating statistics like the standard deviation of X.

Now, let’s assume we look at a financial asset with prices P_t at times t \in \{0,1,...,T\}, thus P_0,P_1,...,P_T. We assume that the continuous returns

    \[PE_c(t-1,t)=ln \left( \frac{P_{t}}{P_{t-1}} \right), t={1,...,T},\]

all are realizations of a series of identically distributed random variables X_1,...,X_T, thus PE_c(0,1) is the realization of X_1PE_c(1,2) is the realization of X_2 and so on. To characterize the distribution of X_1, which is the same as all the other distributions of X_2,...,X_T as they are identically distributed, we can now look at the realizations PE_c(0,1),...,PE_c(T-1,T). The historical probability in this setting for each realization equals 1/T as we have T continuous returns.

Calculation of single-period volatility

To calculate the standard deviation we first need to calculate the expected value. As continuous returns are additive (proofed in our article about properties of linear, discrete and continuous returns) we can use the arithmetical average as an estimation for the expected value. So we calculate in a first step

    \[E[X_1] = \frac{1}{T} \sum_{t =1}^T PE_c(t-1,t).\]

The variance of X_1 is now easily derived using the calculated expected value and the variance formula:

    \[Var[X_1] = \sum_{t=1}^T (PE_c(t-1,t) - E[X_1]) ^2 \cdot f(PE_c(t-1,t))\]

with f(PE_c(t-1,t))=1/T for all t as the historical probability for each realization equals 1/T as written above, thus

    \begin{flalign*} Var[X_1] &= \sum_{t=1}^T (PE_c(t-1,t) - E[X_1]) ^2 \cdot \frac{1}{T} \\ &=\frac{1}{T} \cdot \sum_{t=1}^T (PE_c(t-1,t) - E[X_1]) ^2 . \end{flalign*}

Using this we can calculate the standard deviation of the random variable X_1 or equivalentely the “volatility” of the single-period return by

    \begin{flalign*} \sigma[X_1] &= \sqrt{\frac{1}{T} \cdot \sum_{t=1}^T (PE_c(t-1,t) - E[X_1]) ^2 }.\\ \end{flalign*}

There is a lot of debate among statisticians if the above estimation for the variance should be used or if it should be amended by the Bessel’s correction factor T/(T-1) for an unbiased estimator. The respective unbiased estimation for the variance would look like this:

    \begin{flalign*} Var[X_1] &=\frac{T}{T-1} \frac{1}{T} \cdot \sum_{t=1}^T (PE_c(t-1,t) - E[X_1]) ^2  \\ &=\frac{1}{T-1} \cdot \sum_{t=1}^T (PE_c(t-1,t) - E[X_1]) ^2 . \end{flalign*}

As this discussion would go beyond the scope of this article at this point we will leave it to the reader to decide what estimation measure to use.

 

Aggregating single-period volatility to multi-period volatility

Let’s assume we calculated the volatility based on daily continuous returns, thus \sigma[X_1] characterizes the daily volatility. To be able to annualize this volatility we use another assumption and the consequent property of the variance.

Given that the identically distributed random variables X_1,X_2,...,X_n  are also statistically independent of each other, the following holds:

    \[Var \left( \sum_{i=1} ^n X_i \right) = \sum_{i=1} ^n Var[X_i]\]

Given the additivity of continuous returns we know that a year’s return (let’s assume a year has 252 trading days) described by the random variable X_{ann} can be written as the sum of 252 random variables describing the daily returns, X_{ann} =\sum_{t=1}^{252} X_t. Thus we have for the variance of the yearly continuous return using that Var[X_1]=Var[X_2]=...=Var[X_{252}], as the random variables describing the daily returns are identically distributed,

    \begin{flalign*} Var[X_{ann}] &=Var\left[ \sum_{t=1}^{252} X_t \right]=\sum_{t=1}^{252} Var\left[ X_t \right]\\ &=\sum_{t=1}^{252} Var\left[ X_1 \right]=252 \cdot Var\left[ X_1 \right].\\ \end{flalign*}

And thus

    \[\sigma(X_{ann}) =\sqrt{252\cdot Var[X_1]}= \sqrt{252} \cdot \sigma[X_1].\]

To summarize

Under the assumptions that the

  • single-period returns are identically distributed and
  • single-period returns are additive

the single-period volatility can be calculated based on T observed single-period returns using

    \[\sigma = \sqrt{ \frac{1}{T} \sum_{t =1}^T \left( r(t) - \mu \right )^2 }\]

    \[\mu = \frac{1}{T} \sum_{t =1}^T r(t)\]

    \[r(t) = PE_c(t-1,t) = ln \left(\frac{P_t}{P_{t-1}}\right).\]

Single-period volatiliy can be aggregated under the additional assumption that the

  • single-period returns are independent

to a multi-period volatility consisting of m single-period time frames using

    \[\sigma_{multi-period}  = \sqrt{m} \cdot \sigma.\]

 

Why calculating volatility using discrete returns is not meaningful

Of course, all of the mathematical basics mentioned above are still true when we start working with discrete returns. The random variable X now describes the single-period discrete return of our financial asset and not the continuous return.

Pitfall using discrete returns for calculating single-period volatility

As detailed above, the expected value of our random variable needs to be calculated based on the set of discrete returns. As shown in properties of linear, discrete and continuous returns, discrete returns are not additive but multiplicative. So using the arithmetical average as an estimation for the expected value is not appropriate, as applying arithmetic operations on geometric data like discrete returns would have no meaningful interpretation. An estimation for the expected value of discrete returns we could interpret financially would be to use the geometrical average:

    \[E[X_1] = \left( \prod_{t =1}^T (1+PE_d(t-1,t)) \right) ^{1/T} - 1\]

However, although we can interpret this, it underestimates the expected value of the discrete returns.

So when trying to calculate volatility using discrete returns you must choose between the lesser of two evils – either you take a poor estimation for the expected value (geometrical average) or you risk calculating something which can not be interpreted and thus is not meaningful (arithmetical average).

Consequently, we highly recommend calculating volatility using continuous returns in a well-defined framework as outlined in the sections before. Also, if you’d like to read more about this topic and have future articles delivered conveniently to your inbox, please sign up for our newsletter.

 

WEBINAR

Want to learn more about optimizing investment strategies and improving analytics?

Learn More ❯