msmResid function

Extract Markov Switching Model Residuals

Extract Markov Switching Model Residuals

msmResid is a function which extracts model residuals from objects returned by Markov Switching modeling functions.

msmResid(object, regime)

Arguments

  • object: an object of class "MSM.lm" or "MSM.glm".
  • regime: a number or a vector indicating which regimes are selected to get its residuals. If is missing, the function calculates the conditional residuals of the model.

Returns

A numeric vector with the pooled residuals or a matrix, when more than one regime is indicated, containing the residuals for each observation. When the attributed object is a glm, it returns the Pearson residuals.

Author(s)

Jose A. Sanchez-Espigares, Alberto Lopez-Moreno

See Also

Overview: MSwM-package

Classes : MSM.lm, MSM.glm, MSM.fitted

Methods : msmFit,summary,AIC,intervals,msmResid

Plot : plot,plotProb,plotReg,plotDiag

  • Maintainer: Josep A. Sanchez-Espigares
  • License: GPL (>= 2.0)
  • Last published: 2021-06-06

Useful links