BookmarkSubscribeRSS Feed
podarum
Quartz | Level 8

Hi, does anyone know if there is a way I can extrapolate to an END date in ARIMA rather than say next 12 months.. the reason for this request is that the 6000 models I need to do, have end dates that are all over the place.  Some end in Jun'11 some July'11, etc.. If I end them all Dec'12, that I can use in my developmental forecasting modeling.  I'm aware of SAS' forecast server, but unfortunately not in the plans right now...  Thanks

3 REPLIES 3
udo_sas
SAS Employee

Hi -

PROC ARIMA does not feature an END statement like PROC TIMESERIES does.

It seems to me that the challenge you are running into is one of the reason why SAS Forecast Server was designed - just saying Smiley Happy

Provided that I understand your challenge correctly, the bigger issue will be to come up with the 6000 ARIMA models, unless you would like to reuse the same model specification over and over again.

Back to your challenge: one way to overcome the "different end dates" challenge is to a) figure out the individual end dates of the series and then b) to adjust the LEAD option of the FORECAST statement in ARIMA appropriately.

To illustrate what I'm talking about have a look at this very simplified example:

data air;

set sashelp.air(where=(date le "01MAR60"d)) sashelp.air(in=right);

if right then type=2;else type=1;

run;

*assumption is that end date for series is different and that shorter series contain no missing values but at the end;

proc timeseries data=air out=_null_ outsum=outsum(keep=type nmiss);

id date interval=month end="01DEC1960"d;

var air;

by type;

run;

%macro arima;

%do i=1 %to 2;

data temp;

set outsum(where=(type=&i));

*forecast horizon=12;

call symput('lead',nmiss+12);

run;

proc arima data=air(where=(type=&i)) plots(only)=forecast(forecast);

   identify var=air(1,12);

   estimate q=(1)(12) noint method=ml;

   forecast id=date interval=month out=arima&i lead=&lead;

quit;

data results;

set arima1(where=(air=.)) arima2(where=(air=.) in=right);

if right then type=2;else type=1;

keep date forecast l95 u95 type;

run;

%end;

%mend;

%arima

proc print data=results noobs;run;

Hope this makes sense,

Udo

podarum
Quartz | Level 8

Thanks Udo,  I am all for the SAS Forecast Server..  I might have to do some groupings and then reuse the model specifications over again.. But the question I have, since Price is the dependent variable, would that be treated independently by each 6000 models..  So use the Store (6000) as a BY Groupings.

Also the harder question is, how does ARIMA do variable selection, I beleive ARIMAX might??

Thanks

udo_sas
SAS Employee

Hello -

Yes, if you would like to include independent variables or discrete events to your models it would be either PROC ARIMA (e.g. ARIMAX) or PROC UCM.

Both procedures do not provide automatic variable selection as for example SAS Forecast Server does (sorry for sneaking it in again Smiley Happy).

Unfortunately there is no easy answer to your challenge I can provide you with and you will need to do a lot of macro coding I believe to tackle the following issues:

a) data quality problems (different start and end dates of your 6000 series for example)

b) come up with the concept of a "model repository" which allows you to specify different model formulations - which includes whether or not to include independent variables.

c) allow for BY group processing

d) select an appropriate model using ideas like hold-out samples per BY group

e) allow for the incorporation of a hierarchy concept.

f) other considerations - like running all of this in batch and updating model parameters when new data arrives.

I guess I'm confirming your suspicion that automating forecasting with SAS/ETS procedures for many series can be challenging.

Don't worry I won't mention the more appropriate approach again :smileygrin:

Thanks,

Udo

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 1431 views
  • 0 likes
  • 2 in conversation