GARCH Toolbox    

Transients in the Simulation Process

Automatic Minimization of Transient Effects

The function garchsim generates stable output processes in (approximately) steady-state by attempting to eliminate transients in the data it simulates. garchsim first estimates the number of observations needed for the transients to decay to some arbitrarily small value, and then generates a number of observations equal to the sum of this estimated value and the number you request. garchsim then ignores the estimated number of initial samples needed for the transients to decay sufficiently and returns only the requested number of later observations.

To do this, garchsim interprets the simulated GARCH(P,Q) conditional variance process as an ARMA(max(P,Q),P) model for the squared innovations (see, for example, Bollerslev [4], p.310). It then interprets this ARMA(max(P,Q),P) model as the correlated output of a linear filter and estimates its impulse response by finding the magnitude of the largest eigenvalue of its auto-regressive polynomial. Based on this eigenvalue, garchsim estimates the number of observations needed for the magnitude of the impulse response (which begins at 1) to decay below 0.01 (i.e., 1 percent). If the conditional mean has an ARMA(R,M) component, then garchsim also estimates its impulse response.

Depending on the values of the parameters in the simulated conditional mean and variance models, you may need long pre-sample periods for the transients to die out. Although the simulation outputs may be relatively small matrices, the initial computation of these transients can result in a large memory burden and seriously impact performance. In the previous example, which simulates three 200-by-1000 element arrays, intermediate storage is required for far more than 200 observations.

Further Minimization of Transient Effects

If you suspect transients persist in the simulated data garchsim returns, you can oversample and delete observations from the beginning of each series. For example, suppose you would like to simulate 10 independent paths of 1000 observations each for {t}, {t}, and {yt} starting from a known scalar random number seed (12345). Start by generating 1200 observations, then further minimize the effect of transients by retaining only the last 1000 observations of interest.

Understanding Transient Effects

The example in this section builds on the example in the section Further Minimization of Transient Effects. The previous example simulated 10 independent paths of 1000 observations each for {t}, {t}, and {yt} and returned its outputs in the variables e, s, and y respectively. This example uses the GARCH Toolbox inference function garchinfer to infer {t} and {t} from the simulated return series y. It then compares the steady-state simulated innovations and conditional standard deviation processes with the inferred innovations and conditional standard deviation processes.

Essentially, garchsim uses an ARMA model as a linear filter to transform an uncorrelated input innovations process {t} into a correlated output returns process {yt}. Use the function garchinfer to reverse this process by inferring innovations {t} and standard deviation {t} processes from the observations in {yt}

where eInferred and sInferred are the inferred innovations and conditional standard deviations, respectively. Notice that when you query the workspace, eInferred and sInferred are the same size as the simulated returns matrix y

Now compare the steady-state, simulated processes with their inferred counterparts by examining the third trial (i.e., the third column of each matrix). Note that there is nothing special about the third column, and the following comparisons hold for all columns.

First, create two matrices, eData and sData, to store the row numbers, the simulated and inferred series, and the difference between the two.

Now, print the first 10 rows of eData and sData, using the fprintf command to format the printed output, and examine the observations.

Notice that the difference between the simulated and inferred innovations is effectively zero immediately, whereas the standard deviations appear to converge slowly. If you examine every 25th observation of the standard deviations, through the 400th observation, the convergence is more obvious.

The innovations processes of the default model converge immediately because the default model assumes a simple constant in the conditional mean equation (i.e., there is no correlation in the conditional mean). However, the GARCH(1,1) default conditional variance equation is highly persistent (recall that the GARCH and ARCH parameter estimates are 0.9628 and 0.0318, respectively).


  Simulating Sample Paths A General Simulation Example