Hodrick Prescott Filter (HP-Filter) in...
Transcript of Hodrick Prescott Filter (HP-Filter) in...
![Page 1: Hodrick Prescott Filter (HP-Filter) in Excelunassumingeconomist.com/wp-content/uploads/2015/05/HP_Filter_Cheatsheet.pdfHP-Filter in Excel Step 1: Prepare the original data. In our](https://reader035.fdocuments.in/reader035/viewer/2022062414/5e97e1381d82666db9313e4c/html5/thumbnails/1.jpg)
Hodrick Prescott Filter (HP-Filter) in Excel
May 31, 2016
Backgroud
The Hodrick Prescott Filter (HP-Filter), introduced by Hodrick and Prescott (1980), is a detrendingmethod that is widely used in empirical macro analysis. The original series (Yt) is made up of atrend component (Tt) and a cyclical component (Ct):
Yt = Tt +Ct (1)
The HP-Filter isolates the trend component by minimization the following loss function:
MINT{T
∑t=1
(Yt −Tt)2 +λ
T−1
∑t=2
[(Tt+1 −Tt)− (Tt −Tt−1)]2} (2)
where λ is smoothing parameter. Normally, we use λ = 100, 1600, and 14400 for yearly,quarterly, and monthly data, respectively.
Install HP-Filter Excel Add-in
HP-Filter can be easily done in excel. To do so, we need to install the HP-Filter excel add-in. Thepackage can be downloaded from the following link:
http://www.web-reg.de/hp_addin.html
After download and unzip, install it from the "HPFilter.xla" file.
1
![Page 2: Hodrick Prescott Filter (HP-Filter) in Excelunassumingeconomist.com/wp-content/uploads/2015/05/HP_Filter_Cheatsheet.pdfHP-Filter in Excel Step 1: Prepare the original data. In our](https://reader035.fdocuments.in/reader035/viewer/2022062414/5e97e1381d82666db9313e4c/html5/thumbnails/2.jpg)
HP-Filter in Excel
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 beordered by year.
2
![Page 3: Hodrick Prescott Filter (HP-Filter) in Excelunassumingeconomist.com/wp-content/uploads/2015/05/HP_Filter_Cheatsheet.pdfHP-Filter in Excel Step 1: Prepare the original data. In our](https://reader035.fdocuments.in/reader035/viewer/2022062414/5e97e1381d82666db9313e4c/html5/thumbnails/3.jpg)
Step 2: Select the trend component area that is corresponding with the original data range. In ourexample, we select the area E2:E37.
3
![Page 4: Hodrick Prescott Filter (HP-Filter) in Excelunassumingeconomist.com/wp-content/uploads/2015/05/HP_Filter_Cheatsheet.pdfHP-Filter in Excel Step 1: Prepare the original data. In our](https://reader035.fdocuments.in/reader035/viewer/2022062414/5e97e1381d82666db9313e4c/html5/thumbnails/4.jpg)
Step 3: Keep the area selected, and type the command:=HP(C2:C37,100)where HP is the main command, C2:C37 is the range of the original data, 100 is the smoothing
parameter. Do not hit "Enter".
4
![Page 5: Hodrick Prescott Filter (HP-Filter) in Excelunassumingeconomist.com/wp-content/uploads/2015/05/HP_Filter_Cheatsheet.pdfHP-Filter in Excel Step 1: Prepare the original data. In our](https://reader035.fdocuments.in/reader035/viewer/2022062414/5e97e1381d82666db9313e4c/html5/thumbnails/5.jpg)
Step 4: HP is an array formula, so instead of hitting "Enter", we use "Shift+Ctrl+Enter", and thisshould give us the trend component of unemployment rate.
5
![Page 6: Hodrick Prescott Filter (HP-Filter) in Excelunassumingeconomist.com/wp-content/uploads/2015/05/HP_Filter_Cheatsheet.pdfHP-Filter in Excel Step 1: Prepare the original data. In our](https://reader035.fdocuments.in/reader035/viewer/2022062414/5e97e1381d82666db9313e4c/html5/thumbnails/6.jpg)
Step 5: We can follow the similar steps and get the trend component of real output.
6
![Page 7: Hodrick Prescott Filter (HP-Filter) in Excelunassumingeconomist.com/wp-content/uploads/2015/05/HP_Filter_Cheatsheet.pdfHP-Filter in Excel Step 1: Prepare the original data. In our](https://reader035.fdocuments.in/reader035/viewer/2022062414/5e97e1381d82666db9313e4c/html5/thumbnails/7.jpg)
Step 6: We can get the cyclical component by subtracting the trend component from the originaldata:
7