msmFit: Fitting Markov Switching Models

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

Description

msmFit is an implementation for modeling Markov Switching Models using the EM algorithm

Usage

1
	msmFit(object, k, sw, p, data, family, control)

Arguments

object

an object of class "lm" or "glm", or "formula" with a symbolic description of the model to be fitted.

k

numeric, the estimated number of regimes that the model has.

sw

a logical vector indicatig which coefficients have switching.

p

integer, the number of AR coefficients that the MS model has to have. The default value is zero. If p is higher than zero, the last values of sw have to contain the AR coefficients which have switching.

data

an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which "glm" is called.

family

a character value indicating what family belongs to the model. It is only required when the object is a "General linear formula".

control

a list of control parameters. See "Details".

Details

The control argument is a list that can supply any of the following components:

-trace: A logical value. If it is TRUE, tracing information on the progress of the optimization is produced.

-maxiter: The maximum number of iterations in the EM method. Default is 100.

-tol: Tolerance. The algorithm stops if it is unable to reduce the value by a factor of tol at a step. Default is 1e-8.

-maxiterOuter: The number of short runs of the EM method to stablish the initial values. Default is 5

-maxiterInner: The number of iterations in the EM method in each short run to stablish the initial values. Default is 10

-parallelization: A logical value. Whether the process is done by using parallelization or not. Default is TRUE.

Value

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

Author(s)

Jose A. Sanchez-Espigares, Alberto Lopez-Moreno

References

Hamilton J.D. (1989). A New Approach to the Economic Analysis of Nonstionary Time Series and the Business Cycle. Econometrica 57: 357-384
Hamilton, J.D. (1994). Time Series Analysis. Princeton University Press.
Goldfeld, S., Quantd, R. (2005). 'A Markov model for switching Regression',Journal of Econometrics 135, 349-376.
Perlin, M. (2007). 'Estimation, Simulation and Forecasting of a Markov Switching Regression', (General case in Matlab).

See Also

Overview: MSwM-package
Classes : MSM.lm, MSM.glm, MSM.fitted
Methods : msmFit,summary,AIC,intervals,msmResid
Plot : plot,plotProb,plotReg,plotDiag

Examples

1
2
3
4
5
6
## Not run
##	data(energy)
##	model=lm(Price~Oil+Gas+Coal+EurDol+Ibex35+Demand,energy)
##	mod=msmFit(model,k=2,sw=rep(TRUE,8))
##  summary(mod)
## End(Not run)

MSwM documentation built on June 6, 2021, 5:06 p.m.

Related to msmFit in MSwM...