BookmarkSubscribeRSS Feed
Sroy9
Calcite | Level 5
Hi,

I'm a bit new to using SAS, but am currently attempting to use it to perform Winter's forecasts on a set of data. I found that in using the ESM procedure the parameters are optimized, which is great, but I am having some trouble specifying multi-step ahead forecasting. I know that setting lead will add additional forecasts to the end, but I want that process to occur throughout.

For instance, if I set a lead time of 2 and have 200 data points, the forecast for data point 150 should be set on 148, and remain the same from then on. In this way I have a list of forecasts that are all formed 2-periods out from the original data set.

If anyone could point me in the right direction I would greatly appreciate it. Message was edited by: Sroy9
1 REPLY 1
udo_sas
SAS Employee

Hello -

Provided I understand correctly what you would like to archive, I think the answer is to run ESM several times using the BACK= option and to merge the results of each run.

Here is an illustration of what I'm referring to: I running ESM 12 times with a lead time of one while decreasing the out-of-sample size for each run and keeping the prediction of each run.

Hope that helps.

Thanks,

Udo

%macro esm(value);

  %do i=&value. %to 1 %by -1;

   proc esm data=sashelp.air out=_null_ outfor=work.outfor&i. lead=1 back=&i.;

     id date interval=month;

     forecast air / method=winters;

   run;

   data outfor&i.;

     set outfor&i.(keep=actual predict date) end=last;

     if last;

   run;

  %end;

  data result;

   set outfor1-outfor12;

   by date;

  run;

%mend;

%esm(12)

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 897 views
  • 0 likes
  • 2 in conversation