BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
LzEr23
Obsidian | Level 7

Dear all,

 

I am trying to run Hodrick-Prescott filter for daily index price (or, return).

More specifically, I'd like to run HP filter and end up with four different time series data each reflecting the following information: trend, seasonal, cyclical, and irrational movements. 

 

This is how my dataset looks like:

 

 

data work.return_figures;
   infile datalines truncover;
   input date: yymmddn8. volume;
   ;
   datalines;     20190101 1014;     20190103 1015.5;     20190104 1015;         ...     20191219 1021.5;     20190320 1022; 

 

I've tried the coding with expand procedure (proc expand), but apparently it only provides trend and cyclical series.

 

I do not mind if it uses expand or ucm procedrue, but as I addressed earlier, what I'd like to end up with is those four time series data.

And for some reason, proc ucm codes does not seem to work (but I'm not sure).

 

Thus, in summary,

1) I'd like to run HP filter for daily return data

2) I'd like to have four different data series: trend, seasonal, cyclical, and irrational return movements.

3) (additional question) is there any agreement on the figure of smoothing parameter for daily data?

 

It would be great if anyone help me out with this.

 

I've tried to keep it clear, but still, if any part of my question does not seem to make sense, please ask.

 

Thanks all for reading.

 

1 ACCEPTED SOLUTION

Accepted Solutions
mitrov
SAS Employee

If I understand your needs correctly, the DECOMP statement of PROC TIMESERIES should provide what you are looking for. The LAMBDA option is the parameter for the Hodrick-Prescott filter. 

 

The OUTDECOMP data set will contain the series. 

 

 

View solution in original post

2 REPLIES 2
mitrov
SAS Employee

If I understand your needs correctly, the DECOMP statement of PROC TIMESERIES should provide what you are looking for. The LAMBDA option is the parameter for the Hodrick-Prescott filter. 

 

The OUTDECOMP data set will contain the series. 

 

 

LzEr23
Obsidian | Level 7
This was what I was looking for, and it worked perfectly. It was of a great help to me, thank you.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1863 views
  • 0 likes
  • 2 in conversation