BookmarkSubscribeRSS Feed
noetsi
Obsidian | Level 7

I have worked with SAS and Time Series  but am brand new to UCM and PROC UCM (the former meaning unobserved component models). My job, one of them, is to project spending a year in advance by month. I have used primarily exponential smoothing models (PROC ESM)  combined with expert judgement in cases time series will not work well. But I am looking to expand our approaches and UCM looks very promising.

 

One limit, my organization does not really know why our spending changes over time, we are a public sector service organization and statistics and financial analysis is new here. Also I have found little theory in vocational rehabilitation in this area, This makes it difficult to get a sense how to specifically model some of the elements in UCM. For example, I have no idea how we would model seasonality or cycles, although the former likely exists because of contracting and the number of business days in a month for processing. If anyone knows any good books on that type of detail I would love to know.

 

So some questions about UCM/PROC UCM.

 

1) Is there any way to generate a damptrend model in UCM? One where you believe the data will trend and then stabilize.  Various exponential models do this, but I can not find it in the documentation of PROC UCM or on line.

 

2) If you believe the data will remain stable (a period of no increases) followed by a trend upward is there anyway the components in UCM can be used to address this? I thought splines might address this (or other non-linear functions) but they appear to apply to regression only (predictors).

 

3) ARMA models require differencing if there is a trend in the data commonly - something nearly always true with our data. The DEPLAG command appears to do this, but it also (if I understand the documentation correctly) adds lags of Y  to the predictor list - which in the time series regression I know is fairly serious - something I would prefer to avoid. I also don't know what specifying this does to the slope command if you specify that. Does it remove trend from the model?

 

I have worked with ARIMA, but am not sure how differencing applies to UCM models.

 

Thanks for any help on this.

4 REPLIES 4
rselukar
SAS Employee

I am glad you are considering UCMs for your time series modeling. Since you already use ARIMA and ESM, transition to UCMs should be easy.  I think you will like the rich output provided by PROC UCM.  First let me suggest a book: Pelagatti, M. M. (2015). Time Series Modelling with Unobserved Components. Boca Raton, FL: CRC Press.  This book a easier to follow compared to the classic by Harvey mentioned in the UCM doc.  Additionally, I have provided links to several white papers on UCM modeling at the end of my reply to help you familiarize with PROC UCM and a related ETS procedure, PROC SSM.  Now let us consider your questions one by one.

 

1.  Can one specify damped trend model in PROC UCM?  If you specify your trend using the LEVEL and SLOPE statements then the answer is no.  However, since you can specify an ARIMA model in UCM, you can specify an ARIMA(1,1,2) model that is similar to ESM damped trend model.  By the way, the trends specified using LEVEL and SLOPE statements can model quite general trend patterns: e.g., if the trend pattern damps during the historical period then the time-varying slope can adjust to such damping (if the trend does not damp during the historical period but one expects it to damp in the future, then a damped trend model could be useful but it's damping parameter will not have been well-estimated).  Alternatively, you can specify a damped trend model in PROC SSM by using the TREND statement.

 

2.  The trend specified using LEVEL and SLOPE statements can adjust to such changes in the historical period.  By the way, PROC UCM provides a variety of ways to specify regression effects (usual regressors in the MODEL statement, time-varying regression coefficients and nonlinear regression in RANDOMREG and SPLINEREG statements, and transfer function in the TF statement (in the latest release ETS 15.1)).

 

3.  You are correct that you can specify differencing using the DEPLAG statement (see the ARIMA modeling example in the UCM doc https://go.documentation.sas.com/?docsetId=etsug&docsetTarget=etsug_ucm_examples08.htm&docsetVersion... to see how to specify the Airline model ARIMA(0,1,1)(0,1,1)12).  Typically when you specify trend using differencing (DEPLAG statement), you don't use the LEVEL and SLOPE statements.

 

I know it might take a little bit of thought and going through the DOC examples to follow my answers.  Anyway, here are some useful links on this subject:

Latest UCM and SSM chapters in the ETS/15.1 doc:

https://go.documentation.sas.com/?docsetId=etsug&docsetTarget=titlepage.htm&docsetVersion=15.1&local...

 

A conference proceeding: https://forecasters.org/wp-content/uploads/gravity_forms/7-621289a708af3e7af65a7cd487aee6eb/2016/07/...

 

An SGF paper: http://support.sas.com/resources/papers/proceedings17/SAS0456-2017.pdf 

 

Hope this helps.

noetsi
Obsidian | Level 7

Thanks you very much that was very helpful. I have ordered the book you mentioned and will read up on those link. 

 

I was particularly interested to find out you don't specify slope and level when using differencing. Nothing I saw until now indicated that although it makes sense.

rselukar
SAS Employee

Please see the UCM doc example I mentioned about the Airline model where the trend specification does not use LEVEL and SLOPE but the differencing using the DEPLAG statement.

rselukar
SAS Employee

Since the user had a question about specifying trend without using LEVEL and SLOPE statements, I have decided to provide some syntax examples.  

 

For illustration I am using the sashelp.air data set, which contains the well-known airline series.  The airline series is used in a few different places in the UCM doc (Getting started example and Example 8).  These illustrations show that the log(air) series has a linear trend with essentially constant slope and a strong seasonal component.  Several alternate models can capture this behavior.  Of course, some will fit better than the others.  I am using two such models.  The first one is the traditional Airline model suggested by Box and Jenkins (ARIMA(0,1,1)(0,1,1)12 NOINT) that is known to fit the data well.  In this case the trend (and seasonal component) is entirely specified using the differencing (DEPLAG statement).   The second example uses random walk with constant drift for trend, trigonometric seasonal component, and MA(1) noise.  The random walk part is specified using non-seasonal differencing (DEPLAG) while the constant drift is specified using LEVEL (in this case the LEVEL specification is actually specifying slope!).   The seasonal component is specified using the SEASON statement.  These examples are shown just to show the flexibility of the UCM procedure.  Both models are OK.  The Airline model fits the data slightly better.

 

data test;
set sashelp.air;
logair=log(air);
run;

/*---AIRLINE Model: ARIMA(0,1,1)(0,1,1)12 NOINT--- */
proc ucm data=test ;
id date interval=month;
model logair;
irregular q=1 sq=1 s=12;
deplag lags=(1)(12) phi=1 1 noest;
estimate back=12 plot=panel;* lik=marginal;
forecast back=12 lead=12 plot=decomp;
run;


/*---- ARIMA(0,1,1) with CONSTANT and Trigonometric Seasonal---
That is, random walk with drift as a trend, trigonometric seasonal, and MA(1) noise (irregular).
The non-seasonal differencing is specified using the DEPLAG statement and drift is
specified using the LEVEL statement.
*/
proc ucm data=test ;
id date interval=month;
model logair;
irregular q=1 ;
level variance=0 noest plot=smooth; /* drift specification */
deplag lags=1 phi=1 noest;
season length=12 type=trig plot=smooth;
estimate back=12 plot=panel;* lik=marginal;
forecast back=12 lead=12 plot=decomp;
run;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1170 views
  • 2 likes
  • 2 in conversation