BookmarkSubscribeRSS Feed
Joel_Wesley_NBCU
Fluorite | Level 6

Hello,

 

We're trying to create a forecast with bottom-up reconciliation - half-hour rolled up to day, days rolled up to weeks, etc.  The problem is, every half hour might have a different amount of treatment within it.  So rather than simply adding up all the half hour results to get the results for a day, we'd like to weight each half hour by the amount of treatment in that half hour.  Is there a simple way to do this in Forecast Studio?

 

Thanks,

Joel 

3 REPLIES 3
mitrov
SAS Employee

Hi Joel,

 

Unfortunately that is not possible withing the FS UI.

 

 

However, being that you are using Bottom-Up, it is fairly simple to implement it in coding. It would require a few calls to PROC TIMESERIES to accumulate the lowest-level forecasts to each higer-level of the hierarchy. You can look at the code that generates the data for the project as an example.

 

For example, if you open "CREATE_PROJECT_IMPORT_DATA.sas" in your your project folder, look at the code that follows this comment:

*----------------------------------------------------------------------
* level: _top
*---------------------------------------------------------------------;
There will be one run of PROC TIMESERIES for each level of the hierarchy. You need to replace the lowest-level data with the lowest-level forecasts, e.g. replace "data=_HPF2.DATA" with "data=_HPF2.OUTFOR", where "_HPF2" is the library that contains your lowest level of the hierarchy.

Then you will need a VAR statement to accumulate your PREDICT variable, e.g.

      var predict /acc= AVERAGE ;

 

Store the results in a data set using the OUT= option on the proc statement. This will give you the accumulated prediction for each level of the hierarchy. Since now each level is generated directly from the lowest level, it will be properly weighted by the number of observations in each group.

 

If you have questions feel free to contact our tech support and we will assist you. 

 

Best regards,

Michele

 

mitrov
SAS Employee
I should have added that, once you have your code ready, you can use it to create a report which can be run within the UI.
Joel_Wesley_NBCU
Fluorite | Level 6

That was helpful.  Thank you!

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!

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
  • 1081 views
  • 3 likes
  • 2 in conversation