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 12:59:02 +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/t1273755582dfw9am7ejrtwpvf.htm/, Retrieved Mon, 06 May 2024 08:09:17 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=75913, Retrieved Mon, 06 May 2024 08:09:17 +0000
QR Codes:

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

Post a new message
Dataseries X:
250.75
314.5125
449.3885
305.7
162.375
352.025
379.125
327.125
423.6625
152.25
183.8125
153.8875
245.625
108.9
291.625
284.875
192.25
45.2625
205.375
301.25
165.375
281.6375
140.5875
331.75
232.625




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=75913&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=75913&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75913&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
26232.83646817647864.7636642943782122.939568723439342.733367629517400.909272058578
27232.83646817647863.2695578151926121.962625007843343.710311345113402.403378537764
28232.83646817647861.7853564624555120.992157906311344.680778446645403.887579890501
29232.83646817647860.3107979490923120.027995918543345.644940434413405.362138403864
30232.83646817647858.8456304981384119.069974416431346.602961936525406.827305854818
31232.83646817647857.3896122643942118.117935265898347.555001087058408.283324088562
32232.83646817647855.9425107962774117.171726475025348.501209877931409.730425556679
33232.83646817647854.5041025345123116.231201866258349.441734486699411.168833818444
34232.83646817647853.0741723446241115.296220770725350.376715582232412.598764008332
35232.83646817647851.6525130804954114.366647742860351.306288610097414.020423272461
36232.83646817647850.2389251765027113.442352293716352.230584059241415.434011176454
37232.83646817647848.8332162659791112.523208641490353.149727711467416.839720086977
38232.83646817647847.4352008239589111.609095477927354.063840875029418.237735528998
39232.83646817647846.0446998323435110.699895749385354.973040603571419.628236520613
40232.83646817647844.6615404657945109.795496451449355.877439901508421.011395887162
41232.83646817647843.2855557968074108.895788436090356.777147916867422.387380556149
42232.83646817647841.9165845185576108.000666230445357.672270122512423.756351834399
43232.83646817647840.5544706842257107.110027866369358.562908486588425.118465668731
44232.83646817647839.1990634616242106.223774719996359.44916163296426.473872891332
45232.83646817647837.8502169020409105.341811360594360.331124992363427.822719450916
46232.83646817647836.5077897223076104.464045408062361.208890944894429.165146630649
47232.83646817647835.1716450991825103.590387398493362.082548954463430.501291253774
48232.83646817647833.8416504752047102.720750657222362.952185695734431.831285877752
49232.83646817647832.5176773752532101.855051178882363.817885174075433.155258977703

