filter
Filter disturbances through vector autoregression (VAR) model
Syntax
Description
returns the numeric array Y
= filter(Mdl
,Z
)Y
containing the multivariate
response series, which results from filtering the underlying input numeric array
Z
containing the multivariate disturbance series. The
series in Z
are associated with the model innovations
process through the fully specified VAR(p) model
Mdl
.
returns the table or timetable Tbl2
= filter(Mdl
,Tbl1
,Presample=Presample
)Tbl2
containing the multivariate response series, which results from filtering the underlying multivariate disturbance series in the input table or timetable Tbl1
. filter
initializes the response series using the required table or timetable of presample data in Presample
. Variables in Tbl1
are associated with the model innovations process through Mdl
. (since R2022b)
filter
selects the variables in Mdl.SeriesNames
or all variables in Tbl1
. To select different disturbance variables in Tbl1
to filter through the model, use the DisturbanceVariables
name-value argument. filter
selects the same variables for Presample
by default, but you can select different variables by using the PresampleResponseVariables
name-value argument.
[___] = filter(___,
specifies options using one or more name-value arguments in
addition to any of the input argument combinations in previous syntaxes.
Name=Value
)filter
returns the output argument combination for the
corresponding input arguments. For example, filter(Mdl,Z,Y0=PS,X=Exo)
filters
the numeric array of disturbances Z
through the
VAR(p) model Mdl
, and specifies the
numeric array of presample response data PS
and the numeric
matrix of exogenous predictor data Exo
for the model
regression component.
Examples
Input Arguments
Output Arguments
Algorithms
filter
computes filtered responsesY
and innovationsE
using this process for each pagej
inZ
.If
Scale
istrue
, thenE(:,:,
=j
)L*Z(:,:,
, wherej
)L
=chol(Mdl.Covariance,'lower')
. Otherwise,E(:,:,
=j
)Z(:,:,
. Set et =j
)E(:,:,
.j
)Y(:,:,
is yt in this system of equations.j
)For variable definitions, see More About.
filter
generalizessimulate
. Both functions filter a disturbance series through a model to produce responses and innovations. However, whereassimulate
generates a series of mean-zero, unit-variance, independent Gaussian disturbancesZ
to form innovationsE
=L*Z
,filter
enables you to supply disturbances from any distribution.filter
uses this process to determine the time origin t0 of models that include linear time trends:If you specify
Z
and you do not specify a presample by using theY0
name-value argument, t0 = 0.Otherwise, if you specify
Tbl1
or you supply a presample,filter
sets t0 tosize(
–Y0
,1)Mdl.P
, where
contains presample data, the value ofY0
Y0
orPresample
. Therefore, the times in the trend component are t = t0 + 1, t0 + 2,..., t0 +numobs
, wherenumobs
is the effective sample size (size(Z,1)
, afterfilter
removes missing values, orheight(Tbl1)
). This convention is consistent with the default behavior of model estimation, in whichestimate
removes the firstMdl.P
responses, reducing the effective sample size. Althoughfilter
explicitly uses the firstMdl.P
presample responses in
to initialize the model, the total number of observations inY0
and the input data (Y0
Z
, excluding missing values, orTbl1
) determines t0.
References
[1] Hamilton, James D. Time Series Analysis. Princeton, NJ: Princeton University Press, 1994.
[2] Johansen, S. Likelihood-Based Inference in Cointegrated Vector Autoregressive Models. Oxford: Oxford University Press, 1995.
[3] Juselius, K. The Cointegrated VAR Model. Oxford: Oxford University Press, 2006.
[4] Lütkepohl, H. New Introduction to Multiple Time Series Analysis. Berlin: Springer, 2005.