Giter Site home page Giter Site logo

bpenedo / neverhpfilter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from justinmshea/neverhpfilter

2.0 0.0 0.0 4.71 MB

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

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

R 100.00%

neverhpfilter's Introduction

neverhpfilter Package

CRAN_Status_Badge 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:

(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.4.0.

install.packages("neverhpfilter")

Or 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:

neverhpfilter's People

Contributors

justinmshea avatar

Stargazers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.