Skip to contents

Filters

HP, modified HP (Choudhary et al. 2014) and fully modified HP (Hanif et al. 2017) filters.

hp_filter()
Hodrick-Prescott filter with a fixed smoothing parameter
mhp_filter()
Modified Hodrick-Prescott filter: the smoothing parameter chosen from the data
fmhp_filter()
Fully modified Hodrick-Prescott filter

Many series and comparisons

mhp_batch()
Modified HP filter of many series
fmhp_batch()
Fully modified HP filter of many series
mhp_compare() batch_compare()
Compare the HP and the modified HP filter
fmhp_compare()
Compare the HP, modified HP and fully modified HP filters

End-point diagnostics

Weights, gains and end-point loss of HP-type filters with any smoothing parameters.

hp_schedule()
Smoothing parameters with raised end values
hp_weights()
Weights of an HP-type filter
hp_gain()
Gain functions of an HP-type filter
hp_loss()
End-point loss of an HP-type filter

Simulation

mhp_designs()
The 30 simulation designs of Hanif, Iqbal and Choudhary (2017)
mhp_simulate()
Simulate a series with a known trend and cycle
fmhp_simulation()
Power comparison of the filters on simulated series

Results, plots and interpretation

get_lambda() get_gcv()
Extract the smoothing parameter or the criterion of a result
print(<mhp>)
Print a filter result
autoplot.mhp()
Plot the decomposition of a series
plot_comparison()
Plot the HP and modified HP filters of one series
plot_batch()
Plot the results of many series
mhp_interpret() print(<mhp_interpretation>) format(<mhp_interpretation>)
Plain-language interpretation of a result
print(<mhp_result>) summary(<mhp_result>) print(<summary.mhp_result>) format(<mhp_result>) as.data.table(<mhp_result>) as.data.frame(<mhp_result>) plot(<mhp_result>)
Methods for mhpfilter results

Application

mhp_app() mhp_app_object()
Trend and cycle analysis in a web browser

Data

us_macro
United States real GDP, consumption and investment, 1959 to 2009 (quarterly)

Utilities

mhp_cite()
References of a result or of the package
mhp_theme()
ggplot2 theme of mhpfilter
mhp_save()
Save a figure (vector PDF by default)
mhp_notation()
Notation of mhpfilter
mhp_reference()
Published values used by the tests and vignettes
mhpfilter mhpfilter-package
mhpfilter: Modified and Fully Modified Hodrick-Prescott Filters