<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Reconcile a hierarchical forecast using a weighted average? in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Reconcile-a-hierarchical-forecast-using-a-weighted-average/m-p/231059#M1420</link>
    <description>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.</description>
    <pubDate>Wed, 21 Oct 2015 21:29:24 GMT</pubDate>
    <dc:creator>mitrov</dc:creator>
    <dc:date>2015-10-21T21:29:24Z</dc:date>
    <item>
      <title>Reconcile a hierarchical forecast using a weighted average?</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Reconcile-a-hierarchical-forecast-using-a-weighted-average/m-p/230757#M1416</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We're trying to create a forecast with bottom-up reconciliation - half-hour rolled up to day, days rolled up to weeks, etc.&amp;nbsp; The problem is, every half hour might have a different amount of treatment within it.&amp;nbsp; 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.&amp;nbsp; Is there a simple way to do this in Forecast Studio?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Joel&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2015 14:46:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Reconcile-a-hierarchical-forecast-using-a-weighted-average/m-p/230757#M1416</guid>
      <dc:creator>Joel_Wesley_NBCU</dc:creator>
      <dc:date>2015-10-20T14:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Reconcile a hierarchical forecast using a weighted average?</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Reconcile-a-hierarchical-forecast-using-a-weighted-average/m-p/231039#M1419</link>
      <description>&lt;P&gt;Hi Joel,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately that is not possible withing the FS UI.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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&amp;nbsp;each higer-level of the hierarchy. You can look at the code that generates the data for the project as an example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, if you&amp;nbsp;open&amp;nbsp;"CREATE_PROJECT_IMPORT_DATA.sas" in your your project folder, look at the code that follows this comment:&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="line-height: 20px;"&gt;*----------------------------------------------------------------------&lt;BR /&gt;* level: _top&lt;BR /&gt;*---------------------------------------------------------------------;&lt;BR /&gt;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. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="line-height: 20px;"&gt;Then you will need a VAR statement to accumulate your PREDICT variable, e.g.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; var predict /acc= AVERAGE ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&amp;nbsp;&lt;SPAN style="line-height: 20px;"&gt;Since now each level is generated directly from the lowest level, it will be properly weighted by the number of observations in each group.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have questions feel free to contact our tech support and we will assist you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Michele&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2015 19:43:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Reconcile-a-hierarchical-forecast-using-a-weighted-average/m-p/231039#M1419</guid>
      <dc:creator>mitrov</dc:creator>
      <dc:date>2015-10-21T19:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: Reconcile a hierarchical forecast using a weighted average?</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Reconcile-a-hierarchical-forecast-using-a-weighted-average/m-p/231059#M1420</link>
      <description>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.</description>
      <pubDate>Wed, 21 Oct 2015 21:29:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Reconcile-a-hierarchical-forecast-using-a-weighted-average/m-p/231059#M1420</guid>
      <dc:creator>mitrov</dc:creator>
      <dc:date>2015-10-21T21:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Reconcile a hierarchical forecast using a weighted average?</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Reconcile-a-hierarchical-forecast-using-a-weighted-average/m-p/231136#M1421</link>
      <description>&lt;P&gt;That was helpful. &amp;nbsp;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2015 13:02:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Reconcile-a-hierarchical-forecast-using-a-weighted-average/m-p/231136#M1421</guid>
      <dc:creator>Joel_Wesley_NBCU</dc:creator>
      <dc:date>2015-10-22T13:02:32Z</dc:date>
    </item>
  </channel>
</rss>

