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

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/simulateMSAR.R

Description

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

Usage

1
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

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.

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

Author(s)

Patrick T. Brandt and Ryan Davis

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

1
## Example of call here

Example output

##
## 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)
##

MSBVAR documentation built on May 30, 2017, 1:23 a.m.

Related to simulateMSAR in MSBVAR...