IDEAS home Printed from https://ideas.repec.org/p/arx/papers/2411.08188.html
   My bibliography  Save this paper

MSTest: An R-Package for Testing Markov Switching Models

Author

Listed:
  • Gabriel Rodriguez-Rondon
  • Jean-Marie Dufour

Abstract

We present the R package MSTest, which implements hypothesis testing procedures to identify the number of regimes in Markov switching models. These models have wide-ranging applications in economics, finance, and numerous other fields. The MSTest package includes the Monte Carlo likelihood ratio test procedures proposed by Rodriguez-Rondon and Dufour (2024), the moment-based tests of Dufour and Luger (2017), the parameter stability tests of Carrasco, Hu, and Ploberger (2014), and the likelihood ratio test of Hansen (1992). Additionally, the package enables users to simulate and estimate univariate and multivariate Markov switching and hidden Markov processes, using the expectation-maximization (EM) algorithm or maximum likelihood estimation (MLE). We demonstrate the functionality of the MSTest package through both simulation experiments and an application to U.S. GNP growth data.

Suggested Citation

  • Gabriel Rodriguez-Rondon & Jean-Marie Dufour, 2024. "MSTest: An R-Package for Testing Markov Switching Models," Papers 2411.08188, arXiv.org.
  • Handle: RePEc:arx:papers:2411.08188
    as

    Download full text from publisher

    File URL: http://arxiv.org/pdf/2411.08188
    File Function: Latest version
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Jin Seo Cho & Halbert White, 2007. "Testing for Regime Switching," Econometrica, Econometric Society, vol. 75(6), pages 1671-1720, November.
    2. Dufrénot, Gilles & Mignon, Valérie & Péguin-Feissolle, Anne, 2011. "The effects of the subprime crisis on the Latin American financial markets: An empirical assessment," Economic Modelling, Elsevier, vol. 28(5), pages 2342-2357, September.
    3. Hansen, Bruce E, 1992. "The Likelihood Ratio Test under Nonstandard Conditions: Testing the Markov Switching Model of GNP," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 7(S), pages 61-82, Suppl. De.
    4. Marcelle Chauvet & James D. Hamilton, 2006. "Dating Business Cycle Turning Points," Contributions to Economic Analysis, in: Nonlinear Time Series Analysis of Business Cycles, pages 1-54, Emerald Group Publishing Limited.
    5. Herwartz, Helmut & Lütkepohl, Helmut, 2014. "Structural vector autoregressions with Markov switching: Combining conventional with statistical identification of shocks," Journal of Econometrics, Elsevier, vol. 183(1), pages 104-116.
    6. Dufour, Jean-Marie & Khalaf, Lynda & Bernard, Jean-Thomas & Genest, Ian, 2004. "Simulation-based finite-sample tests for heteroskedasticity and ARCH effects," Journal of Econometrics, Elsevier, vol. 122(2), pages 317-347, October.
    7. Emrah Ismail Cevik & Durmuş Çağrı Yıldırım & Sel Dibooglu, 2021. "Renewable and non-renewable energy consumption and economic growth in the US: A Markov-Switching VAR analysis," Energy & Environment, , vol. 32(3), pages 519-541, May.
    8. Vadim Marmer, 2008. "Testing the null hypothesis of no regime switching with an application to GDP growth rates," Empirical Economics, Springer, vol. 35(1), pages 101-122, August.
    9. Andrew V. Carter & Douglas G. Steigerwald, 2012. "Testing for Regime Switching: A Comment," Econometrica, Econometric Society, vol. 80(4), pages 1809-1812, July.
    10. Hiroyuki Kasahara & Katsumi Shimotsu, 2018. "Testing the Number of Regimes in Markov Regime Switching Models," Papers 1801.06862, arXiv.org, revised Jan 2018.
    11. Donald W. K. Andrews, 1999. "Estimation When a Parameter Is on a Boundary," Econometrica, Econometric Society, vol. 67(6), pages 1341-1384, November.
    12. Caggiano, Giovanni & Castelnuovo, Efrem & Figueres, Juan Manuel, 2017. "Economic policy uncertainty and unemployment in the United States: A nonlinear approach," Economics Letters, Elsevier, vol. 151(C), pages 31-34.
    13. Andrews, Donald W K & Ploberger, Werner, 1994. "Optimal Tests When a Nuisance Parameter Is Present Only under the Alternative," Econometrica, Econometric Society, vol. 62(6), pages 1383-1414, November.
    14. James D. Hamilton, 2005. "What's real about the business cycle?," Review, Federal Reserve Bank of St. Louis, vol. 87(Jul), pages 435-452.
    15. Helmut Lütkepohl & Mika Meitz & Aleksei Netšunajev & Pentti Saikkonen, 2021. "Testing identification via heteroskedasticity in structural vector autoregressive models," The Econometrics Journal, Royal Economic Society, vol. 24(1), pages 1-22.
    16. Goldfeld, Stephen M. & Quandt, Richard E., 1973. "A Markov model for switching regressions," Journal of Econometrics, Elsevier, vol. 1(1), pages 3-15, March.
    17. Charfeddine, Lanouar, 2017. "The impact of energy consumption and economic development on Ecological Footprint and CO2 emissions: Evidence from a Markov Switching Equilibrium Correction Model," Energy Economics, Elsevier, vol. 65(C), pages 355-374.
    18. Kahn, James A. & Rich, Robert W., 2007. "Tracking the new economy: Using growth theory to detect changes in trend productivity," Journal of Monetary Economics, Elsevier, vol. 54(6), pages 1670-1701, September.
    19. Garcia, Rene & Perron, Pierre, 1996. "An Analysis of the Real Interest Rate under Regime Shifts," The Review of Economics and Statistics, MIT Press, vol. 78(1), pages 111-125, February.
    20. Jean-Marie Dufour & Richard Luger, 2017. "Identification-robust moment-based tests for Markov switching in autoregressive models," Econometric Reviews, Taylor & Francis Journals, vol. 36(6-9), pages 713-727, October.
    21. Hansen, Bruce E, 1996. "Erratum: The Likelihood Ratio Test under Nonstandard Conditions: Testing the Markov Switching Model of GNP," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 11(2), pages 195-198, March-Apr.
    22. Hiroyuki Kasahara & Tatsuyoshi Okimoto & Katsumi Shimotsu, 2014. "Modified Quasi-Likelihood Ratio Test for Regime Switching," The Japanese Economic Review, Japanese Economic Association, vol. 65(1), pages 25-41, March.
    23. Dufour, Jean-Marie, 2006. "Monte Carlo tests with nuisance parameters: A general approach to finite-sample inference and nonstandard asymptotics," Journal of Econometrics, Elsevier, vol. 133(2), pages 443-477, August.
    24. Christopher A. Sims & Tao Zha, 2006. "Were There Regime Switches in U.S. Monetary Policy?," American Economic Review, American Economic Association, vol. 96(1), pages 54-81, March.
    25. Simon Dietz & Nicholas Stern, 2015. "Endogenous Growth, Convexity of Damage and Climate Risk: How Nordhaus' Framework Supports Deep Cuts in Carbon Emissions," Economic Journal, Royal Economic Society, vol. 0(583), pages 574-620, March.
    26. Diebold, Francis X & Rudebusch, Glenn D, 1996. "Measuring Business Cycles: A Modern Perspective," The Review of Economics and Statistics, MIT Press, vol. 78(1), pages 67-77, February.
    27. Hamilton, James D., 1990. "Analysis of time series subject to changes in regime," Journal of Econometrics, Elsevier, vol. 45(1-2), pages 39-70.
    28. Zhongjun Qu & Fan Zhuo, 2021. "Likelihood Ratio-Based Tests for Markov Regime Switching," The Review of Economic Studies, Review of Economic Studies Ltd, vol. 88(2), pages 937-968.
    29. Pelletier, Denis, 2006. "Regime switching for dynamic correlations," Journal of Econometrics, Elsevier, vol. 131(1-2), pages 445-473.
    30. Marine Carrasco & Liang Hu & Werner Ploberger, 2014. "Optimal Test for Markov Switching Parameters," Econometrica, Econometric Society, vol. 82(2), pages 765-784, March.
    31. Chang-Jin Kim & Charles R. Nelson, 1999. "Has The U.S. Economy Become More Stable? A Bayesian Approach Based On A Markov-Switching Model Of The Business Cycle," The Review of Economics and Statistics, MIT Press, vol. 81(4), pages 608-616, November.
    32. Hiroyuki Kasahara & Katsumi Shimotsu, 2015. "Testing the Number of Components in Normal Mixture Regression Models," Journal of the American Statistical Association, Taylor & Francis Journals, vol. 110(512), pages 1632-1645, December.
    33. Andrews, Donald W K, 2001. "Testing When a Parameter Is on the Boundary of the Maintained Hypothesis," Econometrica, Econometric Society, vol. 69(3), pages 683-734, May.
    34. Lanne, Markku & Lütkepohl, Helmut & Maciejowska, Katarzyna, 2010. "Structural vector autoregressions with Markov switching," Journal of Economic Dynamics and Control, Elsevier, vol. 34(2), pages 121-131, February.
    35. Victor Aguirregabiria & Pedro Mira, 2007. "Sequential Estimation of Dynamic Discrete Games," Econometrica, Econometric Society, vol. 75(1), pages 1-53, January.
    36. Lanne, Markku & Lütkepohl, Helmut, 2010. "Structural Vector Autoregressions With Nonnormal Residuals," Journal of Business & Economic Statistics, American Statistical Association, vol. 28(1), pages 159-168.
    37. Markus Haas, 2004. "A New Approach to Markov-Switching GARCH Models," Journal of Financial Econometrics, Oxford University Press, vol. 2(4), pages 493-530.
    38. Andrew Sweeting, 2013. "Dynamic Product Positioning in Differentiated Product Markets: The Effect of Fees for Musical Performance Rights on the Commercial Radio Industry," Econometrica, Econometric Society, vol. 81(5), pages 1763-1803, September.
    39. Mikhail Golosov & John Hassler & Per Krusell & Aleh Tsyvinski, 2014. "Optimal Taxes on Fossil Fuel in General Equilibrium," Econometrica, Econometric Society, vol. 82(1), pages 41-88, January.
    40. Hamilton, James D, 1989. "A New Approach to the Economic Analysis of Nonstationary Time Series and the Business Cycle," Econometrica, Econometric Society, vol. 57(2), pages 357-384, March.
    41. So, Mike K P & Lam, K & Li, W K, 1998. "A Stochastic Volatility Model with Markov Switching," Journal of Business & Economic Statistics, American Statistical Association, vol. 16(2), pages 244-253, April.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Hiroyuki Kasahara & Katsumi Shimotsu, 2018. "Testing the Number of Regimes in Markov Regime Switching Models," Papers 1801.06862, arXiv.org, revised Jan 2018.
    2. Jean-Marie Dufour & Richard Luger, 2017. "Identification-robust moment-based tests for Markov switching in autoregressive models," Econometric Reviews, Taylor & Francis Journals, vol. 36(6-9), pages 713-727, October.
    3. Masaru Chiba, 2023. "Robust and efficient specification tests in Markov-switching autoregressive models," Statistical Inference for Stochastic Processes, Springer, vol. 26(1), pages 99-137, April.
    4. Meitz, Mika & Saikkonen, Pentti, 2021. "Testing for observation-dependent regime switching in mixture autoregressive models," Journal of Econometrics, Elsevier, vol. 222(1), pages 601-624.
    5. Hamilton, J.D., 2016. "Macroeconomic Regimes and Regime Shifts," Handbook of Macroeconomics, in: J. B. Taylor & Harald Uhlig (ed.), Handbook of Macroeconomics, edition 1, volume 2, chapter 0, pages 163-201, Elsevier.
    6. Sergei Koulayev & Marc Rysman & Scott Schuh & Joanna Stavins, 2016. "Explaining adoption and use of payment instruments by US consumers," RAND Journal of Economics, RAND Corporation, vol. 47(2), pages 293-325, May.
    7. Odendahl, Florens & Rossi, Barbara & Sekhposyan, Tatevik, 2023. "Evaluating forecast performance with state dependence," Journal of Econometrics, Elsevier, vol. 237(2).
    8. Agnello, Luca & Castro, Vítor & Sousa, Ricardo M., 2012. "How does fiscal policy react to wealth composition and asset prices?," Journal of Macroeconomics, Elsevier, vol. 34(3), pages 874-890.
    9. Maddalena Cavicchioli, 2021. "OLS Estimation of Markov switching VAR models: asymptotics and application to energy use," AStA Advances in Statistical Analysis, Springer;German Statistical Society, vol. 105(3), pages 431-449, September.
    10. Kasahara, Hiroyuki & Shimotsu, Katsumi, 2019. "Asymptotic properties of the maximum likelihood estimator in regime switching econometric models," Journal of Econometrics, Elsevier, vol. 208(2), pages 442-467.
    11. Chung-Ming Kuan, 2013. "Markov switching model (in Russian)," Quantile, Quantile, issue 11, pages 13-40, December.
    12. Nabil Maghrebi & Mark J. Holmes & Kosuke Oya, 2014. "Financial instability and the short-term dynamics of volatility expectations," Applied Financial Economics, Taylor & Francis Journals, vol. 24(6), pages 377-395, March.
    13. Mike Artis & Hans-Martin Krolzig & Juan Toro, 2004. "The European business cycle," Oxford Economic Papers, Oxford University Press, vol. 56(1), pages 1-44, January.
    14. Fritsche, Jan Philipp & Klein, Mathias & Rieth, Malte, 2021. "Government spending multipliers in (un)certain times," Journal of Public Economics, Elsevier, vol. 203(C).
    15. Levant, Jared & Ma, Jun, 2017. "A dynamic Nelson-Siegel yield curve model with Markov switching," Economic Modelling, Elsevier, vol. 67(C), pages 73-87.
    16. Garcia, René & Tsafack, Georges, 2011. "Dependence structure and extreme comovements in international equity and bond markets," Journal of Banking & Finance, Elsevier, vol. 35(8), pages 1954-1970, August.
    17. Chen, Runquan, 2009. "Regime switching in volatilities and correlation between stock and bond markets," LSE Research Online Documents on Economics 29306, London School of Economics and Political Science, LSE Library.
    18. Gabriel Rodriguez-Rondon, 2024. "Underlying Core Inflation with Multiple Regimes," Papers 2411.12845, arXiv.org.
    19. Kalli, Maria & Griffin, Jim E., 2018. "Bayesian nonparametric vector autoregressive models," Journal of Econometrics, Elsevier, vol. 203(2), pages 267-282.
    20. Luca Agnello & Gilles Dufrénot & Ricardo M. Sousa, 2012. "Adjusting the U.S. Fiscal Policy for Asset Prices: Evidence from a TVP-MS Framework," NIPE Working Papers 20/2012, NIPE - Universidade do Minho.

    More about this item

    NEP fields

    This paper has been announced in the following NEP Reports:

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:arx:papers:2411.08188. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: arXiv administrators (email available below). General contact details of provider: http://arxiv.org/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.