mhpfilter
0.1.0Modified Hodrick-Prescott Filter with Optimal Smoothing Parameter Selection
Overview
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
- OK2026-04-2214 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
- ERROR2026-04-1813 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE
- OK2026-03-1014 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
Downloads
Dependencies
Nothing depends on this yet.
Code
Code & tests
Open call graph →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.
Lowest coverage
Per-function coverage is not measured for this package yet.
People & History
1 releases. Pick two to compare their code metrics; R releases are shown for context.
- RR 4.6.0 released · 2026-04-24
- 0.1.0Latest2026-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