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:06:38 +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/t1273756034ti0auxri67g8vpu.htm/, Retrieved Mon, 06 May 2024 03:55:08 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=75919, Retrieved Mon, 06 May 2024 03:55:08 +0000
QR Codes:

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

Post a new message
Dataseries X:
66
71
50
66
66
44
76.75
66
65.75
76.75
65
76
88
75.5
97.5
98
88.0115
55.25
88.25
87
75.5
88
74.5
63.5
94




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

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







Demand Forecast
PointForecast95% LB80% LB80% UB95% UB
2688.593756949478961.169021794570170.6616864881601106.525827410798116.018492104388
2789.671272839561361.912984850751571.5211039030412107.821441776081117.429560828371
2890.748788729643862.656946945638872.3805206893659109.117056769922118.840630513649
2991.826304619726263.400907818261173.2399366764944110.412672562958120.251701421191
3092.903820509808764.14486721291674.099351697232111.708289322385121.662773806701
3193.981336399891164.888824878791174.9587655875813113.003907212201123.073847920991
3295.058852289973665.632780569607875.8181781865093114.299526393438124.484924010339
3396.13636818005666.37673404329276.6775893357323115.595147024380125.896002316820
3497.213884070138567.120685061664577.5369988795133116.890769260764127.307083078612
3598.29139996022167.864633390153778.396406664474118.186393255968128.718166530288
3699.368915850303468.608578797524979.2558125394184119.482019161188130.129252903082
37100.44643174038669.35252105562980.1152163551677120.777647125604131.540342425143
38101.52394763046870.096459939166380.9746179644065122.073277296530132.951435321770
39102.60146352055170.840395225464981.8340172215372123.368909819564134.362531815637
40103.67897941063371.584326694273982.6934139825456124.664544838721135.773632126993
41104.75649530071672.328254127567983.5528081048727125.960182496559137.184736473864
42105.83401119079873.072177309365484.4121994472956127.255822934301138.595845072231
43106.91152708088173.816096025556585.2715878698153128.551466291946140.006958136205
44107.98904297096374.560010063741686.1309732335514129.847112708375141.418075878185
45109.06655886104675.303919213079586.9903554006422131.142762321449142.829198509012
46110.14407475112876.047823264145487.849734234152132.438415268104144.240326238111
47111.22159064121076.791722008795288.7091095979829133.734071684438145.651459273626
48112.29910653129377.535615240039489.5684813567916135.029731705794147.062597822546
49113.37662242137578.279502751923890.427849375912136.325395466839148.473742090827

