MSM.fit: Fitting Univariate Autoregressive Markov Switching Models

Description Usage Arguments Value Examples

Description

Fit autoregressive Markov switching models to a univariate time series using the package MSwM.

Usage

1
MSM.fit(y, p, nregime = 2, include.mean = T, sw = NULL)

Arguments

y

a time series.

p

AR order.

nregime

the number of regimes.

include.mean

a logical value for including constant terms.

sw

logical values for whether coefficients are switching. The length of sw has to be equal of the number of coefficients in the model plus include.mean.

Value

MSM.fit returns an object of class codeMSM.lm or MSM.glm, depending on the input model.

Examples

1
2
3
4
y=MSM.sim(100,c(1,1),0.7,-0.5,c(0.5,0.6),c(1,1),c(0,0),500)
library(parallel)
library(MSwM)
MSM.fit(y$series,1,2,TRUE,c(TRUE,TRUE,TRUE))

ConvFuncTimeSeries/test3 documentation built on May 29, 2019, 11:41 a.m.