## How to use ARIMA model to forecast a data series

Solved
Super Contributor
Posts: 338

# How to use ARIMA model to forecast a data series

Hi Forum,

I have a variable named "ninety" in the attahced file. I need to forecast its values for maximum possible length ahead

as dictated by my 24 month's actual observations.

I have tried various methods such as moving average (3point, 12point), weighted moving average, exponential smoothing etc. but the Percent Absolue Deviation between predicted and actual values are way too high.

So, I tried ARIMA as the last resort.

Honestly I do not have any previous ARIMA expereince, so I have followed the SAS documentation mecahnically and followed the steps.

Question: I cannot run the last two steps to get the final forecasts. Could someone please help?

Thanks, Mirisage

/*taking the graph*/

ods graphics on;

proc sgplot data=test;

scatter y=ninety x=current_date;

run;

/*Analyzing correlation properties*/

proc arima data=test ;

identify var=ninety nlag=6;

run;

/*White Noise Test*/

proc arima data=test ;

identify var=ninety nlag=6;

run;

proc arima data=test ;

identify var=ninety nlag=5;

run;

proc arima data=test ;

identify var=ninety nlag=4;

run;

proc arima data=test ;

identify var=ninety nlag=3;

run;

/*Since the series is nonstationary, I transformed it to a stationary series by differencing.*/

/*Identification of the Differenced Series*/

proc arima data=test;

identify var=ninety(1);

run;

/*The autocorrelations decrease rapidly in this plot, indicating that the

change in ninety is a stationary time series. */

/*not running*/

proc arima data=test;

estimate p=1;

run;

/*Not running*/

/*forecasting*/

proc arima data=test;

run;

Accepted Solutions
Solution
‎07-24-2012 02:28 PM
SAS Employee
Posts: 416

## Re: How to use ARIMA model to forecast a data series

Update: just noticed that my ARIMA code got truncated unfortunately - corrected it now.

Hello -

You might want to combine your last 3 PROC ARIMA calls into 1 call (and provide the correct name of your ID variable in the forecast statement):

proc arima data=test;

identify var=ninety(1);

estimate p=1;

run;

Since you have access to SAS/ETS it seems you could also feed your series to the Time Series Forecasting System:

Start SAS on your machine and take advantage of the automatic model selection.

Documentation about TSFS can be found here:

http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/viewer.htm#tfintro_toc.htm

BTW: your series seems to feature a level shift after Nov2010 - if you can explain why this might be good modeling information:

To replicate the graphics above use the following code (you might want to experiment with the plot features of this ETS procedure as well):

proc timeseries data=test out=_null_ plot=(series cycles);

id current_date interval=month;

var ninety;

run;

Thanks,

Udo

All Replies
Super Contributor
Posts: 338

## Re: How to use ARIMA model to forecast a data series

Hi Udo,

If you have time, could you please have a look on this ARIMA query. I really apprecaite.

Thank you

Mirisage

Solution
‎07-24-2012 02:28 PM
SAS Employee
Posts: 416

## Re: How to use ARIMA model to forecast a data series

Update: just noticed that my ARIMA code got truncated unfortunately - corrected it now.

Hello -

You might want to combine your last 3 PROC ARIMA calls into 1 call (and provide the correct name of your ID variable in the forecast statement):

proc arima data=test;

identify var=ninety(1);

estimate p=1;

run;

Since you have access to SAS/ETS it seems you could also feed your series to the Time Series Forecasting System:

Start SAS on your machine and take advantage of the automatic model selection.

Documentation about TSFS can be found here:

http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/viewer.htm#tfintro_toc.htm

BTW: your series seems to feature a level shift after Nov2010 - if you can explain why this might be good modeling information:

To replicate the graphics above use the following code (you might want to experiment with the plot features of this ETS procedure as well):

proc timeseries data=test out=_null_ plot=(series cycles);

id current_date interval=month;

var ninety;

run;

Thanks,

Udo

Super Contributor
Posts: 338

## Re: How to use ARIMA model to forecast a data series

Hi Udo,

Thank you very much for your great help.

Your help is very valuable for us.

Best regards

Mirisage

🔒 This topic is solved and locked.