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:54:01 +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/t1273755287wq333p59m2dtfxb.htm/, Retrieved Mon, 06 May 2024 10:24:33 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=75910, Retrieved Mon, 06 May 2024 10:24:33 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsB11A,steven,coomans,ETS,thesis,per2maand
Estimated Impact176
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:54:01] [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 time5 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 & 5 seconds \tabularnewline
R Server & wessa.org @ wessa.org \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75910&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]5 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]wessa.org @ wessa.org[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75910&T=0

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







Demand Forecast
PointForecast95% LB80% LB80% UB95% UB
26-4.47164486052619-25.2565782343988-18.06218229648719.1188925754346816.3132885133464
27-5.65403425130916-26.4389692037385-19.24457271943287.936504216814515.1309007011202
28-6.81099952954678-27.5959372385169-20.40153980007566.7795407409820113.9739381794233
29-7.94308737258898-28.7280293065407-21.53363040568475.6474556605067712.8418545613627
30-9.0508327029555-29.8357806011060-22.64137963583134.5397142299202811.7341151951951
31-10.1347589410920-30.9197147947494-23.72531107579413.4557931936100710.6501969125654
32-11.1953782526914-31.9803442875173-24.78593704450182.395180539118899.58958778213443
33-12.2331917906971-33.0181704498749-25.82375883712751.357375255733258.55178686848067
34-13.2486899321024-34.0336838603687-26.83926696245310.3418870982482417.53630399616383
35-14.2423525096589-35.0273645381583-27.8329413751159-0.651763644201916.54265951884051
36-15.2146490386016-35.999682170527-28.8052517028471-1.624046374356035.57038409332381
37-16.1660389384997-36.9510963354812-29.7566574688126-2.575420408186844.6190184584817
38-17.0969717503370-37.8820567195447-30.6876083091596-3.506335191514343.68811321887078
39-18.0078873489238-38.7930033308523-31.5985441858746-4.417230511973102.77722863300461
40-18.8992161507428-39.6843667076431-32.4898955950525-5.308536706433131.88593440615749
41-19.7713793173244-40.5565681222558-33.3620837706773-6.180674863971371.01380948760706
42-20.6247889542498-41.4100197807206-34.2155208840105-7.034057024489120.160441872220961
43-21.4598483058754-42.2451250180454-35.0506102386822-7.86908637306859-0.674571593705313
44-22.2769519458688-43.0622784892877-35.8677464615779-8.68615743015977-1.49162540244994
45-23.0764859636495-43.8618663565043-36.6673156896122-9.48565623768686-2.29110557079467
46-23.8588281468194-44.6442664716688-37.4496957524772-10.2679605411616-3.07338982197006
47-24.6243481596714-45.4098485556418-38.2152563514537-11.0334399678891-3.83884776370101
48-25.3734077178591-46.1589743732821-38.9643592343688-11.7824562013494-4.58784106243611
49-26.1063607593113-46.8919979047804-39.6973583667848-12.5153631518379-5.32072361384225

\begin{tabular}{lllllllll}
\hline
Demand Forecast \tabularnewline
Point & Forecast & 95% LB & 80% LB & 80% UB & 95% UB \tabularnewline
26 & -4.47164486052619 & -25.2565782343988 & -18.0621822964871 & 9.11889257543468 & 16.3132885133464 \tabularnewline
27 & -5.65403425130916 & -26.4389692037385 & -19.2445727194328 & 7.9365042168145 & 15.1309007011202 \tabularnewline
28 & -6.81099952954678 & -27.5959372385169 & -20.4015398000756 & 6.77954074098201 & 13.9739381794233 \tabularnewline
29 & -7.94308737258898 & -28.7280293065407 & -21.5336304056847 & 5.64745566050677 & 12.8418545613627 \tabularnewline
30 & -9.0508327029555 & -29.8357806011060 & -22.6413796358313 & 4.53971422992028 & 11.7341151951951 \tabularnewline
31 & -10.1347589410920 & -30.9197147947494 & -23.7253110757941 & 3.45579319361007 & 10.6501969125654 \tabularnewline
32 & -11.1953782526914 & -31.9803442875173 & -24.7859370445018 & 2.39518053911889 & 9.58958778213443 \tabularnewline
33 & -12.2331917906971 & -33.0181704498749 & -25.8237588371275 & 1.35737525573325 & 8.55178686848067 \tabularnewline
34 & -13.2486899321024 & -34.0336838603687 & -26.8392669624531 & 0.341887098248241 & 7.53630399616383 \tabularnewline
35 & -14.2423525096589 & -35.0273645381583 & -27.8329413751159 & -0.65176364420191 & 6.54265951884051 \tabularnewline
36 & -15.2146490386016 & -35.999682170527 & -28.8052517028471 & -1.62404637435603 & 5.57038409332381 \tabularnewline
37 & -16.1660389384997 & -36.9510963354812 & -29.7566574688126 & -2.57542040818684 & 4.6190184584817 \tabularnewline
38 & -17.0969717503370 & -37.8820567195447 & -30.6876083091596 & -3.50633519151434 & 3.68811321887078 \tabularnewline
39 & -18.0078873489238 & -38.7930033308523 & -31.5985441858746 & -4.41723051197310 & 2.77722863300461 \tabularnewline
40 & -18.8992161507428 & -39.6843667076431 & -32.4898955950525 & -5.30853670643313 & 1.88593440615749 \tabularnewline
41 & -19.7713793173244 & -40.5565681222558 & -33.3620837706773 & -6.18067486397137 & 1.01380948760706 \tabularnewline
42 & -20.6247889542498 & -41.4100197807206 & -34.2155208840105 & -7.03405702448912 & 0.160441872220961 \tabularnewline
43 & -21.4598483058754 & -42.2451250180454 & -35.0506102386822 & -7.86908637306859 & -0.674571593705313 \tabularnewline
44 & -22.2769519458688 & -43.0622784892877 & -35.8677464615779 & -8.68615743015977 & -1.49162540244994 \tabularnewline
45 & -23.0764859636495 & -43.8618663565043 & -36.6673156896122 & -9.48565623768686 & -2.29110557079467 \tabularnewline
46 & -23.8588281468194 & -44.6442664716688 & -37.4496957524772 & -10.2679605411616 & -3.07338982197006 \tabularnewline
47 & -24.6243481596714 & -45.4098485556418 & -38.2152563514537 & -11.0334399678891 & -3.83884776370101 \tabularnewline
48 & -25.3734077178591 & -46.1589743732821 & -38.9643592343688 & -11.7824562013494 & -4.58784106243611 \tabularnewline
49 & -26.1063607593113 & -46.8919979047804 & -39.6973583667848 & -12.5153631518379 & -5.32072361384225 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75910&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]-4.47164486052619[/C][C]-25.2565782343988[/C][C]-18.0621822964871[/C][C]9.11889257543468[/C][C]16.3132885133464[/C][/ROW]
[ROW][C]27[/C][C]-5.65403425130916[/C][C]-26.4389692037385[/C][C]-19.2445727194328[/C][C]7.9365042168145[/C][C]15.1309007011202[/C][/ROW]
[ROW][C]28[/C][C]-6.81099952954678[/C][C]-27.5959372385169[/C][C]-20.4015398000756[/C][C]6.77954074098201[/C][C]13.9739381794233[/C][/ROW]
[ROW][C]29[/C][C]-7.94308737258898[/C][C]-28.7280293065407[/C][C]-21.5336304056847[/C][C]5.64745566050677[/C][C]12.8418545613627[/C][/ROW]
[ROW][C]30[/C][C]-9.0508327029555[/C][C]-29.8357806011060[/C][C]-22.6413796358313[/C][C]4.53971422992028[/C][C]11.7341151951951[/C][/ROW]
[ROW][C]31[/C][C]-10.1347589410920[/C][C]-30.9197147947494[/C][C]-23.7253110757941[/C][C]3.45579319361007[/C][C]10.6501969125654[/C][/ROW]
[ROW][C]32[/C][C]-11.1953782526914[/C][C]-31.9803442875173[/C][C]-24.7859370445018[/C][C]2.39518053911889[/C][C]9.58958778213443[/C][/ROW]
[ROW][C]33[/C][C]-12.2331917906971[/C][C]-33.0181704498749[/C][C]-25.8237588371275[/C][C]1.35737525573325[/C][C]8.55178686848067[/C][/ROW]
[ROW][C]34[/C][C]-13.2486899321024[/C][C]-34.0336838603687[/C][C]-26.8392669624531[/C][C]0.341887098248241[/C][C]7.53630399616383[/C][/ROW]
[ROW][C]35[/C][C]-14.2423525096589[/C][C]-35.0273645381583[/C][C]-27.8329413751159[/C][C]-0.65176364420191[/C][C]6.54265951884051[/C][/ROW]
[ROW][C]36[/C][C]-15.2146490386016[/C][C]-35.999682170527[/C][C]-28.8052517028471[/C][C]-1.62404637435603[/C][C]5.57038409332381[/C][/ROW]
[ROW][C]37[/C][C]-16.1660389384997[/C][C]-36.9510963354812[/C][C]-29.7566574688126[/C][C]-2.57542040818684[/C][C]4.6190184584817[/C][/ROW]
[ROW][C]38[/C][C]-17.0969717503370[/C][C]-37.8820567195447[/C][C]-30.6876083091596[/C][C]-3.50633519151434[/C][C]3.68811321887078[/C][/ROW]
[ROW][C]39[/C][C]-18.0078873489238[/C][C]-38.7930033308523[/C][C]-31.5985441858746[/C][C]-4.41723051197310[/C][C]2.77722863300461[/C][/ROW]
[ROW][C]40[/C][C]-18.8992161507428[/C][C]-39.6843667076431[/C][C]-32.4898955950525[/C][C]-5.30853670643313[/C][C]1.88593440615749[/C][/ROW]
[ROW][C]41[/C][C]-19.7713793173244[/C][C]-40.5565681222558[/C][C]-33.3620837706773[/C][C]-6.18067486397137[/C][C]1.01380948760706[/C][/ROW]
[ROW][C]42[/C][C]-20.6247889542498[/C][C]-41.4100197807206[/C][C]-34.2155208840105[/C][C]-7.03405702448912[/C][C]0.160441872220961[/C][/ROW]
[ROW][C]43[/C][C]-21.4598483058754[/C][C]-42.2451250180454[/C][C]-35.0506102386822[/C][C]-7.86908637306859[/C][C]-0.674571593705313[/C][/ROW]
[ROW][C]44[/C][C]-22.2769519458688[/C][C]-43.0622784892877[/C][C]-35.8677464615779[/C][C]-8.68615743015977[/C][C]-1.49162540244994[/C][/ROW]
[ROW][C]45[/C][C]-23.0764859636495[/C][C]-43.8618663565043[/C][C]-36.6673156896122[/C][C]-9.48565623768686[/C][C]-2.29110557079467[/C][/ROW]
[ROW][C]46[/C][C]-23.8588281468194[/C][C]-44.6442664716688[/C][C]-37.4496957524772[/C][C]-10.2679605411616[/C][C]-3.07338982197006[/C][/ROW]
[ROW][C]47[/C][C]-24.6243481596714[/C][C]-45.4098485556418[/C][C]-38.2152563514537[/C][C]-11.0334399678891[/C][C]-3.83884776370101[/C][/ROW]
[ROW][C]48[/C][C]-25.3734077178591[/C][C]-46.1589743732821[/C][C]-38.9643592343688[/C][C]-11.7824562013494[/C][C]-4.58784106243611[/C][/ROW]
[ROW][C]49[/C][C]-26.1063607593113[/C][C]-46.8919979047804[/C][C]-39.6973583667848[/C][C]-12.5153631518379[/C][C]-5.32072361384225[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75910&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75910&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-4.47164486052619-25.2565782343988-18.06218229648719.1188925754346816.3132885133464
27-5.65403425130916-26.4389692037385-19.24457271943287.936504216814515.1309007011202
28-6.81099952954678-27.5959372385169-20.40153980007566.7795407409820113.9739381794233
29-7.94308737258898-28.7280293065407-21.53363040568475.6474556605067712.8418545613627
30-9.0508327029555-29.8357806011060-22.64137963583134.5397142299202811.7341151951951
31-10.1347589410920-30.9197147947494-23.72531107579413.4557931936100710.6501969125654
32-11.1953782526914-31.9803442875173-24.78593704450182.395180539118899.58958778213443
33-12.2331917906971-33.0181704498749-25.82375883712751.357375255733258.55178686848067
34-13.2486899321024-34.0336838603687-26.83926696245310.3418870982482417.53630399616383
35-14.2423525096589-35.0273645381583-27.8329413751159-0.651763644201916.54265951884051
36-15.2146490386016-35.999682170527-28.8052517028471-1.624046374356035.57038409332381
37-16.1660389384997-36.9510963354812-29.7566574688126-2.575420408186844.6190184584817
38-17.0969717503370-37.8820567195447-30.6876083091596-3.506335191514343.68811321887078
39-18.0078873489238-38.7930033308523-31.5985441858746-4.417230511973102.77722863300461
40-18.8992161507428-39.6843667076431-32.4898955950525-5.308536706433131.88593440615749
41-19.7713793173244-40.5565681222558-33.3620837706773-6.180674863971371.01380948760706
42-20.6247889542498-41.4100197807206-34.2155208840105-7.034057024489120.160441872220961
43-21.4598483058754-42.2451250180454-35.0506102386822-7.86908637306859-0.674571593705313
44-22.2769519458688-43.0622784892877-35.8677464615779-8.68615743015977-1.49162540244994
45-23.0764859636495-43.8618663565043-36.6673156896122-9.48565623768686-2.29110557079467
46-23.8588281468194-44.6442664716688-37.4496957524772-10.2679605411616-3.07338982197006
47-24.6243481596714-45.4098485556418-38.2152563514537-11.0334399678891-3.83884776370101
48-25.3734077178591-46.1589743732821-38.9643592343688-11.7824562013494-4.58784106243611
49-26.1063607593113-46.8919979047804-39.6973583667848-12.5153631518379-5.32072361384225







Actuals and Interpolation
TimeActualForecast
14634.4268537070987
240.532.4378603466732
322.530.492240334061
42528.5853543104307
522.2526.7195658658305
6724.8931981461802
71123.1020415201185
850.2521.3485568619093
916.2519.6418079270611
1032.517.9671794656517
115.752516.3327560407159
127.7514.7288766581764
131413.1590323347601
143.511.6240545816589
151.2510.1198715180038
163.01258.64677576944595
170.57.20503203420426
1805.79327468630679
190.8754.41123208898345
203.1253.05873288600178
21101.73578547934020
2200.443415523420818
2321-0.822338412692918
240-2.05516940597415
250.4125-3.26375371120254

\begin{tabular}{lllllllll}
\hline
Actuals and Interpolation \tabularnewline
Time & Actual & Forecast \tabularnewline
1 & 46 & 34.4268537070987 \tabularnewline
2 & 40.5 & 32.4378603466732 \tabularnewline
3 & 22.5 & 30.492240334061 \tabularnewline
4 & 25 & 28.5853543104307 \tabularnewline
5 & 22.25 & 26.7195658658305 \tabularnewline
6 & 7 & 24.8931981461802 \tabularnewline
7 & 11 & 23.1020415201185 \tabularnewline
8 & 50.25 & 21.3485568619093 \tabularnewline
9 & 16.25 & 19.6418079270611 \tabularnewline
10 & 32.5 & 17.9671794656517 \tabularnewline
11 & 5.7525 & 16.3327560407159 \tabularnewline
12 & 7.75 & 14.7288766581764 \tabularnewline
13 & 14 & 13.1590323347601 \tabularnewline
14 & 3.5 & 11.6240545816589 \tabularnewline
15 & 1.25 & 10.1198715180038 \tabularnewline
16 & 3.0125 & 8.64677576944595 \tabularnewline
17 & 0.5 & 7.20503203420426 \tabularnewline
18 & 0 & 5.79327468630679 \tabularnewline
19 & 0.875 & 4.41123208898345 \tabularnewline
20 & 3.125 & 3.05873288600178 \tabularnewline
21 & 10 & 1.73578547934020 \tabularnewline
22 & 0 & 0.443415523420818 \tabularnewline
23 & 21 & -0.822338412692918 \tabularnewline
24 & 0 & -2.05516940597415 \tabularnewline
25 & 0.4125 & -3.26375371120254 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75910&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]34.4268537070987[/C][/ROW]
[ROW][C]2[/C][C]40.5[/C][C]32.4378603466732[/C][/ROW]
[ROW][C]3[/C][C]22.5[/C][C]30.492240334061[/C][/ROW]
[ROW][C]4[/C][C]25[/C][C]28.5853543104307[/C][/ROW]
[ROW][C]5[/C][C]22.25[/C][C]26.7195658658305[/C][/ROW]
[ROW][C]6[/C][C]7[/C][C]24.8931981461802[/C][/ROW]
[ROW][C]7[/C][C]11[/C][C]23.1020415201185[/C][/ROW]
[ROW][C]8[/C][C]50.25[/C][C]21.3485568619093[/C][/ROW]
[ROW][C]9[/C][C]16.25[/C][C]19.6418079270611[/C][/ROW]
[ROW][C]10[/C][C]32.5[/C][C]17.9671794656517[/C][/ROW]
[ROW][C]11[/C][C]5.7525[/C][C]16.3327560407159[/C][/ROW]
[ROW][C]12[/C][C]7.75[/C][C]14.7288766581764[/C][/ROW]
[ROW][C]13[/C][C]14[/C][C]13.1590323347601[/C][/ROW]
[ROW][C]14[/C][C]3.5[/C][C]11.6240545816589[/C][/ROW]
[ROW][C]15[/C][C]1.25[/C][C]10.1198715180038[/C][/ROW]
[ROW][C]16[/C][C]3.0125[/C][C]8.64677576944595[/C][/ROW]
[ROW][C]17[/C][C]0.5[/C][C]7.20503203420426[/C][/ROW]
[ROW][C]18[/C][C]0[/C][C]5.79327468630679[/C][/ROW]
[ROW][C]19[/C][C]0.875[/C][C]4.41123208898345[/C][/ROW]
[ROW][C]20[/C][C]3.125[/C][C]3.05873288600178[/C][/ROW]
[ROW][C]21[/C][C]10[/C][C]1.73578547934020[/C][/ROW]
[ROW][C]22[/C][C]0[/C][C]0.443415523420818[/C][/ROW]
[ROW][C]23[/C][C]21[/C][C]-0.822338412692918[/C][/ROW]
[ROW][C]24[/C][C]0[/C][C]-2.05516940597415[/C][/ROW]
[ROW][C]25[/C][C]0.4125[/C][C]-3.26375371120254[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75910&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75910&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
14634.4268537070987
240.532.4378603466732
322.530.492240334061
42528.5853543104307
522.2526.7195658658305
6724.8931981461802
71123.1020415201185
850.2521.3485568619093
916.2519.6418079270611
1032.517.9671794656517
115.752516.3327560407159
127.7514.7288766581764
131413.1590323347601
143.511.6240545816589
151.2510.1198715180038
163.01258.64677576944595
170.57.20503203420426
1805.79327468630679
190.8754.41123208898345
203.1253.05873288600178
21101.73578547934020
2200.443415523420818
2321-0.822338412692918
240-2.05516940597415
250.4125-3.26375371120254







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

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