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:22:33 +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/t1273756979jheviml8ejowe31.htm/, Retrieved Sun, 05 May 2024 21:02:50 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=75931, Retrieved Sun, 05 May 2024 21:02:50 +0000
QR Codes:

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

Post a new message
Dataseries X:
22.325
94.125
12.275
7.125
18.925
38.025
28.138
2.386
13.225
26.25
31.975
31.275
34.4875
52.1375
15.675
48.9
16.5
37
54.125
34.4875
44.4875
40.2
52.13
49.575
44.3625




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

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







Demand Forecast
PointForecast95% LB80% LB80% UB95% UB
26102.01124841284129.517181560318654.6099259393838149.412570886298174.505315265363
2719.42308595098925.1314685801110110.07829963844328.767872263535333.7147033218673
2859.830659723683114.339505950546730.08559308151589.5757263658511105.321813496819
2925.38873487860015.476680037561212.368942037492538.408527719707745.300789719639
3046.84307584452119.0068143693811122.103274240871071.582877448171284.679337319661
3156.54967664736849.5745797599948325.834311756747687.2650415379892103.524773534742
3232.78130659688314.811721030247914.492977600385451.069635593380760.7508921635182
3334.41519673902464.2898743544396114.71730720175354.113086276296364.5405191236097
3444.63354534522734.592171791081718.451898452917970.815192237536784.6749188993728
3550.34805774977584.1014265194385220.109010949989480.587104549562396.5946889801132
3645.43262924261662.7419485432833617.518693519336473.346564965896788.1233099419498
3743.98805090639751.7390859447903816.362937579688871.613164233106286.2370158680045
38102.0115875819071.9357464849427536.5755123057051167.447662858108202.087428678870
3919.4231505292589-0.02550245447296726.7063598761468132.139941182370938.8718035129907
4059.8308586498727-1.2782014283989719.873791974157199.7879253255883120.939918728144
4125.3888192915802-1.045794111320088.104154645559642.673483937600951.8234326944805
4246.8432315893287-2.8485125230975714.351546556215279.334916622442296.534975701755
4356.5498646648791-4.5370725203613116.607263371396296.492465958362117.636801850119
4432.7814155888354-3.260718076402659.21473110453256.348100073138868.8235492540735
4534.4153111633680-4.079306069450039.2450338680252159.585588458710972.9099283961861
4644.6336937437432-6.1340564695326211.438446138074177.828941349412295.401443957019
4750.3482251480183-7.8631779393061312.285834539032288.4106157570045108.559628235343
4845.4327802979428-7.9405043552384510.533865294872680.33169530101398.806064951124
4943.9881971587604-8.50009867537179.6679452410775178.308449076443296.4764929928924

\begin{tabular}{lllllllll}
\hline
Demand Forecast \tabularnewline
Point & Forecast & 95% LB & 80% LB & 80% UB & 95% UB \tabularnewline
26 & 102.011248412841 & 29.5171815603186 & 54.6099259393838 & 149.412570886298 & 174.505315265363 \tabularnewline
27 & 19.4230859509892 & 5.13146858011101 & 10.078299638443 & 28.7678722635353 & 33.7147033218673 \tabularnewline
28 & 59.8306597236831 & 14.3395059505467 & 30.085593081515 & 89.5757263658511 & 105.321813496819 \tabularnewline
29 & 25.3887348786001 & 5.4766800375612 & 12.3689420374925 & 38.4085277197077 & 45.300789719639 \tabularnewline
30 & 46.8430758445211 & 9.00681436938111 & 22.1032742408710 & 71.5828774481712 & 84.679337319661 \tabularnewline
31 & 56.5496766473684 & 9.57457975999483 & 25.8343117567476 & 87.2650415379892 & 103.524773534742 \tabularnewline
32 & 32.7813065968831 & 4.8117210302479 & 14.4929776003854 & 51.0696355933807 & 60.7508921635182 \tabularnewline
33 & 34.4151967390246 & 4.28987435443961 & 14.717307201753 & 54.1130862762963 & 64.5405191236097 \tabularnewline
34 & 44.6335453452273 & 4.5921717910817 & 18.4518984529179 & 70.8151922375367 & 84.6749188993728 \tabularnewline
35 & 50.3480577497758 & 4.10142651943852 & 20.1090109499894 & 80.5871045495623 & 96.5946889801132 \tabularnewline
36 & 45.4326292426166 & 2.74194854328336 & 17.5186935193364 & 73.3465649658967 & 88.1233099419498 \tabularnewline
37 & 43.9880509063975 & 1.73908594479038 & 16.3629375796888 & 71.6131642331062 & 86.2370158680045 \tabularnewline
38 & 102.011587581907 & 1.93574648494275 & 36.5755123057051 & 167.447662858108 & 202.087428678870 \tabularnewline
39 & 19.4231505292589 & -0.0255024544729672 & 6.70635987614681 & 32.1399411823709 & 38.8718035129907 \tabularnewline
40 & 59.8308586498727 & -1.27820142839897 & 19.8737919741571 & 99.7879253255883 & 120.939918728144 \tabularnewline
41 & 25.3888192915802 & -1.04579411132008 & 8.1041546455596 & 42.6734839376009 & 51.8234326944805 \tabularnewline
42 & 46.8432315893287 & -2.84851252309757 & 14.3515465562152 & 79.3349166224422 & 96.534975701755 \tabularnewline
43 & 56.5498646648791 & -4.53707252036131 & 16.6072633713962 & 96.492465958362 & 117.636801850119 \tabularnewline
44 & 32.7814155888354 & -3.26071807640265 & 9.214731104532 & 56.3481000731388 & 68.8235492540735 \tabularnewline
45 & 34.4153111633680 & -4.07930606945003 & 9.24503386802521 & 59.5855884587109 & 72.9099283961861 \tabularnewline
46 & 44.6336937437432 & -6.13405646953262 & 11.4384461380741 & 77.8289413494122 & 95.401443957019 \tabularnewline
47 & 50.3482251480183 & -7.86317793930613 & 12.2858345390322 & 88.4106157570045 & 108.559628235343 \tabularnewline
48 & 45.4327802979428 & -7.94050435523845 & 10.5338652948726 & 80.331695301013 & 98.806064951124 \tabularnewline
49 & 43.9881971587604 & -8.5000986753717 & 9.66794524107751 & 78.3084490764432 & 96.4764929928924 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75931&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]102.011248412841[/C][C]29.5171815603186[/C][C]54.6099259393838[/C][C]149.412570886298[/C][C]174.505315265363[/C][/ROW]
[ROW][C]27[/C][C]19.4230859509892[/C][C]5.13146858011101[/C][C]10.078299638443[/C][C]28.7678722635353[/C][C]33.7147033218673[/C][/ROW]
[ROW][C]28[/C][C]59.8306597236831[/C][C]14.3395059505467[/C][C]30.085593081515[/C][C]89.5757263658511[/C][C]105.321813496819[/C][/ROW]
[ROW][C]29[/C][C]25.3887348786001[/C][C]5.4766800375612[/C][C]12.3689420374925[/C][C]38.4085277197077[/C][C]45.300789719639[/C][/ROW]
[ROW][C]30[/C][C]46.8430758445211[/C][C]9.00681436938111[/C][C]22.1032742408710[/C][C]71.5828774481712[/C][C]84.679337319661[/C][/ROW]
[ROW][C]31[/C][C]56.5496766473684[/C][C]9.57457975999483[/C][C]25.8343117567476[/C][C]87.2650415379892[/C][C]103.524773534742[/C][/ROW]
[ROW][C]32[/C][C]32.7813065968831[/C][C]4.8117210302479[/C][C]14.4929776003854[/C][C]51.0696355933807[/C][C]60.7508921635182[/C][/ROW]
[ROW][C]33[/C][C]34.4151967390246[/C][C]4.28987435443961[/C][C]14.717307201753[/C][C]54.1130862762963[/C][C]64.5405191236097[/C][/ROW]
[ROW][C]34[/C][C]44.6335453452273[/C][C]4.5921717910817[/C][C]18.4518984529179[/C][C]70.8151922375367[/C][C]84.6749188993728[/C][/ROW]
[ROW][C]35[/C][C]50.3480577497758[/C][C]4.10142651943852[/C][C]20.1090109499894[/C][C]80.5871045495623[/C][C]96.5946889801132[/C][/ROW]
[ROW][C]36[/C][C]45.4326292426166[/C][C]2.74194854328336[/C][C]17.5186935193364[/C][C]73.3465649658967[/C][C]88.1233099419498[/C][/ROW]
[ROW][C]37[/C][C]43.9880509063975[/C][C]1.73908594479038[/C][C]16.3629375796888[/C][C]71.6131642331062[/C][C]86.2370158680045[/C][/ROW]
[ROW][C]38[/C][C]102.011587581907[/C][C]1.93574648494275[/C][C]36.5755123057051[/C][C]167.447662858108[/C][C]202.087428678870[/C][/ROW]
[ROW][C]39[/C][C]19.4231505292589[/C][C]-0.0255024544729672[/C][C]6.70635987614681[/C][C]32.1399411823709[/C][C]38.8718035129907[/C][/ROW]
[ROW][C]40[/C][C]59.8308586498727[/C][C]-1.27820142839897[/C][C]19.8737919741571[/C][C]99.7879253255883[/C][C]120.939918728144[/C][/ROW]
[ROW][C]41[/C][C]25.3888192915802[/C][C]-1.04579411132008[/C][C]8.1041546455596[/C][C]42.6734839376009[/C][C]51.8234326944805[/C][/ROW]
[ROW][C]42[/C][C]46.8432315893287[/C][C]-2.84851252309757[/C][C]14.3515465562152[/C][C]79.3349166224422[/C][C]96.534975701755[/C][/ROW]
[ROW][C]43[/C][C]56.5498646648791[/C][C]-4.53707252036131[/C][C]16.6072633713962[/C][C]96.492465958362[/C][C]117.636801850119[/C][/ROW]
[ROW][C]44[/C][C]32.7814155888354[/C][C]-3.26071807640265[/C][C]9.214731104532[/C][C]56.3481000731388[/C][C]68.8235492540735[/C][/ROW]
[ROW][C]45[/C][C]34.4153111633680[/C][C]-4.07930606945003[/C][C]9.24503386802521[/C][C]59.5855884587109[/C][C]72.9099283961861[/C][/ROW]
[ROW][C]46[/C][C]44.6336937437432[/C][C]-6.13405646953262[/C][C]11.4384461380741[/C][C]77.8289413494122[/C][C]95.401443957019[/C][/ROW]
[ROW][C]47[/C][C]50.3482251480183[/C][C]-7.86317793930613[/C][C]12.2858345390322[/C][C]88.4106157570045[/C][C]108.559628235343[/C][/ROW]
[ROW][C]48[/C][C]45.4327802979428[/C][C]-7.94050435523845[/C][C]10.5338652948726[/C][C]80.331695301013[/C][C]98.806064951124[/C][/ROW]
[ROW][C]49[/C][C]43.9881971587604[/C][C]-8.5000986753717[/C][C]9.66794524107751[/C][C]78.3084490764432[/C][C]96.4764929928924[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75931&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75931&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
26102.01124841284129.517181560318654.6099259393838149.412570886298174.505315265363
2719.42308595098925.1314685801110110.07829963844328.767872263535333.7147033218673
2859.830659723683114.339505950546730.08559308151589.5757263658511105.321813496819
2925.38873487860015.476680037561212.368942037492538.408527719707745.300789719639
3046.84307584452119.0068143693811122.103274240871071.582877448171284.679337319661
3156.54967664736849.5745797599948325.834311756747687.2650415379892103.524773534742
3232.78130659688314.811721030247914.492977600385451.069635593380760.7508921635182
3334.41519673902464.2898743544396114.71730720175354.113086276296364.5405191236097
3444.63354534522734.592171791081718.451898452917970.815192237536784.6749188993728
3550.34805774977584.1014265194385220.109010949989480.587104549562396.5946889801132
3645.43262924261662.7419485432833617.518693519336473.346564965896788.1233099419498
3743.98805090639751.7390859447903816.362937579688871.613164233106286.2370158680045
38102.0115875819071.9357464849427536.5755123057051167.447662858108202.087428678870
3919.4231505292589-0.02550245447296726.7063598761468132.139941182370938.8718035129907
4059.8308586498727-1.2782014283989719.873791974157199.7879253255883120.939918728144
4125.3888192915802-1.045794111320088.104154645559642.673483937600951.8234326944805
4246.8432315893287-2.8485125230975714.351546556215279.334916622442296.534975701755
4356.5498646648791-4.5370725203613116.607263371396296.492465958362117.636801850119
4432.7814155888354-3.260718076402659.21473110453256.348100073138868.8235492540735
4534.4153111633680-4.079306069450039.2450338680252159.585588458710972.9099283961861
4644.6336937437432-6.1340564695326211.438446138074177.828941349412295.401443957019
4750.3482251480183-7.8631779393061312.285834539032288.4106157570045108.559628235343
4845.4327802979428-7.9405043552384510.533865294872680.33169530101398.806064951124
4943.9881971587604-8.50009867537179.6679452410775178.308449076443296.4764929928924







Actuals and Interpolation
TimeActualForecast
122.32522.6302772146684
294.12593.756538256208
312.27512.4174361918487
47.1257.957394580737
518.92518.5967972646909
638.02537.6891879612587
728.13828.3831854617570
82.3863.268311761931
913.22513.4256098558079
1026.2525.9613378599121
1131.97531.677913672259
1231.27530.9670977340054
1334.487534.1052947012212
1452.137552.3157623512095
1515.67515.3162678731622
1648.948.638206172574
1716.516.5588725982834
183736.8388933781173
1954.12553.7729755226329
2034.487534.1226326563131
2144.487543.9518330273531
2240.240.2574947399717
2352.1352.0305427112002
2449.57549.4446735915632
2544.362544.3510798393309

\begin{tabular}{lllllllll}
\hline
Actuals and Interpolation \tabularnewline
Time & Actual & Forecast \tabularnewline
1 & 22.325 & 22.6302772146684 \tabularnewline
2 & 94.125 & 93.756538256208 \tabularnewline
3 & 12.275 & 12.4174361918487 \tabularnewline
4 & 7.125 & 7.957394580737 \tabularnewline
5 & 18.925 & 18.5967972646909 \tabularnewline
6 & 38.025 & 37.6891879612587 \tabularnewline
7 & 28.138 & 28.3831854617570 \tabularnewline
8 & 2.386 & 3.268311761931 \tabularnewline
9 & 13.225 & 13.4256098558079 \tabularnewline
10 & 26.25 & 25.9613378599121 \tabularnewline
11 & 31.975 & 31.677913672259 \tabularnewline
12 & 31.275 & 30.9670977340054 \tabularnewline
13 & 34.4875 & 34.1052947012212 \tabularnewline
14 & 52.1375 & 52.3157623512095 \tabularnewline
15 & 15.675 & 15.3162678731622 \tabularnewline
16 & 48.9 & 48.638206172574 \tabularnewline
17 & 16.5 & 16.5588725982834 \tabularnewline
18 & 37 & 36.8388933781173 \tabularnewline
19 & 54.125 & 53.7729755226329 \tabularnewline
20 & 34.4875 & 34.1226326563131 \tabularnewline
21 & 44.4875 & 43.9518330273531 \tabularnewline
22 & 40.2 & 40.2574947399717 \tabularnewline
23 & 52.13 & 52.0305427112002 \tabularnewline
24 & 49.575 & 49.4446735915632 \tabularnewline
25 & 44.3625 & 44.3510798393309 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75931&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]22.325[/C][C]22.6302772146684[/C][/ROW]
[ROW][C]2[/C][C]94.125[/C][C]93.756538256208[/C][/ROW]
[ROW][C]3[/C][C]12.275[/C][C]12.4174361918487[/C][/ROW]
[ROW][C]4[/C][C]7.125[/C][C]7.957394580737[/C][/ROW]
[ROW][C]5[/C][C]18.925[/C][C]18.5967972646909[/C][/ROW]
[ROW][C]6[/C][C]38.025[/C][C]37.6891879612587[/C][/ROW]
[ROW][C]7[/C][C]28.138[/C][C]28.3831854617570[/C][/ROW]
[ROW][C]8[/C][C]2.386[/C][C]3.268311761931[/C][/ROW]
[ROW][C]9[/C][C]13.225[/C][C]13.4256098558079[/C][/ROW]
[ROW][C]10[/C][C]26.25[/C][C]25.9613378599121[/C][/ROW]
[ROW][C]11[/C][C]31.975[/C][C]31.677913672259[/C][/ROW]
[ROW][C]12[/C][C]31.275[/C][C]30.9670977340054[/C][/ROW]
[ROW][C]13[/C][C]34.4875[/C][C]34.1052947012212[/C][/ROW]
[ROW][C]14[/C][C]52.1375[/C][C]52.3157623512095[/C][/ROW]
[ROW][C]15[/C][C]15.675[/C][C]15.3162678731622[/C][/ROW]
[ROW][C]16[/C][C]48.9[/C][C]48.638206172574[/C][/ROW]
[ROW][C]17[/C][C]16.5[/C][C]16.5588725982834[/C][/ROW]
[ROW][C]18[/C][C]37[/C][C]36.8388933781173[/C][/ROW]
[ROW][C]19[/C][C]54.125[/C][C]53.7729755226329[/C][/ROW]
[ROW][C]20[/C][C]34.4875[/C][C]34.1226326563131[/C][/ROW]
[ROW][C]21[/C][C]44.4875[/C][C]43.9518330273531[/C][/ROW]
[ROW][C]22[/C][C]40.2[/C][C]40.2574947399717[/C][/ROW]
[ROW][C]23[/C][C]52.13[/C][C]52.0305427112002[/C][/ROW]
[ROW][C]24[/C][C]49.575[/C][C]49.4446735915632[/C][/ROW]
[ROW][C]25[/C][C]44.3625[/C][C]44.3510798393309[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75931&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75931&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
122.32522.6302772146684
294.12593.756538256208
312.27512.4174361918487
47.1257.957394580737
518.92518.5967972646909
638.02537.6891879612587
728.13828.3831854617570
82.3863.268311761931
913.22513.4256098558079
1026.2525.9613378599121
1131.97531.677913672259
1231.27530.9670977340054
1334.487534.1052947012212
1452.137552.3157623512095
1515.67515.3162678731622
1648.948.638206172574
1716.516.5588725982834
183736.8388933781173
1954.12553.7729755226329
2034.487534.1226326563131
2144.487543.9518330273531
2240.240.2574947399717
2352.1352.0305427112002
2449.57549.4446735915632
2544.362544.3510798393309







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

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