IDEAS home Printed from https://ideas.repec.org/p/tin/wpaper/20240060.html
   My bibliography  Save this paper

PyTimeVar: A Python Package for Trending Time-Varying Time Series Models

Author

Listed:
  • Mingxuan Song

    (Vrije Universiteit Amsterdam)

  • Bernhard van der Sluis

    (Erasmus University Rotterdam)

  • Yicong Lin

    (Vrije Universiteit Amsterdam and Tinbergen Institute)

Abstract

Time-varying regression models with trends are commonly used to analyze long-term tendencies and evolving relationships in data. However, statistical inference for parameter paths is challenging, and recent literature has proposed various bootstrap methods to address this issue. Despite this, no software package in any language has yet offered the recently developed tools for conducting inference in time-varying regression models. We propose PyTimeVar, a Python package that implements nonparametric estimation along with multiple new bootstrap-assisted inference methods. It provides a range of bootstrap techniques for constructing pointwise confidence intervals and simultaneous bands for parameter curves. Additionally, the package includes four widely used methods for modeling trends and time-varying relationships. This allows users to compare different approaches within a unified environment.

Suggested Citation

  • Mingxuan Song & Bernhard van der Sluis & Yicong Lin, 2024. "PyTimeVar: A Python Package for Trending Time-Varying Time Series Models," Tinbergen Institute Discussion Papers 24-060/III, Tinbergen Institute.
  • Handle: RePEc:tin:wpaper:20240060
    as

    Download full text from publisher

    File URL: https://papers.tinbergen.nl/24060.pdf
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Peter C. B. Phillips & Zhentao Shi, 2021. "Boosting: Why You Can Use The Hp Filter," International Economic Review, Department of Economics, University of Pennsylvania and Osaka University Institute of Social and Economic Research Association, vol. 62(2), pages 521-570, May.
    2. Xiaoye Li & Zhibiao Zhao, 2019. "A time varying approach to the stock return–inflation puzzle," Journal of the Royal Statistical Society Series C, Royal Statistical Society, vol. 68(5), pages 1509-1528, November.
    3. Durbin, James & Koopman, Siem Jan, 2012. "Time Series Analysis by State Space Methods," OUP Catalogue, Oxford University Press, edition 2, number 9780199641178, Decembrie.
    4. Ren, Boru & Lucey, Brian, 2023. "Herding in the Chinese renewable energy market: Evidence from a bootstrapping time-varying coefficient autoregressive model," Energy Economics, Elsevier, vol. 119(C).
    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. Yicong Lin & Mingxuan Song, 2023. "Robust bootstrap inference for linear time-varying coefficient models: Some Monte Carlo evidence," Tinbergen Institute Discussion Papers 23-049/III, Tinbergen Institute.
    2. Viv B. Hall & Peter Thomson, 2021. "Does Hamilton’s OLS Regression Provide a “better alternative” to the Hodrick-Prescott Filter? A New Zealand Business Cycle Perspective," Journal of Business Cycle Research, Springer;Centre for International Research on Economic Tendency Surveys (CIRET), vol. 17(2), pages 151-183, November.
    3. Hall, Viv B & Thomson, Peter, 2022. "A boosted HP filter for business cycle analysis: evidence from New Zealand’s small open economy," Working Paper Series 9473, Victoria University of Wellington, School of Economics and Finance.
    4. Viv B Hall & Peter Thomson, 2020. "Does Hamilton’s OLS regression provide a “better alternative†to the Hodrick-Prescott filter? A New Zealand business cycle perspective," CAMA Working Papers 2020-71, Centre for Applied Macroeconomic Analysis, Crawford School of Public Policy, The Australian National University.
    5. Viv B. Hall & Peter Thomson, 2022. "A boosted HP filter for business cycle analysis:evidence from New Zealand's small open economy," CAMA Working Papers 2022-45, Centre for Applied Macroeconomic Analysis, Crawford School of Public Policy, The Australian National University.
    6. Avanzi, Benjamin & Taylor, Greg & Vu, Phuong Anh & Wong, Bernard, 2020. "A multivariate evolutionary generalised linear model framework with adaptive estimation for claims reserving," Insurance: Mathematics and Economics, Elsevier, vol. 93(C), pages 50-71.
    7. François R. Velde, 2009. "Chronicle of a Deflation Unforetold," Journal of Political Economy, University of Chicago Press, vol. 117(4), pages 591-634, August.
    8. Wen Xu, 2016. "Estimation of Dynamic Panel Data Models with Stochastic Volatility Using Particle Filters," Econometrics, MDPI, vol. 4(4), pages 1-13, October.
    9. Alejandro Rodriguez & Esther Ruiz, 2009. "Bootstrap prediction intervals in state–space models," Journal of Time Series Analysis, Wiley Blackwell, vol. 30(2), pages 167-178, March.
    10. Parrini, Alessandro, 2013. "Importance Sampling for Portfolio Credit Risk in Factor Copula Models," MPRA Paper 103745, University Library of Munich, Germany.
    11. Jean-Luc Gaffard, 2014. "Crise de la théorie et crise de la politique économique. Des modèles d'équilibre général stochastique aux modèles de dynamique hors de l'équilibre," Revue économique, Presses de Sciences-Po, vol. 65(1), pages 71-96.
    12. Salman Huseynov, 2021. "Long and short memory in dynamic term structure models," CREATES Research Papers 2021-15, Department of Economics and Business Economics, Aarhus University.
    13. Tsionas, Mike G., 2021. "Bayesian forecasting with the structural damped trend model," International Journal of Production Economics, Elsevier, vol. 234(C).
    14. Tommaso Proietti, 2002. "Some Reflections on Trend-Cycle Decompositions with Correlated Components," Econometrics 0209002, University Library of Munich, Germany.
    15. Tobias Hartl & Roland Jucknewitz, 2022. "Approximate state space modelling of unobserved fractional components," Econometric Reviews, Taylor & Francis Journals, vol. 41(1), pages 75-98, January.
    16. Broto Carmen & Ruiz Esther, 2009. "Testing for Conditional Heteroscedasticity in the Components of Inflation," Studies in Nonlinear Dynamics & Econometrics, De Gruyter, vol. 13(2), pages 1-30, May.
    17. Marczak, Martyna & Proietti, Tommaso, 2016. "Outlier detection in structural time series models: The indicator saturation approach," International Journal of Forecasting, Elsevier, vol. 32(1), pages 180-202.
    18. Oreste Napolitano & Alberto Montagnoli, 2010. "The European Unemployment Gap and the Role of Monetary Policy," Economics Bulletin, AccessEcon, vol. 30(2), pages 1346-1358.
    19. Joshua Chan & Arnaud Doucet & Roberto León-González & Rodney W. Strachan, 2018. "Multivariate Stochastic Volatility with Co-Heteroscedasticity," Working Paper series 18-38, Rimini Centre for Economic Analysis.
    20. Siem Jan Koopman & Joao Valle e Azevedo, 2003. "Measuring Synchronisation and Convergence of Business Cycles," Tinbergen Institute Discussion Papers 03-052/4, Tinbergen Institute.

    More about this item

    Keywords

    time-varying; bootstrap; nonparametric estimation; boosted Hodrick-Prescott filter; power-law trend; score-driven; state-space;
    All these keywords.

    JEL classification:

    • C14 - Mathematical and Quantitative Methods - - Econometric and Statistical Methods and Methodology: General - - - Semiparametric and Nonparametric Methods: General
    • C22 - Mathematical and Quantitative Methods - - Single Equation Models; Single Variables - - - Time-Series Models; Dynamic Quantile Regressions; Dynamic Treatment Effect Models; Diffusion Processes
    • C87 - Mathematical and Quantitative Methods - - Data Collection and Data Estimation Methodology; Computer Programs - - - Econometric Software

    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:tin:wpaper:20240060. 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: Tinbergen Office +31 (0)10-4088900 (email available below). General contact details of provider: https://edirc.repec.org/data/tinbenl.html .

    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.