Trend Removal Using the Hodrick-Prescott Filter

/*--------------------------------------------------------------

                    SAS Sample Library

        Name: ucmex05.sas
 Description: Example program from SAS/ETS User's Guide,
              The UCM Procedure
       Title: Trend Removal Using the Hodrick-Prescott Filter
     Product: SAS/ETS Software
        Keys: equally spaced univariate time series data
        PROC: UCM
       Notes:

--------------------------------------------------------------*/

ods graphics on;

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;