neverhpfilter

R package recreating econometric methods proposed in "Why You Should Never Use the Hodrick-Prescott Filter" by James Hamilton

https://github.com/justinmshea/neverhpfilter

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
    2 of 3 committers (66.7%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.8%) to scientific vocabulary

Keywords

cran hamilton hp-filter r r-package time-series
Last synced: 11 months ago · JSON representation

Repository

R package recreating econometric methods proposed in "Why You Should Never Use the Hodrick-Prescott Filter" by James Hamilton

Basic Info
Statistics
  • Stars: 16
  • Watchers: 3
  • Forks: 7
  • Open Issues: 0
  • Releases: 0
Topics
cran hamilton hp-filter r r-package time-series
Created almost 9 years ago · Last pushed 11 months ago
Metadata Files
Readme

README.md

neverhpfilter Package

<!-- badges: start --> CRAN_Status_Badge R-CMD-check <!-- badges: end -->

Introduction

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

Hamilton's abstract offers an excellent introduction:

(1) The HP filter produces series with spurious dynamic relations that have no basis in the underlying data-generating process. (2) Filtered values at the end of the sample are very different from those in the middle, and are also characterized by spurious dynamics. (3) A statistical formalization of the problem typically produces values for the smoothing parameter vastly at odds with common practice, e.g., a value for $\lambda$ far below 1600 for quarterly data. (4) There's a better alternative. A regression of the variable at date $t + h$ on the four most recent values as of date $t$ offers a robust approach to detrending that achieves all the objectives sought by users of the HP filter with none of its drawbacks.

Getting Started

Install from CRAN on R version >= 3.5.0.

{r} install.packages("neverhpfilter")

Or install from the Github master branch on R version >= 3.5.0.

{r} devtools::install_github("JustinMShea/neverhpfilter")

Load the package

{r} library(neverhpfilter)

Package Documentation

The package consists of 2 estimation functions, 12 economic xts objects, an xts object containing Robert Shiller's U.S. Stock Markets and CAPE Ratio data from 1871 to Present, and a data.frame containing the original filter estimates found on table 2 of Hamilton (2017) doi:10.3386/w23429

Documentation for each can be found here:

Finally, a vignette recreating the estimates of the original work can be found in Reproducing Hamilton.

Owner

  • Name: Justin M. Shea
  • Login: JustinMShea
  • Kind: user
  • Location: Chicago, IL

GitHub Events

Total
  • Issues event: 5
  • Watch event: 2
  • Issue comment event: 3
  • Push event: 6
Last Year
  • Issues event: 5
  • Watch event: 2
  • Issue comment event: 3
  • Push event: 6

Committers

Last synced: over 3 years ago

All Time
  • Total Commits: 328
  • Total Committers: 3
  • Avg Commits per committer: 109.333
  • Development Distribution Score (DDS): 0.247
Top Committers
Name Email Commits
JustinMShea j****a@m****u 247
JustinMShea j****a@r****u 80
Justin M. Shea J****a@u****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 8
  • Total pull requests: 2
  • Average time to close issues: 7 days
  • Average time to close pull requests: 1 minute
  • Total issue authors: 4
  • Total pull request authors: 1
  • Average comments per issue: 0.38
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • JustinMShea (6)
  • adzemski (1)
  • SvN-HEC (1)
  • jameshowey (1)
Pull Request Authors
  • JustinMShea (2)
Top Labels
Issue Labels
enhancement (3) bug (2)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 113 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 4
  • Total maintainers: 1
cran.r-project.org: neverhpfilter

An Alternative to the Hodrick-Prescott Filter

  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 113 Last month
Rankings
Forks count: 9.1%
Stargazers count: 15.6%
Average: 25.1%
Dependent packages count: 29.8%
Downloads: 35.4%
Dependent repos count: 35.5%
Maintainers (1)
Last synced: 11 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.5.0 depends
  • xts >= 0.11 depends
  • zoo >= 1.8 depends
  • simplermarkdown * suggests
  • tinytest * suggests