IDEAS home Printed from https://ideas.repec.org/p/vic/vicddp/2401.html

An Aggregation-Consistent Implementation of the Hamilton Filter

Author

Abstract

I propose a modified implementation of the popular Hamilton filter, to make the cyclical component extracted from an aggregate variable consistent with the aggregation of the cyclical components extracted from its underlying variables. This procedure is helpful in many circumstances, for instance when dealing with a variable that comes from a definition or when the empirical relationship is based on an equilibrium condition of a growth model. The procedure consists of the following steps: 1) build the aggregate variable, 2) run the Hamilton filter regression on the aggregate variable and store the related OLS estimates, 3) use these estimated parameters to predict the trends of all the underlying variables, 4) rescale the constant terms to obtain mean-zero cyclical components that are aggregation-consistent. I consider two applications, exploiting U.S. and Canadian data. The former is based on the GDP expenditure components, while the latter on the GDP of its Provinces and Territories. I find sizable differences between the cyclical components of aggregate GDP computed with and without the adjustment, making it a valuable procedure for both assessing the output gap and validating empirically DSGE models.

Suggested Citation

  • Marco Cozzi, 2024. "An Aggregation-Consistent Implementation of the Hamilton Filter," Department Discussion Papers 2401, Department of Economics, University of Victoria.
  • Handle: RePEc:vic:vicddp:2401
    Note: ISSN 1914-2838
    as

    Download full text from publisher

    File URL: https://www.uvic.ca/socialsciences/economics/_assets/docs/discussion/ddp2401.pdf
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Harvey, A C & Jaeger, A, 1993. "Detrending, Stylized Facts and the Business Cycle," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 8(3), pages 231-247, July-Sept.
    2. James D. Hamilton, 2018. "Why You Should Never Use the Hodrick-Prescott Filter," The Review of Economics and Statistics, MIT Press, vol. 100(5), pages 831-843, December.
    3. Biolsi, Christopher, 2023. "Do the Hamilton and Beveridge–Nelson filters provide the same information about output gaps? An empirical comparison for practitioners," Journal of Macroeconomics, Elsevier, vol. 75(C).
    4. Hodrick, Robert J & Prescott, Edward C, 1997. "Postwar U.S. Business Cycles: An Empirical Investigation," Journal of Money, Credit and Banking, Blackwell Publishing, vol. 29(1), pages 1-16, February.
    5. Nicolas Caramp & Sanjay R Singh, 2023. "Bond Premium Cyclicality and Liquidity Traps," The Review of Economic Studies, Review of Economic Studies Ltd, vol. 90(6), pages 2822-2879.
    6. Josefine Quast & Maik H. Wolters, 2022. "Reliable Real-Time Output Gap Estimates Based on a Modified Hamilton Filter," Journal of Business & Economic Statistics, Taylor & Francis Journals, vol. 40(1), pages 152-168, January.
    7. Günes Kamber & James Morley & Benjamin Wong, 2018. "Intuitive and Reliable Estimates of the Output Gap from a Beveridge-Nelson Filter," The Review of Economics and Statistics, MIT Press, vol. 100(3), pages 550-566, July.
    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. Arčabić, Vladimir & Panovska, Irina & Tica, Josip, 2024. "Business cycle synchronization and asymmetry in the European Union," Economic Modelling, Elsevier, vol. 139(C).
    2. Kamber, Güneş & Morley, James & Wong, Benjamin, 2025. "Trend-cycle decomposition in the presence of large shocks," Journal of Economic Dynamics and Control, Elsevier, vol. 173(C).
    3. Tore Dubbert & Adrian Schroeder, 2025. "Conditioning business and financial cycles on multivariate information," CQE Working Papers 11225, Center for Quantitative Economics (CQE), University of Muenster.
    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. Melina Dritsaki & Chaido Dritsaki, 2022. "Comparison of HP Filter and the Hamilton’s Regression," Mathematics, MDPI, vol. 10(8), pages 1-18, April.
    6. Kumar, Labesh, 2026. "The Output Gap: Method Choice, Data Revisions, and Policy Implications," MPRA Paper 127829, University Library of Munich, Germany.
    7. Sarah Fischer & Christian Glocker & Serguei Kaniovski & Philipp Wegmüller, 2024. "Assessing the Potential Output for Switzerland: Determinants, Trends and Drivers," Journal of Business Cycle Research, Springer;Centre for International Research on Economic Tendency Surveys (CIRET), vol. 20(2), pages 297-338, July.
    8. Kristian Jönsson, 2025. "Comparing real-time uncertainty of the Hodrick-Prescott and Hamilton trend/cycle decompositions," Empirical Economics, Springer, vol. 69(3), pages 1335-1361, September.
    9. Chalmovianský, Jakub & Němec, Daniel, 2022. "Assessing uncertainty of output gap estimates: Evidence from Visegrad countries," Economic Modelling, Elsevier, vol. 116(C).
    10. Biolsi, Christopher, 2023. "Do the Hamilton and Beveridge–Nelson filters provide the same information about output gaps? An empirical comparison for practitioners," Journal of Macroeconomics, Elsevier, vol. 75(C).
    11. Martin Boďa & Mariana Považanová, 2023. "How credible are Okun coefficients? The gap version of Okun’s law for G7 economies," Economic Change and Restructuring, Springer, vol. 56(3), pages 1467-1514, June.
    12. Andrew B. Martinez & Alexander D. Schibuola & David Beckworth, 2026. "The Reliability of the Nominal GDP Expectations Gap," International Journal of Central Banking, International Journal of Central Banking, vol. 22(2), pages 525-557, April.
    13. Lars-H. R. Siemers, 2024. "On the Hamilton-HP Filter Controversy: Evidence from German Business Cycles," Journal of Business Cycle Research, Springer;Centre for International Research on Economic Tendency Surveys (CIRET), vol. 20(3), pages 367-409, November.
    14. Schüler, Yves S. & Hiebert, Paul P. & Peltonen, Tuomas A., 2020. "Financial cycles: Characterisation and real-time measurement," Journal of International Money and Finance, Elsevier, vol. 100(C).
    15. Hartwig, Benny & Meinerding, Christoph & Schüler, Yves S., 2021. "Identifying indicators of systemic risk," Journal of International Economics, Elsevier, vol. 132(C).
    16. Duarte, Cláudia & Maria, José R. & Sazedj, Sharmin, 2020. "Trends and cycles under changing economic conditions," Economic Modelling, Elsevier, vol. 92(C), pages 126-146.
    17. Petz, Nico & Zörner, Thomas O., 2026. "How Phillips curve dynamics enhance business cycle synchronization analysis in Central and Eastern Europe," Journal of International Money and Finance, Elsevier, vol. 161(C).
    18. Berger, Tino & Ochsner, Christian, 2022. "Robust real-time estimates of the German output gap based on a multivariate trend-cycle decomposition," Discussion Papers 35/2022, Deutsche Bundesbank.
    19. Ziwei Mei & Zhentao Shi & Peter C. B. Phillips, 2022. "The boosted HP filter is more general than you might think," Cowles Foundation Discussion Papers 2348, Cowles Foundation for Research in Economics, Yale University.
    20. Elias Wolf & Frieder Mokinski & Yves Schüler, 2026. "On Adjusting the One‐Sided Hodrick–Prescott Filter," Journal of Money, Credit and Banking, Blackwell Publishing, vol. 58(3), pages 919-931, April.

    More about this item

    Keywords

    ;
    ;
    ;
    ;
    ;
    ;
    ;

    JEL classification:

    • C22 - Mathematical and Quantitative Methods - - Single Equation Models; Single Variables - - - Time-Series Models; Dynamic Quantile Regressions; Dynamic Treatment Effect Models; Diffusion Processes
    • E30 - Macroeconomics and Monetary Economics - - Prices, Business Fluctuations, and Cycles - - - General (includes Measurement and Data)

    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:vic:vicddp:2401. 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: Kali Moon (email available below). General contact details of provider: https://edirc.repec.org/data/devicca.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.