Forecasting using SAS Forecast Server, SAS/ETS, and more

Kalman smoothing with PROC UCM

Accepted Solution Solved
Reply
New Contributor
Posts: 4
Accepted Solution

Kalman smoothing with PROC UCM

[ Edited ]

I'm trying to smooth a single, daily time series with a Kalman filter. The state vector has an upward trend to it (its nonstationary) so I dont think I can use PROC UCM, since that assumes the underlying signal is a random walk.Come to think of it, I could try differencing the series, buy i havent done that yet.

 

Instead, I went to the SAS/ETS user guides, which is never a good place to be if you aren't 100% sure of what you're doing. Even the examples are too complex for a beginner. I'd gladly accept a pointer to something written in plain English. In the language of the user guide, Ive got a measurement yt=zt+et which is the signal plus white noise measurement error. I assume b=0 and h=1 for all t. And I've got a signal that I think evolves like this zt = a + fzt-1 + nt. I'd like to assume a and f are not time varying, as written. At this point I would like to feed in my vector of measurements y, and initial values for the signal z0 and prior error covariance, and get as output a smoothed series, SAS having estimated a, f and whatever else it needed to estimate in order to generate the signal series.

 

Does this make any sense?  How can I do it?


Accepted Solutions
Solution
‎03-24-2017 03:43 PM
SAS Employee
Posts: 57

Re: Kalman filter calls in ETS

Posted in reply to lsantfrbp

I think you can use PROC UCM.  You can fit a smooth local linear trend model as follows:

proc ucm data test;

   id date interval=day;

   model y;

   irregular;

   level variance=0 noest plot=smooth;

   slope;

   forecast lead=20 plot=decomp;

run;

 

Please check the UCM doc for additional details. 

View solution in original post


All Replies
Solution
‎03-24-2017 03:43 PM
SAS Employee
Posts: 57

Re: Kalman filter calls in ETS

Posted in reply to lsantfrbp

I think you can use PROC UCM.  You can fit a smooth local linear trend model as follows:

proc ucm data test;

   id date interval=day;

   model y;

   irregular;

   level variance=0 noest plot=smooth;

   slope;

   forecast lead=20 plot=decomp;

run;

 

Please check the UCM doc for additional details. 

New Contributor
Posts: 4

Re: Kalman filter calls in ETS

Rajesh- Thanks for suggesting this proc. Its very flexible and easier to understand than the IML calls.

SAS Employee
Posts: 57

Re: Kalman filter calls in ETS

Posted in reply to lsantfrbp
I am glad you liked UCM. For even more flexibility, both in terms of types of time series data and the variety of state space models, you can check out the SSM procedure (also in SAS/ETS). The Kalman routines from IML are rarely needed if you have access to the UCM and SSM procedures.
SAS Employee
Posts: 57

Re: Kalman filter calls in ETS

Posted in reply to lsantfrbp
I am glad you liked UCM. For even more flexibility, both in terms of types of time series data and the variety of state space models, you can check out the SSM procedure (also in SAS/ETS). The Kalman routines from IML are rarely needed if you have access to the UCM and SSM procedures.
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 215 views
  • 0 likes
  • 2 in conversation