\begin{tabular}{lllllllll}
\hline
Demand Forecast \tabularnewline
Point & Forecast & 95% LB & 80% LB & 80% UB & 95% UB \tabularnewline
26 & 88.5937569494789 & 61.1690217945701 & 70.6616864881601 & 106.525827410798 & 116.018492104388 \tabularnewline
27 & 89.6712728395613 & 61.9129848507515 & 71.5211039030412 & 107.821441776081 & 117.429560828371 \tabularnewline
28 & 90.7487887296438 & 62.6569469456388 & 72.3805206893659 & 109.117056769922 & 118.840630513649 \tabularnewline
29 & 91.8263046197262 & 63.4009078182611 & 73.2399366764944 & 110.412672562958 & 120.251701421191 \tabularnewline
30 & 92.9038205098087 & 64.144867212916 & 74.099351697232 & 111.708289322385 & 121.662773806701 \tabularnewline
31 & 93.9813363998911 & 64.8888248787911 & 74.9587655875813 & 113.003907212201 & 123.073847920991 \tabularnewline
32 & 95.0588522899736 & 65.6327805696078 & 75.8181781865093 & 114.299526393438 & 124.484924010339 \tabularnewline
33 & 96.136368180056 & 66.376734043292 & 76.6775893357323 & 115.595147024380 & 125.896002316820 \tabularnewline
34 & 97.2138840701385 & 67.1206850616645 & 77.5369988795133 & 116.890769260764 & 127.307083078612 \tabularnewline
35 & 98.291399960221 & 67.8646333901537 & 78.396406664474 & 118.186393255968 & 128.718166530288 \tabularnewline
36 & 99.3689158503034 & 68.6085787975249 & 79.2558125394184 & 119.482019161188 & 130.129252903082 \tabularnewline
37 & 100.446431740386 & 69.352521055629 & 80.1152163551677 & 120.777647125604 & 131.540342425143 \tabularnewline
38 & 101.523947630468 & 70.0964599391663 & 80.9746179644065 & 122.073277296530 & 132.951435321770 \tabularnewline
39 & 102.601463520551 & 70.8403952254649 & 81.8340172215372 & 123.368909819564 & 134.362531815637 \tabularnewline
40 & 103.678979410633 & 71.5843266942739 & 82.6934139825456 & 124.664544838721 & 135.773632126993 \tabularnewline
41 & 104.756495300716 & 72.3282541275679 & 83.5528081048727 & 125.960182496559 & 137.184736473864 \tabularnewline
42 & 105.834011190798 & 73.0721773093654 & 84.4121994472956 & 127.255822934301 & 138.595845072231 \tabularnewline
43 & 106.911527080881 & 73.8160960255565 & 85.2715878698153 & 128.551466291946 & 140.006958136205 \tabularnewline
44 & 107.989042970963 & 74.5600100637416 & 86.1309732335514 & 129.847112708375 & 141.418075878185 \tabularnewline
45 & 109.066558861046 & 75.3039192130795 & 86.9903554006422 & 131.142762321449 & 142.829198509012 \tabularnewline
46 & 110.144074751128 & 76.0478232641454 & 87.849734234152 & 132.438415268104 & 144.240326238111 \tabularnewline
47 & 111.221590641210 & 76.7917220087952 & 88.7091095979829 & 133.734071684438 & 145.651459273626 \tabularnewline
48 & 112.299106531293 & 77.5356152400394 & 89.5684813567916 & 135.029731705794 & 147.062597822546 \tabularnewline
49 & 113.376622421375 & 78.2795027519238 & 90.427849375912 & 136.325395466839 & 148.473742090827 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75919&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]88.5937569494789[/C][C]61.1690217945701[/C][C]70.6616864881601[/C][C]106.525827410798[/C][C]116.018492104388[/C][/ROW]
[ROW][C]27[/C][C]89.6712728395613[/C][C]61.9129848507515[/C][C]71.5211039030412[/C][C]107.821441776081[/C][C]117.429560828371[/C][/ROW]
[ROW][C]28[/C][C]90.7487887296438[/C][C]62.6569469456388[/C][C]72.3805206893659[/C][C]109.117056769922[/C][C]118.840630513649[/C][/ROW]
[ROW][C]29[/C][C]91.8263046197262[/C][C]63.4009078182611[/C][C]73.2399366764944[/C][C]110.412672562958[/C][C]120.251701421191[/C][/ROW]
[ROW][C]30[/C][C]92.9038205098087[/C][C]64.144867212916[/C][C]74.099351697232[/C][C]111.708289322385[/C][C]121.662773806701[/C][/ROW]
[ROW][C]31[/C][C]93.9813363998911[/C][C]64.8888248787911[/C][C]74.9587655875813[/C][C]113.003907212201[/C][C]123.073847920991[/C][/ROW]
[ROW][C]32[/C][C]95.0588522899736[/C][C]65.6327805696078[/C][C]75.8181781865093[/C][C]114.299526393438[/C][C]124.484924010339[/C][/ROW]
[ROW][C]33[/C][C]96.136368180056[/C][C]66.376734043292[/C][C]76.6775893357323[/C][C]115.595147024380[/C][C]125.896002316820[/C][/ROW]
[ROW][C]34[/C][C]97.2138840701385[/C][C]67.1206850616645[/C][C]77.5369988795133[/C][C]116.890769260764[/C][C]127.307083078612[/C][/ROW]
[ROW][C]35[/C][C]98.291399960221[/C][C]67.8646333901537[/C][C]78.396406664474[/C][C]118.186393255968[/C][C]128.718166530288[/C][/ROW]
[ROW][C]36[/C][C]99.3689158503034[/C][C]68.6085787975249[/C][C]79.2558125394184[/C][C]119.482019161188[/C][C]130.129252903082[/C][/ROW]
[ROW][C]37[/C][C]100.446431740386[/C][C]69.352521055629[/C][C]80.1152163551677[/C][C]120.777647125604[/C][C]131.540342425143[/C][/ROW]
[ROW][C]38[/C][C]101.523947630468[/C][C]70.0964599391663[/C][C]80.9746179644065[/C][C]122.073277296530[/C][C]132.951435321770[/C][/ROW]
[ROW][C]39[/C][C]102.601463520551[/C][C]70.8403952254649[/C][C]81.8340172215372[/C][C]123.368909819564[/C][C]134.362531815637[/C][/ROW]
[ROW][C]40[/C][C]103.678979410633[/C][C]71.5843266942739[/C][C]82.6934139825456[/C][C]124.664544838721[/C][C]135.773632126993[/C][/ROW]
[ROW][C]41[/C][C]104.756495300716[/C][C]72.3282541275679[/C][C]83.5528081048727[/C][C]125.960182496559[/C][C]137.184736473864[/C][/ROW]
[ROW][C]42[/C][C]105.834011190798[/C][C]73.0721773093654[/C][C]84.4121994472956[/C][C]127.255822934301[/C][C]138.595845072231[/C][/ROW]
[ROW][C]43[/C][C]106.911527080881[/C][C]73.8160960255565[/C][C]85.2715878698153[/C][C]128.551466291946[/C][C]140.006958136205[/C][/ROW]
[ROW][C]44[/C][C]107.989042970963[/C][C]74.5600100637416[/C][C]86.1309732335514[/C][C]129.847112708375[/C][C]141.418075878185[/C][/ROW]
[ROW][C]45[/C][C]109.066558861046[/C][C]75.3039192130795[/C][C]86.9903554006422[/C][C]131.142762321449[/C][C]142.829198509012[/C][/ROW]
[ROW][C]46[/C][C]110.144074751128[/C][C]76.0478232641454[/C][C]87.849734234152[/C][C]132.438415268104[/C][C]144.240326238111[/C][/ROW]
[ROW][C]47[/C][C]111.221590641210[/C][C]76.7917220087952[/C][C]88.7091095979829[/C][C]133.734071684438[/C][C]145.651459273626[/C][/ROW]
[ROW][C]48[/C][C]112.299106531293[/C][C]77.5356152400394[/C][C]89.5684813567916[/C][C]135.029731705794[/C][C]147.062597822546[/C][/ROW]
[ROW][C]49[/C][C]113.376622421375[/C][C]78.2795027519238[/C][C]90.427849375912[/C][C]136.325395466839[/C][C]148.473742090827[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75919&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75919&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
2688.593756949478961.169021794570170.6616864881601106.525827410798116.018492104388
2789.671272839561361.912984850751571.5211039030412107.821441776081117.429560828371
2890.748788729643862.656946945638872.3805206893659109.117056769922118.840630513649
2991.826304619726263.400907818261173.2399366764944110.412672562958120.251701421191
3092.903820509808764.14486721291674.099351697232111.708289322385121.662773806701
3193.981336399891164.888824878791174.9587655875813113.003907212201123.073847920991
3295.058852289973665.632780569607875.8181781865093114.299526393438124.484924010339
3396.13636818005666.37673404329276.6775893357323115.595147024380125.896002316820
3497.213884070138567.120685061664577.5369988795133116.890769260764127.307083078612
3598.29139996022167.864633390153778.396406664474118.186393255968128.718166530288
3699.368915850303468.608578797524979.2558125394184119.482019161188130.129252903082
37100.44643174038669.35252105562980.1152163551677120.777647125604131.540342425143
38101.52394763046870.096459939166380.9746179644065122.073277296530132.951435321770
39102.60146352055170.840395225464981.8340172215372123.368909819564134.362531815637
40103.67897941063371.584326694273982.6934139825456124.664544838721135.773632126993
41104.75649530071672.328254127567983.5528081048727125.960182496559137.184736473864
42105.83401119079873.072177309365484.4121994472956127.255822934301138.595845072231
43106.91152708088173.816096025556585.2715878698153128.551466291946140.006958136205
44107.98904297096374.560010063741686.1309732335514129.847112708375141.418075878185
45109.06655886104675.303919213079586.9903554006422131.142762321449142.829198509012
46110.14407475112876.047823264145487.849734234152132.438415268104144.240326238111
47111.22159064121076.791722008795288.7091095979829133.734071684438145.651459273626
48112.29910653129377.535615240039489.5684813567916135.029731705794147.062597822546
49113.37662242137578.279502751923890.427849375912136.325395466839148.473742090827







Actuals and Interpolation
TimeActualForecast
16665.9293366525043
27170.8680320462113
35050.2163309228226
46665.9827164753333
56665.9993404862515
64444.3436189251445
776.7576.6231024714092
86666.0460290529034
965.7565.8141920877573
1076.7576.674093729902
116565.1023563693362
127675.9657948158125
138887.819777379446
1475.575.5018569541544
1597.597.2291009532818
169897.7403340016694
1788.011587.8957556168923
1855.2555.5590661695737
1988.2588.1610477971363
208786.940601684571
2175.575.592583208209
228887.955890234155
2374.574.6272559913572
2463.563.7653950698418
259493.9259056838178

\begin{tabular}{lllllllll}
\hline
Actuals and Interpolation \tabularnewline
Time & Actual & Forecast \tabularnewline
1 & 66 & 65.9293366525043 \tabularnewline
2 & 71 & 70.8680320462113 \tabularnewline
3 & 50 & 50.2163309228226 \tabularnewline
4 & 66 & 65.9827164753333 \tabularnewline
5 & 66 & 65.9993404862515 \tabularnewline
6 & 44 & 44.3436189251445 \tabularnewline
7 & 76.75 & 76.6231024714092 \tabularnewline
8 & 66 & 66.0460290529034 \tabularnewline
9 & 65.75 & 65.8141920877573 \tabularnewline
10 & 76.75 & 76.674093729902 \tabularnewline
11 & 65 & 65.1023563693362 \tabularnewline
12 & 76 & 75.9657948158125 \tabularnewline
13 & 88 & 87.819777379446 \tabularnewline
14 & 75.5 & 75.5018569541544 \tabularnewline
15 & 97.5 & 97.2291009532818 \tabularnewline
16 & 98 & 97.7403340016694 \tabularnewline
17 & 88.0115 & 87.8957556168923 \tabularnewline
18 & 55.25 & 55.5590661695737 \tabularnewline
19 & 88.25 & 88.1610477971363 \tabularnewline
20 & 87 & 86.940601684571 \tabularnewline
21 & 75.5 & 75.592583208209 \tabularnewline
22 & 88 & 87.955890234155 \tabularnewline
23 & 74.5 & 74.6272559913572 \tabularnewline
24 & 63.5 & 63.7653950698418 \tabularnewline
25 & 94 & 93.9259056838178 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75919&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]66[/C][C]65.9293366525043[/C][/ROW]
[ROW][C]2[/C][C]71[/C][C]70.8680320462113[/C][/ROW]
[ROW][C]3[/C][C]50[/C][C]50.2163309228226[/C][/ROW]
[ROW][C]4[/C][C]66[/C][C]65.9827164753333[/C][/ROW]
[ROW][C]5[/C][C]66[/C][C]65.9993404862515[/C][/ROW]
[ROW][C]6[/C][C]44[/C][C]44.3436189251445[/C][/ROW]
[ROW][C]7[/C][C]76.75[/C][C]76.6231024714092[/C][/ROW]
[ROW][C]8[/C][C]66[/C][C]66.0460290529034[/C][/ROW]
[ROW][C]9[/C][C]65.75[/C][C]65.8141920877573[/C][/ROW]
[ROW][C]10[/C][C]76.75[/C][C]76.674093729902[/C][/ROW]
[ROW][C]11[/C][C]65[/C][C]65.1023563693362[/C][/ROW]
[ROW][C]12[/C][C]76[/C][C]75.9657948158125[/C][/ROW]
[ROW][C]13[/C][C]88[/C][C]87.819777379446[/C][/ROW]
[ROW][C]14[/C][C]75.5[/C][C]75.5018569541544[/C][/ROW]
[ROW][C]15[/C][C]97.5[/C][C]97.2291009532818[/C][/ROW]
[ROW][C]16[/C][C]98[/C][C]97.7403340016694[/C][/ROW]
[ROW][C]17[/C][C]88.0115[/C][C]87.8957556168923[/C][/ROW]
[ROW][C]18[/C][C]55.25[/C][C]55.5590661695737[/C][/ROW]
[ROW][C]19[/C][C]88.25[/C][C]88.1610477971363[/C][/ROW]
[ROW][C]20[/C][C]87[/C][C]86.940601684571[/C][/ROW]
[ROW][C]21[/C][C]75.5[/C][C]75.592583208209[/C][/ROW]
[ROW][C]22[/C][C]88[/C][C]87.955890234155[/C][/ROW]
[ROW][C]23[/C][C]74.5[/C][C]74.6272559913572[/C][/ROW]
[ROW][C]24[/C][C]63.5[/C][C]63.7653950698418[/C][/ROW]
[ROW][C]25[/C][C]94[/C][C]93.9259056838178[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75919&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75919&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
16665.9293366525043
27170.8680320462113
35050.2163309228226
46665.9827164753333
56665.9993404862515
64444.3436189251445
776.7576.6231024714092
86666.0460290529034
965.7565.8141920877573
1076.7576.674093729902
116565.1023563693362
127675.9657948158125
138887.819777379446
1475.575.5018569541544
1597.597.2291009532818
169897.7403340016694
1788.011587.8957556168923
1855.2555.5590661695737
1988.2588.1610477971363
208786.940601684571
2175.575.592583208209
228887.955890234155
2374.574.6272559913572
2463.563.7653950698418
259493.9259056838178







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

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