Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software ModulePatrick.Wessarwasp_demand_forecasting_croston.wasp
Title produced by softwareCroston Forecasting
Date of computationThu, 13 May 2010 13:19:38 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2010/May/13/t12737568142c31mnhmdtumv1v.htm/, Retrieved Mon, 06 May 2024 09:59:07 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=75929, Retrieved Mon, 06 May 2024 09:59:07 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsB58A,steven,coomans,thesis,Arima,per2maand
Estimated Impact97
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Croston Forecasting] [B58A,steven,cooma...] [2010-05-13 13:19:38] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
719.625
689.5125
640.5
541.3875
521.3875
613.325
683
728.6375
452.5375
380.425
377.125
316.75
387.2625
409.75
497.875
616.4
715.5125
454.925
464.25
247.675
292.5125
416.525
481.6625
219.7625
402.625




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Serverwessa.org @ wessa.org

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 3 seconds \tabularnewline
R Server & wessa.org @ wessa.org \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75929&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]wessa.org @ wessa.org[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75929&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75929&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Serverwessa.org @ wessa.org







Demand Forecast
PointForecast95% LB80% LB80% UB95% UB
26402.625152.878545688705239.324570993922565.925429006078652.371454311295
27402.62549.4301771583743171.683318558260633.56668144174755.819822841626
28402.625-29.9485478773419119.780360063678685.469639936322835.198547877342
29402.625-96.867908622589776.0241419878438729.225858012156902.11790862259
30402.625-155.82504897960137.4741399875309767.775860012469961.0750489796
31402.625-209.1263781319842.62227415751909802.627725842481014.37637813198
32402.625-258.142008927841-29.4273241402412834.677324140241063.39200892784
33402.625-303.764645683251-59.2583628834809864.5083628834811109.01464568325
34402.625-346.614362933885-87.2762870182344892.5262870182341151.86436293388
35402.625-387.142633174871-113.776298541833919.0262985418331192.39263317487
36402.625-425.690281672203-138.981251117231944.231251117231230.94028167220
37402.625-462.522095754684-163.064279872643968.3142798726431267.77209575468
38402.625-497.848646884698-186.163070086682991.4130700866821303.09864688470
39402.625-531.840665594457-208.3892564539461013.639256453951337.09066559446
40402.625-564.638858321996-229.8348419690671035.084841969071369.88885832200
41402.625-596.360817245179-250.5767160243121055.826716024311401.61081724518
42402.625-627.106010748964-270.6799175007381075.929917500741432.35601074896
43402.625-656.959468524877-290.2000443252211095.450044325221462.20946852488
44402.625-685.994555850532-309.1850674743331114.435067474331491.24455585053
45402.625-714.275097959202-327.6767200249381132.926720024941519.52509795920
46402.625-741.857031428339-345.7115769391151150.961576939121547.10703142834
47402.625-768.78970526172-363.3219057960361168.571905796041574.03970526172
48402.625-795.116918421688-380.536345197841185.786345197841600.36691842169
49402.625-820.877756263969-397.3804516849621202.630451684961626.12775626397

\begin{tabular}{lllllllll}
\hline
Demand Forecast \tabularnewline
Point & Forecast & 95% LB & 80% LB & 80% UB & 95% UB \tabularnewline
26 & 402.625 & 152.878545688705 & 239.324570993922 & 565.925429006078 & 652.371454311295 \tabularnewline
27 & 402.625 & 49.4301771583743 & 171.683318558260 & 633.56668144174 & 755.819822841626 \tabularnewline
28 & 402.625 & -29.9485478773419 & 119.780360063678 & 685.469639936322 & 835.198547877342 \tabularnewline
29 & 402.625 & -96.8679086225897 & 76.0241419878438 & 729.225858012156 & 902.11790862259 \tabularnewline
30 & 402.625 & -155.825048979601 & 37.4741399875309 & 767.775860012469 & 961.0750489796 \tabularnewline
31 & 402.625 & -209.126378131984 & 2.62227415751909 & 802.62772584248 & 1014.37637813198 \tabularnewline
32 & 402.625 & -258.142008927841 & -29.4273241402412 & 834.67732414024 & 1063.39200892784 \tabularnewline
33 & 402.625 & -303.764645683251 & -59.2583628834809 & 864.508362883481 & 1109.01464568325 \tabularnewline
34 & 402.625 & -346.614362933885 & -87.2762870182344 & 892.526287018234 & 1151.86436293388 \tabularnewline
35 & 402.625 & -387.142633174871 & -113.776298541833 & 919.026298541833 & 1192.39263317487 \tabularnewline
36 & 402.625 & -425.690281672203 & -138.981251117231 & 944.23125111723 & 1230.94028167220 \tabularnewline
37 & 402.625 & -462.522095754684 & -163.064279872643 & 968.314279872643 & 1267.77209575468 \tabularnewline
38 & 402.625 & -497.848646884698 & -186.163070086682 & 991.413070086682 & 1303.09864688470 \tabularnewline
39 & 402.625 & -531.840665594457 & -208.389256453946 & 1013.63925645395 & 1337.09066559446 \tabularnewline
40 & 402.625 & -564.638858321996 & -229.834841969067 & 1035.08484196907 & 1369.88885832200 \tabularnewline
41 & 402.625 & -596.360817245179 & -250.576716024312 & 1055.82671602431 & 1401.61081724518 \tabularnewline
42 & 402.625 & -627.106010748964 & -270.679917500738 & 1075.92991750074 & 1432.35601074896 \tabularnewline
43 & 402.625 & -656.959468524877 & -290.200044325221 & 1095.45004432522 & 1462.20946852488 \tabularnewline
44 & 402.625 & -685.994555850532 & -309.185067474333 & 1114.43506747433 & 1491.24455585053 \tabularnewline
45 & 402.625 & -714.275097959202 & -327.676720024938 & 1132.92672002494 & 1519.52509795920 \tabularnewline
46 & 402.625 & -741.857031428339 & -345.711576939115 & 1150.96157693912 & 1547.10703142834 \tabularnewline
47 & 402.625 & -768.78970526172 & -363.321905796036 & 1168.57190579604 & 1574.03970526172 \tabularnewline
48 & 402.625 & -795.116918421688 & -380.53634519784 & 1185.78634519784 & 1600.36691842169 \tabularnewline
49 & 402.625 & -820.877756263969 & -397.380451684962 & 1202.63045168496 & 1626.12775626397 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75929&T=1

[TABLE]
[ROW][C]Demand Forecast[/C][/ROW]
[ROW][C]Point[/C][C]Forecast[/C][C]95% LB[/C][C]80% LB[/C][C]80% UB[/C][C]95% UB[/C][/ROW]
[ROW][C]26[/C][C]402.625[/C][C]152.878545688705[/C][C]239.324570993922[/C][C]565.925429006078[/C][C]652.371454311295[/C][/ROW]
[ROW][C]27[/C][C]402.625[/C][C]49.4301771583743[/C][C]171.683318558260[/C][C]633.56668144174[/C][C]755.819822841626[/C][/ROW]
[ROW][C]28[/C][C]402.625[/C][C]-29.9485478773419[/C][C]119.780360063678[/C][C]685.469639936322[/C][C]835.198547877342[/C][/ROW]
[ROW][C]29[/C][C]402.625[/C][C]-96.8679086225897[/C][C]76.0241419878438[/C][C]729.225858012156[/C][C]902.11790862259[/C][/ROW]
[ROW][C]30[/C][C]402.625[/C][C]-155.825048979601[/C][C]37.4741399875309[/C][C]767.775860012469[/C][C]961.0750489796[/C][/ROW]
[ROW][C]31[/C][C]402.625[/C][C]-209.126378131984[/C][C]2.62227415751909[/C][C]802.62772584248[/C][C]1014.37637813198[/C][/ROW]
[ROW][C]32[/C][C]402.625[/C][C]-258.142008927841[/C][C]-29.4273241402412[/C][C]834.67732414024[/C][C]1063.39200892784[/C][/ROW]
[ROW][C]33[/C][C]402.625[/C][C]-303.764645683251[/C][C]-59.2583628834809[/C][C]864.508362883481[/C][C]1109.01464568325[/C][/ROW]
[ROW][C]34[/C][C]402.625[/C][C]-346.614362933885[/C][C]-87.2762870182344[/C][C]892.526287018234[/C][C]1151.86436293388[/C][/ROW]
[ROW][C]35[/C][C]402.625[/C][C]-387.142633174871[/C][C]-113.776298541833[/C][C]919.026298541833[/C][C]1192.39263317487[/C][/ROW]
[ROW][C]36[/C][C]402.625[/C][C]-425.690281672203[/C][C]-138.981251117231[/C][C]944.23125111723[/C][C]1230.94028167220[/C][/ROW]
[ROW][C]37[/C][C]402.625[/C][C]-462.522095754684[/C][C]-163.064279872643[/C][C]968.314279872643[/C][C]1267.77209575468[/C][/ROW]
[ROW][C]38[/C][C]402.625[/C][C]-497.848646884698[/C][C]-186.163070086682[/C][C]991.413070086682[/C][C]1303.09864688470[/C][/ROW]
[ROW][C]39[/C][C]402.625[/C][C]-531.840665594457[/C][C]-208.389256453946[/C][C]1013.63925645395[/C][C]1337.09066559446[/C][/ROW]
[ROW][C]40[/C][C]402.625[/C][C]-564.638858321996[/C][C]-229.834841969067[/C][C]1035.08484196907[/C][C]1369.88885832200[/C][/ROW]
[ROW][C]41[/C][C]402.625[/C][C]-596.360817245179[/C][C]-250.576716024312[/C][C]1055.82671602431[/C][C]1401.61081724518[/C][/ROW]
[ROW][C]42[/C][C]402.625[/C][C]-627.106010748964[/C][C]-270.679917500738[/C][C]1075.92991750074[/C][C]1432.35601074896[/C][/ROW]
[ROW][C]43[/C][C]402.625[/C][C]-656.959468524877[/C][C]-290.200044325221[/C][C]1095.45004432522[/C][C]1462.20946852488[/C][/ROW]
[ROW][C]44[/C][C]402.625[/C][C]-685.994555850532[/C][C]-309.185067474333[/C][C]1114.43506747433[/C][C]1491.24455585053[/C][/ROW]
[ROW][C]45[/C][C]402.625[/C][C]-714.275097959202[/C][C]-327.676720024938[/C][C]1132.92672002494[/C][C]1519.52509795920[/C][/ROW]
[ROW][C]46[/C][C]402.625[/C][C]-741.857031428339[/C][C]-345.711576939115[/C][C]1150.96157693912[/C][C]1547.10703142834[/C][/ROW]
[ROW][C]47[/C][C]402.625[/C][C]-768.78970526172[/C][C]-363.321905796036[/C][C]1168.57190579604[/C][C]1574.03970526172[/C][/ROW]
[ROW][C]48[/C][C]402.625[/C][C]-795.116918421688[/C][C]-380.53634519784[/C][C]1185.78634519784[/C][C]1600.36691842169[/C][/ROW]
[ROW][C]49[/C][C]402.625[/C][C]-820.877756263969[/C][C]-397.380451684962[/C][C]1202.63045168496[/C][C]1626.12775626397[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75929&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75929&T=1

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Demand Forecast
PointForecast95% LB80% LB80% UB95% UB
26402.625152.878545688705239.324570993922565.925429006078652.371454311295
27402.62549.4301771583743171.683318558260633.56668144174755.819822841626
28402.625-29.9485478773419119.780360063678685.469639936322835.198547877342
29402.625-96.867908622589776.0241419878438729.225858012156902.11790862259
30402.625-155.82504897960137.4741399875309767.775860012469961.0750489796
31402.625-209.1263781319842.62227415751909802.627725842481014.37637813198
32402.625-258.142008927841-29.4273241402412834.677324140241063.39200892784
33402.625-303.764645683251-59.2583628834809864.5083628834811109.01464568325
34402.625-346.614362933885-87.2762870182344892.5262870182341151.86436293388
35402.625-387.142633174871-113.776298541833919.0262985418331192.39263317487
36402.625-425.690281672203-138.981251117231944.231251117231230.94028167220
37402.625-462.522095754684-163.064279872643968.3142798726431267.77209575468
38402.625-497.848646884698-186.163070086682991.4130700866821303.09864688470
39402.625-531.840665594457-208.3892564539461013.639256453951337.09066559446
40402.625-564.638858321996-229.8348419690671035.084841969071369.88885832200
41402.625-596.360817245179-250.5767160243121055.826716024311401.61081724518
42402.625-627.106010748964-270.6799175007381075.929917500741432.35601074896
43402.625-656.959468524877-290.2000443252211095.450044325221462.20946852488
44402.625-685.994555850532-309.1850674743331114.435067474331491.24455585053
45402.625-714.275097959202-327.6767200249381132.926720024941519.52509795920
46402.625-741.857031428339-345.7115769391151150.961576939121547.10703142834
47402.625-768.78970526172-363.3219057960361168.571905796041574.03970526172
48402.625-795.116918421688-380.536345197841185.786345197841600.36691842169
49402.625-820.877756263969-397.3804516849621202.630451684961626.12775626397







Actuals and Interpolation
TimeActualForecast
1719.625718.905375359812
2689.5125719.62500000013
3640.5689.5125
4541.3875640.5
5521.3875541.3875
6613.325521.3875
7683613.325
8728.6375683
9452.5375728.6375
10380.425452.5375
11377.125380.425
12316.75377.125
13387.2625316.75
14409.75387.2625
15497.875409.75
16616.4497.875
17715.5125616.4
18454.925715.5125
19464.25454.925
20247.675464.25
21292.5125247.675
22416.525292.5125
23481.6625416.525
24219.7625481.6625
25402.625219.7625

\begin{tabular}{lllllllll}
\hline
Actuals and Interpolation \tabularnewline
Time & Actual & Forecast \tabularnewline
1 & 719.625 & 718.905375359812 \tabularnewline
2 & 689.5125 & 719.62500000013 \tabularnewline
3 & 640.5 & 689.5125 \tabularnewline
4 & 541.3875 & 640.5 \tabularnewline
5 & 521.3875 & 541.3875 \tabularnewline
6 & 613.325 & 521.3875 \tabularnewline
7 & 683 & 613.325 \tabularnewline
8 & 728.6375 & 683 \tabularnewline
9 & 452.5375 & 728.6375 \tabularnewline
10 & 380.425 & 452.5375 \tabularnewline
11 & 377.125 & 380.425 \tabularnewline
12 & 316.75 & 377.125 \tabularnewline
13 & 387.2625 & 316.75 \tabularnewline
14 & 409.75 & 387.2625 \tabularnewline
15 & 497.875 & 409.75 \tabularnewline
16 & 616.4 & 497.875 \tabularnewline
17 & 715.5125 & 616.4 \tabularnewline
18 & 454.925 & 715.5125 \tabularnewline
19 & 464.25 & 454.925 \tabularnewline
20 & 247.675 & 464.25 \tabularnewline
21 & 292.5125 & 247.675 \tabularnewline
22 & 416.525 & 292.5125 \tabularnewline
23 & 481.6625 & 416.525 \tabularnewline
24 & 219.7625 & 481.6625 \tabularnewline
25 & 402.625 & 219.7625 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75929&T=2

[TABLE]
[ROW][C]Actuals and Interpolation[/C][/ROW]
[ROW][C]Time[/C][C]Actual[/C][C]Forecast[/C][/ROW]
[ROW][C]1[/C][C]719.625[/C][C]718.905375359812[/C][/ROW]
[ROW][C]2[/C][C]689.5125[/C][C]719.62500000013[/C][/ROW]
[ROW][C]3[/C][C]640.5[/C][C]689.5125[/C][/ROW]
[ROW][C]4[/C][C]541.3875[/C][C]640.5[/C][/ROW]
[ROW][C]5[/C][C]521.3875[/C][C]541.3875[/C][/ROW]
[ROW][C]6[/C][C]613.325[/C][C]521.3875[/C][/ROW]
[ROW][C]7[/C][C]683[/C][C]613.325[/C][/ROW]
[ROW][C]8[/C][C]728.6375[/C][C]683[/C][/ROW]
[ROW][C]9[/C][C]452.5375[/C][C]728.6375[/C][/ROW]
[ROW][C]10[/C][C]380.425[/C][C]452.5375[/C][/ROW]
[ROW][C]11[/C][C]377.125[/C][C]380.425[/C][/ROW]
[ROW][C]12[/C][C]316.75[/C][C]377.125[/C][/ROW]
[ROW][C]13[/C][C]387.2625[/C][C]316.75[/C][/ROW]
[ROW][C]14[/C][C]409.75[/C][C]387.2625[/C][/ROW]
[ROW][C]15[/C][C]497.875[/C][C]409.75[/C][/ROW]
[ROW][C]16[/C][C]616.4[/C][C]497.875[/C][/ROW]
[ROW][C]17[/C][C]715.5125[/C][C]616.4[/C][/ROW]
[ROW][C]18[/C][C]454.925[/C][C]715.5125[/C][/ROW]
[ROW][C]19[/C][C]464.25[/C][C]454.925[/C][/ROW]
[ROW][C]20[/C][C]247.675[/C][C]464.25[/C][/ROW]
[ROW][C]21[/C][C]292.5125[/C][C]247.675[/C][/ROW]
[ROW][C]22[/C][C]416.525[/C][C]292.5125[/C][/ROW]
[ROW][C]23[/C][C]481.6625[/C][C]416.525[/C][/ROW]
[ROW][C]24[/C][C]219.7625[/C][C]481.6625[/C][/ROW]
[ROW][C]25[/C][C]402.625[/C][C]219.7625[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75929&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75929&T=2

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Actuals and Interpolation
TimeActualForecast
1719.625718.905375359812
2689.5125719.62500000013
3640.5689.5125
4541.3875640.5
5521.3875541.3875
6613.325521.3875
7683613.325
8728.6375683
9452.5375728.6375
10380.425452.5375
11377.125380.425
12316.75377.125
13387.2625316.75
14409.75387.2625
15497.875409.75
16616.4497.875
17715.5125616.4
18454.925715.5125
19464.25454.925
20247.675464.25
21292.5125247.675
22416.525292.5125
23481.6625416.525
24219.7625481.6625
25402.625219.7625







\begin{tabular}{lllllllll}
\hline
What is next? \tabularnewline
Simulate Time Series \tabularnewline
Generate Forecasts \tabularnewline
Forecast Analysis \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75929&T=3

[TABLE]
[ROW][C]What is next?[/C][/ROW]
[ROW][C]Simulate Time Series[/C][/ROW]
[ROW][C]Generate Forecasts[/C][/ROW]
[ROW][C]Forecast Analysis[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75929&T=3

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75929&T=3

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

What is next?
Simulate Time Series
Generate Forecasts
Forecast Analysis



Parameters (Session):
par1 = Input box ; par2 = ARIMA ; par3 = NA ; par4 = NA ; par5 = ZZZ ; par6 = 12 ; par7 = dum ; par8 = dumresult ; par9 = 3 ; par10 = 0.1 ;
Parameters (R input):
par1 = Input box ; par2 = ARIMA ; par3 = NA ; par4 = NA ; par5 = ZZZ ; par6 = 12 ; par7 = dum ; par8 = dumresult ; par9 = 3 ; par10 = 0.1 ;
R code (references can be found in the software module):
if(par3!='NA') par3 <- as.numeric(par3) else par3 <- NA
if(par4!='NA') par4 <- as.numeric(par4) else par4 <- NA
par6 <- as.numeric(par6) #Seasonal Period
par9 <- as.numeric(par9) #Forecast Horizon
par10 <- as.numeric(par10) #Alpha
library(forecast)
if (par1 == 'CSV') {
xarr <- read.csv(file=paste('tmp/',par7,'.csv',sep=''),header=T)
numseries <- length(xarr[1,])-1
n <- length(xarr[,1])
nmh <- n - par9
nmhp1 <- nmh + 1
rarr <- array(NA,dim=c(n,numseries))
farr <- array(NA,dim=c(n,numseries))
parr <- array(NA,dim=c(numseries,8))
colnames(parr) = list('ME','RMSE','MAE','MPE','MAPE','MASE','ACF1','TheilU')
for(i in 1:numseries) {
sindex <- i+1
x <- xarr[,sindex]
if(par2=='Croston') {
if (i==1) m <- croston(x,alpha=par10)
if (i==1) mydemand <- m$model$demand[]
fit <- croston(x[1:nmh],h=par9,alpha=par10)
}
if(par2=='ARIMA') {
m <- auto.arima(ts(x,freq=par6),d=par3,D=par4)
mydemand <- forecast(m)
fit <- auto.arima(ts(x[1:nmh],freq=par6),d=par3,D=par4)
}
if(par2=='ETS') {
m <- ets(ts(x,freq=par6),model=par5)
mydemand <- forecast(m)
fit <- ets(ts(x[1:nmh],freq=par6),model=par5)
}
try(rarr[,i] <- mydemand$resid,silent=T)
try(farr[,i] <- mydemand$mean,silent=T)
if (par2!='Croston') parr[i,] <- accuracy(forecast(fit,par9),x[nmhp1:n])
if (par2=='Croston') parr[i,] <- accuracy(fit,x[nmhp1:n])
}
write.csv(farr,file=paste('tmp/',par8,'_f.csv',sep=''))
write.csv(rarr,file=paste('tmp/',par8,'_r.csv',sep=''))
write.csv(parr,file=paste('tmp/',par8,'_p.csv',sep=''))
}
if (par1 == 'Input box') {
numseries <- 1
n <- length(x)
if(par2=='Croston') {
m <- croston(x)
mydemand <- m$model$demand[]
}
if(par2=='ARIMA') {
m <- auto.arima(ts(x,freq=par6),d=par3,D=par4)
mydemand <- forecast(m)
}
if(par2=='ETS') {
m <- ets(ts(x,freq=par6),model=par5)
mydemand <- forecast(m)
}
summary(m)
}
bitmap(file='test1.png')
op <- par(mfrow=c(2,1))
if (par2=='Croston') plot(m)
if ((par2=='ARIMA') | par2=='ETS') plot(forecast(m))
plot(mydemand$resid,type='l',main='Residuals', ylab='residual value', xlab='time')
par(op)
dev.off()
bitmap(file='pic2.png')
op <- par(mfrow=c(2,2))
acf(mydemand$resid, lag.max=n/3, main='Residual ACF', ylab='autocorrelation', xlab='time lag')
pacf(mydemand$resid,lag.max=n/3, main='Residual PACF', ylab='partial autocorrelation', xlab='time lag')
cpgram(mydemand$resid, main='Cumulative Periodogram of Residuals')
qqnorm(mydemand$resid); qqline(mydemand$resid, col=2)
par(op)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Demand Forecast',6,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Point',header=TRUE)
a<-table.element(a,'Forecast',header=TRUE)
a<-table.element(a,'95% LB',header=TRUE)
a<-table.element(a,'80% LB',header=TRUE)
a<-table.element(a,'80% UB',header=TRUE)
a<-table.element(a,'95% UB',header=TRUE)
a<-table.row.end(a)
for (i in 1:length(mydemand$mean)) {
a<-table.row.start(a)
a<-table.element(a,i+n,header=TRUE)
a<-table.element(a,as.numeric(mydemand$mean[i]))
a<-table.element(a,as.numeric(mydemand$lower[i,2]))
a<-table.element(a,as.numeric(mydemand$lower[i,1]))
a<-table.element(a,as.numeric(mydemand$upper[i,1]))
a<-table.element(a,as.numeric(mydemand$upper[i,2]))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Actuals and Interpolation',3,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Time',header=TRUE)
a<-table.element(a,'Actual',header=TRUE)
a<-table.element(a,'Forecast',header=TRUE)
a<-table.row.end(a)
for (i in 1:n) {
a<-table.row.start(a)
a<-table.element(a,i,header=TRUE)
a<-table.element(a,x[i])
a<-table.element(a,x[i] - as.numeric(m$resid[i]))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'What is next?',1,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,hyperlink(paste('https://automated.biganalytics.eu/Patrick.Wessa/rwasp_demand_forecasting_simulate.wasp',sep=''),'Simulate Time Series','',target=''))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,hyperlink(paste('https://automated.biganalytics.eu/Patrick.Wessa/rwasp_demand_forecasting_croston.wasp',sep=''),'Generate Forecasts','',target=''))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,hyperlink(paste('https://automated.biganalytics.eu/Patrick.Wessa/rwasp_demand_forecasting_analysis.wasp',sep=''),'Forecast Analysis','',target=''))
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable0.tab')
-SERVER-wessa.org