शुरू करेंमुफ़्त में शुरू करें

The recursive nature of the GARCH variance

Under the GARCH(1,1) equation the predicted variance is determined by the squared surprise in return and the previous variance prediction:

You can implement this using a loop (refer to the slides if you don't remember the loop structure from the video).

Let's do this for the S&P 500 daily returns. The variables omega, alpha, beta, nobs, e2 and predvar are already loaded in your R environment.

यह अभ्यास पाठ्यक्रम का हिस्सा है

GARCH Models in R

पाठ्यक्रम देखें

अभ्यास निर्देश

  • Compute the predicted variances.
  • Use predvar to define the series of predicted annualized volatility ann_predvol .
  • Plot the predicted annualized volatility for the years 2008-2009 to see the dynamics around the financial crisis.

इंटरैक्टिव व्यावहारिक अभ्यास

इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।

# Compute the predicted variances
predvar[1] <- var(sp500ret) 
for(t in 2:nobs){
   predvar[t] <- ___ + ___ * e2[t-1] + ___ * predvar[___]
}

# Create annualized predicted volatility
ann_predvol <- xts(___(252) * sqrt(___), order.by = time(sp500ret))

# Plot the annual predicted volatility in 2008 and 2009
___(___["2008::2009"], main = "Ann. S&P 500 vol in 2008-2009")
कोड संपादित करें और चलाएँ