\begin{tabular}{lllllllll}
\hline
Demand Forecast \tabularnewline
Point & Forecast & 95% LB & 80% LB & 80% UB & 95% UB \tabularnewline
26 & 232.836468176478 & 64.7636642943782 & 122.939568723439 & 342.733367629517 & 400.909272058578 \tabularnewline
27 & 232.836468176478 & 63.2695578151926 & 121.962625007843 & 343.710311345113 & 402.403378537764 \tabularnewline
28 & 232.836468176478 & 61.7853564624555 & 120.992157906311 & 344.680778446645 & 403.887579890501 \tabularnewline
29 & 232.836468176478 & 60.3107979490923 & 120.027995918543 & 345.644940434413 & 405.362138403864 \tabularnewline
30 & 232.836468176478 & 58.8456304981384 & 119.069974416431 & 346.602961936525 & 406.827305854818 \tabularnewline
31 & 232.836468176478 & 57.3896122643942 & 118.117935265898 & 347.555001087058 & 408.283324088562 \tabularnewline
32 & 232.836468176478 & 55.9425107962774 & 117.171726475025 & 348.501209877931 & 409.730425556679 \tabularnewline
33 & 232.836468176478 & 54.5041025345123 & 116.231201866258 & 349.441734486699 & 411.168833818444 \tabularnewline
34 & 232.836468176478 & 53.0741723446241 & 115.296220770725 & 350.376715582232 & 412.598764008332 \tabularnewline
35 & 232.836468176478 & 51.6525130804954 & 114.366647742860 & 351.306288610097 & 414.020423272461 \tabularnewline
36 & 232.836468176478 & 50.2389251765027 & 113.442352293716 & 352.230584059241 & 415.434011176454 \tabularnewline
37 & 232.836468176478 & 48.8332162659791 & 112.523208641490 & 353.149727711467 & 416.839720086977 \tabularnewline
38 & 232.836468176478 & 47.4352008239589 & 111.609095477927 & 354.063840875029 & 418.237735528998 \tabularnewline
39 & 232.836468176478 & 46.0446998323435 & 110.699895749385 & 354.973040603571 & 419.628236520613 \tabularnewline
40 & 232.836468176478 & 44.6615404657945 & 109.795496451449 & 355.877439901508 & 421.011395887162 \tabularnewline
41 & 232.836468176478 & 43.2855557968074 & 108.895788436090 & 356.777147916867 & 422.387380556149 \tabularnewline
42 & 232.836468176478 & 41.9165845185576 & 108.000666230445 & 357.672270122512 & 423.756351834399 \tabularnewline
43 & 232.836468176478 & 40.5544706842257 & 107.110027866369 & 358.562908486588 & 425.118465668731 \tabularnewline
44 & 232.836468176478 & 39.1990634616242 & 106.223774719996 & 359.44916163296 & 426.473872891332 \tabularnewline
45 & 232.836468176478 & 37.8502169020409 & 105.341811360594 & 360.331124992363 & 427.822719450916 \tabularnewline
46 & 232.836468176478 & 36.5077897223076 & 104.464045408062 & 361.208890944894 & 429.165146630649 \tabularnewline
47 & 232.836468176478 & 35.1716450991825 & 103.590387398493 & 362.082548954463 & 430.501291253774 \tabularnewline
48 & 232.836468176478 & 33.8416504752047 & 102.720750657222 & 362.952185695734 & 431.831285877752 \tabularnewline
49 & 232.836468176478 & 32.5176773752532 & 101.855051178882 & 363.817885174075 & 433.155258977703 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75913&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]232.836468176478[/C][C]64.7636642943782[/C][C]122.939568723439[/C][C]342.733367629517[/C][C]400.909272058578[/C][/ROW]
[ROW][C]27[/C][C]232.836468176478[/C][C]63.2695578151926[/C][C]121.962625007843[/C][C]343.710311345113[/C][C]402.403378537764[/C][/ROW]
[ROW][C]28[/C][C]232.836468176478[/C][C]61.7853564624555[/C][C]120.992157906311[/C][C]344.680778446645[/C][C]403.887579890501[/C][/ROW]
[ROW][C]29[/C][C]232.836468176478[/C][C]60.3107979490923[/C][C]120.027995918543[/C][C]345.644940434413[/C][C]405.362138403864[/C][/ROW]
[ROW][C]30[/C][C]232.836468176478[/C][C]58.8456304981384[/C][C]119.069974416431[/C][C]346.602961936525[/C][C]406.827305854818[/C][/ROW]
[ROW][C]31[/C][C]232.836468176478[/C][C]57.3896122643942[/C][C]118.117935265898[/C][C]347.555001087058[/C][C]408.283324088562[/C][/ROW]
[ROW][C]32[/C][C]232.836468176478[/C][C]55.9425107962774[/C][C]117.171726475025[/C][C]348.501209877931[/C][C]409.730425556679[/C][/ROW]
[ROW][C]33[/C][C]232.836468176478[/C][C]54.5041025345123[/C][C]116.231201866258[/C][C]349.441734486699[/C][C]411.168833818444[/C][/ROW]
[ROW][C]34[/C][C]232.836468176478[/C][C]53.0741723446241[/C][C]115.296220770725[/C][C]350.376715582232[/C][C]412.598764008332[/C][/ROW]
[ROW][C]35[/C][C]232.836468176478[/C][C]51.6525130804954[/C][C]114.366647742860[/C][C]351.306288610097[/C][C]414.020423272461[/C][/ROW]
[ROW][C]36[/C][C]232.836468176478[/C][C]50.2389251765027[/C][C]113.442352293716[/C][C]352.230584059241[/C][C]415.434011176454[/C][/ROW]
[ROW][C]37[/C][C]232.836468176478[/C][C]48.8332162659791[/C][C]112.523208641490[/C][C]353.149727711467[/C][C]416.839720086977[/C][/ROW]
[ROW][C]38[/C][C]232.836468176478[/C][C]47.4352008239589[/C][C]111.609095477927[/C][C]354.063840875029[/C][C]418.237735528998[/C][/ROW]
[ROW][C]39[/C][C]232.836468176478[/C][C]46.0446998323435[/C][C]110.699895749385[/C][C]354.973040603571[/C][C]419.628236520613[/C][/ROW]
[ROW][C]40[/C][C]232.836468176478[/C][C]44.6615404657945[/C][C]109.795496451449[/C][C]355.877439901508[/C][C]421.011395887162[/C][/ROW]
[ROW][C]41[/C][C]232.836468176478[/C][C]43.2855557968074[/C][C]108.895788436090[/C][C]356.777147916867[/C][C]422.387380556149[/C][/ROW]
[ROW][C]42[/C][C]232.836468176478[/C][C]41.9165845185576[/C][C]108.000666230445[/C][C]357.672270122512[/C][C]423.756351834399[/C][/ROW]
[ROW][C]43[/C][C]232.836468176478[/C][C]40.5544706842257[/C][C]107.110027866369[/C][C]358.562908486588[/C][C]425.118465668731[/C][/ROW]
[ROW][C]44[/C][C]232.836468176478[/C][C]39.1990634616242[/C][C]106.223774719996[/C][C]359.44916163296[/C][C]426.473872891332[/C][/ROW]
[ROW][C]45[/C][C]232.836468176478[/C][C]37.8502169020409[/C][C]105.341811360594[/C][C]360.331124992363[/C][C]427.822719450916[/C][/ROW]
[ROW][C]46[/C][C]232.836468176478[/C][C]36.5077897223076[/C][C]104.464045408062[/C][C]361.208890944894[/C][C]429.165146630649[/C][/ROW]
[ROW][C]47[/C][C]232.836468176478[/C][C]35.1716450991825[/C][C]103.590387398493[/C][C]362.082548954463[/C][C]430.501291253774[/C][/ROW]
[ROW][C]48[/C][C]232.836468176478[/C][C]33.8416504752047[/C][C]102.720750657222[/C][C]362.952185695734[/C][C]431.831285877752[/C][/ROW]
[ROW][C]49[/C][C]232.836468176478[/C][C]32.5176773752532[/C][C]101.855051178882[/C][C]363.817885174075[/C][C]433.155258977703[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75913&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75913&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
26232.83646817647864.7636642943782122.939568723439342.733367629517400.909272058578
27232.83646817647863.2695578151926121.962625007843343.710311345113402.403378537764
28232.83646817647861.7853564624555120.992157906311344.680778446645403.887579890501
29232.83646817647860.3107979490923120.027995918543345.644940434413405.362138403864
30232.83646817647858.8456304981384119.069974416431346.602961936525406.827305854818
31232.83646817647857.3896122643942118.117935265898347.555001087058408.283324088562
32232.83646817647855.9425107962774117.171726475025348.501209877931409.730425556679
33232.83646817647854.5041025345123116.231201866258349.441734486699411.168833818444
34232.83646817647853.0741723446241115.296220770725350.376715582232412.598764008332
35232.83646817647851.6525130804954114.366647742860351.306288610097414.020423272461
36232.83646817647850.2389251765027113.442352293716352.230584059241415.434011176454
37232.83646817647848.8332162659791112.523208641490353.149727711467416.839720086977
38232.83646817647847.4352008239589111.609095477927354.063840875029418.237735528998
39232.83646817647846.0446998323435110.699895749385354.973040603571419.628236520613
40232.83646817647844.6615404657945109.795496451449355.877439901508421.011395887162
41232.83646817647843.2855557968074108.895788436090356.777147916867422.387380556149
42232.83646817647841.9165845185576108.000666230445357.672270122512423.756351834399
43232.83646817647840.5544706842257107.110027866369358.562908486588425.118465668731
44232.83646817647839.1990634616242106.223774719996359.44916163296426.473872891332
45232.83646817647837.8502169020409105.341811360594360.331124992363427.822719450916
46232.83646817647836.5077897223076104.464045408062361.208890944894429.165146630649
47232.83646817647835.1716450991825103.590387398493362.082548954463430.501291253774
48232.83646817647833.8416504752047102.720750657222362.952185695734431.831285877752
49232.83646817647832.5176773752532101.855051178882363.817885174075433.155258977703







Actuals and Interpolation
TimeActualForecast
1250.75250.850152884021
2314.5125314.369477869004
3449.3885448.784077969190
4305.7305.685475232751
5162.375162.837106781298
6352.025351.787128034443
7379.125378.830448248692
8327.125327.047794937283
9423.6625423.280779333534
10152.25152.776138996337
11183.8125184.199992170458
12153.8875154.348519548268
13245.625245.711928676033
14108.9109.490720296634
15291.625291.441298968799
16284.875284.744734135499
17192.25192.499491581822
1845.262546.0800968454689
19205.375205.452810842879
20301.25300.883977236240
21165.375165.658013776605
22281.6375281.371526167842
23140.5875140.975949750512
24331.75331.23300462894
25232.625232.626038312863

\begin{tabular}{lllllllll}
\hline
Actuals and Interpolation \tabularnewline
Time & Actual & Forecast \tabularnewline
1 & 250.75 & 250.850152884021 \tabularnewline
2 & 314.5125 & 314.369477869004 \tabularnewline
3 & 449.3885 & 448.784077969190 \tabularnewline
4 & 305.7 & 305.685475232751 \tabularnewline
5 & 162.375 & 162.837106781298 \tabularnewline
6 & 352.025 & 351.787128034443 \tabularnewline
7 & 379.125 & 378.830448248692 \tabularnewline
8 & 327.125 & 327.047794937283 \tabularnewline
9 & 423.6625 & 423.280779333534 \tabularnewline
10 & 152.25 & 152.776138996337 \tabularnewline
11 & 183.8125 & 184.199992170458 \tabularnewline
12 & 153.8875 & 154.348519548268 \tabularnewline
13 & 245.625 & 245.711928676033 \tabularnewline
14 & 108.9 & 109.490720296634 \tabularnewline
15 & 291.625 & 291.441298968799 \tabularnewline
16 & 284.875 & 284.744734135499 \tabularnewline
17 & 192.25 & 192.499491581822 \tabularnewline
18 & 45.2625 & 46.0800968454689 \tabularnewline
19 & 205.375 & 205.452810842879 \tabularnewline
20 & 301.25 & 300.883977236240 \tabularnewline
21 & 165.375 & 165.658013776605 \tabularnewline
22 & 281.6375 & 281.371526167842 \tabularnewline
23 & 140.5875 & 140.975949750512 \tabularnewline
24 & 331.75 & 331.23300462894 \tabularnewline
25 & 232.625 & 232.626038312863 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75913&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]250.75[/C][C]250.850152884021[/C][/ROW]
[ROW][C]2[/C][C]314.5125[/C][C]314.369477869004[/C][/ROW]
[ROW][C]3[/C][C]449.3885[/C][C]448.784077969190[/C][/ROW]
[ROW][C]4[/C][C]305.7[/C][C]305.685475232751[/C][/ROW]
[ROW][C]5[/C][C]162.375[/C][C]162.837106781298[/C][/ROW]
[ROW][C]6[/C][C]352.025[/C][C]351.787128034443[/C][/ROW]
[ROW][C]7[/C][C]379.125[/C][C]378.830448248692[/C][/ROW]
[ROW][C]8[/C][C]327.125[/C][C]327.047794937283[/C][/ROW]
[ROW][C]9[/C][C]423.6625[/C][C]423.280779333534[/C][/ROW]
[ROW][C]10[/C][C]152.25[/C][C]152.776138996337[/C][/ROW]
[ROW][C]11[/C][C]183.8125[/C][C]184.199992170458[/C][/ROW]
[ROW][C]12[/C][C]153.8875[/C][C]154.348519548268[/C][/ROW]
[ROW][C]13[/C][C]245.625[/C][C]245.711928676033[/C][/ROW]
[ROW][C]14[/C][C]108.9[/C][C]109.490720296634[/C][/ROW]
[ROW][C]15[/C][C]291.625[/C][C]291.441298968799[/C][/ROW]
[ROW][C]16[/C][C]284.875[/C][C]284.744734135499[/C][/ROW]
[ROW][C]17[/C][C]192.25[/C][C]192.499491581822[/C][/ROW]
[ROW][C]18[/C][C]45.2625[/C][C]46.0800968454689[/C][/ROW]
[ROW][C]19[/C][C]205.375[/C][C]205.452810842879[/C][/ROW]
[ROW][C]20[/C][C]301.25[/C][C]300.883977236240[/C][/ROW]
[ROW][C]21[/C][C]165.375[/C][C]165.658013776605[/C][/ROW]
[ROW][C]22[/C][C]281.6375[/C][C]281.371526167842[/C][/ROW]
[ROW][C]23[/C][C]140.5875[/C][C]140.975949750512[/C][/ROW]
[ROW][C]24[/C][C]331.75[/C][C]331.23300462894[/C][/ROW]
[ROW][C]25[/C][C]232.625[/C][C]232.626038312863[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75913&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75913&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
1250.75250.850152884021
2314.5125314.369477869004
3449.3885448.784077969190
4305.7305.685475232751
5162.375162.837106781298
6352.025351.787128034443
7379.125378.830448248692
8327.125327.047794937283
9423.6625423.280779333534
10152.25152.776138996337
11183.8125184.199992170458
12153.8875154.348519548268
13245.625245.711928676033
14108.9109.490720296634
15291.625291.441298968799
16284.875284.744734135499
17192.25192.499491581822
1845.262546.0800968454689
19205.375205.452810842879
20301.25300.883977236240
21165.375165.658013776605
22281.6375281.371526167842
23140.5875140.975949750512
24331.75331.23300462894
25232.625232.626038312863







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

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