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:15:35 +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/t1273756579c9q5fdpvgxa0bzf.htm/, Retrieved Mon, 06 May 2024 09:42:33 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=75926, Retrieved Mon, 06 May 2024 09:42:33 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsB580,steven,coomans,thesis,Arima,per2maand
Estimated Impact121
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:15:35] [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 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=75926&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=75926&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75926&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
26223.873363456751121.815375469530157.141231992586290.605494920916325.931351443973
27215.347242990557103.869291413696142.455728404610288.238757576504326.825194567419
28211.60040802423998.3935452644993137.578419179284285.622396869193324.807270783978
29209.95384763132796.4161314033541135.715525331510284.192169931143323.491563859299
30209.23026061671995.628761133171134.950232687777283.510288545661322.831760100268
31208.91227764448195.2984644938408134.624198241398283.200357047563322.52609079512
32208.77253885896895.1563478524543134.482904659500283.062173058436322.388729865482
33208.71113013623495.09447992504134.421195678965283.001064593503322.327780347428
34208.68414384739595.0674049550219134.394151404619282.97413629017322.300882739767
35208.67228462360995.0555286051762134.382280982705282.962288264513322.289040642041
36208.66707304414295.050313718333134.377067240661282.957078847623322.283832369951
37208.66478279639695.0480228318684134.374776575279282.954789017513322.281542760924
38208.66377633860995.0470162507324134.373770036839282.95378264038322.280536426486
39208.66333404703795.0465739353389134.373327729691282.953340364383322.280094158735
40208.66313968038095.0463795640819134.373133360026282.953146000735322.279899796679
41208.66305426523995.0462941480521134.373047944304282.953060586174322.279814382426
42208.66301672924195.0462566118828134.373010408194282.953023050289322.279776846600
43208.66300023390995.0462401165175134.37299391284282.953006554978322.279760351301
44208.66299298497595.0462328675768134.372986663901282.952999306048322.279753102373
45208.66298979940495.0462296820048134.372983478330282.952996120478322.279749916803
46208.66298839949395.0462282820937134.372982078419282.952994720567322.279748516892
47208.66298778429795.0462276668977134.372981463223282.952994105371322.279747901697
48208.66298751394795.0462273965476134.372981192873282.952993835021322.279747631346
49208.66298739514195.0462272777412134.372981074066282.952993716215322.27974751254

\begin{tabular}{lllllllll}
\hline
Demand Forecast \tabularnewline
Point & Forecast & 95% LB & 80% LB & 80% UB & 95% UB \tabularnewline
26 & 223.873363456751 & 121.815375469530 & 157.141231992586 & 290.605494920916 & 325.931351443973 \tabularnewline
27 & 215.347242990557 & 103.869291413696 & 142.455728404610 & 288.238757576504 & 326.825194567419 \tabularnewline
28 & 211.600408024239 & 98.3935452644993 & 137.578419179284 & 285.622396869193 & 324.807270783978 \tabularnewline
29 & 209.953847631327 & 96.4161314033541 & 135.715525331510 & 284.192169931143 & 323.491563859299 \tabularnewline
30 & 209.230260616719 & 95.628761133171 & 134.950232687777 & 283.510288545661 & 322.831760100268 \tabularnewline
31 & 208.912277644481 & 95.2984644938408 & 134.624198241398 & 283.200357047563 & 322.52609079512 \tabularnewline
32 & 208.772538858968 & 95.1563478524543 & 134.482904659500 & 283.062173058436 & 322.388729865482 \tabularnewline
33 & 208.711130136234 & 95.09447992504 & 134.421195678965 & 283.001064593503 & 322.327780347428 \tabularnewline
34 & 208.684143847395 & 95.0674049550219 & 134.394151404619 & 282.97413629017 & 322.300882739767 \tabularnewline
35 & 208.672284623609 & 95.0555286051762 & 134.382280982705 & 282.962288264513 & 322.289040642041 \tabularnewline
36 & 208.667073044142 & 95.050313718333 & 134.377067240661 & 282.957078847623 & 322.283832369951 \tabularnewline
37 & 208.664782796396 & 95.0480228318684 & 134.374776575279 & 282.954789017513 & 322.281542760924 \tabularnewline
38 & 208.663776338609 & 95.0470162507324 & 134.373770036839 & 282.95378264038 & 322.280536426486 \tabularnewline
39 & 208.663334047037 & 95.0465739353389 & 134.373327729691 & 282.953340364383 & 322.280094158735 \tabularnewline
40 & 208.663139680380 & 95.0463795640819 & 134.373133360026 & 282.953146000735 & 322.279899796679 \tabularnewline
41 & 208.663054265239 & 95.0462941480521 & 134.373047944304 & 282.953060586174 & 322.279814382426 \tabularnewline
42 & 208.663016729241 & 95.0462566118828 & 134.373010408194 & 282.953023050289 & 322.279776846600 \tabularnewline
43 & 208.663000233909 & 95.0462401165175 & 134.37299391284 & 282.953006554978 & 322.279760351301 \tabularnewline
44 & 208.662992984975 & 95.0462328675768 & 134.372986663901 & 282.952999306048 & 322.279753102373 \tabularnewline
45 & 208.662989799404 & 95.0462296820048 & 134.372983478330 & 282.952996120478 & 322.279749916803 \tabularnewline
46 & 208.662988399493 & 95.0462282820937 & 134.372982078419 & 282.952994720567 & 322.279748516892 \tabularnewline
47 & 208.662987784297 & 95.0462276668977 & 134.372981463223 & 282.952994105371 & 322.279747901697 \tabularnewline
48 & 208.662987513947 & 95.0462273965476 & 134.372981192873 & 282.952993835021 & 322.279747631346 \tabularnewline
49 & 208.662987395141 & 95.0462272777412 & 134.372981074066 & 282.952993716215 & 322.27974751254 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75926&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]223.873363456751[/C][C]121.815375469530[/C][C]157.141231992586[/C][C]290.605494920916[/C][C]325.931351443973[/C][/ROW]
[ROW][C]27[/C][C]215.347242990557[/C][C]103.869291413696[/C][C]142.455728404610[/C][C]288.238757576504[/C][C]326.825194567419[/C][/ROW]
[ROW][C]28[/C][C]211.600408024239[/C][C]98.3935452644993[/C][C]137.578419179284[/C][C]285.622396869193[/C][C]324.807270783978[/C][/ROW]
[ROW][C]29[/C][C]209.953847631327[/C][C]96.4161314033541[/C][C]135.715525331510[/C][C]284.192169931143[/C][C]323.491563859299[/C][/ROW]
[ROW][C]30[/C][C]209.230260616719[/C][C]95.628761133171[/C][C]134.950232687777[/C][C]283.510288545661[/C][C]322.831760100268[/C][/ROW]
[ROW][C]31[/C][C]208.912277644481[/C][C]95.2984644938408[/C][C]134.624198241398[/C][C]283.200357047563[/C][C]322.52609079512[/C][/ROW]
[ROW][C]32[/C][C]208.772538858968[/C][C]95.1563478524543[/C][C]134.482904659500[/C][C]283.062173058436[/C][C]322.388729865482[/C][/ROW]
[ROW][C]33[/C][C]208.711130136234[/C][C]95.09447992504[/C][C]134.421195678965[/C][C]283.001064593503[/C][C]322.327780347428[/C][/ROW]
[ROW][C]34[/C][C]208.684143847395[/C][C]95.0674049550219[/C][C]134.394151404619[/C][C]282.97413629017[/C][C]322.300882739767[/C][/ROW]
[ROW][C]35[/C][C]208.672284623609[/C][C]95.0555286051762[/C][C]134.382280982705[/C][C]282.962288264513[/C][C]322.289040642041[/C][/ROW]
[ROW][C]36[/C][C]208.667073044142[/C][C]95.050313718333[/C][C]134.377067240661[/C][C]282.957078847623[/C][C]322.283832369951[/C][/ROW]
[ROW][C]37[/C][C]208.664782796396[/C][C]95.0480228318684[/C][C]134.374776575279[/C][C]282.954789017513[/C][C]322.281542760924[/C][/ROW]
[ROW][C]38[/C][C]208.663776338609[/C][C]95.0470162507324[/C][C]134.373770036839[/C][C]282.95378264038[/C][C]322.280536426486[/C][/ROW]
[ROW][C]39[/C][C]208.663334047037[/C][C]95.0465739353389[/C][C]134.373327729691[/C][C]282.953340364383[/C][C]322.280094158735[/C][/ROW]
[ROW][C]40[/C][C]208.663139680380[/C][C]95.0463795640819[/C][C]134.373133360026[/C][C]282.953146000735[/C][C]322.279899796679[/C][/ROW]
[ROW][C]41[/C][C]208.663054265239[/C][C]95.0462941480521[/C][C]134.373047944304[/C][C]282.953060586174[/C][C]322.279814382426[/C][/ROW]
[ROW][C]42[/C][C]208.663016729241[/C][C]95.0462566118828[/C][C]134.373010408194[/C][C]282.953023050289[/C][C]322.279776846600[/C][/ROW]
[ROW][C]43[/C][C]208.663000233909[/C][C]95.0462401165175[/C][C]134.37299391284[/C][C]282.953006554978[/C][C]322.279760351301[/C][/ROW]
[ROW][C]44[/C][C]208.662992984975[/C][C]95.0462328675768[/C][C]134.372986663901[/C][C]282.952999306048[/C][C]322.279753102373[/C][/ROW]
[ROW][C]45[/C][C]208.662989799404[/C][C]95.0462296820048[/C][C]134.372983478330[/C][C]282.952996120478[/C][C]322.279749916803[/C][/ROW]
[ROW][C]46[/C][C]208.662988399493[/C][C]95.0462282820937[/C][C]134.372982078419[/C][C]282.952994720567[/C][C]322.279748516892[/C][/ROW]
[ROW][C]47[/C][C]208.662987784297[/C][C]95.0462276668977[/C][C]134.372981463223[/C][C]282.952994105371[/C][C]322.279747901697[/C][/ROW]
[ROW][C]48[/C][C]208.662987513947[/C][C]95.0462273965476[/C][C]134.372981192873[/C][C]282.952993835021[/C][C]322.279747631346[/C][/ROW]
[ROW][C]49[/C][C]208.662987395141[/C][C]95.0462272777412[/C][C]134.372981074066[/C][C]282.952993716215[/C][C]322.27974751254[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75926&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75926&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
26223.873363456751121.815375469530157.141231992586290.605494920916325.931351443973
27215.347242990557103.869291413696142.455728404610288.238757576504326.825194567419
28211.60040802423998.3935452644993137.578419179284285.622396869193324.807270783978
29209.95384763132796.4161314033541135.715525331510284.192169931143323.491563859299
30209.23026061671995.628761133171134.950232687777283.510288545661322.831760100268
31208.91227764448195.2984644938408134.624198241398283.200357047563322.52609079512
32208.77253885896895.1563478524543134.482904659500283.062173058436322.388729865482
33208.71113013623495.09447992504134.421195678965283.001064593503322.327780347428
34208.68414384739595.0674049550219134.394151404619282.97413629017322.300882739767
35208.67228462360995.0555286051762134.382280982705282.962288264513322.289040642041
36208.66707304414295.050313718333134.377067240661282.957078847623322.283832369951
37208.66478279639695.0480228318684134.374776575279282.954789017513322.281542760924
38208.66377633860995.0470162507324134.373770036839282.95378264038322.280536426486
39208.66333404703795.0465739353389134.373327729691282.953340364383322.280094158735
40208.66313968038095.0463795640819134.373133360026282.953146000735322.279899796679
41208.66305426523995.0462941480521134.373047944304282.953060586174322.279814382426
42208.66301672924195.0462566118828134.373010408194282.953023050289322.279776846600
43208.66300023390995.0462401165175134.37299391284282.953006554978322.279760351301
44208.66299298497595.0462328675768134.372986663901282.952999306048322.279753102373
45208.66298979940495.0462296820048134.372983478330282.952996120478322.279749916803
46208.66298839949395.0462282820937134.372982078419282.952994720567322.279748516892
47208.66298778429795.0462276668977134.372981463223282.952994105371322.279747901697
48208.66298751394795.0462273965476134.372981192873282.952993835021322.279747631346
49208.66298739514195.0462272777412134.372981074066282.952993716215322.27974751254







Actuals and Interpolation
TimeActualForecast
1192206.967782536146
2212.25201.340376307467
3191.8210.239313211865
4163.7625201.252485572609
5272.025188.931303179668
6284.575236.507656592625
7301.6635242.02280020498
8287.5375249.532404318106
9220.4375243.324681715068
10178.3213.837340170125
11284.8875195.319860969677
12283.9875242.160129478196
13238241.764621171334
14216.275221.555245324865
15162.875212.008114250888
16185.95188.541288043735
17193.7875198.681681578005
18128.3275202.125899750263
1983.925173.359262231158
20177.15153.846420458440
21142.3194.814489244242
22120.5375179.499528695192
23269.25169.935918108429
24167.625235.288172646467
25243.275190.628692996618

\begin{tabular}{lllllllll}
\hline
Actuals and Interpolation \tabularnewline
Time & Actual & Forecast \tabularnewline
1 & 192 & 206.967782536146 \tabularnewline
2 & 212.25 & 201.340376307467 \tabularnewline
3 & 191.8 & 210.239313211865 \tabularnewline
4 & 163.7625 & 201.252485572609 \tabularnewline
5 & 272.025 & 188.931303179668 \tabularnewline
6 & 284.575 & 236.507656592625 \tabularnewline
7 & 301.6635 & 242.02280020498 \tabularnewline
8 & 287.5375 & 249.532404318106 \tabularnewline
9 & 220.4375 & 243.324681715068 \tabularnewline
10 & 178.3 & 213.837340170125 \tabularnewline
11 & 284.8875 & 195.319860969677 \tabularnewline
12 & 283.9875 & 242.160129478196 \tabularnewline
13 & 238 & 241.764621171334 \tabularnewline
14 & 216.275 & 221.555245324865 \tabularnewline
15 & 162.875 & 212.008114250888 \tabularnewline
16 & 185.95 & 188.541288043735 \tabularnewline
17 & 193.7875 & 198.681681578005 \tabularnewline
18 & 128.3275 & 202.125899750263 \tabularnewline
19 & 83.925 & 173.359262231158 \tabularnewline
20 & 177.15 & 153.846420458440 \tabularnewline
21 & 142.3 & 194.814489244242 \tabularnewline
22 & 120.5375 & 179.499528695192 \tabularnewline
23 & 269.25 & 169.935918108429 \tabularnewline
24 & 167.625 & 235.288172646467 \tabularnewline
25 & 243.275 & 190.628692996618 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75926&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]206.967782536146[/C][/ROW]
[ROW][C]2[/C][C]212.25[/C][C]201.340376307467[/C][/ROW]
[ROW][C]3[/C][C]191.8[/C][C]210.239313211865[/C][/ROW]
[ROW][C]4[/C][C]163.7625[/C][C]201.252485572609[/C][/ROW]
[ROW][C]5[/C][C]272.025[/C][C]188.931303179668[/C][/ROW]
[ROW][C]6[/C][C]284.575[/C][C]236.507656592625[/C][/ROW]
[ROW][C]7[/C][C]301.6635[/C][C]242.02280020498[/C][/ROW]
[ROW][C]8[/C][C]287.5375[/C][C]249.532404318106[/C][/ROW]
[ROW][C]9[/C][C]220.4375[/C][C]243.324681715068[/C][/ROW]
[ROW][C]10[/C][C]178.3[/C][C]213.837340170125[/C][/ROW]
[ROW][C]11[/C][C]284.8875[/C][C]195.319860969677[/C][/ROW]
[ROW][C]12[/C][C]283.9875[/C][C]242.160129478196[/C][/ROW]
[ROW][C]13[/C][C]238[/C][C]241.764621171334[/C][/ROW]
[ROW][C]14[/C][C]216.275[/C][C]221.555245324865[/C][/ROW]
[ROW][C]15[/C][C]162.875[/C][C]212.008114250888[/C][/ROW]
[ROW][C]16[/C][C]185.95[/C][C]188.541288043735[/C][/ROW]
[ROW][C]17[/C][C]193.7875[/C][C]198.681681578005[/C][/ROW]
[ROW][C]18[/C][C]128.3275[/C][C]202.125899750263[/C][/ROW]
[ROW][C]19[/C][C]83.925[/C][C]173.359262231158[/C][/ROW]
[ROW][C]20[/C][C]177.15[/C][C]153.846420458440[/C][/ROW]
[ROW][C]21[/C][C]142.3[/C][C]194.814489244242[/C][/ROW]
[ROW][C]22[/C][C]120.5375[/C][C]179.499528695192[/C][/ROW]
[ROW][C]23[/C][C]269.25[/C][C]169.935918108429[/C][/ROW]
[ROW][C]24[/C][C]167.625[/C][C]235.288172646467[/C][/ROW]
[ROW][C]25[/C][C]243.275[/C][C]190.628692996618[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75926&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75926&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
1192206.967782536146
2212.25201.340376307467
3191.8210.239313211865
4163.7625201.252485572609
5272.025188.931303179668
6284.575236.507656592625
7301.6635242.02280020498
8287.5375249.532404318106
9220.4375243.324681715068
10178.3213.837340170125
11284.8875195.319860969677
12283.9875242.160129478196
13238241.764621171334
14216.275221.555245324865
15162.875212.008114250888
16185.95188.541288043735
17193.7875198.681681578005
18128.3275202.125899750263
1983.925173.359262231158
20177.15153.846420458440
21142.3194.814489244242
22120.5375179.499528695192
23269.25169.935918108429
24167.625235.288172646467
25243.275190.628692996618







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

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