BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Lopa2016
Fluorite | Level 6

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?

1 ACCEPTED SOLUTION

Accepted Solutions
rselukar
SAS Employee

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;

View solution in original post

5 REPLIES 5
PeterClemmensen
Tourmaline | Level 20

What does your code look like now?

 

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

Lopa2016
Fluorite | Level 6

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;

Lopa2016
Fluorite | Level 6
I am little confused on how to include individual seasonality variables for eg Aug & Dec in my case.Can you please help me understand?
rselukar
SAS Employee

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;

Lopa2016
Fluorite | Level 6

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

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
  • 5 replies
  • 2066 views
  • 1 like
  • 3 in conversation