The One- And Two-Sided Hodrick-Prescott Filter
Overview
Provides two functions that implement the one-sided and two-sided versions of the Hodrick-Prescott filter. The one-sided version is a Kalman filter-based implementation, whereas the two- sided version uses sparse matrices for improved efficiency. References: Hodrick, R. J., and Prescott, E. C. (1997) doi:10.2307/2953682 Mcelroy, T. (2008) doi:10.1111/j.1368-423X.2008.00230.x Meyer-Gohde, A. (2010) https://ideas.repec.org/c/dge/qmrbcd/181.html For more references, see the vignette.
Code adapted to new version of Matrix 1.5-5, which introduced changes that
could lead to an error in hpfilter 1.0.1.
Replaced some special characters which were not displaying correctly in the
help file.
From NEWS.md in the release
Install
Health
NOTECRAN incoming feasibilityr-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc
Maintainer: ‘Alexandru Monahov <alexandru.monahov@proton.me>’
No Authors@R field in DESCRIPTION.
Please add one, modifying
Authors@R: person(given = "Alexandru",
family = "Monahov",
role = c("aut", "cre"),
email = "alexandru.monahov@proton.me")
as necessary.- NOTE11 OK, 2 NOTENow
- NOTE12 OK, 2 NOTE2026-03-10
Documentation
- Help pages
- 4 (1 internal)includes a package overview page
- Examples that run
- 100%4 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 100%
Downloads
Dependencies
Installing hpfilter adds no packages beyond those that come with R.
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- 1.0.2Latest
- RR 4.3.0 released · 2023-04-21
- 1.0.12023-02-26 · diff ↗
- 1.0.02023-02-24
- RR 4.2.0 released · 2022-04-22
Package metadata
- First published
- 2023-02-24
- Total releases
- 3 / 3 yrs
- License
- CC BY-SA 4.0
- Minimum R
- ≥ 3.5.0
- Bundled data
- 1.1 KB / 1 file
- Download size
- 116 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("hpfilter")Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.