A Better Alternative to the Hodrick-Prescott Filter

In the working paper titled "Why You Should Never Use the Hodrick-Prescott Filter", James D. Hamilton proposes an interesting new alternative to economic time series filtering. The neverhpfilter package provides functions for implementing his solution. Hamilton (2017) .


AppVeyor Build Status Travis-CI Build Status codecov.io

Introduction

In the working paper titled "Why You Should Never Use the Hodrick-Prescott Filter", James D. Hamilton proposes an interesting new alternative to economic time series filtering. The neverhpfilter package provides functions for implementing his solution. Hamilton (2017) doi:10.3386/w23429

Hamilton's abstract offers an excellent introduction:

Getting Started

Install from the Github master branch on R version >= 3.4.0.

devtools::install_github("JustinMShea/neverhpfilter")

Load the package

library(neverhpfilter)

Read the vignette Reproducing Hamilton.

Package Documentation

The package consists of 2 core functions documented here:

News


title: "NEWS" output: github_document

neverhpfilter 0.2-0

Functions consolidated into just two functions. yth_glm remains unchanged, while yth_filter has been given an output parameter to specify the return of specific series. This feature eliminates the need for yth_filter and yth_trend, which are helpful when apply the function to multiple data sets.

Nine additional data sets have been added to replicate most all of Hamilton's table 2.

The "Reproducing Hamilton" vignette has been expanded and content has been edited for clarity.

neverhpfilter 0.1-0

First complete version. Has four functions yth_glm, yth_filter, yth_cycle, and yth_trend. Three data sets are included to reproduce part of Hamilton's work. They are GDPC1, PAYEMS, and Hamilton_table_2. A vignette titled "Reproducing Hamilton" illustrated the work and shows users how to implement functions.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("neverhpfilter")

0.2-0 by Justin M. Shea, a year ago


https://justinmshea.github.io/neverhpfilter/


Report a bug at https://github.com/JustinMShea/neverhpfilter/issues


Browse source code at https://github.com/cran/neverhpfilter


Authors: Justin M. Shea [aut, cre]


Documentation:   PDF Manual  


GPL-3 license


Imports xts, zoo

Suggests knitr, rmarkdown, testthat, covr


See at CRAN