Documentation Center |
Simulate ARMAX/GARCH model responses
garchsim has been removed. Use simulate instead.
[Innovations,Sigmas,Series]
= garchsim(Spec)
[...] = garchsim(Spec,NumSamples,NumPaths)
[...] = garchsim(Spec,NumSamples,NumPaths,
State)
[...] = garchsim(Spec,NumSamples,NumPaths,State,X)
[...] = garchsim(Spec,NumSamples,NumPaths,State,X,Tolerance)
[...] = garchsim(Spec,NumSamples,NumPaths,State,X,Tolerance,
...
PreInnovations,PreSigmas,PreSeries)
[Innovations,Sigmas,Series] = garchsim(Spec), given specifications for the conditional mean and variance of a univariate time series, simulates a sample path with 100 observations for the return series, innovations, and conditional standard deviation processes. The conditional mean can be of general ARMA form and the conditional variance of general GARCH, EGARCH, or GJR form.
[...] = garchsim(Spec,NumSamples,NumPaths) simulates NumPaths sample paths. Each path is sampled at NumSamples observations.
[...] = garchsim(Spec,NumSamples,NumPaths, State) specifies the State time series matrix of the standardized (zero mean, unit variance), independent, identically distributed random noise process.
[...] = garchsim(Spec,NumSamples,NumPaths,State,X) accepts a time series regression matrix X of observed explanatory data. garchsim treats each column of X as an individual time series, and uses it as an explanatory variable in the regression component of the conditional mean.
[...] = garchsim(Spec,NumSamples,NumPaths,State,X,Tolerance) accepts a scalar transient response tolerance, such that 0 < Tolerance ≤ 1. garchsim estimates the number of observations needed for the magnitude of the impulse response, which begins at 1, to decay below the Tolerance value. The number of observations associated with the transient decay period is subject to a maximum of 10,000 to prevent out-of-memory conditions. When you specify presample observations (PreInnovations, PreSigmas, and PreSeries), garchsim ignores the value of Tolerance.
Use Tolerance to manage the conflict between transient minimization and memory usage. Smaller Tolerance values generate output processes that more closely approximate true steady-state behavior, but require more memory for the additional filtering required. Conversely, larger Tolerance values require less memory, but produce outputs in which transients tend to persist.
If you do not explicitly specify presample data (see below), the impulse response estimates are based on the magnitude of the largest eigenvalue of the autoregressive polynomial.
[...] = garchsim(Spec,NumSamples,NumPaths,State,X,Tolerance,
...
PreInnovations,PreSigmas,PreSeries) uses
presample observations, contained in the time series matrices or column
vectors PreInnovations, PreSigmas,
and PreSeries, to simulate the outputs Innovations, Sigmas,
and Series, respectively. When specified, garchsim uses
these presample arrays to initiate the filtering process, and thus
form the conditioning set upon which the simulated paths are based.
If you specify the presample data as matrices, they must have NumPaths columns. garchsim uses the presample information from a given column to initiate the simulation of the corresponding column of the Innovations, Sigmas, and Series outputs. If you specify the presample data as column vectors, garchsim applies the vectors to each column of the corresponding Innovations, Sigmas, and Series outputs.
If you provide no explicit presample data, garchsim automatically derives the necessary presample observations.
PreInnovations and PreSigmas are usually companion inputs. Although both are optional, when specified, they are typically entered together. A notable exception would be a GARCH(0,Q) (that is, an ARCH(Q)) model in which the conditional variance equation does not require lagged conditional variance forecasts. Similarly, PreSeries is only necessary when you want to simulate the output return Series, and when the conditional mean equation has an autoregressive component.
If the conditional mean or the conditional variance equation is not recursive, then certain presample information is not needed to jump-start the models. However, specifying redundant presample information is not an error, and garchsim ignores presample observations you specify for models that require no such information.
GARCH specification structure for the conditional mean and variance models. You create Spec by calling the function garchset or the estimation function garchfit. The conditional mean can be of general ARMAX form and the conditional variance of general GARCH form. | |
(optional) Positive integer indicating the number of observations garchsim generates for each path of the Innovations, Sigmas, and Series outputs. If NumSamples = [] or is unspecified, the default is 100. | |
(Optional) Positive integer indicating the number of sample paths garchsim generates for the Innovations, Sigmas, and Series outputs. If NumPaths = [] or is unspecified, the default is 1; that is, Innovations, Sigmas and Series are column vectors. | |
Time series matrix or column vector of presample innovations on which the recursive mean and variance models are conditioned. This array can have any number of rows, provided it contains sufficient observations to initialize the mean and variance equations. That is, if M and Q are the number of lagged innovations required by the conditional mean and variance equations, respectively, then PreInnovations must have at least max(M,Q) rows. If the number of rows exceeds max(M,Q), then garchsim uses only the last (most recent) max(M,Q) rows. If PreInnovations is a matrix, then it must have NumPaths columns. | |
Time series matrix or column vector of positive presample conditional standard deviations on which the recursive variance model is conditioned. This array can have any number of rows, provided it contains sufficient observations to initialize the conditional variance equation. That is, if P and Q are the number of lagged conditional standard deviations and lagged innovations required by the conditional variance equation, respectively, then PreSigmas must have at least P rows for GARCH and GJR models, and at least max(P,Q) rows for EGARCH models. If the number of rows exceeds the requirement, then garchsim uses only the last (most recent) rows. If PreSigmas is a matrix, then it must have NumPaths columns. | |
Time series matrix or column vector of presample observations of the return series of interest on which the recursive mean model is conditioned. This array can have any number of rows, provided it contains sufficient observations to initialize the conditional mean equation. Thus, if R is the number of lagged observations of the return series required by the conditional mean equation, then PreSeries must have at least R rows. If the number of rows exceeds R, then garchsim uses only the last (most recent) R rows. If PreSeries is a matrix, then it must have NumPaths columns. | |
Time series matrix of standardized (mean zero, unit variance), independent, identically distributed disturbances that drive the output Innovations time series process. When specified, State must have NumPaths columns and at least NumSamples rows. The first row contains the oldest observation and the last row the most recent. garchsim automatically generates additional presample observations required to minimize transients, if any, based on the distribution found in the input specification structure Spec. garchsim then prepends these to the input State time series matrix. If State has more observations (rows) than necessary, then garchsim uses only the most recent observations. If State is empty or missing, garchsim automatically generates a noise process of appropriate size and distribution. | |
Scalar transient response tolerance, such that 0 < Tolerance ≤ 1. garchsim ignores this tolerance parameter if you specify presample conditioning information (PreInnovations, PreSigmas, and PreSeries). If Tolerance is empty or missing, the default is 0.01 (1%). | |
Time series regression matrix of observed explanatory data. Typically, X is a matrix of asset returns (for example, the return series of an equity index), and represents the past history of the explanatory data. Each column of X is an individual time series used as an explanatory variable in the regression component of the conditional mean. In each column, the first row contains the oldest observation and the last row the most recent. If X = [] or is unspecified, the conditional mean has no regression component. If specified, then at least the most recent NumSamples observations of each return series must be valid (non-NaN). When the number of valid observations in each series exceeds NumSamples, garchsim uses only the most recent NumSamples observations of X. |
NumSamples by NumPaths matrix of innovations, representing a mean zero, discrete-time stochastic process. The Innovations time series follows the conditional variance specification defined in Spec. Rows are sequential observations, columns are paths. | |
NumSamples by NumPaths matrix of conditional standard deviations of the corresponding Innovations matrix. Innovations and Sigmas are the same size. Rows are sequential observations. Columns are paths. | |
NumSamples by NumPaths matrix of the return series of interest. Series is the dependent stochastic process and follows the conditional mean specification of general ARMAX form defined in Spec. Rows are sequential observations. Columns are paths. |
When State is specified, it represents a user-defined time series matrix of standardized (mean zero, unit variance), i.i.d. disturbances {z(t)} that drive the output time series processes {e(t)}, {s(t)}, and {y(t)}.
For example, if you run garchsim once, then standardize the simulated residuals and pass them into garchsim as the i.i.d. state noise input for a second run, the standardized residuals from both runs will be identical. This verifies that the specified input state noise matrix is indeed the "in-sample" i.i.d. noise process {z(t)} for both:
spec = garchset('C', 0.0001, 'K', 0.00005, ... 'GARCH', 0.8, 'ARCH', 0.1); [e1, s1, y1] = garchsim(spec, 100, 1); z1 = e1./s1; % Standardize residuals [e2, s2, y2] = garchsim(spec, 100, 1, z1); z2 = e2./s2; % Standardize residuals
In this case, z1 = z2. However, although the "in-sample" standardized noise processes are identical, in the absence of presample data the simulated output processes {e(t)}, {s(t)}, and {y(t)} differ. This is because additional standardized noise observations necessary to minimize transients must be simulated from the distribution, 'Gaussian' or 'T', found in the specification structure.
Specify all required presample data and repeat the experiment:
[e3,s3,y3] = garchsim(spec,100,1,[],[],[],... 0.02,0.06); z3 = e3./s3; % Standardize residuals [e4,s4,y4] = garchsim(spec,100,1,z3,... [],[],0.02,0.06); z4 = e4./s4; % Standardize residuals
In this case, e3 = e4, s3 = s4, y3 = y4 and z3 = z4.
[1] Bollerslev, T. "A Conditionally Heteroskedastic Time Series Model for Speculative Prices and Rates of Return." Review of Economics and Statistics. Vol. 69, 1987, pp. 542–547.
[2] Bollerslev, T. "Generalized Autoregressive Conditional Heteroskedasticity." Journal of Econometrics. Vol. 31, 1986, pp. 307–327.
[3] Box, G. E. P., G. M. Jenkins, and G. C. Reinsel. Time Series Analysis: Forecasting and Control. 3rd ed. Englewood Cliffs, NJ: Prentice Hall, 1994.
[4] Enders, W. Applied Econometric Time Series. Hoboken, NJ: John Wiley & Sons, Inc., 1995.
[5] Engle, Robert F. "Autoregressive Conditional Heteroskedasticity with Estimates of the Variance of United Kingdom Inflation." Econometrica. Vol. 50, 1982, pp. 987–1007.
[6] Engle, Robert F., D. M. Lilien, and R. P. Robins. "Estimating Time Varying Risk Premia in the Term Structure: The ARCH-M Model." Econometrica. Vol. 59, 1987, pp. 391–407.
[7] Glosten, L. R., R. Jagannathan, and D. E. Runkle. "On the Relation between the Expected Value and the Volatility of the Nominal Excess Return on Stocks." The Journal of Finance. Vol. 48, No. 5, 1993, pp. 1779–1801.
[8] Hamilton, J. D. Time Series Analysis. Princeton, NJ: Princeton University Press, 1994.
[9] Nelson, D. B. "Conditional Heteroskedasticity in Asset Returns: A New Approach." Econometrica. Vol. 59, 1991, pp. 347–370.
garchget | garchpred | garchset | rand | randn