I have seen this strategy example, which uses garch in a regime switching context:


The author classifies volatility by percentile using a 252 day look back period. Volatility is defined as the standard deviation of the past 21 log returns. So far, so good.

However, the way the author ranks volatility is strange to me. Instead of simply taking the percentile rank of the current day counting the past 252, he does this, in R:

vol.rank = percent.rank(SMA(percent.rank(hist.vol, 252), 21), 250)

So, assuming hist.vol is a vector of historical volatilities, he first assigns to each day its percentile rank according to the past 252 days. That should be enough to me, but then he proceeds to take the simple moving average of the percentile ranks, and then again classify each of these SMAs of percentile ranks into their own percentile ranks.

What is the rationale in doing that?


1 Answer 1


Using a simple moving average is a trick to take the noise out of the estimated quantity. He calculates a measure of volatility that is the SMA of the estimates of historical volatilities for the past 21 days.

This is a crude way to estimate volatility. If you read further you will see that the author uses a GARCH(1,1) model to estimate volatility.

  • $\begingroup$ Hi, thanks, yes I am aware of the garch, but, after applying garch, he takes the percentile rank of the SMA of the percentile rank... that is what is bugging me, I found it really strange. But thanks! $\endgroup$ Feb 26, 2015 at 22:56
  • $\begingroup$ If I remember correctly he was just providing a simple example before applying GARCH. $\endgroup$
    – jaamor
    Feb 26, 2015 at 23:00
  • $\begingroup$ He actually also does it after GARCH: vol.rank = percent.rank(SMA(percent.rank(garch.vol, 252), 21), 250) $\endgroup$ Feb 27, 2015 at 0:25
  • $\begingroup$ Interesting. I am not sure why he does that. $\endgroup$
    – jaamor
    Feb 27, 2015 at 0:36
  • $\begingroup$ Yeah, I am not sure either, and the fact that you are not sure actually comforts me in a weird way hehe, my fear was that this was standard practice and that I've been doing it all wrong for a long time! $\endgroup$ Feb 27, 2015 at 14:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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