Skip to content

Fitting Markov Switching Models

1packages dependsuggested by 3
66.1Kdownloads / year
–test coverage
0/13flavors OK

Overview

About

Estimation, inference and diagnostics for Univariate Autoregressive Markov Switching Models for Linear and Generalized Models. Distributions for the series include gaussian, Poisson, binomial and gamma cases. The EM algorithm is used for estimation (see Perlin (2012) doi:10.2139/ssrn.1714016).

Install

Health

CRAN checks
13NOTE
Check messages
NOTERd filesr-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-x86_64, r-oldrel-macos-arm64, r-oldrel-macos-x86_64, r-oldrel-windows-x86_64, r-patched-linux-x86_64, r-release-linux-x86_64, r-release-macos-arm64, r-release-macos-x86_64, r-release-windows-x86_64
checkRd: (-1) msmFit.Rd:30: Lost braces
    30 |         -\code{trace}{: A logical value. If it is TRUE, tracing information on the progress of the optimization is produced.}
       |                      ^
checkRd: (-1) msmFit.Rd:32: Lost braces
    32 |         -\code{maxiter}{: The maximum number of iterations in the EM method. Default is 100.}
       |                        ^
checkRd: (-1) msmFit.Rd:34: Lost braces
    34 |         -\code{tol}{: Tolerance. The algorithm stops if it is unable to reduce the value by a factor of \code{tol} at a step. Default is 1e-8.}
       |                    ^
checkRd: (-1) msmFit.Rd:36: Lost braces
    36 |         -\code{maxiterOuter}{: The number of short runs of the EM method to stablish the initial values. Default is 5}
       |                             ^
checkRd: (-1) msmFit.Rd:38: Lost braces
    38 |         -\code{maxiterInner}{: The number of iterations in the EM method in each short run to stablish the initial values. Default is 10}
...[truncated]...
     -\code{parallelization}{: A logical value. Whether the process is done by using parallelization or not. Default is TRUE.}
       |                                ^
checkRd: (-1) plotDiag.Rd:33: Lost braces
    33 | - \code{1}{: represents the plot of residuals against fitted values. }
       |           ^
checkRd: (-1) plotDiag.Rd:35: Lost braces
    35 | - \code{2}{: represents the Normal Q-Q plot. }
       |           ^
checkRd: (-1) plotDiag.Rd:37: Lost braces
    37 | - \code{3}{: represents the ACF/PACF of residuals and ACF/PACF of square residuals. }
       |           ^
checkRd: (-1) plotProb.Rd:29: Lost braces
    29 | -\code{1}{: represents the plots that contains, for each regime, its smoothed and filtered probabilities.}.
       |          ^
checkRd: (-1) plotProb.Rd:31: Lost braces
    31 | -\code{2:(number of regimes +1)}{: represents plot of the regime minus one with the response variable against the smoothed probabilities.}
       |                                 ^
NOTECRAN incoming feasibilityr-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc
Maintainer: ‘Josep A. Sanchez-Espigares <josep.a.sanchez@upc.edu>’

No Authors@R field in DESCRIPTION.
Please add one, modifying
  Authors@R: c(person(given = c("Josep", "A."),
                      family = "Sanchez-Espigares",
                      role = c("aut", "cre"),
                      email = "josep.a.sanchez@upc.edu"),
               person(given = "Alberto",
                      family = "Lopez-Moreno",
                      role = "aut"))
as necessary.

CRAN check page ↗

Slowest check: 1.5 min · r-oldrel-windows-x86_64
Status changes
  • NOTE13 NOTENow
  • NOTE14 NOTE2026-03-10
Advisories

none known

Documentation

In release 1.5
READMENoVignettesYes · 1 · dynamicNEWSNoCitation fileNoWebsitenot declared in DESCRIPTION
Help pages
17 (1 internal)includes a package overview page
Examples that run
67%2 run in a plain check · 1 hold no code
Exported functions with examples
20%
Documented parameters
not tracked
Return-value docs
not tracked
Help pages citing references
18%
Vignettes (1)

Downloads

66.1K
CRAN downloads in the past year
Rank #1,791 · ~181/day · ~5.5K/mo
Daily download trend is not available in this view yet.
4K30 days
11.5K90 days
66.1K1 year
Compare downloads with other packages →
Also on124 r2u9 autocran159 c2d4u

Dependencies

Declared dependencies
0 external dependencies (excludes base and recommended)

Installing MSwM adds no packages beyond those that come with R.

Depends (3)
methodsgraphicsparallel
Imports (1)
nlme
LinkingTo (0)
none
Suggests (0)
none
Enhances (0)
none
Reverse dependencies
1direct
0indirect
Imports 1
Suggested by 3
Depends, Imports or LinkingTo, most downloaded first
Suggests, most downloaded first

Datasets

People & History

People (from the free-text Author field) (2)

Maintainer since 1.0 (2013)

Releases (6)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • R
    R 4.2.0 released · 2022-04-22
  • 1.5Latest
    record
    2021-06-06 · current release · diff ↗
  • R
    R 4.1.0 released · 2021-05-18
  • R
    R 4.0.0 released · 2020-04-24
  • R
    R 3.6.0 released · 2019-04-26
  • 1.4
    record
    2018-07-16 · diff ↗ ·
    removed 4 exports
    AIC.MSM.lm, AIC.MSM.glm, intervals.MSM.lm, intervals.MSM.glm
  • 1.3
    record
    2018-06-12 · diff ↗
  • R
    R 3.5.0 released · 2018-04-23
  • R
    R 3.4.0 released · 2017-04-21
  • R
    R 3.3.0 released · 2016-05-03
  • R
    R 3.2.0 released · 2015-04-16
  • R
    R 3.1.0 released · 2014-04-10
Show 5 earlier eventsHide 5 earlier events
  • 1.2
    record
    2014-02-24 · diff ↗
  • R
    R 3.0.0 released · 2013-04-03
  • 1.01
    record
    2013-02-05 · diff ↗ ·
    added 4 exports
    AIC.MSM.lm, AIC.MSM.glm, intervals.MSM.lm, intervals.MSM.glm
  • 1.0
    record
    2013-01-04
  • R
    R 2.15.0 released · 2012-03-30

Package metadata

First published
2013-01-04
Total releases
6 / 13 yrs
License
GPL (>= 2.0)
Bundled data
57 KB / 3 files
Download size
374 KB
Appears in task views

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("MSwM")

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for MSwM version 1.5 [Data set]. HJJB, LLC. Data release v2026-10-24. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-24, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy