Solved
Highlighted
Contributor
Posts: 53

# Arima Time series

[ Edited ]

I have the following data set:

 ``````Date Paid Jan-14 13392905 Feb-14 11939873 Mar-14 12473667 Apr-14 12237110 May-14 12579693 Jun-14 12030095 Jul-14 12052101 Aug-14 10205025 Sep-14 12102526 Oct-14 1237336 Nov-14 12148331 Dec-14 9842860 Jan-15 11990085 Feb-15 11061740 Mar-15 12076397 Apr-15 11702514 May-15 11395657 Jun-15 11817594 Jul-15 11643682 Aug-15 10243241 Sep-15 12233001 Oct-15 11769231 Nov-15 12652418 Dec-15 9774333 Jan-16 11888965 Feb-16 11892589 Mar-16 11419517 Apr-16 12143787 May-16 12330387 Jun-16 11929805 Jul-16 11583281 Aug-16 11995557 Sep-16 12646047 Oct-16 12677372 Nov-16 13301244 Dec-16 9915846``````

I want to predict 60 months ahead. But the ARIMA procedure is generating flat forecasts.Using Proc UCM doesn't. The data does have a major dip in October 2014 & there are seasonal patterns in August & December in 2015 as well which are seasonal componenets. Can some one tell me how do I incorporate seasonality in ARIMA model or UCM should suffice?

Accepted Solutions
Solution
‎02-05-2018 06:34 AM
SAS Employee
Posts: 72

## Re: Arima Time series

Plotting your series shows a seasonal series with significant dip in Oct 14 and no significant upward/downward trend.  Here is a simple UCM model you could use:

paid = dip-effect + random walk trend + seasonal component + error

In order to get forecasts you will have to manually extend your input data set with missing values for paid (in the future

region).  Sample program (without input data extension):

*---------------------------------------------------;

data test;
input date : monyy7. paid;
format date date.;
OctDip = (date = '01oct2014'd);
datalines;
Jan-14  13392905
Feb-14  11939873
Mar-14  12473667
Apr-14  12237110
May-14  12579693
Jun-14  12030095
Jul-14  12052101
Aug-14  10205025
Sep-14  12102526
Oct-14  1237336
Nov-14  12148331
Dec-14  9842860
Jan-15  11990085
Feb-15  11061740
Mar-15  12076397
Apr-15  11702514
May-15  11395657
Jun-15  11817594
Jul-15  11643682
Aug-15  10243241
Sep-15  12233001
Oct-15  11769231
Nov-15  12652418
Dec-15  9774333
Jan-16  11888965
Feb-16  11892589
Mar-16  11419517
Apr-16  12143787
May-16  12330387
Jun-16  11929805
Jul-16  11583281
Aug-16  11995557
Sep-16  12646047
Oct-16  12677372
Nov-16  13301244
Dec-16  9915846
;

proc sgplot data=test;
*where date ^= '01oct2014'd;
series x=date y=paid;
run;

proc ucm data=test;
id date interval=month;
model paid = OctDip;
irregular;
level;
season length=12 type=trig;
estimate plot=panel;
forecast plot=(forecasts decomp);
run;

All Replies
PROC Star
Posts: 1,218

## Re: Arima Time series

What does your code look like now?

The documentations for both PROC ARIMA and PROC UCM have examples on seasonality

Contributor
Posts: 53

## Re: Arima Time series

proc ucm data=data;
id date interval=month;
model paid;
level variance=0 noest ;
slope variance=0 noest;
season length=12 variance=0 noest;
irregular p=1 q=1 sq=1 ;
deplag lags=(1) phi=1 1 noest;
estimate back=12 outest=est1;
forecast back=12 lead=60 outfor=for1 plot=decomp print=decomp;
run;

Contributor
Posts: 53

## Re: Arima Time series

I am little confused on how to include individual seasonality variables for eg Aug & Dec in my case.Can you please help me understand?
Solution
‎02-05-2018 06:34 AM
SAS Employee
Posts: 72

## Re: Arima Time series

Plotting your series shows a seasonal series with significant dip in Oct 14 and no significant upward/downward trend.  Here is a simple UCM model you could use:

paid = dip-effect + random walk trend + seasonal component + error

In order to get forecasts you will have to manually extend your input data set with missing values for paid (in the future

region).  Sample program (without input data extension):

*---------------------------------------------------;

data test;
input date : monyy7. paid;
format date date.;
OctDip = (date = '01oct2014'd);
datalines;
Jan-14  13392905
Feb-14  11939873
Mar-14  12473667
Apr-14  12237110
May-14  12579693
Jun-14  12030095
Jul-14  12052101
Aug-14  10205025
Sep-14  12102526
Oct-14  1237336
Nov-14  12148331
Dec-14  9842860
Jan-15  11990085
Feb-15  11061740
Mar-15  12076397
Apr-15  11702514
May-15  11395657
Jun-15  11817594
Jul-15  11643682
Aug-15  10243241
Sep-15  12233001
Oct-15  11769231
Nov-15  12652418
Dec-15  9774333
Jan-16  11888965
Feb-16  11892589
Mar-16  11419517
Apr-16  12143787
May-16  12330387
Jun-16  11929805
Jul-16  11583281
Aug-16  11995557
Sep-16  12646047
Oct-16  12677372
Nov-16  13301244
Dec-16  9915846
;

proc sgplot data=test;
*where date ^= '01oct2014'd;
series x=date y=paid;
run;

proc ucm data=test;
id date interval=month;
model paid = OctDip;
irregular;
level;
season length=12 type=trig;
estimate plot=panel;
forecast plot=(forecasts decomp);
run;

Contributor
Posts: 53

## Re: Arima Time series

Thanks for the suggestion. What is the best measure to evaluate the model performance?

☑ This topic is solved.