simulate
Monte Carlo simulation of vector autoregression (VAR) model
Syntax
Y = simulate(Mdl,numobs)
Y = simulate(Mdl,numobs,Name,Value)
[Y,E] = simulate(___)
Description
uses additional options specified by one or moreY
= simulate(Mdl
,numobs
,Name,Value
)Name,Value
pair arguments.For example, you can specify simulation of multiple paths, exogenous predictor data, or inclusion of future responses for conditional simulation.
Examples
Input Arguments
Output Arguments
Algorithms
simulate
performs conditional simulation using this process for all pagesk
= 1,...,numpaths
and for each timet
= 1,...,numobs
.simulate
infers (or inverse filters) the innovationsE(
from the known future responsest
,:,k
)YF(
. Fort
,:,k
)E(
,t
,:,k
)simulate
mimics the pattern ofNaN
values that appears inYF(
.t
,:,k
)For the missing elements of
E(
,t
,:,k
)simulate
performs these steps.Draw
Z1
, the random, standard Gaussian distribution disturbances conditional on the known elements ofE(
.t
,:,k
)Scale
Z1
by the lower triangular Cholesky factor of the conditional covariance matrix. That is,Z2
=L*Z1
, whereL
=chol(C,'lower')
andC
条件协方差的高斯距离吗ribution.Impute
Z2
in place of the corresponding missing values inE(
.t
,:,k
)
For the missing values in
YF(
,t
,:,k
)simulate
filters the corresponding random innovations through the modelMdl
.
simulate
uses this process to determine the time origint0of models that include linear time trends.If you do not specify
Y0
, thent0= 0.Otherwise,
simulate
setst0tosize(Y0,1)
–Mdl.P
. Therefore, the times in the trend component aret=t0+ 1,t0+ 2,...,t0+numobs
. This convention is consistent with the default behavior of model estimation in whichestimate
removes the firstMdl.P
responses, reducing the effective sample size. Althoughsimulate
explicitly uses the firstMdl.P
presample responses inY0
to initialize the model, the total number of observations inY0
(excluding any missing values) determinest0.
References
[1]Hamilton, J. 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.