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