 # Volatility calculation : Team zerodha

#1

Hi Team,
zerodha varsity show volatility calculation As Std deviation of daily return , Also Daily return calculation is done using LOG function .

Two doubts :

1. Why Daily return is used ? why cant we directly take closing prices and mean of closing prices and calculate std Deviation from same ? Finally we are interested in closing prices rt ?

2. Also couldn’t get Why Log function is used for e.g
Following are closing prices 100 , 101 ,103 , 102 , 104

So why Day 1 return is LOG (101/100) , why cant be it just 1/100 = 0.01 % or 1 as absolute number
Day 2 return is LOG(103/101) , why cant be it just 2/101 = 1.98 % or 2 as absolute number

I’m Confused about daily return word ?

Any explanation on same will be of gr8 help in understanding volatility.

#2

You can use log or simple returns, depends on your data set. Will get to that in a bit.

How can you calculate the SD with just one closing price and the mean? You need a time series of data to calculate the SD.

Like I said, you can take log of simple returns. This depends on the data set. If you are dealing with multiple years data, then simple is better, else stick to log. Log returns tend to give you a fairly representation of returns.

Let me give you an example. You invest in a stock -

Year 1 - 100
Year 2 - 150
Year 3 - 100

So 2nd year, you make a 50% return (simple), and year 3 you get a -33% return. If you take the average across 2 years, then it means you’ve earned 8.33% return. But in reality you started with 100 and ended up with 100.

For the same if you calculate the log return -

log (150/100) = +17.6%
log (100/150) = -17.6%

So avg is 0%, which is in line with the reality.

#3

Hi Karthik ,
Thanks for your response . From the example you have shared I got the point we cannot mix percentages returns which are calculated using different base

Now my question is can we calculate using absolute values and Log returns :

Like let say 10,11,12,13,14 are closing prices -
mean would be 12
and
std dev = sqrt of [(2^2 +1^2+0±1^2±2^2) /5]
= sqrt of [(4+1+0+1+4)/5]
= sqrt of [10/5 ]
=1.41

using LOG function
log(11/10) = 0.041 ,
log(12/11)= 0.037 ,
log(13/12) = 0.034 ,
log(14/13)= 0.032
std dev of above 4 values = 0.00339

which one to consider correct in above example ? calculation using absolute values and calculation using log return values

#4

In Above example i have calculated log to base 10 ,

calculating log to base e

loge(11/10)= 0.095
loge(12/11)= 0.087
loge(13/12)=0.080
loge(14/13)=0.074

convert above values to percentage 9.5,8.7,8.0,7.4

Std dev of 9.5,8.7,8.0,7.4
=0.784

calculation of volatility using absolute number and log to base e give different volatility values.

what to use ?