Skip to content

mhpfilter

0.1.0

Modified Hodrick-Prescott Filter with Optimal Smoothing Parameter Selection

0packages depend
1.1Kdownloads / year
test coverage
13/13checks pass

Overview

About
Maintained by Muhammad YaseenFirst published 2026-02-131 releasesCRAN page ↗GitHub ↗

High-performance implementation of the Modified Hodrick-Prescott (HP) Filter for decomposing macroeconomic time series into trend and cyclical components. Based on the methodology of Choudhary, Hanif and Iqbal (2014) <doi:10.1080/00036846.2014.894631> "On smoothing macroeconomic time series using the modified HP filter", which uses generalized cross-validation (GCV) to automatically select the optimal smoothing parameter lambda, following McDermott (1997) "An automatic method for choosing the smoothing parameter in the HP filter" (as described in Coe and McDermott (1997) <doi:10.2307/3867497>). Unlike the standard HP filter that uses fixed lambda values (1600 for quarterly, 100 for annual data), this package estimates series-specific lambda values that minimize the GCV criterion. Implements efficient C++ routines via 'RcppArmadillo' for fast computation, supports batch processing of multiple series, and provides comprehensive visualization tools using 'ggplot2'. Particularly useful for cross-country macroeconomic comparisons, business cycle analysis, and when the appropriate smoothing parameter is uncertain.

Install

Health

CRAN checks
13OK
Code health
None
Tests · ratio 0.00
not tracked
Coverage
100%
Documentation · exports
Yes
Vignettes
Yes
README
5
Dependencies · direct
Check history
  • OK2026-04-22
    14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
  • ERROR2026-04-18
    13 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE
  • OK2026-03-10
    14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE

Downloads

1.1K
CRAN downloads in the past year
Rank #22,287 · ~3/day · ~88/mo
25330 days
53390 days
1.1K1 year
Also on177 r2u20 autocran
Source & community
GitHub ↗

Repository stars, issues, and contributor activity are not tracked yet.

Dependencies

Declared dependencies
12 external dependencies (excludes base and recommended)
Depends (1)
R >= 4.0.0
LinkingTo (2)
Enhances (0)
none
Reverse dependencies
0direct
indirect (not tracked)

Nothing depends on this yet.

Code

3,322Lines of code
9Exported functions

Line coverage

Expression

Tests / Examples

Functions

35 10 exported

Complexity

2.5 avg / 7 max

Call network

35 nodes / 25 edges

Test coverage has not been measured for this package yet; nodes fall back to a neutral fill.

Loading call graph…

Lowest coverage

Per-function coverage is not measured for this package yet.

People & History

People (3)
Maintainer (1)
Author, Maintainer
Contributors (2)
Contributor
Contributor
Release timeline

1 releases. Pick two to compare their code metrics; R releases are shown for context.

  • R
    R 4.6.0 released · 2026-04-24
  • 0.1.0Latest
    2026-03-10 · current release

Package metadata

First published
2026-02-13
Total releases
1 / 1 yrs
License
MIT + file LICENSE OSI
Download size
not tracked yet
Installed size
not tracked yet
With dependencies
not tracked yet