# How to calculate volatility using historical returns. Explanation and Overview.

In our last article, we talked about how to calculate volatility by using the expected return. But what if you don't know the expected return? Well, in that case, you could use historical realized returns in order to calculate volatility. Let's say that you have the S&P 500 or some other stock market index and you want to know what is the volatility over a certain period of time. Let's take the S&P 500 from 2004 to 2007 you've got the annual return, it's 10.9% in 2004 going through 2007 where's 5.5%. Now you want to calculate the volatility of the S&P 500, how would you go about doing that?

### #1st Step:

we need to know the average return over this period. So what we're just gonna do here is we're gonna take each return and we're gonna add them together in the numerator. So (0.109 + 0.049 + 0.158 + 0.055) and we're gonna divide that by 4 because there are four periods or four years. Now that gives us 0.09275. So in other words the return was 9.75% but we're gonna use that number in order to compute our volatility. Because volatility is basically just going to be the standard deviation of these returns but before we can get to standard deviation we need to calculate the variance.

### #2nd Step:

We're gonna need this number here is the Average Return that we got from 1st step is 0.09275. We're gonna need that to calculate the variance. So we're gonna take each year's return, 2004 for example that was 0.109 we're going to take that and we're going to subtract the Average Return that we got from 1st step which is 0.09275. You can think of that as the mean.

So we're gonna take the observation for each year each year's return and then we're going to subtract out the mean or the average return each time and then we're going to square them all. That's all we're doing with the variance we're getting squared deviations from the mean. So we're going to divide in the denominator, not by 4 but actually (4 - 1) the formula would be (n -1) ends the number of observations we have four years here so the N is for four but we're subtracting one, why? Because we don't know the actual expected return. What we're doing really here is sampling, so I don't want to go into all the statistics and everything but suffice it to say that we lose one degree of freedom here and so we have to subtract one from the denominator.

Now I'm just gonna do the algebra but ultimately we end up with the fraction of 0.007861 and then we divide that by 3 of course because that (4 - 1) and that gives us 0.0262 as our variance.

### #3rd Step:

But the variance is not the volatility the variance is what allows us to calculate the standard deviation. The standard deviation is the square root of the variance, so we're going to take the square root of this 0.0262 and that's going to give us our standard deviation which is 0.051186 and we can convert that to a percentage of 5.1186%.

this is our volatility which is the same thing as our standard deviation. So if somebody said for the period what are we looking at here 2004 to 2007 which is right before the big crash in 2008. So things were still looking pretty good.