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?
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.
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.
Rajesh- Thanks for suggesting this proc. Its very flexible and easier to understand than the IML calls.