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:11:30 +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/t1273756326nmowia96jees1rm.htm/, Retrieved Mon, 06 May 2024 04:09:26 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=75923, Retrieved Mon, 06 May 2024 04:09:26 +0000
QR Codes:

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

Post a new message
Dataseries X:
341.25
303.6875
357.5
295.075
386.5755
455.6625
424.926
506.751
433.9
466.3375
496.7
464.45
385.375
381.875
219.6375
268.975
292.2875
181.025
277.625
166.75
266
189.25
226.35
158.75
218.8125




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time7 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 & 7 seconds \tabularnewline
R Server & wessa.org @ wessa.org \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75923&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]7 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]wessa.org @ wessa.org[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75923&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75923&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 time7 seconds
R Serverwessa.org @ wessa.org







Demand Forecast
PointForecast95% LB80% LB80% UB95% UB
26204.96065227839377.6260842593891121.701053489901288.220251066886332.295220297397
27204.96065227839354.3913716649274106.508691520352303.412613036434355.529932891859
28204.96065227839334.291017262884893.3657762141894316.555528342597375.630287293902
29204.96065227839316.320411692782681.6154288181103328.305875738676393.600892864004
30204.960652278393-0.081188378745110970.8909989740408339.030305582746410.002492935532
31204.960652278393-15.264624363361860.9630838133966348.95822074339425.185928920148
32204.960652278393-29.466710723044351.6768386824577358.244465874329439.388015279831
33204.960652278393-42.856224821771242.921905994686366.999398562101452.777529378558
34204.960652278393-55.558484499595234.6163448188313375.304959737955465.479789056382
35204.960652278393-67.669567395469226.6973333634805383.223971193306477.590871952256
36204.960652278393-79.265055093914419.1154514868688390.805853069918489.186359650701
37204.960652278393-90.405677527762711.8309900203026398.090314536484500.326982084549
38204.960652278393-101.1411034092034.81147233851374405.109832218273511.06240796599
39204.960652278393-111.512570738815-1.97006563774505411.891370194532521.433875295601
40204.960652278393-121.554763802945-8.53630274432021418.457607301107531.476068359732
41204.960652278393-131.297184791079-14.9065294260454424.827833982832541.218489347866
42204.960652278393-140.765177017756-21.0973167855944431.018621342381550.686481574542
43204.960652278393-149.98070216538-27.1230247952366437.044329352023559.902006722167
44204.960652278393-158.96294017784-32.9961945461918442.917499102978568.884244734626
45204.960652278393-167.728758891445-38.7278553237938448.64915988058577.650063448232
46204.960652278393-176.293086391788-44.3277680785565454.249072635343586.214390948575
47204.960652278393-184.669209644254-49.8046206901678459.725925246954594.59051420104
48204.960652278393-192.869016491712-55.1661862012753465.087490758062602.790321048498
49204.960652278393-200.903193617742-60.4194522586833470.34075681547610.824498174528

\begin{tabular}{lllllllll}
\hline
Demand Forecast \tabularnewline
Point & Forecast & 95% LB & 80% LB & 80% UB & 95% UB \tabularnewline
26 & 204.960652278393 & 77.6260842593891 & 121.701053489901 & 288.220251066886 & 332.295220297397 \tabularnewline
27 & 204.960652278393 & 54.3913716649274 & 106.508691520352 & 303.412613036434 & 355.529932891859 \tabularnewline
28 & 204.960652278393 & 34.2910172628848 & 93.3657762141894 & 316.555528342597 & 375.630287293902 \tabularnewline
29 & 204.960652278393 & 16.3204116927826 & 81.6154288181103 & 328.305875738676 & 393.600892864004 \tabularnewline
30 & 204.960652278393 & -0.0811883787451109 & 70.8909989740408 & 339.030305582746 & 410.002492935532 \tabularnewline
31 & 204.960652278393 & -15.2646243633618 & 60.9630838133966 & 348.95822074339 & 425.185928920148 \tabularnewline
32 & 204.960652278393 & -29.4667107230443 & 51.6768386824577 & 358.244465874329 & 439.388015279831 \tabularnewline
33 & 204.960652278393 & -42.8562248217712 & 42.921905994686 & 366.999398562101 & 452.777529378558 \tabularnewline
34 & 204.960652278393 & -55.5584844995952 & 34.6163448188313 & 375.304959737955 & 465.479789056382 \tabularnewline
35 & 204.960652278393 & -67.6695673954692 & 26.6973333634805 & 383.223971193306 & 477.590871952256 \tabularnewline
36 & 204.960652278393 & -79.2650550939144 & 19.1154514868688 & 390.805853069918 & 489.186359650701 \tabularnewline
37 & 204.960652278393 & -90.4056775277627 & 11.8309900203026 & 398.090314536484 & 500.326982084549 \tabularnewline
38 & 204.960652278393 & -101.141103409203 & 4.81147233851374 & 405.109832218273 & 511.06240796599 \tabularnewline
39 & 204.960652278393 & -111.512570738815 & -1.97006563774505 & 411.891370194532 & 521.433875295601 \tabularnewline
40 & 204.960652278393 & -121.554763802945 & -8.53630274432021 & 418.457607301107 & 531.476068359732 \tabularnewline
41 & 204.960652278393 & -131.297184791079 & -14.9065294260454 & 424.827833982832 & 541.218489347866 \tabularnewline
42 & 204.960652278393 & -140.765177017756 & -21.0973167855944 & 431.018621342381 & 550.686481574542 \tabularnewline
43 & 204.960652278393 & -149.98070216538 & -27.1230247952366 & 437.044329352023 & 559.902006722167 \tabularnewline
44 & 204.960652278393 & -158.96294017784 & -32.9961945461918 & 442.917499102978 & 568.884244734626 \tabularnewline
45 & 204.960652278393 & -167.728758891445 & -38.7278553237938 & 448.64915988058 & 577.650063448232 \tabularnewline
46 & 204.960652278393 & -176.293086391788 & -44.3277680785565 & 454.249072635343 & 586.214390948575 \tabularnewline
47 & 204.960652278393 & -184.669209644254 & -49.8046206901678 & 459.725925246954 & 594.59051420104 \tabularnewline
48 & 204.960652278393 & -192.869016491712 & -55.1661862012753 & 465.087490758062 & 602.790321048498 \tabularnewline
49 & 204.960652278393 & -200.903193617742 & -60.4194522586833 & 470.34075681547 & 610.824498174528 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75923&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]204.960652278393[/C][C]77.6260842593891[/C][C]121.701053489901[/C][C]288.220251066886[/C][C]332.295220297397[/C][/ROW]
[ROW][C]27[/C][C]204.960652278393[/C][C]54.3913716649274[/C][C]106.508691520352[/C][C]303.412613036434[/C][C]355.529932891859[/C][/ROW]
[ROW][C]28[/C][C]204.960652278393[/C][C]34.2910172628848[/C][C]93.3657762141894[/C][C]316.555528342597[/C][C]375.630287293902[/C][/ROW]
[ROW][C]29[/C][C]204.960652278393[/C][C]16.3204116927826[/C][C]81.6154288181103[/C][C]328.305875738676[/C][C]393.600892864004[/C][/ROW]
[ROW][C]30[/C][C]204.960652278393[/C][C]-0.0811883787451109[/C][C]70.8909989740408[/C][C]339.030305582746[/C][C]410.002492935532[/C][/ROW]
[ROW][C]31[/C][C]204.960652278393[/C][C]-15.2646243633618[/C][C]60.9630838133966[/C][C]348.95822074339[/C][C]425.185928920148[/C][/ROW]
[ROW][C]32[/C][C]204.960652278393[/C][C]-29.4667107230443[/C][C]51.6768386824577[/C][C]358.244465874329[/C][C]439.388015279831[/C][/ROW]
[ROW][C]33[/C][C]204.960652278393[/C][C]-42.8562248217712[/C][C]42.921905994686[/C][C]366.999398562101[/C][C]452.777529378558[/C][/ROW]
[ROW][C]34[/C][C]204.960652278393[/C][C]-55.5584844995952[/C][C]34.6163448188313[/C][C]375.304959737955[/C][C]465.479789056382[/C][/ROW]
[ROW][C]35[/C][C]204.960652278393[/C][C]-67.6695673954692[/C][C]26.6973333634805[/C][C]383.223971193306[/C][C]477.590871952256[/C][/ROW]
[ROW][C]36[/C][C]204.960652278393[/C][C]-79.2650550939144[/C][C]19.1154514868688[/C][C]390.805853069918[/C][C]489.186359650701[/C][/ROW]
[ROW][C]37[/C][C]204.960652278393[/C][C]-90.4056775277627[/C][C]11.8309900203026[/C][C]398.090314536484[/C][C]500.326982084549[/C][/ROW]
[ROW][C]38[/C][C]204.960652278393[/C][C]-101.141103409203[/C][C]4.81147233851374[/C][C]405.109832218273[/C][C]511.06240796599[/C][/ROW]
[ROW][C]39[/C][C]204.960652278393[/C][C]-111.512570738815[/C][C]-1.97006563774505[/C][C]411.891370194532[/C][C]521.433875295601[/C][/ROW]
[ROW][C]40[/C][C]204.960652278393[/C][C]-121.554763802945[/C][C]-8.53630274432021[/C][C]418.457607301107[/C][C]531.476068359732[/C][/ROW]
[ROW][C]41[/C][C]204.960652278393[/C][C]-131.297184791079[/C][C]-14.9065294260454[/C][C]424.827833982832[/C][C]541.218489347866[/C][/ROW]
[ROW][C]42[/C][C]204.960652278393[/C][C]-140.765177017756[/C][C]-21.0973167855944[/C][C]431.018621342381[/C][C]550.686481574542[/C][/ROW]
[ROW][C]43[/C][C]204.960652278393[/C][C]-149.98070216538[/C][C]-27.1230247952366[/C][C]437.044329352023[/C][C]559.902006722167[/C][/ROW]
[ROW][C]44[/C][C]204.960652278393[/C][C]-158.96294017784[/C][C]-32.9961945461918[/C][C]442.917499102978[/C][C]568.884244734626[/C][/ROW]
[ROW][C]45[/C][C]204.960652278393[/C][C]-167.728758891445[/C][C]-38.7278553237938[/C][C]448.64915988058[/C][C]577.650063448232[/C][/ROW]
[ROW][C]46[/C][C]204.960652278393[/C][C]-176.293086391788[/C][C]-44.3277680785565[/C][C]454.249072635343[/C][C]586.214390948575[/C][/ROW]
[ROW][C]47[/C][C]204.960652278393[/C][C]-184.669209644254[/C][C]-49.8046206901678[/C][C]459.725925246954[/C][C]594.59051420104[/C][/ROW]
[ROW][C]48[/C][C]204.960652278393[/C][C]-192.869016491712[/C][C]-55.1661862012753[/C][C]465.087490758062[/C][C]602.790321048498[/C][/ROW]
[ROW][C]49[/C][C]204.960652278393[/C][C]-200.903193617742[/C][C]-60.4194522586833[/C][C]470.34075681547[/C][C]610.824498174528[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75923&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75923&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
26204.96065227839377.6260842593891121.701053489901288.220251066886332.295220297397
27204.96065227839354.3913716649274106.508691520352303.412613036434355.529932891859
28204.96065227839334.291017262884893.3657762141894316.555528342597375.630287293902
29204.96065227839316.320411692782681.6154288181103328.305875738676393.600892864004
30204.960652278393-0.081188378745110970.8909989740408339.030305582746410.002492935532
31204.960652278393-15.264624363361860.9630838133966348.95822074339425.185928920148
32204.960652278393-29.466710723044351.6768386824577358.244465874329439.388015279831
33204.960652278393-42.856224821771242.921905994686366.999398562101452.777529378558
34204.960652278393-55.558484499595234.6163448188313375.304959737955465.479789056382
35204.960652278393-67.669567395469226.6973333634805383.223971193306477.590871952256
36204.960652278393-79.265055093914419.1154514868688390.805853069918489.186359650701
37204.960652278393-90.405677527762711.8309900203026398.090314536484500.326982084549
38204.960652278393-101.1411034092034.81147233851374405.109832218273511.06240796599
39204.960652278393-111.512570738815-1.97006563774505411.891370194532521.433875295601
40204.960652278393-121.554763802945-8.53630274432021418.457607301107531.476068359732
41204.960652278393-131.297184791079-14.9065294260454424.827833982832541.218489347866
42204.960652278393-140.765177017756-21.0973167855944431.018621342381550.686481574542
43204.960652278393-149.98070216538-27.1230247952366437.044329352023559.902006722167
44204.960652278393-158.96294017784-32.9961945461918442.917499102978568.884244734626
45204.960652278393-167.728758891445-38.7278553237938448.64915988058577.650063448232
46204.960652278393-176.293086391788-44.3277680785565454.249072635343586.214390948575
47204.960652278393-184.669209644254-49.8046206901678459.725925246954594.59051420104
48204.960652278393-192.869016491712-55.1661862012753465.087490758062602.790321048498
49204.960652278393-200.903193617742-60.4194522586833470.34075681547610.824498174528







Actuals and Interpolation
TimeActualForecast
1341.25333.775928269088
2303.6875338.492504687478
3357.5316.528510995532
4295.075342.383916967292
5386.5755312.529223276755
6455.6625359.256754833345
7424.926420.094418776242
8506.751423.143429126151
9433.9475.904696528962
10466.3375449.397276177252
11496.7460.087548237949
12464.45483.19214675098
13385.375471.364755928644
14381.875417.100190422978
15219.6375394.871034955396
16268.975284.288425042335
17292.2875274.624758163045
18181.025285.770981350566
19277.625219.670140557742
20166.75256.243046627923
21266199.767699784603
22189.25241.56415512763
23226.35208.550863403060
24158.75219.783159661820
25218.8125181.267666104251

\begin{tabular}{lllllllll}
\hline
Actuals and Interpolation \tabularnewline
Time & Actual & Forecast \tabularnewline
1 & 341.25 & 333.775928269088 \tabularnewline
2 & 303.6875 & 338.492504687478 \tabularnewline
3 & 357.5 & 316.528510995532 \tabularnewline
4 & 295.075 & 342.383916967292 \tabularnewline
5 & 386.5755 & 312.529223276755 \tabularnewline
6 & 455.6625 & 359.256754833345 \tabularnewline
7 & 424.926 & 420.094418776242 \tabularnewline
8 & 506.751 & 423.143429126151 \tabularnewline
9 & 433.9 & 475.904696528962 \tabularnewline
10 & 466.3375 & 449.397276177252 \tabularnewline
11 & 496.7 & 460.087548237949 \tabularnewline
12 & 464.45 & 483.19214675098 \tabularnewline
13 & 385.375 & 471.364755928644 \tabularnewline
14 & 381.875 & 417.100190422978 \tabularnewline
15 & 219.6375 & 394.871034955396 \tabularnewline
16 & 268.975 & 284.288425042335 \tabularnewline
17 & 292.2875 & 274.624758163045 \tabularnewline
18 & 181.025 & 285.770981350566 \tabularnewline
19 & 277.625 & 219.670140557742 \tabularnewline
20 & 166.75 & 256.243046627923 \tabularnewline
21 & 266 & 199.767699784603 \tabularnewline
22 & 189.25 & 241.56415512763 \tabularnewline
23 & 226.35 & 208.550863403060 \tabularnewline
24 & 158.75 & 219.783159661820 \tabularnewline
25 & 218.8125 & 181.267666104251 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75923&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]341.25[/C][C]333.775928269088[/C][/ROW]
[ROW][C]2[/C][C]303.6875[/C][C]338.492504687478[/C][/ROW]
[ROW][C]3[/C][C]357.5[/C][C]316.528510995532[/C][/ROW]
[ROW][C]4[/C][C]295.075[/C][C]342.383916967292[/C][/ROW]
[ROW][C]5[/C][C]386.5755[/C][C]312.529223276755[/C][/ROW]
[ROW][C]6[/C][C]455.6625[/C][C]359.256754833345[/C][/ROW]
[ROW][C]7[/C][C]424.926[/C][C]420.094418776242[/C][/ROW]
[ROW][C]8[/C][C]506.751[/C][C]423.143429126151[/C][/ROW]
[ROW][C]9[/C][C]433.9[/C][C]475.904696528962[/C][/ROW]
[ROW][C]10[/C][C]466.3375[/C][C]449.397276177252[/C][/ROW]
[ROW][C]11[/C][C]496.7[/C][C]460.087548237949[/C][/ROW]
[ROW][C]12[/C][C]464.45[/C][C]483.19214675098[/C][/ROW]
[ROW][C]13[/C][C]385.375[/C][C]471.364755928644[/C][/ROW]
[ROW][C]14[/C][C]381.875[/C][C]417.100190422978[/C][/ROW]
[ROW][C]15[/C][C]219.6375[/C][C]394.871034955396[/C][/ROW]
[ROW][C]16[/C][C]268.975[/C][C]284.288425042335[/C][/ROW]
[ROW][C]17[/C][C]292.2875[/C][C]274.624758163045[/C][/ROW]
[ROW][C]18[/C][C]181.025[/C][C]285.770981350566[/C][/ROW]
[ROW][C]19[/C][C]277.625[/C][C]219.670140557742[/C][/ROW]
[ROW][C]20[/C][C]166.75[/C][C]256.243046627923[/C][/ROW]
[ROW][C]21[/C][C]266[/C][C]199.767699784603[/C][/ROW]
[ROW][C]22[/C][C]189.25[/C][C]241.56415512763[/C][/ROW]
[ROW][C]23[/C][C]226.35[/C][C]208.550863403060[/C][/ROW]
[ROW][C]24[/C][C]158.75[/C][C]219.783159661820[/C][/ROW]
[ROW][C]25[/C][C]218.8125[/C][C]181.267666104251[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75923&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75923&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
1341.25333.775928269088
2303.6875338.492504687478
3357.5316.528510995532
4295.075342.383916967292
5386.5755312.529223276755
6455.6625359.256754833345
7424.926420.094418776242
8506.751423.143429126151
9433.9475.904696528962
10466.3375449.397276177252
11496.7460.087548237949
12464.45483.19214675098
13385.375471.364755928644
14381.875417.100190422978
15219.6375394.871034955396
16268.975284.288425042335
17292.2875274.624758163045
18181.025285.770981350566
19277.625219.670140557742
20166.75256.243046627923
21266199.767699784603
22189.25241.56415512763
23226.35208.550863403060
24158.75219.783159661820
25218.8125181.267666104251







\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=75923&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=75923&T=3

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75923&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 = ETS ; 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