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

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

Post a new message
Dataseries X:
1216,67
1186,17
1217,475
1096,95
1685,6
1758,5
1786,6
2049,895
1845,895
2015,02
1609,63
918,725
1240,96
1671,785
2451,83
1886,14
2110,66
1856,87
1775,765
1569,625
1835,69
2041,46
1667,035
948,25
1365,66
1681,025
1661,9
2194,88
2051,025
2365,845
2398,5
2181,85
2626,77
2529,72
1700,3
605,38
1200,495
1597,02
1174,955
1612,88
1683,55
2260,955
2455,335
2365,62
2417,755
2308,785
1629,94
1053,275
1330,235
1543,85




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

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







Demand Forecast
PointForecast95% LB80% LB80% UB95% UB
511768.27401478368803.1408867568731137.207382469022399.340647098342733.40714281049
521768.27401478368798.3272253344041134.059898443492402.488131123882738.22080423296
531768.27401478368793.5373355153221130.927957833942405.620071733432743.01069405204
541768.27401478368788.7708685614461127.811332612742408.736696954632747.77716100592
551768.27401478368784.0274841789731124.709800273732411.838229293632752.52054538839
561768.27401478368779.3068502349521121.623143646862414.924885920512757.24117933241
571768.27401478368774.6086424858941118.551150720682417.996878846682761.93938708147
581768.27401478368769.9325443178641115.493614472492421.054415094872766.6154852495
591768.27401478368765.2782464974951112.450332705452424.097696861912771.26978306987
601768.27401478368760.6454469333321109.421107892582427.126921674792775.90258263403

