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:13: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/t12737564455fpa9eitp1x95hc.htm/, Retrieved Mon, 06 May 2024 00:20:24 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=75924, Retrieved Mon, 06 May 2024 00:20:24 +0000
QR Codes:

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

Post a new message
Dataseries X:
192
212,25
191,8
163,7625
272,025
284,575
301,6635
287,5375
220,4375
178,3
284,8875
283,9875
238
216,275
162,875
185,95
193,7875
128,3275
83,925
177,15
142,3
120,5375
269,25
167,625
243,275




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75924&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
26211.017957920105103.592664127725140.776333826681281.259582013530318.443251712485
27211.01795792010592.6761936605904133.638437453212288.397478386999329.359722179620
28211.01795792010582.6849824627817127.105535597240294.93038024297339.350933377428
29211.01795792010573.4173328800807121.045745251442300.990170588769348.618582960129
30211.01795792010564.7356574422934115.369102804638306.666813035572357.300258397917
31211.01795792010556.5411284123882110.010988272936312.024927567274365.494787427822
32211.01795792010548.7599218281086104.923130761999317.112785078211373.275994012102
33211.01795792010541.3351665177149100.068344211391321.967571628819380.700749322495
34211.01795792010534.221948010994195.4172606275831326.618655212627387.813967829216
35211.01795792010527.384059792722690.9462058427671331.089709997443394.651856047488
36211.01795792010520.791808395037786.6357643418998335.40015149831401.244107445172
37211.01795792010514.420482390003982.4697781907501339.56613764946407.615433450206
38211.0179579201058.2492551909014778.4346296162231343.601286223987413.786660649309
39211.0179579201052.2603802656410674.5187147846965347.517201055514419.775535574569
40211.017957920105-3.5614111949964570.7120499584522351.323865881758425.597327035207
41211.017957920105-9.229369127263267.0059714698508355.029944370359431.265284967473
42211.017957920105-14.755079649011763.3929035636286358.643012276581436.790995489222
43211.017957920105-20.148743650128159.8661762364046362.169739603806442.184659490338
44211.017957920105-25.419398131210756.4198805110976365.616035329112447.455313971421
45211.017957920105-30.575094045823953.0487521521268368.987163688083452.611009886034
46211.017957920105-35.623040658573049.74807727474372.28783856547457.658956498783
47211.017957920105-40.569723816427746.5136150115523375.522300828658462.605639656638
48211.017957920105-45.421003673562243.3415336137074378.694382226503467.456919513772
49211.017957920105-50.182196070878940.2283572396669381.807558600543472.218111911089

