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. Cai, Zongwu, 2007. "Trending time-varying coefficient time series models with serially correlated errors," Journal of Econometrics, Elsevier, vol. 136(1), pages 163-188, January.
    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).
    5. Umlandt, Dennis, 2023. "Score-driven asset pricing: Predicting time-varying risk premia based on cross-sectional model performance," Journal of Econometrics, Elsevier, vol. 237(2).
    6. Zhou Zhou & Wei Biao Wu, 2010. "Simultaneous inference of linear models with time varying coefficients," Journal of the Royal Statistical Society Series B, Royal Statistical Society, vol. 72(4), pages 513-531, September.
    7. 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. Friedrich, Marina & Lin, Yicong, 2024. "Sieve bootstrap inference for linear time-varying coefficient models," Journal of Econometrics, Elsevier, vol. 239(1).
    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, 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.
    5. Weichi Wu & Zhou Zhou, 2017. "Nonparametric Inference for Time-Varying Coefficient Quantile Regression," Journal of Business & Economic Statistics, Taylor & Francis Journals, vol. 35(1), pages 98-109, January.
    6. Čížek, Pavel & Koo, Chao Hui, 2021. "Jump-preserving varying-coefficient models for nonlinear time series," Econometrics and Statistics, Elsevier, vol. 19(C), pages 58-96.
    7. Ngai Hang Chan & Linhao Gao & Wilfredo Palma, 2022. "Simultaneous variable selection and structural identification for time‐varying coefficient models," Journal of Time Series Analysis, Wiley Blackwell, vol. 43(4), pages 511-531, July.
    8. Karmakar, Sayar & Richter, Stefan & Wu, Wei Biao, 2022. "Simultaneous inference for time-varying models," Journal of Econometrics, Elsevier, vol. 227(2), pages 408-428.
    9. Degui Li & Bin Peng & Songqiao Tang & Weibiao Wu, 2023. "Inference of Grouped Time-Varying Network Vector Autoregression Models," Monash Econometrics and Business Statistics Working Papers 5/23, Monash University, Department of Econometrics and Business Statistics.
    10. Xingcai Zhou & Guang Yang & Yu Xiang, 2022. "Quantile-Wavelet Nonparametric Estimates for Time-Varying Coefficient Models," Mathematics, MDPI, vol. 10(13), pages 1-15, July.
    11. Marina Friedrich & Karim Moussa & Yuliya Shapovalova & David van der Straten, 2025. "Forecasting Atmospheric Ethane: Application to the Jungfraujoch Measurement Station," Tinbergen Institute Discussion Papers 25-025/III, Tinbergen Institute.
    12. Zongwu Cai & Ted Juhl, 2020. "The Distribution Of Rolling Regression Estimators," WORKING PAPERS SERIES IN THEORETICAL AND APPLIED ECONOMICS 202218, University of Kansas, Department of Economics, revised Dec 2022.
    13. Riccardo Lucchetti & Francesco Valentini, 2023. "Kernel-based time-varying IV estimation: handle with care," Empirical Economics, Springer, vol. 65(6), pages 3001-3026, December.
    14. Degui Li & Bin Peng & Songqiao Tang & Weibiao Wu, 2023. "Estimation of Grouped Time-Varying Network Vector Autoregression Models," Papers 2303.10117, arXiv.org, revised Mar 2024.
    15. Cai, Zongwu & Juhl, Ted, 2023. "The distribution of rolling regression estimators," Journal of Econometrics, Elsevier, vol. 235(2), pages 1447-1463.
    16. Zhang, Ting, 2015. "Semiparametric model building for regression models with time-varying parameters," Journal of Econometrics, Elsevier, vol. 187(1), pages 189-200.
    17. 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.
    18. Li, Degui & Phillips, Peter C.B. & Gao, Jiti, 2020. "Kernel-based Inference in Time-Varying Coefficient Cointegrating Regression," Journal of Econometrics, Elsevier, vol. 215(2), pages 607-632.
    19. Lujia Bai & Weichi Wu, 2021. "Detecting long-range dependence for time-varying linear models," Papers 2110.08089, arXiv.org, revised Mar 2023.
    20. 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.

    More about this item

    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.