turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Forecasting
- /
- Kalman smoothing with PROC UCM

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-22-2017 11:57 AM - last edited on 04-05-2017 12:46 PM by ShelleySessoms

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to lsantfrbp

03-23-2017 01:54 PM

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.

All Replies

Solution

03-24-2017
03:43 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to lsantfrbp

03-23-2017 01:54 PM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to rselukar

03-24-2017 02:15 PM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to lsantfrbp

03-24-2017 02:25 PM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to lsantfrbp

03-24-2017 02:25 PM