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
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.
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 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.