Skip to content

hpfilter

The One- And Two-Sided Hodrick-Prescott Filter

v1.0.2 · May 28, 2023 · CC BY-SA 4.0

Description

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.

Downloads

CRAN

433

Last 30 days

9838th

1.4K

Last 90 days

5.4K

Last year

Trend: -10.2% (30d vs prior 30d)

r2u CRAN

1

Last 30 days

31

Last 90 days

105

Last year

Trend: -92.9% (30d vs prior 30d)

autoCRAN

3

Last 7 days

7

Last 30 days

0

All-time

autoCRAN-only: this name is served only by autoCRAN, so the count is exact.

CRAN Check Status

2 NOTE
11 OK
Show all 13 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang NOTE
r-devel-linux-x86_64-debian-gcc NOTE
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK
Check details (2 non-OK)
NOTE r-devel-linux-x86_64-debian-clang

CRAN incoming feasibility

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.
NOTE r-devel-linux-x86_64-debian-gcc

CRAN incoming feasibility

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.

Check History

NOTE 12 OK · 2 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026
NOTE r-devel-linux-x86_64-debian-clang

CRAN incoming feasibility

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.
NOTE r-devel-linux-x86_64-debian-gcc

CRAN incoming feasibility

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.

Code

Structure

Lines of code

934

Files

22

Compiled share

0%

Has compiled src

No

Language breakdown

R 383 (41%)Docs 337 (36.1%)Vignettes 214 (22.9%)

API

Exported functions

2

Internal functions

0

Recent export changes

v1.0.0+2 hp1, hp2

Testing & CI

Has tests

No

Test-to-code ratio

0.00

testthat edition

CI present

No

CI type

[]

PR gated

No

Docs

Return-value doc rate

100%

\dontrun example ratio

0%

Roxygen coverage

100%

Has pkgdown

No

NEWS present

Yes

Health & Security signals

Informational signals; not verdicts.

on.exit coverage

Unsafe pattern score

0

Dep constraint coverage

0%

Secret pattern count

0

Bundled 3rd-party code

2 items

Portability & License

Min R version

3.5.0

System requirements

C++ standard

License

CC BY-SA 4.0

License flags

not SPDX, not OSI

History

Versions

3

First release

2023-02-24

Latest release

2023-05-28

Avg cadence

47 days

Cold removal rate

Dep drift

0

LOC over versions

v1.0.0: 934 LOCv1.0.1: 928 LOCv1.0.2: 934 LOC

Per-file churn detail lives in the source pipeline: https://github.com/r-observatory/cran-code-metrics.

Reverse Dependencies (1)

imports

Dependency Network

Dependencies Reverse dependencies Matrix trendseries hpfilter

Version History

4 tracked
new 1.0.2 Mar 10, 2026
updated 1.0.2 ← 1.0.1 diff May 27, 2023
updated 1.0.1 ← 1.0.0 diff Feb 25, 2023
new 1.0.0 Feb 23, 2023