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:55:47 +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/t1273755383viam73hwfhzejyr.htm/, Retrieved Mon, 06 May 2024 05:56:44 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=75911, Retrieved Mon, 06 May 2024 05:56:44 +0000
QR Codes:

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

Post a new message
Dataseries X:
46
40.5
22.5
25
22.25
7
11
50.25
16.25
32.5
5.7525
7.75
14
3.5
1.25
3.0125
0.5
0
0.875
3.125
10
0
21
0
0.4125




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

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







Demand Forecast
PointForecast95% LB80% LB80% UB95% UB
26-15.1982691889396-45.9521218500289-35.30713258399634.9105942061170615.5555834721496
27-17.4482691889396-48.2021218500289-37.55713258399632.6605942061170513.3055834721496
28-15.6857691889396-46.4396218500289-35.79463258399634.4230942061170515.0680834721496
29-18.1982691889396-48.9521218500289-38.30713258399631.9105942061170512.5555834721496
30-18.6982691889396-49.4521218500289-38.80713258399631.4105942061170612.0555834721496
31-17.8232691889396-48.5771218500289-37.93213258399632.2855942061170612.9305834721496
32-15.5732691889396-46.3271218500289-35.68213258399634.5355942061170615.1805834721496
33-8.69826918893965-39.4521218500289-28.807132583996311.410594206117122.0555834721496
34-18.6982691889396-49.4521218500289-38.80713258399631.4105942061170512.0555834721496
352.30173081106036-28.4521218500289-17.807132583996322.410594206117133.0555834721496
36-18.6982691889396-49.4521218500289-38.80713258399631.4105942061170612.0555834721496
37-18.2857691889396-49.0396218500289-38.39463258399631.8230942061170612.4680834721496
38-33.8965383778793-77.3890539064156-62.3347657150763-5.458311040682229.59597715065708
39-36.1465383778793-79.6390539064156-64.5847657150763-7.708311040682227.34597715065708
40-34.3840383778793-77.8765539064156-62.8222657150763-5.945811040682229.10847715065707
41-36.8965383778793-80.3890539064156-65.3347657150763-8.458311040682226.59597715065708
42-37.3965383778793-80.8890539064156-65.8347657150763-8.958311040682226.09597715065708
43-36.5215383778793-80.0140539064156-64.9597657150763-8.083311040682226.97097715065708
44-34.2715383778793-77.7640539064156-62.7097657150763-5.833311040682229.22097715065708
45-27.3965383778793-70.8890539064157-55.83476571507641.0416889593177716.0959771506571
46-37.3965383778793-80.8890539064157-65.8347657150763-8.958311040682236.09597715065707
47-16.3965383778793-59.8890539064156-44.834765715076412.041688959317827.0959771506571
48-37.3965383778793-80.8890539064157-65.8347657150763-8.958311040682236.09597715065707
49-36.9840383778793-80.4765539064156-65.4222657150763-8.545811040682226.50847715065707

