Skip to content

sdBrinkmann/HPFilter.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HPFilter.jl

HPFilter.jl is a Julia module that implements the Hodrick-Prescott (HP) filter as well as the its generalization generally known as Whittaker-Henderson smoothing, in this package named bohl_filter after its first inventor George Bohlmann.

In addition this module tries to implement also more novel approaches, so far the boosted HP Filter based on Peter Phillips and Zhentao Shi (2019): "Boosting the Hodrick-Prescott Filter" has been implemented.

Get Started

This module can either be employed by cloning this repository or by using the Julia package manager. With the package manager simply use the add command:

(v1.11) pkg> add https://github.com/sdBrinkmann/HPFilter.jl

Usage

The basic usage is demonstrated with the US industrial production index (IPI) provided by FRED data service.

using HPFilter
using CSV

# Set path to directory where time series is located
path = "/.../data"

IPI = CSV.read("$(path)/IPB50001SQ.csv", copycols=true)

# HP filter with λ = 1600
hp = HP(IPI[!, 2], 1600)

# The above is equivalent to Whittaker-Henderson smoothing with m = 2 differentation
wh = bohl_filter(IPI[!, 2], 2, 1600)

# Boosted HP filter with baysian-type information criterion (BIC)
bHP_bic = bHP(IPI[!, 2], 1600, Criterion="BIC")

# Boosted HP filter with augmented Dickey-Fuller (ADF) test 
bHP_adf = bHP(IPI[!, 2], 1600, Criterion="ADF", p=0.01)

HP Results

About

(Boosted) Hodrick-Prescott Filter implemented as Julia package

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages