Documentation Center 
[Y,E,V]
= filter(Mdl,Z)
[Y,E,V]
= filter(Mdl,Z,Name,Value)
[Y,E,V] = filter(Mdl,Z) filters disturbances, Z, to produce responses, innovations, and conditional variances of a univariate ARIMA(p,D,q) model.
[Y,E,V] = filter(Mdl,Z,Name,Value) filters disturbances using additional options specified by one or more Name,Value pair arguments.
Mdl 
ARIMA model, as created by arima or estimate. The input model cannot have any NaN values. 
Z 
numObsbyNumPaths matrix of disturbances, z_{t}, that drives the innovation process, ε_{t}. For a variance process the innovation process is given by
As a column vector, Z represents a 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. 
Specify optional commaseparated 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.
'V0' 
Positive presample conditional variances that provide 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 requires at least NumPaths columns. If the number of columns exceeds NumPaths, then filter uses the first NumPaths columns. V0 requires enough rows to initialize the moving average component of the ARIMA model and any conditional variance model. The required number of rows is at least Mdl.Q. If you include a conditional variance model, then filter might require more than Mdl.Q rows. If the number of rows in V0 exceeds the number necessary, then filter uses the most recent observations. The last row contains the most recent observation. Default: filter sets necessary presample observations to the unconditional variance of the conditional variance process. 
'X' 
Matrix of predictor data corresponding to a regression component in the conditional mean model. The columns of X are separate, synchronized time series, with the last row containing the most recent observations. The number of rows of X must be at least the number of rows of Z. When the number of rows of X exceeds the number necessary, then filter uses the most recent observations. Default: filter does not include a regression component in the conditional mean model regardless of the presence of regression coefficients in Mdl. 
'Y0' 
Presample response data, providing initial values for the model. If Y0 is a column vector, then filter applies it to each output path. If Y0 is a matrix, then it requires at least NumPaths columns. If the number of columns in Y0 exceeds NumPaths, then filter uses the first NumPaths columns. Y0 requires at least Mdl.P rows to initialize the model. If the number of rows in Y0 exceeds Mdl.P, then filter uses the most recent Mdl.P observations. The last row contains the most recent observation. Default: filter sets the necessary presample observations to the unconditional mean for stationary processes, and to 0 for nonstationary processes or processes with a regression component. 
'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 requires at least NumPaths columns. If the number of columns exceeds NumPaths, then filter uses the first NumPaths columns. Z0 requires a sufficient number of rows to initialize the moving average component of the ARIMA model and any conditional variance model. The required number of rows is at least Mdl.Q, but might be more if a conditional variance model is included. If the number of rows in Z0 exceeds the number necessary, then filter uses the most recent observations. The last row contains the most recent observation. Default: filter sets the necessary presample observations to 0. 
Notes

Y 
numObsbyNumPaths matrix of simulated responses. Y is the continuation of the presample series Y0. 
E 
numObsbyNumPaths matrix of simulated innovations with conditional variances, V. Each column is a scaled series of innovations (or disturbances) such that E = sqrt(V)*Z. 
V 
numObsbyNumPaths matrix of conditional variances of the innovations in E such that E = sqrt(V)*Z. V is the continuation of the presample series V0. 
[1] 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.
[2] Enders, W. Applied Econometric Time Series. Hoboken, NJ: John Wiley & Sons, 1995.
[3] Hamilton, J. D. Time Series Analysis. Princeton, NJ: Princeton University Press, 1994.
The filter method generalizes the simulate method. Both methods 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 Mdl. In contrast, filter lets you directly specify your own disturbances.
arima  estimate  forecast  impulse  infer  print  simulate