Markov-switching GARCH models in R: The MSGARCH package

David Ardia*, Keven Bluteau, Kris Boudt, Leopoldo Catania, Denis Alexandre Trottier

*Corresponding author for this work

Research output: Contribution to JournalArticleAcademicpeer-review


We describe the package MSGARCH, which implements Markov-switching GARCH (generalized autoregressive conditional heteroscedasticity) models in R with efficient C++ object-oriented programming. Markov-switching GARCH models have become popular methods to account for regime changes in the conditional variance dynamics of time series. The package MSGARCH allows the user to perform simulations as well as maximum likelihood and Bayesian Markov chain Monte Carlo estimations of a very large class of Markov-switching GARCH-type models. The package also provides methods to make single-step and multi-step ahead forecasts of the complete conditional density of the variable of interest. Risk management tools to estimate conditional volatility, value-at-risk, and expected-shortfall are also available. We illustrate the broad functionality of the MSGARCH package using exchange rate and stock market return data.

Original languageEnglish
Article number4
Pages (from-to)1-38
Number of pages38
JournalJournal of Statistical Software
Issue number4
Publication statusPublished - 31 Oct 2019


The authors are grateful to the Associate Editor (Rob J. Hyndman) and two anonymous referees for useful comments. They also thank Carol Alexander, Samuel Borms, Muriel Buri, Peter Carl, Dirk Eddelbuettel, Laurent Fastnacht, Félix-Antoine Fortin, Alexios Ghalanos, Richard Gerlach, Lennart Hoogerheide, Eliane Maalouf, Brian Peterson, Enrico Schumann, Tobias Setz, Max Tchirikov, conference participants at R/Finance 2017 (Chicago), the 37th International Symposium on Forecasting (Cairns), useR! 2017 (Brussels), Quant Insights 2017 (London), MAFE 2018 (Madrid), eRum 2018 (Budapest), and seminar participants at HEC Liège, Paris-Dauphine, and IAE-AMSE Aix-Marseille. We acknowledge Industrielle-Alliance, International Institute of Forecasters (, Google Summer of Code (, FQRSC (, grant 2015-NP-179931), swissuniversities (, IVADO (https: //, and the Swiss National Science Foundation (, grant 179281) for their financial support, and Calcul Québec ( for computational support.

FundersFunder number
Calcul Qu?bec
Google Summer of Code
IAE-AMSE Aix-Marseille
International Institute of Forecasters
Schweizerischer Nationalfonds zur Förderung der Wissenschaftlichen Forschung179281
Higher Education Commission, Pakistan


    • Conditional volatility
    • Forecasting
    • GARCH
    • Markov-switching
    • R software


    Dive into the research topics of 'Markov-switching GARCH models in R: The MSGARCH package'. Together they form a unique fingerprint.

    Cite this