Learn R Programming

MSBVAR (version 0.9-2)

simulateMSAR: Simulate (univariate) Markov-switching autoregressive (MSAR) data

Description

Simulate (univariate) Markov-switching autoregressive (MSAR) data

Usage

simulateMSAR(bigt, Q, theta, st1, y1)

Arguments

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 st1

Value

A list with two elements:
Y
The simulated univariate MSAR time series
st
A vector of integers identifying the regime of each observation in Y

Details

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.

References

Kim, Chang-Jin and Charles R. Nelson. 1999. State-Space Models with Regime Switching: Classical and Gibbs-Sampling Approaches with Applications. Cambridge: MIT Press.

See Also

simulateMSVAR for the multivariate version

Examples

Run this code
## Example of call here

Run the code above in your browser using DataLab