Take the 2-minute tour ×
Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. It's 100% free, no registration required.

I want to calculate realized/historical volatility for the underlying products of various options using the Garman-Klass estimator, but I can't see to find an equation, although I know it involves OHLC data. In the comments there is a link to the equation, but I still am looking for a little explanation. Why does this work? What is the variable "F"?

share|improve this question
Google is your best friend, todaysgroep.nl/media/236846/measuring_historic_volatility.pdf –  Matt Wolf May 15 '14 at 15:39
I found this, but was hoping for a better explanation. For example, what is the variable "F"? Frequency? Is this suppose to be the sqrt(252) to annualize the volatility? –  Stu May 15 '14 at 15:40
My Google-fu didn't turn up anything great so I will produce something below. Credits to @joshuaulrich for the TTR R-package I used as source. –  Bob Jansen May 15 '14 at 16:20
that's perfect, thanks –  Stu May 15 '14 at 16:41

1 Answer 1

up vote 3 down vote accepted

In the R TTR package the Garman-Klass volatility is given by

# Historical Open-High-Low-Close Volatility: Garman Klass
# http://www.sitmo.com/eq/402
if( calc=="garman.klass" ) {
  s <- sqrt( N/n * runSum( .5 * log(OHLC[,2]/OHLC[,3])^2 -
             (2*log(2)-1) * log(OHLC[,4]/OHLC[,1])^2 , n ) )

which corresponds to*

$$ \sigma = \sqrt{ \frac{Z}{n} \sum \left[ \textstyle\frac{1}{2}\displaystyle \left( \log \frac{H_i}{L_i} \right)^2 - (2\log 2-1) \left( \log \frac{C_i}{O_i} \right)^2 \right] }. $$ (Note that the link in the source doesn't show anything related to Garman-Klass at the moment.)

I think this code is fairly self-explanatory but what's what?

Z = Number of closing prices in a year, n = number of historical prices used for the volatility estimate.

* $\LaTeX$ taken from the vignette.

share|improve this answer
I like when my documentation helps non-users of my code. :) –  Joshua Ulrich May 16 '14 at 19:49
It really is excellent, better than the papers Google gives. Thanks for that! –  Bob Jansen May 16 '14 at 19:57
No kidding, thanks @JoshuaUlrich ! –  Stu Jul 24 '14 at 20:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.