View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Hodrick-Prescott Filter

2.9 | 6 ratings Rate this file 24 Downloads (last 30 days) File Size: 2.04 KB File ID: #3972 Version: 1.0
image thumbnail

Hodrick-Prescott Filter



17 Sep 2003 (Updated )

Finds the Hodrick-Prescott filter of a series.

| Watch this File

File Information

This m-file finds the Hodrick-Prescott filtered series of any trendy time series; H-P is widely known in econometrics and can be used to analyse the trends and volatility of the series.

This version uses sparse matrices, this approach increases speed and performance and allows working with several time series simultaneously. The option 'makeplot' plots every time series introduced against its filtered counterpart and the output desvabs gives a "measure" of the volatility.

Download and type Help hpfilter for more details

Inspired in hpfilter by Ivailo Izvorski and Gauss code by Ken Matheny


This file inspired Analyze Fex Download Data.

MATLAB release MATLAB 6.5 (R13)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (11)
26 Jan 2017 Victor Hernandez Martinez

13 Oct 2014 Panty

Panty (view profile)

is there any available m-file which corrects for the end-of-sample problem that filters like this face? Thank you

Comment only
21 Sep 2008 amira sultan


Comment only
21 Sep 2008 amira sultan


Comment only
16 Jul 2005 HP Filter

There is also an online Hodrick-Prescott filter at

06 Jul 2005 fatima zahra taouss

can I use excel to run Hodrik-Prescott filter?

15 Jun 2004 Jürgen Raue

sehr gute verständliche arbeit. könnte nur noch durch ein wenig theoetischen hintergrund verbessert werden

17 May 2004 Kurt Annen

Look at There is an Add-In for the HP-Filter (freeware). Unfortunality it is in german language. a translation will follow.

Comment only
04 Dec 2003 Nadir Yigitcanoglu

Can I find a patch for excel to run Hodrick-Prescott filter?


Comment only
02 Oct 2003 cristiano angelis

02 Oct 2003 cristiano angelis

Contact us