\begin{tabular}{lllllllll}
\hline
Demand Forecast \tabularnewline
Point & Forecast & 95% LB & 80% LB & 80% UB & 95% UB \tabularnewline
51 & 1768.27401478368 & 803.140886756873 & 1137.20738246902 & 2399.34064709834 & 2733.40714281049 \tabularnewline
52 & 1768.27401478368 & 798.327225334404 & 1134.05989844349 & 2402.48813112388 & 2738.22080423296 \tabularnewline
53 & 1768.27401478368 & 793.537335515322 & 1130.92795783394 & 2405.62007173343 & 2743.01069405204 \tabularnewline
54 & 1768.27401478368 & 788.770868561446 & 1127.81133261274 & 2408.73669695463 & 2747.77716100592 \tabularnewline
55 & 1768.27401478368 & 784.027484178973 & 1124.70980027373 & 2411.83822929363 & 2752.52054538839 \tabularnewline
56 & 1768.27401478368 & 779.306850234952 & 1121.62314364686 & 2414.92488592051 & 2757.24117933241 \tabularnewline
57 & 1768.27401478368 & 774.608642485894 & 1118.55115072068 & 2417.99687884668 & 2761.93938708147 \tabularnewline
58 & 1768.27401478368 & 769.932544317864 & 1115.49361447249 & 2421.05441509487 & 2766.6154852495 \tabularnewline
59 & 1768.27401478368 & 765.278246497495 & 1112.45033270545 & 2424.09769686191 & 2771.26978306987 \tabularnewline
60 & 1768.27401478368 & 760.645446933332 & 1109.42110789258 & 2427.12692167479 & 2775.90258263403 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75876&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]51[/C][C]1768.27401478368[/C][C]803.140886756873[/C][C]1137.20738246902[/C][C]2399.34064709834[/C][C]2733.40714281049[/C][/ROW]
[ROW][C]52[/C][C]1768.27401478368[/C][C]798.327225334404[/C][C]1134.05989844349[/C][C]2402.48813112388[/C][C]2738.22080423296[/C][/ROW]
[ROW][C]53[/C][C]1768.27401478368[/C][C]793.537335515322[/C][C]1130.92795783394[/C][C]2405.62007173343[/C][C]2743.01069405204[/C][/ROW]
[ROW][C]54[/C][C]1768.27401478368[/C][C]788.770868561446[/C][C]1127.81133261274[/C][C]2408.73669695463[/C][C]2747.77716100592[/C][/ROW]
[ROW][C]55[/C][C]1768.27401478368[/C][C]784.027484178973[/C][C]1124.70980027373[/C][C]2411.83822929363[/C][C]2752.52054538839[/C][/ROW]
[ROW][C]56[/C][C]1768.27401478368[/C][C]779.306850234952[/C][C]1121.62314364686[/C][C]2414.92488592051[/C][C]2757.24117933241[/C][/ROW]
[ROW][C]57[/C][C]1768.27401478368[/C][C]774.608642485894[/C][C]1118.55115072068[/C][C]2417.99687884668[/C][C]2761.93938708147[/C][/ROW]
[ROW][C]58[/C][C]1768.27401478368[/C][C]769.932544317864[/C][C]1115.49361447249[/C][C]2421.05441509487[/C][C]2766.6154852495[/C][/ROW]
[ROW][C]59[/C][C]1768.27401478368[/C][C]765.278246497495[/C][C]1112.45033270545[/C][C]2424.09769686191[/C][C]2771.26978306987[/C][/ROW]
[ROW][C]60[/C][C]1768.27401478368[/C][C]760.645446933332[/C][C]1109.42110789258[/C][C]2427.12692167479[/C][C]2775.90258263403[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75876&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75876&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
511768.27401478368803.1408867568731137.207382469022399.340647098342733.40714281049
521768.27401478368798.3272253344041134.059898443492402.488131123882738.22080423296
531768.27401478368793.5373355153221130.927957833942405.620071733432743.01069405204
541768.27401478368788.7708685614461127.811332612742408.736696954632747.77716100592
551768.27401478368784.0274841789731124.709800273732411.838229293632752.52054538839
561768.27401478368779.3068502349521121.623143646862414.924885920512757.24117933241
571768.27401478368774.6086424858941118.551150720682417.996878846682761.93938708147
581768.27401478368769.9325443178641115.493614472492421.054415094872766.6154852495
591768.27401478368765.2782464974951112.450332705452424.097696861912771.26978306987
601768.27401478368760.6454469333321109.421107892582427.126921674792775.90258263403







Actuals and Interpolation
TimeActualForecast
11216.67NA
21186.171216.67
31217.4751213.62
41096.951214.0055
51685.61202.29995
61758.51250.629955
71786.61301.4169595
82049.8951349.93526355
91845.8951419.931237195
102015.021462.5276134755
111609.631517.77685212795
12918.7251526.96216691516
131240.961466.13845022364
141671.7851443.62060520128
152451.831466.43704468115
161886.141564.97634021303
172110.661597.09270619173
181856.871648.44943557256
191775.7651669.29149201530
201569.6251679.93884281377
211835.691668.90745853239
222041.461685.58571267915
231667.0351721.17314141124
24948.251715.75932727012
251365.661639.00839454310
261681.0251611.67355508879
271661.91618.60869957991
282194.881622.93782962192
292051.0251680.13204665973
302365.8451717.22134199376
312398.51782.08370779438
322181.851843.72533701494
332626.771877.53780331345
342529.721952.46102298210
351700.32010.18692068389
36605.381979.19822861550
371200.4951841.81640575395
381597.021777.68426517856
391174.9551759.61783866070
401612.881701.15155479463
411683.551692.32439931517
422260.9551691.44695938365
432455.3351748.39776344529
442365.621819.09148710076
452417.7551873.74433839068
462308.7851928.14540455161
471629.941966.20936409645
481053.2751932.58242768681
491330.2351844.65168491813
501543.851793.21001642631

\begin{tabular}{lllllllll}
\hline
Actuals and Interpolation \tabularnewline
Time & Actual & Forecast \tabularnewline
1 & 1216.67 & NA \tabularnewline
2 & 1186.17 & 1216.67 \tabularnewline
3 & 1217.475 & 1213.62 \tabularnewline
4 & 1096.95 & 1214.0055 \tabularnewline
5 & 1685.6 & 1202.29995 \tabularnewline
6 & 1758.5 & 1250.629955 \tabularnewline
7 & 1786.6 & 1301.4169595 \tabularnewline
8 & 2049.895 & 1349.93526355 \tabularnewline
9 & 1845.895 & 1419.931237195 \tabularnewline
10 & 2015.02 & 1462.5276134755 \tabularnewline
11 & 1609.63 & 1517.77685212795 \tabularnewline
12 & 918.725 & 1526.96216691516 \tabularnewline
13 & 1240.96 & 1466.13845022364 \tabularnewline
14 & 1671.785 & 1443.62060520128 \tabularnewline
15 & 2451.83 & 1466.43704468115 \tabularnewline
16 & 1886.14 & 1564.97634021303 \tabularnewline
17 & 2110.66 & 1597.09270619173 \tabularnewline
18 & 1856.87 & 1648.44943557256 \tabularnewline
19 & 1775.765 & 1669.29149201530 \tabularnewline
20 & 1569.625 & 1679.93884281377 \tabularnewline
21 & 1835.69 & 1668.90745853239 \tabularnewline
22 & 2041.46 & 1685.58571267915 \tabularnewline
23 & 1667.035 & 1721.17314141124 \tabularnewline
24 & 948.25 & 1715.75932727012 \tabularnewline
25 & 1365.66 & 1639.00839454310 \tabularnewline
26 & 1681.025 & 1611.67355508879 \tabularnewline
27 & 1661.9 & 1618.60869957991 \tabularnewline
28 & 2194.88 & 1622.93782962192 \tabularnewline
29 & 2051.025 & 1680.13204665973 \tabularnewline
30 & 2365.845 & 1717.22134199376 \tabularnewline
31 & 2398.5 & 1782.08370779438 \tabularnewline
32 & 2181.85 & 1843.72533701494 \tabularnewline
33 & 2626.77 & 1877.53780331345 \tabularnewline
34 & 2529.72 & 1952.46102298210 \tabularnewline
35 & 1700.3 & 2010.18692068389 \tabularnewline
36 & 605.38 & 1979.19822861550 \tabularnewline
37 & 1200.495 & 1841.81640575395 \tabularnewline
38 & 1597.02 & 1777.68426517856 \tabularnewline
39 & 1174.955 & 1759.61783866070 \tabularnewline
40 & 1612.88 & 1701.15155479463 \tabularnewline
41 & 1683.55 & 1692.32439931517 \tabularnewline
42 & 2260.955 & 1691.44695938365 \tabularnewline
43 & 2455.335 & 1748.39776344529 \tabularnewline
44 & 2365.62 & 1819.09148710076 \tabularnewline
45 & 2417.755 & 1873.74433839068 \tabularnewline
46 & 2308.785 & 1928.14540455161 \tabularnewline
47 & 1629.94 & 1966.20936409645 \tabularnewline
48 & 1053.275 & 1932.58242768681 \tabularnewline
49 & 1330.235 & 1844.65168491813 \tabularnewline
50 & 1543.85 & 1793.21001642631 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75876&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]1216.67[/C][C]NA[/C][/ROW]
[ROW][C]2[/C][C]1186.17[/C][C]1216.67[/C][/ROW]
[ROW][C]3[/C][C]1217.475[/C][C]1213.62[/C][/ROW]
[ROW][C]4[/C][C]1096.95[/C][C]1214.0055[/C][/ROW]
[ROW][C]5[/C][C]1685.6[/C][C]1202.29995[/C][/ROW]
[ROW][C]6[/C][C]1758.5[/C][C]1250.629955[/C][/ROW]
[ROW][C]7[/C][C]1786.6[/C][C]1301.4169595[/C][/ROW]
[ROW][C]8[/C][C]2049.895[/C][C]1349.93526355[/C][/ROW]
[ROW][C]9[/C][C]1845.895[/C][C]1419.931237195[/C][/ROW]
[ROW][C]10[/C][C]2015.02[/C][C]1462.5276134755[/C][/ROW]
[ROW][C]11[/C][C]1609.63[/C][C]1517.77685212795[/C][/ROW]
[ROW][C]12[/C][C]918.725[/C][C]1526.96216691516[/C][/ROW]
[ROW][C]13[/C][C]1240.96[/C][C]1466.13845022364[/C][/ROW]
[ROW][C]14[/C][C]1671.785[/C][C]1443.62060520128[/C][/ROW]
[ROW][C]15[/C][C]2451.83[/C][C]1466.43704468115[/C][/ROW]
[ROW][C]16[/C][C]1886.14[/C][C]1564.97634021303[/C][/ROW]
[ROW][C]17[/C][C]2110.66[/C][C]1597.09270619173[/C][/ROW]
[ROW][C]18[/C][C]1856.87[/C][C]1648.44943557256[/C][/ROW]
[ROW][C]19[/C][C]1775.765[/C][C]1669.29149201530[/C][/ROW]
[ROW][C]20[/C][C]1569.625[/C][C]1679.93884281377[/C][/ROW]
[ROW][C]21[/C][C]1835.69[/C][C]1668.90745853239[/C][/ROW]
[ROW][C]22[/C][C]2041.46[/C][C]1685.58571267915[/C][/ROW]
[ROW][C]23[/C][C]1667.035[/C][C]1721.17314141124[/C][/ROW]
[ROW][C]24[/C][C]948.25[/C][C]1715.75932727012[/C][/ROW]
[ROW][C]25[/C][C]1365.66[/C][C]1639.00839454310[/C][/ROW]
[ROW][C]26[/C][C]1681.025[/C][C]1611.67355508879[/C][/ROW]
[ROW][C]27[/C][C]1661.9[/C][C]1618.60869957991[/C][/ROW]
[ROW][C]28[/C][C]2194.88[/C][C]1622.93782962192[/C][/ROW]
[ROW][C]29[/C][C]2051.025[/C][C]1680.13204665973[/C][/ROW]
[ROW][C]30[/C][C]2365.845[/C][C]1717.22134199376[/C][/ROW]
[ROW][C]31[/C][C]2398.5[/C][C]1782.08370779438[/C][/ROW]
[ROW][C]32[/C][C]2181.85[/C][C]1843.72533701494[/C][/ROW]
[ROW][C]33[/C][C]2626.77[/C][C]1877.53780331345[/C][/ROW]
[ROW][C]34[/C][C]2529.72[/C][C]1952.46102298210[/C][/ROW]
[ROW][C]35[/C][C]1700.3[/C][C]2010.18692068389[/C][/ROW]
[ROW][C]36[/C][C]605.38[/C][C]1979.19822861550[/C][/ROW]
[ROW][C]37[/C][C]1200.495[/C][C]1841.81640575395[/C][/ROW]
[ROW][C]38[/C][C]1597.02[/C][C]1777.68426517856[/C][/ROW]
[ROW][C]39[/C][C]1174.955[/C][C]1759.61783866070[/C][/ROW]
[ROW][C]40[/C][C]1612.88[/C][C]1701.15155479463[/C][/ROW]
[ROW][C]41[/C][C]1683.55[/C][C]1692.32439931517[/C][/ROW]
[ROW][C]42[/C][C]2260.955[/C][C]1691.44695938365[/C][/ROW]
[ROW][C]43[/C][C]2455.335[/C][C]1748.39776344529[/C][/ROW]
[ROW][C]44[/C][C]2365.62[/C][C]1819.09148710076[/C][/ROW]
[ROW][C]45[/C][C]2417.755[/C][C]1873.74433839068[/C][/ROW]
[ROW][C]46[/C][C]2308.785[/C][C]1928.14540455161[/C][/ROW]
[ROW][C]47[/C][C]1629.94[/C][C]1966.20936409645[/C][/ROW]
[ROW][C]48[/C][C]1053.275[/C][C]1932.58242768681[/C][/ROW]
[ROW][C]49[/C][C]1330.235[/C][C]1844.65168491813[/C][/ROW]
[ROW][C]50[/C][C]1543.85[/C][C]1793.21001642631[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75876&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75876&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
11216.67NA
21186.171216.67
31217.4751213.62
41096.951214.0055
51685.61202.29995
61758.51250.629955
71786.61301.4169595
82049.8951349.93526355
91845.8951419.931237195
102015.021462.5276134755
111609.631517.77685212795
12918.7251526.96216691516
131240.961466.13845022364
141671.7851443.62060520128
152451.831466.43704468115
161886.141564.97634021303
172110.661597.09270619173
181856.871648.44943557256
191775.7651669.29149201530
201569.6251679.93884281377
211835.691668.90745853239
222041.461685.58571267915
231667.0351721.17314141124
24948.251715.75932727012
251365.661639.00839454310
261681.0251611.67355508879
271661.91618.60869957991
282194.881622.93782962192
292051.0251680.13204665973
302365.8451717.22134199376
312398.51782.08370779438
322181.851843.72533701494
332626.771877.53780331345
342529.721952.46102298210
351700.32010.18692068389
36605.381979.19822861550
371200.4951841.81640575395
381597.021777.68426517856
391174.9551759.61783866070
401612.881701.15155479463
411683.551692.32439931517
422260.9551691.44695938365
432455.3351748.39776344529
442365.621819.09148710076
452417.7551873.74433839068
462308.7851928.14540455161
471629.941966.20936409645
481053.2751932.58242768681
491330.2351844.65168491813
501543.851793.21001642631







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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75876&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 = Croston ; par3 = NA ; par4 = NA ; par5 = ZZZ ; par6 = 12 ; par7 = dum ; par8 = dumresult ; par9 = 3 ; par10 = 0.1 ;
Parameters (R input):
par1 = Input box ; par2 = Croston ; 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