0
$\begingroup$
Realized.Variance<-rollapply((log(Fama.French.daily$Mkt+1)^2) ,126,sum,by=1)

So Fama.French.dail$Mkt is my daily Market return.

To calculate the realized Variance over the preceding 126 days, i took the sum of the squared log returns of the past 126 observations. (Using the approach above the value on day 126 includes day 126, so its the preceding value for day 127.) Anyway, How can i annualize them ? Is it times 252 or do i just multiply by 2 since i already summed up half a year?

$\endgroup$
2
  • 1
    $\begingroup$ Don’t follow your code, but in terms of annualised variance, you will need to multiply the variance by 252 as the variance you computed represents the variance of daily returns. Had you computed the return over half a year, $X_{127}-X_{1}$, then you could have annualised by multiplying it by 2. $\endgroup$ Jun 30 '19 at 19:46
  • $\begingroup$ And re variance pls see discussion here: stackoverflow.com/questions/13195442/moving-variance-in-r $\endgroup$ Jun 30 '19 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.