{"id":24132882,"url":"https://github.com/justinmshea/neverhpfilter","last_synced_at":"2025-09-19T02:31:57.219Z","repository":{"id":56934832,"uuid":"101463296","full_name":"JustinMShea/neverhpfilter","owner":"JustinMShea","description":"R package recreating econometric methods proposed in \"Why You Should Never Use the Hodrick-Prescott Filter\" by James Hamilton","archived":false,"fork":false,"pushed_at":"2022-12-10T21:28:31.000Z","size":13778,"stargazers_count":14,"open_issues_count":5,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-04T02:15:09.883Z","etag":null,"topics":["cran","hamilton","hp-filter","r","r-package","time-series"],"latest_commit_sha":null,"homepage":"https://justinmshea.github.io/neverhpfilter/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JustinMShea.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-26T04:52:10.000Z","updated_at":"2024-11-28T10:36:15.000Z","dependencies_parsed_at":"2022-08-21T06:50:45.574Z","dependency_job_id":null,"html_url":"https://github.com/JustinMShea/neverhpfilter","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JustinMShea%2Fneverhpfilter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JustinMShea%2Fneverhpfilter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JustinMShea%2Fneverhpfilter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JustinMShea%2Fneverhpfilter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JustinMShea","download_url":"https://codeload.github.com/JustinMShea/neverhpfilter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233546488,"owners_count":18692223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cran","hamilton","hp-filter","r","r-package","time-series"],"created_at":"2025-01-11T22:38:45.475Z","updated_at":"2025-09-19T02:31:56.975Z","avatar_url":"https://github.com/JustinMShea.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# neverhpfilter Package\n\n  \u003c!-- badges: start --\u003e\n[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/neverhpfilter)](https://cran.r-project.org/package=neverhpfilter) \n[![R-CMD-check](https://github.com/JustinMShea/neverhpfilter/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/JustinMShea/neverhpfilter/actions/workflows/R-CMD-check.yaml)\n  \u003c!-- badges: end --\u003e\n\n## Introduction\n\n  In the working paper titled \"Why You Should Never Use the **H**odrick-**P**rescott 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) \u003cdoi:10.3386/w23429\u003e](https://www.nber.org/papers/w23429)\n\nHamilton's abstract offers an excellent introduction:\n\n  \u003e (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.\n\n\n  \n## Getting Started\n\n\nInstall from CRAN on R version \u003e= 3.5.0.\n\n```{r}\ninstall.packages(\"neverhpfilter\")\n```\n\nOr install from the Github master branch on R version \u003e= 3.5.0.\n\n```{r}\ndevtools::install_github(\"JustinMShea/neverhpfilter\")\n```\n\nLoad the package\n\n```{r}\nlibrary(neverhpfilter)\n```\n\n## Package Documentation\n\nThe 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) \u003cdoi:10.3386/w23429\u003e](https://www.nber.org/papers/w23429)\n\nDocumentation for each can be found here:\n\n * [yth_glm](https://justinmshea.github.io/neverhpfilter/reference/yth_glm.html)\n\n * [yth_filter](https://justinmshea.github.io/neverhpfilter/reference/yth_filter.html)\n \n * [U.S. Stock Markets and CAPE Ratio 1871-Present](https://justinmshea.github.io/neverhpfilter/reference/SP500.html)\n \n * [Effective Federal Funds Rate](https://justinmshea.github.io/neverhpfilter/reference/FEDFUNDS.html)\n \n * [10-Year Treasury Constant Maturity Rate](https://justinmshea.github.io/neverhpfilter/reference/GS10.html)\n \n * [Gross Domestic Product](https://justinmshea.github.io/neverhpfilter/reference/GDPC1.html)\n \n * [Gross Domestic Product: Implicit Price Deflator](https://justinmshea.github.io/neverhpfilter/reference/GDPDEF.html)\n \n * [Real Gross Private Domestic Investment](https://justinmshea.github.io/neverhpfilter/reference/GPDIC1.html)\n \n * [Real Government Consumption Expenditures and Gross Investment](https://justinmshea.github.io/neverhpfilter/reference/GCEC1.html)\n\n * [Real Exports of Goods and Services](https://justinmshea.github.io/neverhpfilter/reference/EXPGSC1.html)\n \n * [Real Imports of goods and services](https://justinmshea.github.io/neverhpfilter/reference/IMPGSC1.html) \n \n * [Employment Situation](https://justinmshea.github.io/neverhpfilter/reference/PAYEMS.html)\n \n * [Civilian Unemployment Rate](https://justinmshea.github.io/neverhpfilter/reference/UNRATENSA.html)\n\n * [Real Personal Consumption Expenditures](https://justinmshea.github.io/neverhpfilter/reference/PCECC96.html)\n \n * [Hamilton's table 2 estimates](https://justinmshea.github.io/neverhpfilter/reference/Hamilton_table_2.html)\n \n \n Finally, a vignette recreating the estimates of the original work can be found in [Reproducing Hamilton.](https://justinmshea.github.io/neverhpfilter/articles/Reproducing-Hamilton.html)\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustinmshea%2Fneverhpfilter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustinmshea%2Fneverhpfilter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustinmshea%2Fneverhpfilter/lists"}