\begin{tabular}{lllllllll}
\hline
Demand Forecast \tabularnewline
Point & Forecast & 95% LB & 80% LB & 80% UB & 95% UB \tabularnewline
26 & -15.1982691889396 & -45.9521218500289 & -35.3071325839963 & 4.91059420611706 & 15.5555834721496 \tabularnewline
27 & -17.4482691889396 & -48.2021218500289 & -37.5571325839963 & 2.66059420611705 & 13.3055834721496 \tabularnewline
28 & -15.6857691889396 & -46.4396218500289 & -35.7946325839963 & 4.42309420611705 & 15.0680834721496 \tabularnewline
29 & -18.1982691889396 & -48.9521218500289 & -38.3071325839963 & 1.91059420611705 & 12.5555834721496 \tabularnewline
30 & -18.6982691889396 & -49.4521218500289 & -38.8071325839963 & 1.41059420611706 & 12.0555834721496 \tabularnewline
31 & -17.8232691889396 & -48.5771218500289 & -37.9321325839963 & 2.28559420611706 & 12.9305834721496 \tabularnewline
32 & -15.5732691889396 & -46.3271218500289 & -35.6821325839963 & 4.53559420611706 & 15.1805834721496 \tabularnewline
33 & -8.69826918893965 & -39.4521218500289 & -28.8071325839963 & 11.4105942061171 & 22.0555834721496 \tabularnewline
34 & -18.6982691889396 & -49.4521218500289 & -38.8071325839963 & 1.41059420611705 & 12.0555834721496 \tabularnewline
35 & 2.30173081106036 & -28.4521218500289 & -17.8071325839963 & 22.4105942061171 & 33.0555834721496 \tabularnewline
36 & -18.6982691889396 & -49.4521218500289 & -38.8071325839963 & 1.41059420611706 & 12.0555834721496 \tabularnewline
37 & -18.2857691889396 & -49.0396218500289 & -38.3946325839963 & 1.82309420611706 & 12.4680834721496 \tabularnewline
38 & -33.8965383778793 & -77.3890539064156 & -62.3347657150763 & -5.45831104068222 & 9.59597715065708 \tabularnewline
39 & -36.1465383778793 & -79.6390539064156 & -64.5847657150763 & -7.70831104068222 & 7.34597715065708 \tabularnewline
40 & -34.3840383778793 & -77.8765539064156 & -62.8222657150763 & -5.94581104068222 & 9.10847715065707 \tabularnewline
41 & -36.8965383778793 & -80.3890539064156 & -65.3347657150763 & -8.45831104068222 & 6.59597715065708 \tabularnewline
42 & -37.3965383778793 & -80.8890539064156 & -65.8347657150763 & -8.95831104068222 & 6.09597715065708 \tabularnewline
43 & -36.5215383778793 & -80.0140539064156 & -64.9597657150763 & -8.08331104068222 & 6.97097715065708 \tabularnewline
44 & -34.2715383778793 & -77.7640539064156 & -62.7097657150763 & -5.83331104068222 & 9.22097715065708 \tabularnewline
45 & -27.3965383778793 & -70.8890539064157 & -55.8347657150764 & 1.04168895931777 & 16.0959771506571 \tabularnewline
46 & -37.3965383778793 & -80.8890539064157 & -65.8347657150763 & -8.95831104068223 & 6.09597715065707 \tabularnewline
47 & -16.3965383778793 & -59.8890539064156 & -44.8347657150764 & 12.0416889593178 & 27.0959771506571 \tabularnewline
48 & -37.3965383778793 & -80.8890539064157 & -65.8347657150763 & -8.95831104068223 & 6.09597715065707 \tabularnewline
49 & -36.9840383778793 & -80.4765539064156 & -65.4222657150763 & -8.54581104068222 & 6.50847715065707 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75911&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]-15.1982691889396[/C][C]-45.9521218500289[/C][C]-35.3071325839963[/C][C]4.91059420611706[/C][C]15.5555834721496[/C][/ROW]
[ROW][C]27[/C][C]-17.4482691889396[/C][C]-48.2021218500289[/C][C]-37.5571325839963[/C][C]2.66059420611705[/C][C]13.3055834721496[/C][/ROW]
[ROW][C]28[/C][C]-15.6857691889396[/C][C]-46.4396218500289[/C][C]-35.7946325839963[/C][C]4.42309420611705[/C][C]15.0680834721496[/C][/ROW]
[ROW][C]29[/C][C]-18.1982691889396[/C][C]-48.9521218500289[/C][C]-38.3071325839963[/C][C]1.91059420611705[/C][C]12.5555834721496[/C][/ROW]
[ROW][C]30[/C][C]-18.6982691889396[/C][C]-49.4521218500289[/C][C]-38.8071325839963[/C][C]1.41059420611706[/C][C]12.0555834721496[/C][/ROW]
[ROW][C]31[/C][C]-17.8232691889396[/C][C]-48.5771218500289[/C][C]-37.9321325839963[/C][C]2.28559420611706[/C][C]12.9305834721496[/C][/ROW]
[ROW][C]32[/C][C]-15.5732691889396[/C][C]-46.3271218500289[/C][C]-35.6821325839963[/C][C]4.53559420611706[/C][C]15.1805834721496[/C][/ROW]
[ROW][C]33[/C][C]-8.69826918893965[/C][C]-39.4521218500289[/C][C]-28.8071325839963[/C][C]11.4105942061171[/C][C]22.0555834721496[/C][/ROW]
[ROW][C]34[/C][C]-18.6982691889396[/C][C]-49.4521218500289[/C][C]-38.8071325839963[/C][C]1.41059420611705[/C][C]12.0555834721496[/C][/ROW]
[ROW][C]35[/C][C]2.30173081106036[/C][C]-28.4521218500289[/C][C]-17.8071325839963[/C][C]22.4105942061171[/C][C]33.0555834721496[/C][/ROW]
[ROW][C]36[/C][C]-18.6982691889396[/C][C]-49.4521218500289[/C][C]-38.8071325839963[/C][C]1.41059420611706[/C][C]12.0555834721496[/C][/ROW]
[ROW][C]37[/C][C]-18.2857691889396[/C][C]-49.0396218500289[/C][C]-38.3946325839963[/C][C]1.82309420611706[/C][C]12.4680834721496[/C][/ROW]
[ROW][C]38[/C][C]-33.8965383778793[/C][C]-77.3890539064156[/C][C]-62.3347657150763[/C][C]-5.45831104068222[/C][C]9.59597715065708[/C][/ROW]
[ROW][C]39[/C][C]-36.1465383778793[/C][C]-79.6390539064156[/C][C]-64.5847657150763[/C][C]-7.70831104068222[/C][C]7.34597715065708[/C][/ROW]
[ROW][C]40[/C][C]-34.3840383778793[/C][C]-77.8765539064156[/C][C]-62.8222657150763[/C][C]-5.94581104068222[/C][C]9.10847715065707[/C][/ROW]
[ROW][C]41[/C][C]-36.8965383778793[/C][C]-80.3890539064156[/C][C]-65.3347657150763[/C][C]-8.45831104068222[/C][C]6.59597715065708[/C][/ROW]
[ROW][C]42[/C][C]-37.3965383778793[/C][C]-80.8890539064156[/C][C]-65.8347657150763[/C][C]-8.95831104068222[/C][C]6.09597715065708[/C][/ROW]
[ROW][C]43[/C][C]-36.5215383778793[/C][C]-80.0140539064156[/C][C]-64.9597657150763[/C][C]-8.08331104068222[/C][C]6.97097715065708[/C][/ROW]
[ROW][C]44[/C][C]-34.2715383778793[/C][C]-77.7640539064156[/C][C]-62.7097657150763[/C][C]-5.83331104068222[/C][C]9.22097715065708[/C][/ROW]
[ROW][C]45[/C][C]-27.3965383778793[/C][C]-70.8890539064157[/C][C]-55.8347657150764[/C][C]1.04168895931777[/C][C]16.0959771506571[/C][/ROW]
[ROW][C]46[/C][C]-37.3965383778793[/C][C]-80.8890539064157[/C][C]-65.8347657150763[/C][C]-8.95831104068223[/C][C]6.09597715065707[/C][/ROW]
[ROW][C]47[/C][C]-16.3965383778793[/C][C]-59.8890539064156[/C][C]-44.8347657150764[/C][C]12.0416889593178[/C][C]27.0959771506571[/C][/ROW]
[ROW][C]48[/C][C]-37.3965383778793[/C][C]-80.8890539064157[/C][C]-65.8347657150763[/C][C]-8.95831104068223[/C][C]6.09597715065707[/C][/ROW]
[ROW][C]49[/C][C]-36.9840383778793[/C][C]-80.4765539064156[/C][C]-65.4222657150763[/C][C]-8.54581104068222[/C][C]6.50847715065707[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75911&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75911&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
26-15.1982691889396-45.9521218500289-35.30713258399634.9105942061170615.5555834721496
27-17.4482691889396-48.2021218500289-37.55713258399632.6605942061170513.3055834721496
28-15.6857691889396-46.4396218500289-35.79463258399634.4230942061170515.0680834721496
29-18.1982691889396-48.9521218500289-38.30713258399631.9105942061170512.5555834721496
30-18.6982691889396-49.4521218500289-38.80713258399631.4105942061170612.0555834721496
31-17.8232691889396-48.5771218500289-37.93213258399632.2855942061170612.9305834721496
32-15.5732691889396-46.3271218500289-35.68213258399634.5355942061170615.1805834721496
33-8.69826918893965-39.4521218500289-28.807132583996311.410594206117122.0555834721496
34-18.6982691889396-49.4521218500289-38.80713258399631.4105942061170512.0555834721496
352.30173081106036-28.4521218500289-17.807132583996322.410594206117133.0555834721496
36-18.6982691889396-49.4521218500289-38.80713258399631.4105942061170612.0555834721496
37-18.2857691889396-49.0396218500289-38.39463258399631.8230942061170612.4680834721496
38-33.8965383778793-77.3890539064156-62.3347657150763-5.458311040682229.59597715065708
39-36.1465383778793-79.6390539064156-64.5847657150763-7.708311040682227.34597715065708
40-34.3840383778793-77.8765539064156-62.8222657150763-5.945811040682229.10847715065707
41-36.8965383778793-80.3890539064156-65.3347657150763-8.458311040682226.59597715065708
42-37.3965383778793-80.8890539064156-65.8347657150763-8.958311040682226.09597715065708
43-36.5215383778793-80.0140539064156-64.9597657150763-8.083311040682226.97097715065708
44-34.2715383778793-77.7640539064156-62.7097657150763-5.833311040682229.22097715065708
45-27.3965383778793-70.8890539064157-55.83476571507641.0416889593177716.0959771506571
46-37.3965383778793-80.8890539064157-65.8347657150763-8.958311040682236.09597715065707
47-16.3965383778793-59.8890539064156-44.834765715076412.041688959317827.0959771506571
48-37.3965383778793-80.8890539064157-65.8347657150763-8.958311040682236.09597715065707
49-36.9840383778793-80.4765539064156-65.4222657150763-8.545811040682226.50847715065707







Actuals and Interpolation
TimeActualForecast
14645.95244183468
240.540.45638364361
322.522.4728254462900
42524.9687672592201
522.2522.2199590695251
676.98365087358009
71110.9780926872601
850.2550.1872845185651
916.2516.2197263132451
1032.532.4519181330501
115.75255.72960743135642
127.757.72355174403519
131427.3017308111177
143.521.8017308111392
151.253.80173081107135
163.01256.30173081107452
170.53.5517308110735
180-11.6982691889900
190.875-7.69826918897657
203.12531.5517308111828
2110-2.44826918899326
22013.8017308111198
2321-12.9457691890859
240-10.9482691889868
250.4125-4.69826918893965

\begin{tabular}{lllllllll}
\hline
Actuals and Interpolation \tabularnewline
Time & Actual & Forecast \tabularnewline
1 & 46 & 45.95244183468 \tabularnewline
2 & 40.5 & 40.45638364361 \tabularnewline
3 & 22.5 & 22.4728254462900 \tabularnewline
4 & 25 & 24.9687672592201 \tabularnewline
5 & 22.25 & 22.2199590695251 \tabularnewline
6 & 7 & 6.98365087358009 \tabularnewline
7 & 11 & 10.9780926872601 \tabularnewline
8 & 50.25 & 50.1872845185651 \tabularnewline
9 & 16.25 & 16.2197263132451 \tabularnewline
10 & 32.5 & 32.4519181330501 \tabularnewline
11 & 5.7525 & 5.72960743135642 \tabularnewline
12 & 7.75 & 7.72355174403519 \tabularnewline
13 & 14 & 27.3017308111177 \tabularnewline
14 & 3.5 & 21.8017308111392 \tabularnewline
15 & 1.25 & 3.80173081107135 \tabularnewline
16 & 3.0125 & 6.30173081107452 \tabularnewline
17 & 0.5 & 3.5517308110735 \tabularnewline
18 & 0 & -11.6982691889900 \tabularnewline
19 & 0.875 & -7.69826918897657 \tabularnewline
20 & 3.125 & 31.5517308111828 \tabularnewline
21 & 10 & -2.44826918899326 \tabularnewline
22 & 0 & 13.8017308111198 \tabularnewline
23 & 21 & -12.9457691890859 \tabularnewline
24 & 0 & -10.9482691889868 \tabularnewline
25 & 0.4125 & -4.69826918893965 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75911&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]46[/C][C]45.95244183468[/C][/ROW]
[ROW][C]2[/C][C]40.5[/C][C]40.45638364361[/C][/ROW]
[ROW][C]3[/C][C]22.5[/C][C]22.4728254462900[/C][/ROW]
[ROW][C]4[/C][C]25[/C][C]24.9687672592201[/C][/ROW]
[ROW][C]5[/C][C]22.25[/C][C]22.2199590695251[/C][/ROW]
[ROW][C]6[/C][C]7[/C][C]6.98365087358009[/C][/ROW]
[ROW][C]7[/C][C]11[/C][C]10.9780926872601[/C][/ROW]
[ROW][C]8[/C][C]50.25[/C][C]50.1872845185651[/C][/ROW]
[ROW][C]9[/C][C]16.25[/C][C]16.2197263132451[/C][/ROW]
[ROW][C]10[/C][C]32.5[/C][C]32.4519181330501[/C][/ROW]
[ROW][C]11[/C][C]5.7525[/C][C]5.72960743135642[/C][/ROW]
[ROW][C]12[/C][C]7.75[/C][C]7.72355174403519[/C][/ROW]
[ROW][C]13[/C][C]14[/C][C]27.3017308111177[/C][/ROW]
[ROW][C]14[/C][C]3.5[/C][C]21.8017308111392[/C][/ROW]
[ROW][C]15[/C][C]1.25[/C][C]3.80173081107135[/C][/ROW]
[ROW][C]16[/C][C]3.0125[/C][C]6.30173081107452[/C][/ROW]
[ROW][C]17[/C][C]0.5[/C][C]3.5517308110735[/C][/ROW]
[ROW][C]18[/C][C]0[/C][C]-11.6982691889900[/C][/ROW]
[ROW][C]19[/C][C]0.875[/C][C]-7.69826918897657[/C][/ROW]
[ROW][C]20[/C][C]3.125[/C][C]31.5517308111828[/C][/ROW]
[ROW][C]21[/C][C]10[/C][C]-2.44826918899326[/C][/ROW]
[ROW][C]22[/C][C]0[/C][C]13.8017308111198[/C][/ROW]
[ROW][C]23[/C][C]21[/C][C]-12.9457691890859[/C][/ROW]
[ROW][C]24[/C][C]0[/C][C]-10.9482691889868[/C][/ROW]
[ROW][C]25[/C][C]0.4125[/C][C]-4.69826918893965[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75911&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75911&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
14645.95244183468
240.540.45638364361
322.522.4728254462900
42524.9687672592201
522.2522.2199590695251
676.98365087358009
71110.9780926872601
850.2550.1872845185651
916.2516.2197263132451
1032.532.4519181330501
115.75255.72960743135642
127.757.72355174403519
131427.3017308111177
143.521.8017308111392
151.253.80173081107135
163.01256.30173081107452
170.53.5517308110735
180-11.6982691889900
190.875-7.69826918897657
203.12531.5517308111828
2110-2.44826918899326
22013.8017308111198
2321-12.9457691890859
240-10.9482691889868
250.4125-4.69826918893965







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

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

As an alternative you can also use a QR Code:  

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

What is next?
Simulate Time Series
Generate Forecasts
Forecast Analysis



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