<?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: FORECAST BASED ON HOURLY DATA in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/FORECAST-BASED-ON-HOURLY-DATA/m-p/316870#M2102</link>
    <description>&lt;P&gt;Hello -&lt;/P&gt;
&lt;P&gt;It may be worthwhile to run PROC ESM instead on PROC FORECAST.&lt;/P&gt;
&lt;P&gt;Here is an example which should work for your data (even when adding&amp;nbsp;several stores):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;esm&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; data=production plot=forecasts lead=&amp;amp;lead outfor=work.AFORECASTOUTPUT;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;forecast sales/model=damptrend;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;by&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; store;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course ESM will assume the same model for all stores (in my code I used a damped trend exponential smoothing model, which seems to be appropriate for your example), but at least the parameters for each store will be different.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Udo&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Dec 2016 22:30:33 GMT</pubDate>
    <dc:creator>udo_sas</dc:creator>
    <dc:date>2016-12-05T22:30:33Z</dc:date>
    <item>
      <title>FORECAST BASED ON HOURLY DATA</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/FORECAST-BASED-ON-HOURLY-DATA/m-p/316760#M2100</link>
      <description>&lt;P&gt;Good morning,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a time process based on 14 hours and I am trying to forecast for each store&lt;BR /&gt;the sales based on historical hourly data.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;DATA Production;&lt;BR /&gt;Store="A";&amp;nbsp; hour =1 ; sales =9127513; output;&lt;BR /&gt;Store="A";&amp;nbsp; hour =2 ; sales =7632319; output;&lt;BR /&gt;Store="A";&amp;nbsp; hour =3 ; sales =5272615; output;&lt;BR /&gt;Store="A";&amp;nbsp; hour =4 ; sales =7632319; output;&lt;BR /&gt;Store="A";&amp;nbsp; hour =5 ; sales =13160441; output;&lt;BR /&gt;Store="A";&amp;nbsp; hour =6 ; sales =4332659; output;&lt;BR /&gt;Store="A";&amp;nbsp; hour =7 ; sales =6687890; output;&lt;BR /&gt;Store="A";&amp;nbsp; hour =8 ; sales =21424791; output;&lt;BR /&gt;Store="A";&amp;nbsp; hour =9 ; sales =9810671; output;&lt;BR /&gt;Store="A";&amp;nbsp; hour =10 ; sales =5272615; output;&lt;BR /&gt;Store="A";&amp;nbsp; hour =11 ; sales =21989117; output;&lt;BR /&gt;Store="A";&amp;nbsp; hour =12 ; sales =59998842; output;&lt;BR /&gt;Store="A";&amp;nbsp; hour =13 ; sales =527261542; output; &lt;BR /&gt;Store="A";&amp;nbsp; hour =14 ; sales =599986000; output;run;&lt;/P&gt;
&lt;P&gt;and so on for 17 stores.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following process does not work and I get the following error :&lt;BR /&gt;%let currenthour=6;&lt;/P&gt;
&lt;P&gt;%let lead = %eval(14 - &amp;amp;Currenthour)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc forecast data =production lead = &amp;amp;lead outactual outlimits&lt;BR /&gt;&amp;nbsp;&amp;nbsp;out = AFORECASTOUTPUT outfull outest = AFORECASTOUTPUT2&amp;nbsp;&amp;nbsp;&amp;nbsp; interval =hour&lt;BR /&gt;&amp;nbsp;&amp;nbsp;method=STEPAR trend = 2 alpha=0.05;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;by store;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;id hour;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;var sales; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: Duplicate time interval found at observation number 2 according to the INTERVAL=HOUR&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; option and the ID variable values. The current ID is date=2 and the previous is date=1,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; which are within the same HOUR interval.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 16:25:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/FORECAST-BASED-ON-HOURLY-DATA/m-p/316760#M2100</guid>
      <dc:creator>nketata</dc:creator>
      <dc:date>2016-12-05T16:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: FORECAST BASED ON HOURLY DATA</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/FORECAST-BASED-ON-HOURLY-DATA/m-p/316831#M2101</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;interval=hour&lt;/STRONG&gt; refers to SAS time intervals, not the name of your variable. Just remove that option and the procedure should use your ID statement variable (hour) as a time value with a default increment of one.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 20:07:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/FORECAST-BASED-ON-HOURLY-DATA/m-p/316831#M2101</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-12-05T20:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: FORECAST BASED ON HOURLY DATA</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/FORECAST-BASED-ON-HOURLY-DATA/m-p/316870#M2102</link>
      <description>&lt;P&gt;Hello -&lt;/P&gt;
&lt;P&gt;It may be worthwhile to run PROC ESM instead on PROC FORECAST.&lt;/P&gt;
&lt;P&gt;Here is an example which should work for your data (even when adding&amp;nbsp;several stores):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;esm&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; data=production plot=forecasts lead=&amp;amp;lead outfor=work.AFORECASTOUTPUT;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;forecast sales/model=damptrend;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;by&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; store;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course ESM will assume the same model for all stores (in my code I used a damped trend exponential smoothing model, which seems to be appropriate for your example), but at least the parameters for each store will be different.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Udo&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 22:30:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/FORECAST-BASED-ON-HOURLY-DATA/m-p/316870#M2102</guid>
      <dc:creator>udo_sas</dc:creator>
      <dc:date>2016-12-05T22:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: FORECAST BASED ON HOURLY DATA</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/FORECAST-BASED-ON-HOURLY-DATA/m-p/317126#M2103</link>
      <description>&lt;P&gt;If I do that, I get the following error :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: Observation number 14 is out of order according to the ID variable values. The current ID&lt;/P&gt;
&lt;P&gt;is hour=1, the previous ID was hour=13.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2016 20:27:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/FORECAST-BASED-ON-HOURLY-DATA/m-p/317126#M2103</guid>
      <dc:creator>nketata</dc:creator>
      <dc:date>2016-12-06T20:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: FORECAST BASED ON HOURLY DATA</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/FORECAST-BASED-ON-HOURLY-DATA/m-p/317146#M2104</link>
      <description>&lt;P&gt;You need&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BY STORE &lt;FONT color="#FF0000"&gt;DAY&lt;/FONT&gt;;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2016 21:37:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/FORECAST-BASED-ON-HOURLY-DATA/m-p/317146#M2104</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-12-06T21:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: FORECAST BASED ON HOURLY DATA</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/FORECAST-BASED-ON-HOURLY-DATA/m-p/317400#M2111</link>
      <description>&lt;P&gt;the variable HOUR is just a doule, not a datetime variable, You can either change the format of HOUR to datetime or trick the proc with the option interval = day&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc forecast data =production lead = 12 outactual outlimits&lt;BR /&gt; out = AFORECASTOUTPUT outfull outest = AFORECASTOUTPUT2 interval =hour&lt;BR /&gt; method=STEPAR trend = 2 alpha=0.05&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt; interval = day&lt;/STRONG&gt;&lt;/FONT&gt;;&lt;BR /&gt; by store;&lt;BR /&gt; id hour;&lt;BR /&gt; var sales;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2016 18:06:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/FORECAST-BASED-ON-HOURLY-DATA/m-p/317400#M2111</guid>
      <dc:creator>alexchien</dc:creator>
      <dc:date>2016-12-07T18:06:10Z</dc:date>
    </item>
  </channel>
</rss>

