BookmarkSubscribeRSS Feed
Edoedoedo
Pyrite | Level 9

Hi, could you please verify if this is the correct way to implement a sarimax model with ssm, especially for the exogenous part?

proc ssm data=casuser.series optimizer(technique=ACTIVESET maxiter=10) like=DIFFUSE;
id d interval=day;
trend sarima(arima(d=1 sd=1 p=1 q=1 sq=1 s=52)) ;
*trend arimaTrend(arma(d=1 sd=1 p=1 q=1 sq=1 s=52)) ar=0.8550 ma=-0.9781 -0.9990 ;
model v = sarima x;
output outfor=casuser.For;
run;
proc ssm data=casuser.series optimizer(technique=ACTIVESET maxiter=10) like=DIFFUSE;
    id d interval=week;        
    trend sarima(arima(d=1 sd=1 p=1 q=1 sq=1 s=52)) ;
    model v = sarima x;     
    output outfor=casuser.For;
run;

The Series dataset has 3 columns (d=date, v=endogenous variable, x=exogenous variable).

I define an arima trend with that parameters.

I model the v as: that trend AND the x, simply put in there.

Is this the correct formulation for the sarimaX model?

 

Thank you

3 REPLIES 3
rselukar
SAS Employee

Specifying ARIMAX models in the SSM (or CSSM) syntax can be a bit tedious.  I am assuming that you want to specify the model (1-B)(1-B^52) v = (1-B)(1-B^52) x + ARMA(1,1)(0,1)52 Noise.

 

Since the SSM DATA-step statements currently don't allow differecing, you must difference the x variable prior to its use in PROC SSM.  Let's say the appropriately differenced x is called x_1_52 and is part of the input data set (casuser.series).  Then you can specify your model as follows:

 

proc ssm data=casuser.series;

    id date interval=week;
    trend noise(arma(p=1 q=1 sq=1 s=52));
    deplag airLags(v) v(lags=(1 52 53) coeff=(1 1 -1));
    model v = airLags noise;

    output out=for;

run;

 

Please see the SSM (or CSSM) doc for more info on the DEPLAG statement.

   

rselukar
SAS Employee
I am sorry, I forgot to include the regressor in the model statement! The revised model statement is:
model v = airLags x_1_52 noise;
rselukar
SAS Employee

Actually, rethinking a little, I realize that the syntax by @Edoedoedo also results in the same model I specified, without having to explicitly difference x (but including diferencing in the trend statement).  So, in fact the parameter estimates and the forecasts according to both specs will be quite close.  However, the appearance of the output will be different in many ways because the state space formulations of these two specs differ. 

 

Although more tedious, the alternate spec I provided allows more control over the terms included in the model. 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 3 replies
  • 585 views
  • 2 likes
  • 2 in conversation