simulate_gsmvar_int
an internal a simulation function for class 'gsmvar' objects.
It allows to simulate observations from a GMVAR, StMVAR, or G-StMVAR process.
simulate_gsmvar_int(
object,
nsim = 1,
seed = NULL,
...,
init_values = NULL,
init_regimes = 1:sum(gsmvar$model$M),
ntimes = 1,
drop = TRUE,
girf_pars = NULL
)
If drop==TRUE
and ntimes==1
(default): $sample
, $component
, and $mixing_weights
are matrices.
Otherwise, returns a list with...
$sample
a size (nsim
\(\times d \times\)ntimes
) array containing the samples: the dimension [t, , ]
is
the time index, the dimension [, d, ]
indicates the marginal time series, and the dimension [, , i]
indicates
the i:th set of simulations.
$component
a size (nsim
\(\times\)ntimes
) matrix containing the information from which mixture component
each value was generated from.
$mixing_weights
a size (nsim
\(\times M \times\)ntimes
) array containing the mixing weights corresponding to
the sample: the dimension [t, , ]
is the time index, the dimension [, m, ]
indicates the regime, and the dimension
[, , i]
indicates the i:th set of simulations.
an object of class 'gsmvar'
, typically created with fitGSMVAR
or GSMVAR
.
number of observations to be simulated.
set seed for the random number generator?
currently not in use.
a size \((p\times d)\) matrix specifying the initial values, where d is the number
of time series in the system. The last row will be used as initial values for the first lag,
the second last row for second lag etc. If not specified, initial values will be drawn according to
mixture distribution specifed by the argument init_regimes
.
a numeric vector of length at most \(M\) and elements
in \(1,...,M\) specifying the regimes from which the initial values
should be generated from. The initial values will be generated from a
mixture distribution with the mixture components being the stationary
distributions of the specific regimes and the (proportional) mixing weights
given by the mixing weight parameters of those regimes. Note that if
init_regimes=1:M
, the initial values are generated from the
stationary distribution of the process and if init_regimes=m
, the
initial value are generated from the stationary distribution of the
\(m\)th regime. Ignored if the argument init_values
is specified.
how many sets of simulations should be performed?
if TRUE
(default) then the components of the returned list are coerced to lower dimension if ntimes==1
, i.e.,
$sample
and $mixing_weights
will be matrices, and $component
will be vector.
This argument is used internally in the estimation of generalized impulse response functions (see ?GIRF
).
You should ignore it (specifying something else than null to it will change how the function behaves). Should be a list with the following elements:
shock_numb
an integer indicating which shock to impose in the GIRF estimation.
shock_size
a numeric value indicating the size of the structural shock to impose in the GIRF estimation.
include_mixweights
a logical value indicating whether the GIRF should be estimated for the mixing weights as well.
The argument ntimes
is intended for forecasting: a GMVAR, StMVAR, or G-StMVAR process can be forecasted by simulating
its possible future values. One can easily perform a large number simulations and calculate the sample quantiles from the simulated
values to obtain prediction intervals (see the forecasting example).
Kalliovirta L., Meitz M. and Saikkonen P. 2016. Gaussian mixture vector autoregression. Journal of Econometrics, 192, 485-498.
Lütkepohl H. 2005. New Introduction to Multiple Time Series Analysis, Springer.
McElroy T. 2017. Computation of vector ARMA autocovariances. Statistics and Probability Letters, 124, 92-96.
Virolainen S. 2025. A statistically identified structural vector autoregression with endogenously switching volatility regime. Journal of Business & Economic Statistics, 43, 1, 44-54.
Virolainen S. 2022. Gaussian and Student's t mixture vector autoregressive model with application to the asymmetric effects of monetary policy shocks in the Euro area. Unpublished working paper, available as arXiv:2109.13648.
fitGSMVAR
, GSMVAR
, diagnostic_plot
, predict.gsmvar
,
profile_logliks
, quantile_residual_tests
, GIRF
, GFEVD