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. Durbin, James & Koopman, Siem Jan, 2012. "Time Series Analysis by State Space Methods," OUP Catalogue, Oxford University Press, edition 2, number 9780199641178.
    3. 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).
    4. 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.
    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. 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.
    3. 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.
    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. Victor Bystrov, 2018. "Measuring the Natural Rates of Interest in Germany and Italy," Central European Journal of Economic Modelling and Econometrics, Central European Journal of Economic Modelling and Econometrics, vol. 10(4), pages 333-353, December.
    7. Yukai Yang & Luc Bauwens, 2018. "State-Space Models on the Stiefel Manifold with a New Approach to Nonlinear Filtering," Econometrics, MDPI, vol. 6(4), pages 1-22, December.
    8. Fernández-Macho, Javier, 2008. "Spectral estimation of a structural thin-plate smoothing model," Computational Statistics & Data Analysis, Elsevier, vol. 53(1), pages 189-195, September.
    9. Drew Creal & Siem Jan Koopman & Eric Zivot, 2008. "The Effect of the Great Moderation on the U.S. Business Cycle in a Time-varying Multivariate Trend-cycle Model," Tinbergen Institute Discussion Papers 08-069/4, Tinbergen Institute.
    10. 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.
    11. 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.
    12. Chen, Peimin & Wu, Chunchi, 2014. "Default prediction with dynamic sectoral and macroeconomic frailties," Journal of Banking & Finance, Elsevier, vol. 40(C), pages 211-226.
    13. repec:zbw:bofitp:2019_008 is not listed on IDEAS
    14. Yue Zhao & Difang Wan, 2018. "Institutional high frequency trading and price discovery: Evidence from an emerging commodity futures market," Journal of Futures Markets, John Wiley & Sons, Ltd., vol. 38(2), pages 243-270, February.
    15. Wen Xu, 2016. "Estimation of Dynamic Panel Data Models with Stochastic Volatility Using Particle Filters," Econometrics, MDPI, vol. 4(4), pages 1-13, October.
    16. Scott Brave & R. Andrew Butters & Alejandro Justiniano, 2016. "Forecasting Economic Activity with Mixed Frequency Bayesian VARs," Working Paper Series WP-2016-5, Federal Reserve Bank of Chicago.
    17. repec:spo:wpmain:info:hdl:2441/1904 is not listed on IDEAS
    18. Hári, Norbert & De Waegenaere, Anja & Melenberg, Bertrand & Nijman, Theo E., 2008. "Estimating the term structure of mortality," Insurance: Mathematics and Economics, Elsevier, vol. 42(2), pages 492-504, April.
    19. Brave, Scott A. & Gascon, Charles & Kluender, William & Walstrum, Thomas, 2021. "Predicting benchmarked US state employment data in real time," International Journal of Forecasting, Elsevier, vol. 37(3), pages 1261-1275.
    20. 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.
    21. Parrini, Alessandro, 2013. "Importance Sampling for Portfolio Credit Risk in Factor Copula Models," MPRA Paper 103745, University Library of Munich, Germany.
    22. 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.

    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.