Get startedGet started for free

Change estimation sample

There can be several causes for rejecting the validity of the GARCH model. It could be a wrong assumption for the mean, the variance or the distribution. It could also be that the time series of returns cannot be described by one set of GARCH parameters. In fact, given the dynamic nature of financial markets, it is realistic to expect that GARCH model parameters change through time. Let's therefore re-estimate our GARCH model on the 2500 most recent EUR/USD returns instead of doing the analysis on all 4961 returns.

This exercise is part of the course

GARCH Models in R

View Course

Exercise instructions

  • Use the function tail() to estimate the GARCH model on the last 2500 observations
  • Compute the standardized returns
  • Do the Ljung-Box test that all autocorrelations of order 1,…,22 are zero.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Estimate the model on the last 2500 observations
tgarchspec <- ___( mean.model = list(armaOrder = c(0,0)),
                        variance.model = list(model = "sGARCH"),
                        distribution.model = "std")
tgarchfit <- ___( data = ___(EURUSDret, ___) , spec = tgarchspec)

# Compute standardized returns
stdEURUSDret <- ___(tgarchfit, standardize = TRUE)

# Do the Ljung-Box test on the absolute standardized returns
___(abs(stdEURUSDret), 22, type = "Ljung-Box")
Edit and Run Code