Accelerating the pace of engineering and science

filter

Class: gjr

Filter disturbances with GJR model

Syntax

[V,Y] = filter(model,Z)
[V,Y] = filter(model,Z,Name,Value)

Description

[V,Y] = filter(model,Z) filters disturbances, Z, to produce conditional variances and responses of a univariate GJR(P,Q) model.

[V,Y] = filter(model,Z,Name,Value) filters disturbances using additional options specified by one or more Name,Value pair arguments.

Input Arguments

model

GJR model object, as created by gjr or estimate. The input model object cannot have any NaN values.

Z

numObs-by-numPaths matrix of disturbances, zt, used to drive the innovation process, εt. For a variance process ${\sigma }_{t}^{2},$ the innovation process is given by

${\epsilon }_{t}={\sigma }_{t}{z}_{t}.$

As a column vector, Z represents a single path of the underlying disturbance series. As a matrix, Z represents numObs observations of numPaths paths of the underlying disturbance series. filter assumes that observations across any row occur simultaneously. The last row contains the most recent observation.

 Note:   NaNs indicate missing values. filter removes these values from Z by listwise deletion. That is, any row of Z with at least one NaN is removed, reducing the effective sample size.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

 'Z0' Presample disturbances, providing initial values for the input disturbance series, Z. If Z0 is a column vector, then filter applies it to each output path. If Z0 is a matrix, then it must have at least numPaths columns. If the number of columns exceeds numPaths, then filter uses only the first numPaths columns. Z0 must have at least model.Q rows to initialize the conditional variance model. If the number of rows in Z0 exceeds model.Q, then filter uses only the most recent observations. The last row contains the most recent observation. Default: Necessary presample observations are set equal to an independent sequence of standardized disturbances drawn from the distribution in model. 'V0' Positive presample conditional variances, providing initial values for the model. If V0 is a column vector, then filter applies it to each output path. If V0 is a matrix, then it must have at least numPaths columns. If the number of columns exceeds numPaths, then filter uses only the first numPaths columns. V0 must have at least max(model.P,model.Q)rows to initialize the variance equation. If the number of rows in V0 exceeds the number necessary, then filter uses only the most recent observations. The last row contains the most recent observation. Default: Necessary presample observations are set equal to the unconditional variance of the process.
 Notes   NaNs indicate missing values. filter uses listwise deletion to remove missing values in the presample data, Z0 and V0. That is, Z0 and V0 are merged into a composite series, and any row of the combined series with at least one NaN is removed. filter assumes you synchronize presample data such that the last (most recent) observation of each presample series occurs simultaneously.

Output Arguments

 V numObs-by-numPaths matrix of conditional variances of the mean-zero, heteroscedastic innovations associated with Y. Y numObs-by-numPaths time series matrix of response data. Y usually represents a mean-zero, heteroscedastic time series of innovations with conditional variances given in V. Y might also represent a time series of mean-zero, heteroscedastic innovations plus an offset. The inclusion of an offset is signaled by a nonzero Offset value in the input model. If the input model includes an offset, filter adds the offset to the underlying mean-zero, heteroscedastic innovations so that Y represents a time series of offset-adjusted innovations.

Examples

expand all

Simulate and Filter

This example illustrates the relationship between simulate and filter.

Specify a GJR(1,1) model with Gaussian innovations.

model = gjr('Constant',0.005,'GARCH',0.8,'ARCH',0.1,...
'Leverage',0.05);

Simulate the model via Monte Carlo simulation. Then, standardize the simulated innovations and filter.

rng(1); % For reproducibility
[v,e] = simulate(model,100,'E0',0,'V0',0.05);
Z = e./sqrt(v);
[V,E] = filter(model,Z,'Z0',0,'V0',0.05);

Confirm that the outputs of simulate and filter are identical.

isequal(v,V)
ans =

1

The logical value 1 confirms the two outputs are identical.

References

[1] Bollerslev, T. "Generalized Autoregressive Conditional Heteroskedasticity." Journal of Econometrics. Vol. 31, 1986, pp. 307–327.

[2] Bollerslev, T. "A Conditionally Heteroskedastic Time Series Model for Speculative Prices and Rates of Return." The Review of Economics and Statistics. Vol. 69, 1987, pp. 542–547.

[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, 1995.

[5] Engle, R. F. "Autoregressive Conditional Heteroskedasticity with Estimates of the Variance of United Kingdom Inflation." Econometrica. Vol. 50, 1982, pp. 987–1007.

[6] 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.

[7] Hamilton, J. D. Time Series Analysis. Princeton, NJ: Princeton University Press, 1994.

Alternatives

• filter generalizes simulate. That is, both filter a series of disturbances to produce output responses, innovations, and conditional variances. However, simulate autogenerates a series of mean-zero, unit-variance, independent and identically distributed (iid) disturbances according to the distribution in the model object, model. In contrast, filter lets you directly specify your own disturbances.