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:52:50 +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/t12737588040nds1cuw2841ziq.htm/, Retrieved Sun, 05 May 2024 21:05:49 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=75941, Retrieved Sun, 05 May 2024 21:05:49 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsB11A,steven,coomans,Arima,thesis,per3maand
Estimated Impact131
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 13:52:50] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
41
31.66666667
23.83333333
12.33333333
30.83333333
20.83333333
25.50166667
5.166666667
11.66666667
0.833333333
2.341666667
0
0.666666667
8.666666667
2.333333333
11.66666667
0.275




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Serverwessa.org @ wessa.org

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 3 seconds \tabularnewline
R Server & wessa.org @ wessa.org \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75941&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]wessa.org @ wessa.org[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75941&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75941&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Serverwessa.org @ wessa.org







Demand Forecast
PointForecast95% LB80% LB80% UB95% UB
181.42452929851498-11.1450066566587-6.794248499742439.643307096772413.9940652536886
19-3.81956978616952-17.6979005497924-12.89412251140275.2549829390636110.0587609774534
204.04244107448406-12.7421060758005-6.932384405511815.017266554479920.8269882247687
21-2.70387022706694-21.1075525885833-14.73739131634439.3296508622104615.6998121344495
220.046387055341242-20.2482994701005-13.223595196409313.316369307091820.341073580783
23-4.01612398175038-25.8377055371885-18.284489230101410.252241266600617.8054575736877
24-5.98653813322253-29.3346920430646-21.25307539194489.279999125499717.3616157766196
25-9.6116858691682-34.3422075527044-25.78210483107996.558733092743515.118835814368
26-17.3971771114423-43.462119334948-34.4401267655412-0.3542274573433178.66776511206344
27-17.0833599831679-44.404778483154-34.94787531495000.78115534861419510.2380585168183
28-25.6155046315076-54.1446568559233-44.2697145992689-6.961294663746372.91364759290805
29-22.4506479453084-52.1350902530181-41.8602614952692-3.041034395347637.23379436240128
30-26.3636781858072-56.0690619651101-45.7869846280439-6.940371743570423.34170559349574
31-26.6682900062467-56.7725389979845-46.3524003925708-6.984179619922593.43595898549111
32-34.3682257140401-64.6098647885727-54.1421706468583-14.5942807812218-4.12658663950739
33-33.8254906448588-64.3234642290533-53.7670437045363-13.8839375851813-3.3275170606643
34-38.6411133451462-69.3256553430267-58.7046569334897-18.5775697568026-7.95657134726566
35-39.6127166353796-70.5171799117912-59.8200590185077-19.4053742522514-8.70825335896797
36-41.7647768461957-72.8690354017221-62.1027583404288-21.4267953519626-10.6605182906692
37-42.9831712066616-74.2956651470544-63.4573105005186-22.5090319128045-11.6706772662688
38-41.8542025920564-73.3683938683809-62.4602246851222-21.2481804989906-10.3400113157319
39-45.2950693972828-77.0123959509488-66.033914508908-24.5562242856576-13.5777428436169
40-43.7448165046797-75.6625453038045-64.61469760137-22.8749354079893-11.8270877055548
41-48.7943159362552-80.9119572910056-69.7949128270392-27.7937190454712-16.6766745815047

\begin{tabular}{lllllllll}
\hline
Demand Forecast \tabularnewline
Point & Forecast & 95% LB & 80% LB & 80% UB & 95% UB \tabularnewline
18 & 1.42452929851498 & -11.1450066566587 & -6.79424849974243 & 9.6433070967724 & 13.9940652536886 \tabularnewline
19 & -3.81956978616952 & -17.6979005497924 & -12.8941225114027 & 5.25498293906361 & 10.0587609774534 \tabularnewline
20 & 4.04244107448406 & -12.7421060758005 & -6.9323844055118 & 15.0172665544799 & 20.8269882247687 \tabularnewline
21 & -2.70387022706694 & -21.1075525885833 & -14.7373913163443 & 9.32965086221046 & 15.6998121344495 \tabularnewline
22 & 0.046387055341242 & -20.2482994701005 & -13.2235951964093 & 13.3163693070918 & 20.341073580783 \tabularnewline
23 & -4.01612398175038 & -25.8377055371885 & -18.2844892301014 & 10.2522412666006 & 17.8054575736877 \tabularnewline
24 & -5.98653813322253 & -29.3346920430646 & -21.2530753919448 & 9.2799991254997 & 17.3616157766196 \tabularnewline
25 & -9.6116858691682 & -34.3422075527044 & -25.7821048310799 & 6.5587330927435 & 15.118835814368 \tabularnewline
26 & -17.3971771114423 & -43.462119334948 & -34.4401267655412 & -0.354227457343317 & 8.66776511206344 \tabularnewline
27 & -17.0833599831679 & -44.404778483154 & -34.9478753149500 & 0.781155348614195 & 10.2380585168183 \tabularnewline
28 & -25.6155046315076 & -54.1446568559233 & -44.2697145992689 & -6.96129466374637 & 2.91364759290805 \tabularnewline
29 & -22.4506479453084 & -52.1350902530181 & -41.8602614952692 & -3.04103439534763 & 7.23379436240128 \tabularnewline
30 & -26.3636781858072 & -56.0690619651101 & -45.7869846280439 & -6.94037174357042 & 3.34170559349574 \tabularnewline
31 & -26.6682900062467 & -56.7725389979845 & -46.3524003925708 & -6.98417961992259 & 3.43595898549111 \tabularnewline
32 & -34.3682257140401 & -64.6098647885727 & -54.1421706468583 & -14.5942807812218 & -4.12658663950739 \tabularnewline
33 & -33.8254906448588 & -64.3234642290533 & -53.7670437045363 & -13.8839375851813 & -3.3275170606643 \tabularnewline
34 & -38.6411133451462 & -69.3256553430267 & -58.7046569334897 & -18.5775697568026 & -7.95657134726566 \tabularnewline
35 & -39.6127166353796 & -70.5171799117912 & -59.8200590185077 & -19.4053742522514 & -8.70825335896797 \tabularnewline
36 & -41.7647768461957 & -72.8690354017221 & -62.1027583404288 & -21.4267953519626 & -10.6605182906692 \tabularnewline
37 & -42.9831712066616 & -74.2956651470544 & -63.4573105005186 & -22.5090319128045 & -11.6706772662688 \tabularnewline
38 & -41.8542025920564 & -73.3683938683809 & -62.4602246851222 & -21.2481804989906 & -10.3400113157319 \tabularnewline
39 & -45.2950693972828 & -77.0123959509488 & -66.033914508908 & -24.5562242856576 & -13.5777428436169 \tabularnewline
40 & -43.7448165046797 & -75.6625453038045 & -64.61469760137 & -22.8749354079893 & -11.8270877055548 \tabularnewline
41 & -48.7943159362552 & -80.9119572910056 & -69.7949128270392 & -27.7937190454712 & -16.6766745815047 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75941&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]18[/C][C]1.42452929851498[/C][C]-11.1450066566587[/C][C]-6.79424849974243[/C][C]9.6433070967724[/C][C]13.9940652536886[/C][/ROW]
[ROW][C]19[/C][C]-3.81956978616952[/C][C]-17.6979005497924[/C][C]-12.8941225114027[/C][C]5.25498293906361[/C][C]10.0587609774534[/C][/ROW]
[ROW][C]20[/C][C]4.04244107448406[/C][C]-12.7421060758005[/C][C]-6.9323844055118[/C][C]15.0172665544799[/C][C]20.8269882247687[/C][/ROW]
[ROW][C]21[/C][C]-2.70387022706694[/C][C]-21.1075525885833[/C][C]-14.7373913163443[/C][C]9.32965086221046[/C][C]15.6998121344495[/C][/ROW]
[ROW][C]22[/C][C]0.046387055341242[/C][C]-20.2482994701005[/C][C]-13.2235951964093[/C][C]13.3163693070918[/C][C]20.341073580783[/C][/ROW]
[ROW][C]23[/C][C]-4.01612398175038[/C][C]-25.8377055371885[/C][C]-18.2844892301014[/C][C]10.2522412666006[/C][C]17.8054575736877[/C][/ROW]
[ROW][C]24[/C][C]-5.98653813322253[/C][C]-29.3346920430646[/C][C]-21.2530753919448[/C][C]9.2799991254997[/C][C]17.3616157766196[/C][/ROW]
[ROW][C]25[/C][C]-9.6116858691682[/C][C]-34.3422075527044[/C][C]-25.7821048310799[/C][C]6.5587330927435[/C][C]15.118835814368[/C][/ROW]
[ROW][C]26[/C][C]-17.3971771114423[/C][C]-43.462119334948[/C][C]-34.4401267655412[/C][C]-0.354227457343317[/C][C]8.66776511206344[/C][/ROW]
[ROW][C]27[/C][C]-17.0833599831679[/C][C]-44.404778483154[/C][C]-34.9478753149500[/C][C]0.781155348614195[/C][C]10.2380585168183[/C][/ROW]
[ROW][C]28[/C][C]-25.6155046315076[/C][C]-54.1446568559233[/C][C]-44.2697145992689[/C][C]-6.96129466374637[/C][C]2.91364759290805[/C][/ROW]
[ROW][C]29[/C][C]-22.4506479453084[/C][C]-52.1350902530181[/C][C]-41.8602614952692[/C][C]-3.04103439534763[/C][C]7.23379436240128[/C][/ROW]
[ROW][C]30[/C][C]-26.3636781858072[/C][C]-56.0690619651101[/C][C]-45.7869846280439[/C][C]-6.94037174357042[/C][C]3.34170559349574[/C][/ROW]
[ROW][C]31[/C][C]-26.6682900062467[/C][C]-56.7725389979845[/C][C]-46.3524003925708[/C][C]-6.98417961992259[/C][C]3.43595898549111[/C][/ROW]
[ROW][C]32[/C][C]-34.3682257140401[/C][C]-64.6098647885727[/C][C]-54.1421706468583[/C][C]-14.5942807812218[/C][C]-4.12658663950739[/C][/ROW]
[ROW][C]33[/C][C]-33.8254906448588[/C][C]-64.3234642290533[/C][C]-53.7670437045363[/C][C]-13.8839375851813[/C][C]-3.3275170606643[/C][/ROW]
[ROW][C]34[/C][C]-38.6411133451462[/C][C]-69.3256553430267[/C][C]-58.7046569334897[/C][C]-18.5775697568026[/C][C]-7.95657134726566[/C][/ROW]
[ROW][C]35[/C][C]-39.6127166353796[/C][C]-70.5171799117912[/C][C]-59.8200590185077[/C][C]-19.4053742522514[/C][C]-8.70825335896797[/C][/ROW]
[ROW][C]36[/C][C]-41.7647768461957[/C][C]-72.8690354017221[/C][C]-62.1027583404288[/C][C]-21.4267953519626[/C][C]-10.6605182906692[/C][/ROW]
[ROW][C]37[/C][C]-42.9831712066616[/C][C]-74.2956651470544[/C][C]-63.4573105005186[/C][C]-22.5090319128045[/C][C]-11.6706772662688[/C][/ROW]
[ROW][C]38[/C][C]-41.8542025920564[/C][C]-73.3683938683809[/C][C]-62.4602246851222[/C][C]-21.2481804989906[/C][C]-10.3400113157319[/C][/ROW]
[ROW][C]39[/C][C]-45.2950693972828[/C][C]-77.0123959509488[/C][C]-66.033914508908[/C][C]-24.5562242856576[/C][C]-13.5777428436169[/C][/ROW]
[ROW][C]40[/C][C]-43.7448165046797[/C][C]-75.6625453038045[/C][C]-64.61469760137[/C][C]-22.8749354079893[/C][C]-11.8270877055548[/C][/ROW]
[ROW][C]41[/C][C]-48.7943159362552[/C][C]-80.9119572910056[/C][C]-69.7949128270392[/C][C]-27.7937190454712[/C][C]-16.6766745815047[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75941&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75941&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
181.42452929851498-11.1450066566587-6.794248499742439.643307096772413.9940652536886
19-3.81956978616952-17.6979005497924-12.89412251140275.2549829390636110.0587609774534
204.04244107448406-12.7421060758005-6.932384405511815.017266554479920.8269882247687
21-2.70387022706694-21.1075525885833-14.73739131634439.3296508622104615.6998121344495
220.046387055341242-20.2482994701005-13.223595196409313.316369307091820.341073580783
23-4.01612398175038-25.8377055371885-18.284489230101410.252241266600617.8054575736877
24-5.98653813322253-29.3346920430646-21.25307539194489.279999125499717.3616157766196
25-9.6116858691682-34.3422075527044-25.78210483107996.558733092743515.118835814368
26-17.3971771114423-43.462119334948-34.4401267655412-0.3542274573433178.66776511206344
27-17.0833599831679-44.404778483154-34.94787531495000.78115534861419510.2380585168183
28-25.6155046315076-54.1446568559233-44.2697145992689-6.961294663746372.91364759290805
29-22.4506479453084-52.1350902530181-41.8602614952692-3.041034395347637.23379436240128
30-26.3636781858072-56.0690619651101-45.7869846280439-6.940371743570423.34170559349574
31-26.6682900062467-56.7725389979845-46.3524003925708-6.984179619922593.43595898549111
32-34.3682257140401-64.6098647885727-54.1421706468583-14.5942807812218-4.12658663950739
33-33.8254906448588-64.3234642290533-53.7670437045363-13.8839375851813-3.3275170606643
34-38.6411133451462-69.3256553430267-58.7046569334897-18.5775697568026-7.95657134726566
35-39.6127166353796-70.5171799117912-59.8200590185077-19.4053742522514-8.70825335896797
36-41.7647768461957-72.8690354017221-62.1027583404288-21.4267953519626-10.6605182906692
37-42.9831712066616-74.2956651470544-63.4573105005186-22.5090319128045-11.6706772662688
38-41.8542025920564-73.3683938683809-62.4602246851222-21.2481804989906-10.3400113157319
39-45.2950693972828-77.0123959509488-66.033914508908-24.5562242856576-13.5777428436169
40-43.7448165046797-75.6625453038045-64.61469760137-22.8749354079893-11.8270877055548
41-48.7943159362552-80.9119572910056-69.7949128270392-27.7937190454712-16.6766745815047







Actuals and Interpolation
TimeActualForecast
14140.9569135138413
231.6666666736.7345324696379
323.8333333331.758263136203
412.3333333322.6335077092444
530.8333333317.9625206650331
620.8333333318.3414307638322
725.5016666723.370763577192
85.16666666717.3223286042793
911.6666666712.4854037188620
100.8333333334.48602028418904
112.3416666672.83130750565654
120-0.655209184125606
130.666666667-2.94484720752371
148.6666666671.07220255011467
152.3333333336.63228634277377
1611.666666679.5419036881876
170.275-5.28462981551762

\begin{tabular}{lllllllll}
\hline
Actuals and Interpolation \tabularnewline
Time & Actual & Forecast \tabularnewline
1 & 41 & 40.9569135138413 \tabularnewline
2 & 31.66666667 & 36.7345324696379 \tabularnewline
3 & 23.83333333 & 31.758263136203 \tabularnewline
4 & 12.33333333 & 22.6335077092444 \tabularnewline
5 & 30.83333333 & 17.9625206650331 \tabularnewline
6 & 20.83333333 & 18.3414307638322 \tabularnewline
7 & 25.50166667 & 23.370763577192 \tabularnewline
8 & 5.166666667 & 17.3223286042793 \tabularnewline
9 & 11.66666667 & 12.4854037188620 \tabularnewline
10 & 0.833333333 & 4.48602028418904 \tabularnewline
11 & 2.341666667 & 2.83130750565654 \tabularnewline
12 & 0 & -0.655209184125606 \tabularnewline
13 & 0.666666667 & -2.94484720752371 \tabularnewline
14 & 8.666666667 & 1.07220255011467 \tabularnewline
15 & 2.333333333 & 6.63228634277377 \tabularnewline
16 & 11.66666667 & 9.5419036881876 \tabularnewline
17 & 0.275 & -5.28462981551762 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75941&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]41[/C][C]40.9569135138413[/C][/ROW]
[ROW][C]2[/C][C]31.66666667[/C][C]36.7345324696379[/C][/ROW]
[ROW][C]3[/C][C]23.83333333[/C][C]31.758263136203[/C][/ROW]
[ROW][C]4[/C][C]12.33333333[/C][C]22.6335077092444[/C][/ROW]
[ROW][C]5[/C][C]30.83333333[/C][C]17.9625206650331[/C][/ROW]
[ROW][C]6[/C][C]20.83333333[/C][C]18.3414307638322[/C][/ROW]
[ROW][C]7[/C][C]25.50166667[/C][C]23.370763577192[/C][/ROW]
[ROW][C]8[/C][C]5.166666667[/C][C]17.3223286042793[/C][/ROW]
[ROW][C]9[/C][C]11.66666667[/C][C]12.4854037188620[/C][/ROW]
[ROW][C]10[/C][C]0.833333333[/C][C]4.48602028418904[/C][/ROW]
[ROW][C]11[/C][C]2.341666667[/C][C]2.83130750565654[/C][/ROW]
[ROW][C]12[/C][C]0[/C][C]-0.655209184125606[/C][/ROW]
[ROW][C]13[/C][C]0.666666667[/C][C]-2.94484720752371[/C][/ROW]
[ROW][C]14[/C][C]8.666666667[/C][C]1.07220255011467[/C][/ROW]
[ROW][C]15[/C][C]2.333333333[/C][C]6.63228634277377[/C][/ROW]
[ROW][C]16[/C][C]11.66666667[/C][C]9.5419036881876[/C][/ROW]
[ROW][C]17[/C][C]0.275[/C][C]-5.28462981551762[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75941&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75941&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
14140.9569135138413
231.6666666736.7345324696379
323.8333333331.758263136203
412.3333333322.6335077092444
530.8333333317.9625206650331
620.8333333318.3414307638322
725.5016666723.370763577192
85.16666666717.3223286042793
911.6666666712.4854037188620
100.8333333334.48602028418904
112.3416666672.83130750565654
120-0.655209184125606
130.666666667-2.94484720752371
148.6666666671.07220255011467
152.3333333336.63228634277377
1611.666666679.5419036881876
170.275-5.28462981551762







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

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