The UCM Procedure

Example 34.5 Trend Removal Using the Hodrick-Prescott Filter

Hodrick-Prescott filter (Hodrick and Prescott, 1997) is a popular tool in macroeconomics for fitting smooth trend to time series. It is well known that the trend computation according to this filter is equivalent to fitting the local linear trend plus irregular model with the level disturbance variance restricted to zero and the slope disturbance variance restricted to be a suitable multiple of the irregular component variance. The multiple used depends on the frequency of the series; for example, for quarterly series the commonly recommended multiple is $1/1600 = 0.000625$. For other intervals there is no consensus, but a frequently suggested value for monthly series is $1/14400$ and the value for an annual series can range from $1/400 = 0.0025$ to $1/7 = 0.15$. The data set considered in this example consists of quarterly GNP values for the United States from 1960 to 1991. In the UCM procedure statements that follow, the presence of the PROFILE option in the ESTIMATE statement implies that the restriction that the disturbance variance of the slope component be fixed at $0.000625$ is interpreted differently: it implies that the disturbance variance of the slope component be restricted to be $0.000625$ times the estimated irregular component variance, as needed for the Hodrick-Prescott filter. The plot of the fitted trend is shown in Output 34.5.1, and the plot of the smoothed irregular component, which corresponds to the detrended series, is given in Output 34.5.2. The detrended series can be further analyzed for business cycles.

proc ucm data=sashelp.gnp;
   id date interval=qtr;
   model gnp;
   irregular plot=smooth;
   level var=0 noest plot=smooth;
   slope var=0.000625 noest;
   estimate PROFILE;
   forecast plot=(decomp);
run;

Output 34.5.1: Smoothed Trend for the GNP Series as per the Hodrick-Prescott Filter


Output 34.5.2: Detrended GNP Series