You are on page 1of 7

HP Filter Tehseen Iqbal (IBA)

Installation of the Hodrick-Prescott (HP) filter add-in into

Excel on your computer:

HP-Filter can be easily done in excel. To do so, we need to install the HP-Filter excel

add-in. The package can be downloaded from the link, HP filter.

After download and unzip, install it from the “HPFilter.xla” file. Create a folder for your

excel data file and save the .xla file in your folder.

Open the Excel workbook the contains the data you want to filter.

Click the “File” tab (upper left corner).

In the drop down menu click “Options” (lowest), and in the new box appearing click

“Add-Ins” (in menu to the left, second lowest).

A new box appears. In the “Manage” dropdown menu of this box (at the very bottom of

it), choose “Excel Add-Ins” and then click “Go”.

A new box comes up. If this already offers “Hodrick-Prescott Filter (HP-Filter)” among the

different add-ins, you can simply select this and then click “OK” (if the Excel workbook you

are in lies in the folder in which you have the filter this should be so). If not click “Browse”

and find and open the folder where you have put the filter, select “Hodrick-Prescott Filter

(HP-Filter.xla)” and then click “OK”.

Now you should be able to use the HP Filter in the workbook you are in.

tiqbal@iba.edu.pk 1
HP Filter Tehseen Iqbal (IBA)

HP Filtering

Step 1: Prepare the original data. In our example, we have unemployment rate (LUR) and

loga- rithm of real GDP multiplied by 100 (lnY*100) of Alabama from 1976 to 2011. They

need to be ordered by year.

tiqbal@iba.edu.pk 2
HP Filter Tehseen Iqbal (IBA)

Step 2: Select the trend component area that is corresponding with the original data

range. In our example, we select the area E2:E37.

tiqbal@iba.edu.pk 3
HP Filter Tehseen Iqbal (IBA)

Step 3: Keep the area selected, and type the command: =HP(C2:C37,100)1 , where

HP is the main command, C2:C37 is the range of the original data, 100 is the smoothing

parameter. Do not hit “Enter”.

1
For quarterly data, we use 1600 as smoothing parameter in place of 100

tiqbal@iba.edu.pk 4
HP Filter Tehseen Iqbal (IBA)

Step 4: HP is an array formula, so instead of hitting “Enter”, we use “Shift+Ctrl+Enter”,

and this should give us the trend component of unemployment rate.

tiqbal@iba.edu.pk 5
HP Filter Tehseen Iqbal (IBA)

Step 5: We can follow the similar steps and get the trend component of real output.

tiqbal@iba.edu.pk 6
HP Filter Tehseen Iqbal (IBA)

Step 6: We can get the cyclical component by subtracting the trend component from the

original data:

tiqbal@iba.edu.pk 7

You might also like