Skip to content

A question on volatility

2 messages · Adrian Trapletti

#
Hi Megh,

As a practitioner I would use something like

x1 <- get.hist.quote(instrument = "^gspc", start = "1990-01-01")
x2 <- get.hist.quote(instrument = "^dji", start = "1990-01-01")  ## both 
need to be synchronized in time

r1 <- log(x1[, 2])-log(x1[, 3]) ## range as proxy for vola
r2 <- log(x2[, 2])-log(x2[, 3]) ## not ()^2 to avoid possibly non-finite 
fourth moment

r <- merge(r1, r2)

plot(r)

rcor <- rollapply(r, width = 250, FUN = function(z) cor(z[, 1], z[, 2], 
method = "pearson"),
                  by.column = FALSE, align = "left") ## method != 
"pearson" for rank correlations

plot(rcor)

as a starting point. As a next step I would use a better proxy for vola 
from the zoo of realized vola based estimators.

Best regards
Adrian

  
    
#
I forgot to mention: Usually it is better to work with the logarithmic 
vola proxy, i.e., use

r<-log(r)

after the merge.

Best regards
Adrian
Adrian Trapletti wrote: