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:18:31 +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/t1273756746568zwbd4hrw17nj.htm/, Retrieved Sun, 05 May 2024 21:06:21 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=75928, Retrieved Sun, 05 May 2024 21:06:21 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsB58A,steven,coomans,thesis,ETS,per2maand
Estimated Impact111
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:18:31] [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 time6 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 & 6 seconds \tabularnewline
R Server & wessa.org @ wessa.org \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75928&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]6 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]wessa.org @ wessa.org[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75928&T=0

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







Demand Forecast
PointForecast95% LB80% LB80% UB95% UB
26379.125191407579136.732205394325220.632936880150537.617445935008621.518177420833
27379.12519140757963.4494309800173172.715906251576585.534476563582694.80095183514
28379.1251914075794.22785642823169133.993000024976624.257382790181754.022526386926
29379.125191407579-46.8382317025686100.602679740278657.64770307488805.088614517726
30379.125191407579-92.405999374973870.807517962013687.442864853144850.656382190131
31379.125191407579-133.94253310246143.6482383805321714.602144434625892.192915917618
32379.125191407579-172.35945569241718.528762881538739.72161993362930.609838507575
33379.125191407579-208.269175300262-4.9513407043961763.201723519554966.519558115419
34379.125191407579-242.106623693034-27.0764589738366785.3268417889941000.35700650819
35379.125191407579-274.193868582485-48.0571806842603806.3075634994181032.44425139764
36379.125191407579-304.777301788197-68.0546127869255826.3049956020831063.02768460335
37379.125191407579-334.050415475113-87.195273008106845.4456558232631092.30079829027
38379.125191407579-362.168456417352-105.580671757171863.8310545723281120.41883923251
39379.125191407579-389.258240453553-123.293729453996881.5441122691541147.50862326871
40379.125191407579-415.424948238616-140.403220032194898.6536028473521173.67533105377
41379.125191407579-440.756965042289-156.966935513307915.2173183284641199.00734785745
42379.125191407579-465.329411586557-173.033994697284931.284377512441223.57979440171
43379.125191407579-489.206774243278-188.646562956275946.8969457714331247.45715705844
44379.125191407579-512.444900410321-203.841156940963962.091539756121270.69528322548
45379.125191407579-535.092536859203-218.649650452012976.900033267171293.34291967436
46379.125191407579-557.192532834771-233.100061104667991.3504439198241315.44291564993
47379.125191407579-578.782793100052-247.217173491291005.467556306451337.03317591521
48379.125191407579-599.897041657927-261.0230385521181019.273421367281358.14742447308
49379.125191407579-620.565440182848-274.5373779460271032.787760761181378.81582299801

\begin{tabular}{lllllllll}
\hline
Demand Forecast \tabularnewline
Point & Forecast & 95% LB & 80% LB & 80% UB & 95% UB \tabularnewline
26 & 379.125191407579 & 136.732205394325 & 220.632936880150 & 537.617445935008 & 621.518177420833 \tabularnewline
27 & 379.125191407579 & 63.4494309800173 & 172.715906251576 & 585.534476563582 & 694.80095183514 \tabularnewline
28 & 379.125191407579 & 4.22785642823169 & 133.993000024976 & 624.257382790181 & 754.022526386926 \tabularnewline
29 & 379.125191407579 & -46.8382317025686 & 100.602679740278 & 657.64770307488 & 805.088614517726 \tabularnewline
30 & 379.125191407579 & -92.4059993749738 & 70.807517962013 & 687.442864853144 & 850.656382190131 \tabularnewline
31 & 379.125191407579 & -133.942533102461 & 43.6482383805321 & 714.602144434625 & 892.192915917618 \tabularnewline
32 & 379.125191407579 & -172.359455692417 & 18.528762881538 & 739.72161993362 & 930.609838507575 \tabularnewline
33 & 379.125191407579 & -208.269175300262 & -4.9513407043961 & 763.201723519554 & 966.519558115419 \tabularnewline
34 & 379.125191407579 & -242.106623693034 & -27.0764589738366 & 785.326841788994 & 1000.35700650819 \tabularnewline
35 & 379.125191407579 & -274.193868582485 & -48.0571806842603 & 806.307563499418 & 1032.44425139764 \tabularnewline
36 & 379.125191407579 & -304.777301788197 & -68.0546127869255 & 826.304995602083 & 1063.02768460335 \tabularnewline
37 & 379.125191407579 & -334.050415475113 & -87.195273008106 & 845.445655823263 & 1092.30079829027 \tabularnewline
38 & 379.125191407579 & -362.168456417352 & -105.580671757171 & 863.831054572328 & 1120.41883923251 \tabularnewline
39 & 379.125191407579 & -389.258240453553 & -123.293729453996 & 881.544112269154 & 1147.50862326871 \tabularnewline
40 & 379.125191407579 & -415.424948238616 & -140.403220032194 & 898.653602847352 & 1173.67533105377 \tabularnewline
41 & 379.125191407579 & -440.756965042289 & -156.966935513307 & 915.217318328464 & 1199.00734785745 \tabularnewline
42 & 379.125191407579 & -465.329411586557 & -173.033994697284 & 931.28437751244 & 1223.57979440171 \tabularnewline
43 & 379.125191407579 & -489.206774243278 & -188.646562956275 & 946.896945771433 & 1247.45715705844 \tabularnewline
44 & 379.125191407579 & -512.444900410321 & -203.841156940963 & 962.09153975612 & 1270.69528322548 \tabularnewline
45 & 379.125191407579 & -535.092536859203 & -218.649650452012 & 976.90003326717 & 1293.34291967436 \tabularnewline
46 & 379.125191407579 & -557.192532834771 & -233.100061104667 & 991.350443919824 & 1315.44291564993 \tabularnewline
47 & 379.125191407579 & -578.782793100052 & -247.21717349129 & 1005.46755630645 & 1337.03317591521 \tabularnewline
48 & 379.125191407579 & -599.897041657927 & -261.023038552118 & 1019.27342136728 & 1358.14742447308 \tabularnewline
49 & 379.125191407579 & -620.565440182848 & -274.537377946027 & 1032.78776076118 & 1378.81582299801 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75928&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]379.125191407579[/C][C]136.732205394325[/C][C]220.632936880150[/C][C]537.617445935008[/C][C]621.518177420833[/C][/ROW]
[ROW][C]27[/C][C]379.125191407579[/C][C]63.4494309800173[/C][C]172.715906251576[/C][C]585.534476563582[/C][C]694.80095183514[/C][/ROW]
[ROW][C]28[/C][C]379.125191407579[/C][C]4.22785642823169[/C][C]133.993000024976[/C][C]624.257382790181[/C][C]754.022526386926[/C][/ROW]
[ROW][C]29[/C][C]379.125191407579[/C][C]-46.8382317025686[/C][C]100.602679740278[/C][C]657.64770307488[/C][C]805.088614517726[/C][/ROW]
[ROW][C]30[/C][C]379.125191407579[/C][C]-92.4059993749738[/C][C]70.807517962013[/C][C]687.442864853144[/C][C]850.656382190131[/C][/ROW]
[ROW][C]31[/C][C]379.125191407579[/C][C]-133.942533102461[/C][C]43.6482383805321[/C][C]714.602144434625[/C][C]892.192915917618[/C][/ROW]
[ROW][C]32[/C][C]379.125191407579[/C][C]-172.359455692417[/C][C]18.528762881538[/C][C]739.72161993362[/C][C]930.609838507575[/C][/ROW]
[ROW][C]33[/C][C]379.125191407579[/C][C]-208.269175300262[/C][C]-4.9513407043961[/C][C]763.201723519554[/C][C]966.519558115419[/C][/ROW]
[ROW][C]34[/C][C]379.125191407579[/C][C]-242.106623693034[/C][C]-27.0764589738366[/C][C]785.326841788994[/C][C]1000.35700650819[/C][/ROW]
[ROW][C]35[/C][C]379.125191407579[/C][C]-274.193868582485[/C][C]-48.0571806842603[/C][C]806.307563499418[/C][C]1032.44425139764[/C][/ROW]
[ROW][C]36[/C][C]379.125191407579[/C][C]-304.777301788197[/C][C]-68.0546127869255[/C][C]826.304995602083[/C][C]1063.02768460335[/C][/ROW]
[ROW][C]37[/C][C]379.125191407579[/C][C]-334.050415475113[/C][C]-87.195273008106[/C][C]845.445655823263[/C][C]1092.30079829027[/C][/ROW]
[ROW][C]38[/C][C]379.125191407579[/C][C]-362.168456417352[/C][C]-105.580671757171[/C][C]863.831054572328[/C][C]1120.41883923251[/C][/ROW]
[ROW][C]39[/C][C]379.125191407579[/C][C]-389.258240453553[/C][C]-123.293729453996[/C][C]881.544112269154[/C][C]1147.50862326871[/C][/ROW]
[ROW][C]40[/C][C]379.125191407579[/C][C]-415.424948238616[/C][C]-140.403220032194[/C][C]898.653602847352[/C][C]1173.67533105377[/C][/ROW]
[ROW][C]41[/C][C]379.125191407579[/C][C]-440.756965042289[/C][C]-156.966935513307[/C][C]915.217318328464[/C][C]1199.00734785745[/C][/ROW]
[ROW][C]42[/C][C]379.125191407579[/C][C]-465.329411586557[/C][C]-173.033994697284[/C][C]931.28437751244[/C][C]1223.57979440171[/C][/ROW]
[ROW][C]43[/C][C]379.125191407579[/C][C]-489.206774243278[/C][C]-188.646562956275[/C][C]946.896945771433[/C][C]1247.45715705844[/C][/ROW]
[ROW][C]44[/C][C]379.125191407579[/C][C]-512.444900410321[/C][C]-203.841156940963[/C][C]962.09153975612[/C][C]1270.69528322548[/C][/ROW]
[ROW][C]45[/C][C]379.125191407579[/C][C]-535.092536859203[/C][C]-218.649650452012[/C][C]976.90003326717[/C][C]1293.34291967436[/C][/ROW]
[ROW][C]46[/C][C]379.125191407579[/C][C]-557.192532834771[/C][C]-233.100061104667[/C][C]991.350443919824[/C][C]1315.44291564993[/C][/ROW]
[ROW][C]47[/C][C]379.125191407579[/C][C]-578.782793100052[/C][C]-247.21717349129[/C][C]1005.46755630645[/C][C]1337.03317591521[/C][/ROW]
[ROW][C]48[/C][C]379.125191407579[/C][C]-599.897041657927[/C][C]-261.023038552118[/C][C]1019.27342136728[/C][C]1358.14742447308[/C][/ROW]
[ROW][C]49[/C][C]379.125191407579[/C][C]-620.565440182848[/C][C]-274.537377946027[/C][C]1032.78776076118[/C][C]1378.81582299801[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75928&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75928&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
26379.125191407579136.732205394325220.632936880150537.617445935008621.518177420833
27379.12519140757963.4494309800173172.715906251576585.534476563582694.80095183514
28379.1251914075794.22785642823169133.993000024976624.257382790181754.022526386926
29379.125191407579-46.8382317025686100.602679740278657.64770307488805.088614517726
30379.125191407579-92.405999374973870.807517962013687.442864853144850.656382190131
31379.125191407579-133.94253310246143.6482383805321714.602144434625892.192915917618
32379.125191407579-172.35945569241718.528762881538739.72161993362930.609838507575
33379.125191407579-208.269175300262-4.9513407043961763.201723519554966.519558115419
34379.125191407579-242.106623693034-27.0764589738366785.3268417889941000.35700650819
35379.125191407579-274.193868582485-48.0571806842603806.3075634994181032.44425139764
36379.125191407579-304.777301788197-68.0546127869255826.3049956020831063.02768460335
37379.125191407579-334.050415475113-87.195273008106845.4456558232631092.30079829027
38379.125191407579-362.168456417352-105.580671757171863.8310545723281120.41883923251
39379.125191407579-389.258240453553-123.293729453996881.5441122691541147.50862326871
40379.125191407579-415.424948238616-140.403220032194898.6536028473521173.67533105377
41379.125191407579-440.756965042289-156.966935513307915.2173183284641199.00734785745
42379.125191407579-465.329411586557-173.033994697284931.284377512441223.57979440171
43379.125191407579-489.206774243278-188.646562956275946.8969457714331247.45715705844
44379.125191407579-512.444900410321-203.841156940963962.091539756121270.69528322548
45379.125191407579-535.092536859203-218.649650452012976.900033267171293.34291967436
46379.125191407579-557.192532834771-233.100061104667991.3504439198241315.44291564993
47379.125191407579-578.782793100052-247.217173491291005.467556306451337.03317591521
48379.125191407579-599.897041657927-261.0230385521181019.273421367281358.14742447308
49379.125191407579-620.565440182848-274.5373779460271032.787760761181378.81582299801







Actuals and Interpolation
TimeActualForecast
1719.625712.710818344606
2689.5125718.479353436485
3640.5694.312167950503
4541.3875649.416416773587
5521.3875559.287370647071
6613.325527.667325831681
7683599.131936389492
8728.6375669.103466230299
9452.5375718.772997648195
10380.425496.65143830366
11377.125399.683160440186
12316.75380.862778420582
13387.2625327.373178264001
14409.75377.339128145203
15497.875404.379674802946
16616.4482.383275403329
17715.5125594.194074897074
18454.925695.410621898232
19464.25494.772308045129
20247.675469.307399279518
21292.5125284.398419958176
22416.525291.168036059174
23481.6625395.75395548464
24219.7625467.427868382560
25402.625260.799457420375

\begin{tabular}{lllllllll}
\hline
Actuals and Interpolation \tabularnewline
Time & Actual & Forecast \tabularnewline
1 & 719.625 & 712.710818344606 \tabularnewline
2 & 689.5125 & 718.479353436485 \tabularnewline
3 & 640.5 & 694.312167950503 \tabularnewline
4 & 541.3875 & 649.416416773587 \tabularnewline
5 & 521.3875 & 559.287370647071 \tabularnewline
6 & 613.325 & 527.667325831681 \tabularnewline
7 & 683 & 599.131936389492 \tabularnewline
8 & 728.6375 & 669.103466230299 \tabularnewline
9 & 452.5375 & 718.772997648195 \tabularnewline
10 & 380.425 & 496.65143830366 \tabularnewline
11 & 377.125 & 399.683160440186 \tabularnewline
12 & 316.75 & 380.862778420582 \tabularnewline
13 & 387.2625 & 327.373178264001 \tabularnewline
14 & 409.75 & 377.339128145203 \tabularnewline
15 & 497.875 & 404.379674802946 \tabularnewline
16 & 616.4 & 482.383275403329 \tabularnewline
17 & 715.5125 & 594.194074897074 \tabularnewline
18 & 454.925 & 695.410621898232 \tabularnewline
19 & 464.25 & 494.772308045129 \tabularnewline
20 & 247.675 & 469.307399279518 \tabularnewline
21 & 292.5125 & 284.398419958176 \tabularnewline
22 & 416.525 & 291.168036059174 \tabularnewline
23 & 481.6625 & 395.75395548464 \tabularnewline
24 & 219.7625 & 467.427868382560 \tabularnewline
25 & 402.625 & 260.799457420375 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75928&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]712.710818344606[/C][/ROW]
[ROW][C]2[/C][C]689.5125[/C][C]718.479353436485[/C][/ROW]
[ROW][C]3[/C][C]640.5[/C][C]694.312167950503[/C][/ROW]
[ROW][C]4[/C][C]541.3875[/C][C]649.416416773587[/C][/ROW]
[ROW][C]5[/C][C]521.3875[/C][C]559.287370647071[/C][/ROW]
[ROW][C]6[/C][C]613.325[/C][C]527.667325831681[/C][/ROW]
[ROW][C]7[/C][C]683[/C][C]599.131936389492[/C][/ROW]
[ROW][C]8[/C][C]728.6375[/C][C]669.103466230299[/C][/ROW]
[ROW][C]9[/C][C]452.5375[/C][C]718.772997648195[/C][/ROW]
[ROW][C]10[/C][C]380.425[/C][C]496.65143830366[/C][/ROW]
[ROW][C]11[/C][C]377.125[/C][C]399.683160440186[/C][/ROW]
[ROW][C]12[/C][C]316.75[/C][C]380.862778420582[/C][/ROW]
[ROW][C]13[/C][C]387.2625[/C][C]327.373178264001[/C][/ROW]
[ROW][C]14[/C][C]409.75[/C][C]377.339128145203[/C][/ROW]
[ROW][C]15[/C][C]497.875[/C][C]404.379674802946[/C][/ROW]
[ROW][C]16[/C][C]616.4[/C][C]482.383275403329[/C][/ROW]
[ROW][C]17[/C][C]715.5125[/C][C]594.194074897074[/C][/ROW]
[ROW][C]18[/C][C]454.925[/C][C]695.410621898232[/C][/ROW]
[ROW][C]19[/C][C]464.25[/C][C]494.772308045129[/C][/ROW]
[ROW][C]20[/C][C]247.675[/C][C]469.307399279518[/C][/ROW]
[ROW][C]21[/C][C]292.5125[/C][C]284.398419958176[/C][/ROW]
[ROW][C]22[/C][C]416.525[/C][C]291.168036059174[/C][/ROW]
[ROW][C]23[/C][C]481.6625[/C][C]395.75395548464[/C][/ROW]
[ROW][C]24[/C][C]219.7625[/C][C]467.427868382560[/C][/ROW]
[ROW][C]25[/C][C]402.625[/C][C]260.799457420375[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75928&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75928&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.625712.710818344606
2689.5125718.479353436485
3640.5694.312167950503
4541.3875649.416416773587
5521.3875559.287370647071
6613.325527.667325831681
7683599.131936389492
8728.6375669.103466230299
9452.5375718.772997648195
10380.425496.65143830366
11377.125399.683160440186
12316.75380.862778420582
13387.2625327.373178264001
14409.75377.339128145203
15497.875404.379674802946
16616.4482.383275403329
17715.5125594.194074897074
18454.925695.410621898232
19464.25494.772308045129
20247.675469.307399279518
21292.5125284.398419958176
22416.525291.168036059174
23481.6625395.75395548464
24219.7625467.427868382560
25402.625260.799457420375







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

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