regime: an integer in 1,...,M determining the regime from which to simulate observations from
nsim: number of observations to be simulated.
init_values: a size (p×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 are set to the unconditional mean of the regime.
use_transweights: if TRUE will calculate the transition weights of the provided model, simulate p+100 observations more, calculate the transition weights for the last 100 observations, and return the the consecutive p observations have the highest transition weight for the specified regime.
Returns
If use_transweights=FALSE:: Returns a (nsim×d) matrix such that the tth row contains the tth simulated observation.
If use_transweights=TRUE:: Returns a (p×d) such that the tth row constrains the tth observations.
Details
Does not take random number generator seed as an argument to avoid unwanted behavior, because simulate_from_regime is mostly called from simulate.stvar
that takes a seed as its argument, and simulate_from_regime calls simulate.stvar to simulate the observations. Specifically, simulate_from_regime generates a STVAR model from the given regime, sets up the initial values to the (if not specified), and then calls simulate.stvar accordingly.
References
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.