\begin{tabular}{lllllllll}
\hline
Demand Forecast \tabularnewline
Point & Forecast & 95% LB & 80% LB & 80% UB & 95% UB \tabularnewline
26 & 211.017957920105 & 103.592664127725 & 140.776333826681 & 281.259582013530 & 318.443251712485 \tabularnewline
27 & 211.017957920105 & 92.6761936605904 & 133.638437453212 & 288.397478386999 & 329.359722179620 \tabularnewline
28 & 211.017957920105 & 82.6849824627817 & 127.105535597240 & 294.93038024297 & 339.350933377428 \tabularnewline
29 & 211.017957920105 & 73.4173328800807 & 121.045745251442 & 300.990170588769 & 348.618582960129 \tabularnewline
30 & 211.017957920105 & 64.7356574422934 & 115.369102804638 & 306.666813035572 & 357.300258397917 \tabularnewline
31 & 211.017957920105 & 56.5411284123882 & 110.010988272936 & 312.024927567274 & 365.494787427822 \tabularnewline
32 & 211.017957920105 & 48.7599218281086 & 104.923130761999 & 317.112785078211 & 373.275994012102 \tabularnewline
33 & 211.017957920105 & 41.3351665177149 & 100.068344211391 & 321.967571628819 & 380.700749322495 \tabularnewline
34 & 211.017957920105 & 34.2219480109941 & 95.4172606275831 & 326.618655212627 & 387.813967829216 \tabularnewline
35 & 211.017957920105 & 27.3840597927226 & 90.9462058427671 & 331.089709997443 & 394.651856047488 \tabularnewline
36 & 211.017957920105 & 20.7918083950377 & 86.6357643418998 & 335.40015149831 & 401.244107445172 \tabularnewline
37 & 211.017957920105 & 14.4204823900039 & 82.4697781907501 & 339.56613764946 & 407.615433450206 \tabularnewline
38 & 211.017957920105 & 8.24925519090147 & 78.4346296162231 & 343.601286223987 & 413.786660649309 \tabularnewline
39 & 211.017957920105 & 2.26038026564106 & 74.5187147846965 & 347.517201055514 & 419.775535574569 \tabularnewline
40 & 211.017957920105 & -3.56141119499645 & 70.7120499584522 & 351.323865881758 & 425.597327035207 \tabularnewline
41 & 211.017957920105 & -9.2293691272632 & 67.0059714698508 & 355.029944370359 & 431.265284967473 \tabularnewline
42 & 211.017957920105 & -14.7550796490117 & 63.3929035636286 & 358.643012276581 & 436.790995489222 \tabularnewline
43 & 211.017957920105 & -20.1487436501281 & 59.8661762364046 & 362.169739603806 & 442.184659490338 \tabularnewline
44 & 211.017957920105 & -25.4193981312107 & 56.4198805110976 & 365.616035329112 & 447.455313971421 \tabularnewline
45 & 211.017957920105 & -30.5750940458239 & 53.0487521521268 & 368.987163688083 & 452.611009886034 \tabularnewline
46 & 211.017957920105 & -35.6230406585730 & 49.74807727474 & 372.28783856547 & 457.658956498783 \tabularnewline
47 & 211.017957920105 & -40.5697238164277 & 46.5136150115523 & 375.522300828658 & 462.605639656638 \tabularnewline
48 & 211.017957920105 & -45.4210036735622 & 43.3415336137074 & 378.694382226503 & 467.456919513772 \tabularnewline
49 & 211.017957920105 & -50.1821960708789 & 40.2283572396669 & 381.807558600543 & 472.218111911089 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75924&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]211.017957920105[/C][C]103.592664127725[/C][C]140.776333826681[/C][C]281.259582013530[/C][C]318.443251712485[/C][/ROW]
[ROW][C]27[/C][C]211.017957920105[/C][C]92.6761936605904[/C][C]133.638437453212[/C][C]288.397478386999[/C][C]329.359722179620[/C][/ROW]
[ROW][C]28[/C][C]211.017957920105[/C][C]82.6849824627817[/C][C]127.105535597240[/C][C]294.93038024297[/C][C]339.350933377428[/C][/ROW]
[ROW][C]29[/C][C]211.017957920105[/C][C]73.4173328800807[/C][C]121.045745251442[/C][C]300.990170588769[/C][C]348.618582960129[/C][/ROW]
[ROW][C]30[/C][C]211.017957920105[/C][C]64.7356574422934[/C][C]115.369102804638[/C][C]306.666813035572[/C][C]357.300258397917[/C][/ROW]
[ROW][C]31[/C][C]211.017957920105[/C][C]56.5411284123882[/C][C]110.010988272936[/C][C]312.024927567274[/C][C]365.494787427822[/C][/ROW]
[ROW][C]32[/C][C]211.017957920105[/C][C]48.7599218281086[/C][C]104.923130761999[/C][C]317.112785078211[/C][C]373.275994012102[/C][/ROW]
[ROW][C]33[/C][C]211.017957920105[/C][C]41.3351665177149[/C][C]100.068344211391[/C][C]321.967571628819[/C][C]380.700749322495[/C][/ROW]
[ROW][C]34[/C][C]211.017957920105[/C][C]34.2219480109941[/C][C]95.4172606275831[/C][C]326.618655212627[/C][C]387.813967829216[/C][/ROW]
[ROW][C]35[/C][C]211.017957920105[/C][C]27.3840597927226[/C][C]90.9462058427671[/C][C]331.089709997443[/C][C]394.651856047488[/C][/ROW]
[ROW][C]36[/C][C]211.017957920105[/C][C]20.7918083950377[/C][C]86.6357643418998[/C][C]335.40015149831[/C][C]401.244107445172[/C][/ROW]
[ROW][C]37[/C][C]211.017957920105[/C][C]14.4204823900039[/C][C]82.4697781907501[/C][C]339.56613764946[/C][C]407.615433450206[/C][/ROW]
[ROW][C]38[/C][C]211.017957920105[/C][C]8.24925519090147[/C][C]78.4346296162231[/C][C]343.601286223987[/C][C]413.786660649309[/C][/ROW]
[ROW][C]39[/C][C]211.017957920105[/C][C]2.26038026564106[/C][C]74.5187147846965[/C][C]347.517201055514[/C][C]419.775535574569[/C][/ROW]
[ROW][C]40[/C][C]211.017957920105[/C][C]-3.56141119499645[/C][C]70.7120499584522[/C][C]351.323865881758[/C][C]425.597327035207[/C][/ROW]
[ROW][C]41[/C][C]211.017957920105[/C][C]-9.2293691272632[/C][C]67.0059714698508[/C][C]355.029944370359[/C][C]431.265284967473[/C][/ROW]
[ROW][C]42[/C][C]211.017957920105[/C][C]-14.7550796490117[/C][C]63.3929035636286[/C][C]358.643012276581[/C][C]436.790995489222[/C][/ROW]
[ROW][C]43[/C][C]211.017957920105[/C][C]-20.1487436501281[/C][C]59.8661762364046[/C][C]362.169739603806[/C][C]442.184659490338[/C][/ROW]
[ROW][C]44[/C][C]211.017957920105[/C][C]-25.4193981312107[/C][C]56.4198805110976[/C][C]365.616035329112[/C][C]447.455313971421[/C][/ROW]
[ROW][C]45[/C][C]211.017957920105[/C][C]-30.5750940458239[/C][C]53.0487521521268[/C][C]368.987163688083[/C][C]452.611009886034[/C][/ROW]
[ROW][C]46[/C][C]211.017957920105[/C][C]-35.6230406585730[/C][C]49.74807727474[/C][C]372.28783856547[/C][C]457.658956498783[/C][/ROW]
[ROW][C]47[/C][C]211.017957920105[/C][C]-40.5697238164277[/C][C]46.5136150115523[/C][C]375.522300828658[/C][C]462.605639656638[/C][/ROW]
[ROW][C]48[/C][C]211.017957920105[/C][C]-45.4210036735622[/C][C]43.3415336137074[/C][C]378.694382226503[/C][C]467.456919513772[/C][/ROW]
[ROW][C]49[/C][C]211.017957920105[/C][C]-50.1821960708789[/C][C]40.2283572396669[/C][C]381.807558600543[/C][C]472.218111911089[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75924&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75924&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
26211.017957920105103.592664127725140.776333826681281.259582013530318.443251712485
27211.01795792010592.6761936605904133.638437453212288.397478386999329.359722179620
28211.01795792010582.6849824627817127.105535597240294.93038024297339.350933377428
29211.01795792010573.4173328800807121.045745251442300.990170588769348.618582960129
30211.01795792010564.7356574422934115.369102804638306.666813035572357.300258397917
31211.01795792010556.5411284123882110.010988272936312.024927567274365.494787427822
32211.01795792010548.7599218281086104.923130761999317.112785078211373.275994012102
33211.01795792010541.3351665177149100.068344211391321.967571628819380.700749322495
34211.01795792010534.221948010994195.4172606275831326.618655212627387.813967829216
35211.01795792010527.384059792722690.9462058427671331.089709997443394.651856047488
36211.01795792010520.791808395037786.6357643418998335.40015149831401.244107445172
37211.01795792010514.420482390003982.4697781907501339.56613764946407.615433450206
38211.0179579201058.2492551909014778.4346296162231343.601286223987413.786660649309
39211.0179579201052.2603802656410674.5187147846965347.517201055514419.775535574569
40211.017957920105-3.5614111949964570.7120499584522351.323865881758425.597327035207
41211.017957920105-9.229369127263267.0059714698508355.029944370359431.265284967473
42211.017957920105-14.755079649011763.3929035636286358.643012276581436.790995489222
43211.017957920105-20.148743650128159.8661762364046362.169739603806442.184659490338
44211.017957920105-25.419398131210756.4198805110976365.616035329112447.455313971421
45211.017957920105-30.575094045823953.0487521521268368.987163688083452.611009886034
46211.017957920105-35.623040658573049.74807727474372.28783856547457.658956498783
47211.017957920105-40.569723816427746.5136150115523375.522300828658462.605639656638
48211.017957920105-45.421003673562243.3415336137074378.694382226503467.456919513772
49211.017957920105-50.182196070878940.2283572396669381.807558600543472.218111911089







Actuals and Interpolation
TimeActualForecast
1192201.992383256927
2212.25197.374595777152
3191.8204.248977354664
4163.7625198.495922223946
5272.025182.444540071016
6284.575223.842424405143
7301.6635251.908814573073
8287.5375274.901984222098
9220.4375280.741244492589
10178.3252.873030359752
11284.8875218.410540574304
12283.9875249.131587099083
13238265.239575959338
14216.275252.651330534283
15162.875235.840709946355
16185.95202.121012334719
17193.7875194.647890420306
18128.3275194.250277557744
1983.925163.7853355103
20177.15126.879419477262
21142.3150.111000109239
22120.5375146.501296840105
23269.25134.502628164888
24167.625196.773530970922
25243.275183.303098751657

\begin{tabular}{lllllllll}
\hline
Actuals and Interpolation \tabularnewline
Time & Actual & Forecast \tabularnewline
1 & 192 & 201.992383256927 \tabularnewline
2 & 212.25 & 197.374595777152 \tabularnewline
3 & 191.8 & 204.248977354664 \tabularnewline
4 & 163.7625 & 198.495922223946 \tabularnewline
5 & 272.025 & 182.444540071016 \tabularnewline
6 & 284.575 & 223.842424405143 \tabularnewline
7 & 301.6635 & 251.908814573073 \tabularnewline
8 & 287.5375 & 274.901984222098 \tabularnewline
9 & 220.4375 & 280.741244492589 \tabularnewline
10 & 178.3 & 252.873030359752 \tabularnewline
11 & 284.8875 & 218.410540574304 \tabularnewline
12 & 283.9875 & 249.131587099083 \tabularnewline
13 & 238 & 265.239575959338 \tabularnewline
14 & 216.275 & 252.651330534283 \tabularnewline
15 & 162.875 & 235.840709946355 \tabularnewline
16 & 185.95 & 202.121012334719 \tabularnewline
17 & 193.7875 & 194.647890420306 \tabularnewline
18 & 128.3275 & 194.250277557744 \tabularnewline
19 & 83.925 & 163.7853355103 \tabularnewline
20 & 177.15 & 126.879419477262 \tabularnewline
21 & 142.3 & 150.111000109239 \tabularnewline
22 & 120.5375 & 146.501296840105 \tabularnewline
23 & 269.25 & 134.502628164888 \tabularnewline
24 & 167.625 & 196.773530970922 \tabularnewline
25 & 243.275 & 183.303098751657 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75924&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]192[/C][C]201.992383256927[/C][/ROW]
[ROW][C]2[/C][C]212.25[/C][C]197.374595777152[/C][/ROW]
[ROW][C]3[/C][C]191.8[/C][C]204.248977354664[/C][/ROW]
[ROW][C]4[/C][C]163.7625[/C][C]198.495922223946[/C][/ROW]
[ROW][C]5[/C][C]272.025[/C][C]182.444540071016[/C][/ROW]
[ROW][C]6[/C][C]284.575[/C][C]223.842424405143[/C][/ROW]
[ROW][C]7[/C][C]301.6635[/C][C]251.908814573073[/C][/ROW]
[ROW][C]8[/C][C]287.5375[/C][C]274.901984222098[/C][/ROW]
[ROW][C]9[/C][C]220.4375[/C][C]280.741244492589[/C][/ROW]
[ROW][C]10[/C][C]178.3[/C][C]252.873030359752[/C][/ROW]
[ROW][C]11[/C][C]284.8875[/C][C]218.410540574304[/C][/ROW]
[ROW][C]12[/C][C]283.9875[/C][C]249.131587099083[/C][/ROW]
[ROW][C]13[/C][C]238[/C][C]265.239575959338[/C][/ROW]
[ROW][C]14[/C][C]216.275[/C][C]252.651330534283[/C][/ROW]
[ROW][C]15[/C][C]162.875[/C][C]235.840709946355[/C][/ROW]
[ROW][C]16[/C][C]185.95[/C][C]202.121012334719[/C][/ROW]
[ROW][C]17[/C][C]193.7875[/C][C]194.647890420306[/C][/ROW]
[ROW][C]18[/C][C]128.3275[/C][C]194.250277557744[/C][/ROW]
[ROW][C]19[/C][C]83.925[/C][C]163.7853355103[/C][/ROW]
[ROW][C]20[/C][C]177.15[/C][C]126.879419477262[/C][/ROW]
[ROW][C]21[/C][C]142.3[/C][C]150.111000109239[/C][/ROW]
[ROW][C]22[/C][C]120.5375[/C][C]146.501296840105[/C][/ROW]
[ROW][C]23[/C][C]269.25[/C][C]134.502628164888[/C][/ROW]
[ROW][C]24[/C][C]167.625[/C][C]196.773530970922[/C][/ROW]
[ROW][C]25[/C][C]243.275[/C][C]183.303098751657[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75924&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75924&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
1192201.992383256927
2212.25197.374595777152
3191.8204.248977354664
4163.7625198.495922223946
5272.025182.444540071016
6284.575223.842424405143
7301.6635251.908814573073
8287.5375274.901984222098
9220.4375280.741244492589
10178.3252.873030359752
11284.8875218.410540574304
12283.9875249.131587099083
13238265.239575959338
14216.275252.651330534283
15162.875235.840709946355
16185.95202.121012334719
17193.7875194.647890420306
18128.3275194.250277557744
1983.925163.7853355103
20177.15126.879419477262
21142.3150.111000109239
22120.5375146.501296840105
23269.25134.502628164888
24167.625196.773530970922
25243.275183.303098751657







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

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