1
$\begingroup$

I'm trying to write the R codes for forecasting the realized volatility of S&P 500 using the HAR-IV model with Markov Switching, where IV is VIX index. I used the MsWM package in R with the data imported from a Excel spreadsheet which haves the following data labels: RV, RV(t-1), RV(t-5), RV(t-22), VIX. Basically, the HAR model is a linear model:

RV= aRV(t-1)+ bRV(t-5)+cRV(t-22)+dVIX

Then, I applied the MsFit function. Everything goes well for the in-the-sample performance. However, I don't know how to perform the out-of-sample forecast with this package. Does anybody have any idea on this problem?

Thank you!!

$\endgroup$

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.