GARCH Toolbox    

A General Simulation Example

This simulation example is more general than the previous one that used the default model, GARCH(1,1). It uses an ARMA(2,1) model to express correlation in the conditional mean. The example:

  1. Defines an ARMA(2,1)/GARCH(1,1) model
  2. Uses the model to simulate 2000 observations for return series, innovations, and conditional standard deviation processes
  3. Infers the innovations and standard deviations for the simulated return series
  4. Compares the simulated and inferred innovations for the first 20 observations

Create the Model

Start by creating an ARMA(2,1)/GARCH(1,1) composite model with repeated calls to garchset.

If you substitute the coefficient vectors from this specification structure in Eq. (2-8) and Eq. (2-9) you get the following ARMA(2,1) and GARCH(1,1) models. These are the models this example simulates.

Simulate and Infer the Innovations

Use this model to simulate 2000 observations in a return series, and their corresponding innovations and standard deviations. Then use garchinfer to infer innovations and standard deviations from the simulated return series.

You can think of the simulation engine garchsim as a filter that generates a (possibly) correlated return series {yt} from a white noise input series {t}. garchinfer reverses this process by inferring innovations {t} and standard deviation {t} processes from the observations in {yt}.

However, garchinfer is a convenience function that only provides a user-friendly interface to the log-likelihood objective function, garchllfn. So, in fact, garchllfn is the inverse (i.e., whitening) filter associated with the simulation engine, because it infers the white noise process from the observed return series. (See the section Understanding Transient Effects.)

Compare Simulated and Inferred Innovations

Now compare the simulated and inferred innovations for the first 20 observations. Notice that, after a few observations, the difference between the simulated and inferred innovations is insignificant.

In the example above, the difference between the simulated and inferred innovations (e - eInferred) illustrates the transient effects introduced by the inference. When garchsim generates data, it generates sufficient initial data, which it then discards, to allow transients to decay to some arbitrarily small value (see Automatic Minimization of Transient Effects). However, the inference function garchinfer (an interface to the log-likelihood objective function, garchllfn) must infer the innovations and conditional standard deviations directly from the observed returns. This can introduce transient effects.

That the first R = 2 rows of the inferred innovations are 0, illustrates the link between simulation, inference, and estimation in the GARCH Toolbox. This fact is also directly related to the manner in which maximum likelihood estimation is performed.

Maximum Likelihood Estimation

Forming the log-likelihood objective function involves a two-step process:

  1. garchllfn uses the conditional mean specification of ARMAX form shown in Eq. (2-16) to infer the innovations from the observed returns. This equation is derived from Eq. (2-8) by solving for t.

     (2-16)  

  1. To infer the innovations, garchllfn uses the Box and Jenkins conditional approach, which conditions the recursion on the initial R observations of yt, setting the initial values of t to 0 (see Hamilton [12], page 132, or Box, Jenkins, and Reinsel [7], page 237). Note that for the default model, R = M = 0, and no transients are induced due to this initialization.

  1. garchllfn must then infer the conditional variances from the squared innovations as illustrated in Eq. (2-9), which is replicated here.
  1. This step initializes the recursion by setting the first max(P,Q) observations of both t2 and t2 to the sample variance of the innovations inferred from the first step (see Hamilton [12], pages 666-667, or Bollerslev [4], page 316).


  Transients in the Simulation Process Forecasting