simulate_stvar_int
is an internal simulate function for class 'stvar' objects.
simulate_stvar_int(
object,
nsim = 1,
seed = NULL,
...,
init_values = NULL,
init_regime,
ntimes = 1,
use_stat_for_Gaus = FALSE,
burn_in = 1000,
exo_weights = NULL,
drop = TRUE,
girf_pars = NULL
)
Returns a list containing the simulation results. If drop==TRUE
and ntimes==1
(default),
contains the following entries:
a size (nsim
\(\times d\)) matrix containing the simulated time series.
a size (nsim
\(\times M\)) matrix containing the transition weights corresponding
to the simulated sample.
Otherwise, returns a list with the following entries:
$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.
$transition_weights
a size (nsim
\(\times M \times\)ntimes
) array containing the transition 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 'stvar'
.
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 from
the regime specified in init_regimes
(for Gaussian models only).
an integer in \(1,...,M\) specifying the regime from which the initial values should be generated from (using a simulation procedure with a burn-in period). For models with Gaussian conditional distribution, it is also possible to generate the starting values from the stationary distribution of a regime. See the details section.
how many sets of simulations should be performed?
if TRUE
and cond_dist=="Gaussian"
, uses the stationary distribution
of a regime to generate the initial values for the simulation. Note that if stationary distribution is used,
unlike with out simulation procedure, it is not guaranteed that the regime of interest has high transition weights
at the given points of time. Note that if the model allows for unstable estimates (stvar$allow_unstab=TRUE
),
simulation procedure is always used.
Burn-in period for simulating initial values from a regime when cond_dist!="Gaussian"
.
See the details section.
if weight_function="exogenous"
, provide a size \((nsim \times M)\) matrix of exogenous
transition weights for the regimes: [t, m]
for a time \(t\) and regime \(m\) weight. Ignored
if weight_function!="exogenous"
.
if TRUE
(default) then the components of the returned list are coerced to lower dimension if
ntimes==1
, i.e., $sample
and $transition_weights
will be matrices, and $component
will be vector.
This argument is used internally in the estimation of generalized impulse response functions. Specifying something else than null to it will change how the function behaves. Should be a list with following elements
The number of the shock to be used in the GIRF.
The size of the shock to be used in the GIRF.
A list with the following elements (only for simulating counterfactuals):
The metatype of the counterfactual, c("counterfactual_fore", "counterfactual_girf").
The type of the counterfactual, c("fixed_path", "muted_response").
The variable to be used as the policy variable.
The variable to be used as the mute variable.
The start of the counterfactual period.
The end of the counterfactual period.
When using init_regime
to simulate the initial values from a given regime, we employ the following simulation
procedure to obtain the initial values (unless use_stat_for_Gaus=TRUE
and Gaussian model is considered).
First, we set the initial values to the unconditional mean of the specified regime. Then,
we simulate a large number observations from that regime as specified in the argument burn_in
. Then, we simulate
\(p + 100\) observations more after the burn in period, and for the \(100\) observations calculate the transition
weights for them and take the consecutive \(p\) observations that yield the highest transition weight for the given regime.
For models with exogenous transition weights, takes just the last \(p\) observations after the burn-in period.
The argument ntimes
is intended for forecasting, which is used by the predict method (see ?predict.stvar
).
Anderson H., Vahid F. 1998. Testing multiple equation systems for common nonlinear components. Journal of Econometrics, 84:1, 1-36.
Hansen B.E. 1994. Autoregressive Conditional Density estimation. Journal of Econometrics, 35:3, 705-730.
Kheifets I.L., Saikkonen P.J. 2020. Stationarity and ergodicity of Vector STAR models. International Economic Review, 35:3, 407-414.
Lanne M., Virolainen S. 2025. A Gaussian smooth transition vector autoregressive model: An application to the macroeconomic effects of severe weather shocks. Unpublished working paper, available as arXiv:2403.14216.
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.
Kilian L., Lütkepohl H. 20017. Structural Vector Autoregressive Analysis. 1st edition. Cambridge University Press, Cambridge.
Tsay R. 1998. Testing and Modeling Multivariate Threshold Models. Journal of the American Statistical Association, 93:443, 1188-1202.
Virolainen S. 2025. Identification by non-Gaussianity in structural threshold and smooth transition vector autoregressive models. Unpublished working paper, available as arXiv:2404.19707.
predict.stvar
,GIRF
, GFEVD
, fitSTVAR
,
fitSSTVAR
STVAR