Description Usage Arguments Details Value Author(s) References See Also Examples
Simulate (univariate) Markov-switching autoregressive (MSAR) data
1 | simulateMSAR(bigt, Q, theta, st1, y1)
|
bigt |
Integer, number of observations to generate. |
Q |
h dimensional transition matrix for the MS process. h x h Markov transition matrix whose rows sum to 1 with the main weights on the diagonal elements. |
theta |
Matrix of the MSAR coeffients with h rows and m x p + 2 columns. The first column is the constants, the next m x p + 1 columns are the autoregressive coefficients (by lag – so the first m x 1 are the AR(1) coefficients, etc.) and the last m x 1 elements are the error variances (remember, this is univariate!) |
st1 |
Starting regime, an integer less than or equal to h |
y1 |
Starting value for simulated data in regime |
This function simulates a univariate MSAR model. The user needs to input the transition matrix Q and the autoregression coefficients via theta. The assumption in this model is that the error process is Gaussian.
A list with two elements:
Y |
The simulated univariate MSAR time series |
st |
A vector of integers identifying the regime of each
observation in |
Patrick T. Brandt and Ryan Davis
Kim, Chang-Jin and Charles R. Nelson. 1999. State-Space Models with Regime Switching: Classical and Gibbs-Sampling Approaches with Applications. Cambridge: MIT Press.
simulateMSVAR
for the multivariate version
1 | ## Example of call here
|
##
## MSBVAR Package v.0.9-2
## Build date: Fri Jun 16 09:12:46 2017
## Copyright (C) 2005-2017, Patrick T. Brandt
## Written by Patrick T. Brandt
##
## Support provided by the U.S. National Science Foundation
## (Grants SES-0351179, SES-0351205, SES-0540816, and SES-0921051)
##
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.