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 14:25:25 +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/t1273760757f8ua8kjqnkpd174.htm/, Retrieved Mon, 06 May 2024 01:19:38 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=75968, Retrieved Mon, 06 May 2024 01:19:38 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsFM22,steven,coomans,thesis,Arima,per3maand
Estimated Impact107
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Croston Forecasting] [FM22,steven,cooma...] [2010-05-13 14:25:25] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
738.1666667
733.4333333
671.625
696.7083333
678.8
692.6583333
733.8833333
697.5416667
546.4166667
716.1166667
600.2583333
387.8083333
137.25
403.4083333
241.9583333
183.9
91.5




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75968&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
1886.644662096658-141.51367918119-62.5400585222275235.829382715543314.803003374506
1946.9840343740384-209.596010556908-120.784639368160214.752708116237303.564079304985
207.32340665141896-274.82976135999-177.166633492480191.813446795318289.476574662828
21-32.3372210712006-337.930907165959-232.154192160692167.479750018290273.256465023558
22-71.9978487938201-399.35788261452-286.047069671775142.051372084135255.362185026880
23-111.658476516440-459.425183527328-339.050903790395115.733950757515236.108230494449
24-151.319104239059-518.359665032148-391.31402711165388.6758186335344215.72145655403
25-190.979731961679-576.331342869707-442.94760695312160.9881430297640194.37187894635
26-230.640359684298-633.471533740528-494.03750669007832.756787321482172.190814371932
27-270.300987406918-689.884168139449-544.6516828204084.0497080065727149.282193325614
28-309.961615129537-745.65317611705-594.845014254419-25.0782160046551125.729945857976
29-349.622242852157-800.847493783267-644.662575891604-54.5819098127092101.603008078954
30-389.282870574776-855.524565235336-694.141928408243-84.42381274130976.9588240857843
31-428.943498297396-909.732858206763-743.314763151852-114.5722334429451.8458616119713
32-468.604126020015-963.513713080285-792.208111145773-145.00014089425726.3054610402544
33-508.264753742635-1016.90272924808-840.84524958139-175.6842579038790.373221762807077
34-547.925381465254-1069.93082290086-889.246393469253-206.604369461255-25.9199400296482
35-587.586009187874-1122.62504668933-937.429231586872-237.742786788875-52.5469716864128
36-627.246636910493-1175.00923367354-985.409347534584-269.083926286402-79.4840401474453
37-666.907264633113-1227.10450951629-1033.20055464083-300.613974625395-106.710019749933
38-706.567892355732-1278.92970444387-1080.81516532877-332.32061938269-134.206080267598
39-746.228520078352-1330.50168795355-1128.26420996981-364.192830186896-161.955352203153
40-785.889147800971-1381.83564326934-1175.55761634047-396.220679261469-189.942652332604
41-825.549775523591-1432.94529429463-1222.70435801887-428.395193028308-218.154256752555

\begin{tabular}{lllllllll}
\hline
Demand Forecast \tabularnewline
Point & Forecast & 95% LB & 80% LB & 80% UB & 95% UB \tabularnewline
18 & 86.644662096658 & -141.51367918119 & -62.5400585222275 & 235.829382715543 & 314.803003374506 \tabularnewline
19 & 46.9840343740384 & -209.596010556908 & -120.784639368160 & 214.752708116237 & 303.564079304985 \tabularnewline
20 & 7.32340665141896 & -274.82976135999 & -177.166633492480 & 191.813446795318 & 289.476574662828 \tabularnewline
21 & -32.3372210712006 & -337.930907165959 & -232.154192160692 & 167.479750018290 & 273.256465023558 \tabularnewline
22 & -71.9978487938201 & -399.35788261452 & -286.047069671775 & 142.051372084135 & 255.362185026880 \tabularnewline
23 & -111.658476516440 & -459.425183527328 & -339.050903790395 & 115.733950757515 & 236.108230494449 \tabularnewline
24 & -151.319104239059 & -518.359665032148 & -391.314027111653 & 88.6758186335344 & 215.72145655403 \tabularnewline
25 & -190.979731961679 & -576.331342869707 & -442.947606953121 & 60.9881430297640 & 194.37187894635 \tabularnewline
26 & -230.640359684298 & -633.471533740528 & -494.037506690078 & 32.756787321482 & 172.190814371932 \tabularnewline
27 & -270.300987406918 & -689.884168139449 & -544.651682820408 & 4.0497080065727 & 149.282193325614 \tabularnewline
28 & -309.961615129537 & -745.65317611705 & -594.845014254419 & -25.0782160046551 & 125.729945857976 \tabularnewline
29 & -349.622242852157 & -800.847493783267 & -644.662575891604 & -54.5819098127092 & 101.603008078954 \tabularnewline
30 & -389.282870574776 & -855.524565235336 & -694.141928408243 & -84.423812741309 & 76.9588240857843 \tabularnewline
31 & -428.943498297396 & -909.732858206763 & -743.314763151852 & -114.57223344294 & 51.8458616119713 \tabularnewline
32 & -468.604126020015 & -963.513713080285 & -792.208111145773 & -145.000140894257 & 26.3054610402544 \tabularnewline
33 & -508.264753742635 & -1016.90272924808 & -840.84524958139 & -175.684257903879 & 0.373221762807077 \tabularnewline
34 & -547.925381465254 & -1069.93082290086 & -889.246393469253 & -206.604369461255 & -25.9199400296482 \tabularnewline
35 & -587.586009187874 & -1122.62504668933 & -937.429231586872 & -237.742786788875 & -52.5469716864128 \tabularnewline
36 & -627.246636910493 & -1175.00923367354 & -985.409347534584 & -269.083926286402 & -79.4840401474453 \tabularnewline
37 & -666.907264633113 & -1227.10450951629 & -1033.20055464083 & -300.613974625395 & -106.710019749933 \tabularnewline
38 & -706.567892355732 & -1278.92970444387 & -1080.81516532877 & -332.32061938269 & -134.206080267598 \tabularnewline
39 & -746.228520078352 & -1330.50168795355 & -1128.26420996981 & -364.192830186896 & -161.955352203153 \tabularnewline
40 & -785.889147800971 & -1381.83564326934 & -1175.55761634047 & -396.220679261469 & -189.942652332604 \tabularnewline
41 & -825.549775523591 & -1432.94529429463 & -1222.70435801887 & -428.395193028308 & -218.154256752555 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75968&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]86.644662096658[/C][C]-141.51367918119[/C][C]-62.5400585222275[/C][C]235.829382715543[/C][C]314.803003374506[/C][/ROW]
[ROW][C]19[/C][C]46.9840343740384[/C][C]-209.596010556908[/C][C]-120.784639368160[/C][C]214.752708116237[/C][C]303.564079304985[/C][/ROW]
[ROW][C]20[/C][C]7.32340665141896[/C][C]-274.82976135999[/C][C]-177.166633492480[/C][C]191.813446795318[/C][C]289.476574662828[/C][/ROW]
[ROW][C]21[/C][C]-32.3372210712006[/C][C]-337.930907165959[/C][C]-232.154192160692[/C][C]167.479750018290[/C][C]273.256465023558[/C][/ROW]
[ROW][C]22[/C][C]-71.9978487938201[/C][C]-399.35788261452[/C][C]-286.047069671775[/C][C]142.051372084135[/C][C]255.362185026880[/C][/ROW]
[ROW][C]23[/C][C]-111.658476516440[/C][C]-459.425183527328[/C][C]-339.050903790395[/C][C]115.733950757515[/C][C]236.108230494449[/C][/ROW]
[ROW][C]24[/C][C]-151.319104239059[/C][C]-518.359665032148[/C][C]-391.314027111653[/C][C]88.6758186335344[/C][C]215.72145655403[/C][/ROW]
[ROW][C]25[/C][C]-190.979731961679[/C][C]-576.331342869707[/C][C]-442.947606953121[/C][C]60.9881430297640[/C][C]194.37187894635[/C][/ROW]
[ROW][C]26[/C][C]-230.640359684298[/C][C]-633.471533740528[/C][C]-494.037506690078[/C][C]32.756787321482[/C][C]172.190814371932[/C][/ROW]
[ROW][C]27[/C][C]-270.300987406918[/C][C]-689.884168139449[/C][C]-544.651682820408[/C][C]4.0497080065727[/C][C]149.282193325614[/C][/ROW]
[ROW][C]28[/C][C]-309.961615129537[/C][C]-745.65317611705[/C][C]-594.845014254419[/C][C]-25.0782160046551[/C][C]125.729945857976[/C][/ROW]
[ROW][C]29[/C][C]-349.622242852157[/C][C]-800.847493783267[/C][C]-644.662575891604[/C][C]-54.5819098127092[/C][C]101.603008078954[/C][/ROW]
[ROW][C]30[/C][C]-389.282870574776[/C][C]-855.524565235336[/C][C]-694.141928408243[/C][C]-84.423812741309[/C][C]76.9588240857843[/C][/ROW]
[ROW][C]31[/C][C]-428.943498297396[/C][C]-909.732858206763[/C][C]-743.314763151852[/C][C]-114.57223344294[/C][C]51.8458616119713[/C][/ROW]
[ROW][C]32[/C][C]-468.604126020015[/C][C]-963.513713080285[/C][C]-792.208111145773[/C][C]-145.000140894257[/C][C]26.3054610402544[/C][/ROW]
[ROW][C]33[/C][C]-508.264753742635[/C][C]-1016.90272924808[/C][C]-840.84524958139[/C][C]-175.684257903879[/C][C]0.373221762807077[/C][/ROW]
[ROW][C]34[/C][C]-547.925381465254[/C][C]-1069.93082290086[/C][C]-889.246393469253[/C][C]-206.604369461255[/C][C]-25.9199400296482[/C][/ROW]
[ROW][C]35[/C][C]-587.586009187874[/C][C]-1122.62504668933[/C][C]-937.429231586872[/C][C]-237.742786788875[/C][C]-52.5469716864128[/C][/ROW]
[ROW][C]36[/C][C]-627.246636910493[/C][C]-1175.00923367354[/C][C]-985.409347534584[/C][C]-269.083926286402[/C][C]-79.4840401474453[/C][/ROW]
[ROW][C]37[/C][C]-666.907264633113[/C][C]-1227.10450951629[/C][C]-1033.20055464083[/C][C]-300.613974625395[/C][C]-106.710019749933[/C][/ROW]
[ROW][C]38[/C][C]-706.567892355732[/C][C]-1278.92970444387[/C][C]-1080.81516532877[/C][C]-332.32061938269[/C][C]-134.206080267598[/C][/ROW]
[ROW][C]39[/C][C]-746.228520078352[/C][C]-1330.50168795355[/C][C]-1128.26420996981[/C][C]-364.192830186896[/C][C]-161.955352203153[/C][/ROW]
[ROW][C]40[/C][C]-785.889147800971[/C][C]-1381.83564326934[/C][C]-1175.55761634047[/C][C]-396.220679261469[/C][C]-189.942652332604[/C][/ROW]
[ROW][C]41[/C][C]-825.549775523591[/C][C]-1432.94529429463[/C][C]-1222.70435801887[/C][C]-428.395193028308[/C][C]-218.154256752555[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75968&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75968&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
1886.644662096658-141.51367918119-62.5400585222275235.829382715543314.803003374506
1946.9840343740384-209.596010556908-120.784639368160214.752708116237303.564079304985
207.32340665141896-274.82976135999-177.166633492480191.813446795318289.476574662828
21-32.3372210712006-337.930907165959-232.154192160692167.479750018290273.256465023558
22-71.9978487938201-399.35788261452-286.047069671775142.051372084135255.362185026880
23-111.658476516440-459.425183527328-339.050903790395115.733950757515236.108230494449
24-151.319104239059-518.359665032148-391.31402711165388.6758186335344215.72145655403
25-190.979731961679-576.331342869707-442.94760695312160.9881430297640194.37187894635
26-230.640359684298-633.471533740528-494.03750669007832.756787321482172.190814371932
27-270.300987406918-689.884168139449-544.6516828204084.0497080065727149.282193325614
28-309.961615129537-745.65317611705-594.845014254419-25.0782160046551125.729945857976
29-349.622242852157-800.847493783267-644.662575891604-54.5819098127092101.603008078954
30-389.282870574776-855.524565235336-694.141928408243-84.42381274130976.9588240857843
31-428.943498297396-909.732858206763-743.314763151852-114.5722334429451.8458616119713
32-468.604126020015-963.513713080285-792.208111145773-145.00014089425726.3054610402544
33-508.264753742635-1016.90272924808-840.84524958139-175.6842579038790.373221762807077
34-547.925381465254-1069.93082290086-889.246393469253-206.604369461255-25.9199400296482
35-587.586009187874-1122.62504668933-937.429231586872-237.742786788875-52.5469716864128
36-627.246636910493-1175.00923367354-985.409347534584-269.083926286402-79.4840401474453
37-666.907264633113-1227.10450951629-1033.20055464083-300.613974625395-106.710019749933
38-706.567892355732-1278.92970444387-1080.81516532877-332.32061938269-134.206080267598
39-746.228520078352-1330.50168795355-1128.26420996981-364.192830186896-161.955352203153
40-785.889147800971-1381.83564326934-1175.55761634047-396.220679261469-189.942652332604
41-825.549775523591-1432.94529429463-1222.70435801887-428.395193028308-218.154256752555







Actuals and Interpolation
TimeActualForecast
1738.1666667737.38883988618
2733.4333333702.013587224558
3671.625679.86573961518
4696.7083333636.184921863945
5678.8627.868765768785
6692.6583333614.460675199214
7733.8833333615.047131681786
8697.5416667636.526410902895
9546.4166667628.255186240842
10716.1166667546.492806998329
11600.2583333594.095092729053
12387.8083333557.605131041833
13137.25430.592686869799
14403.4083333240.022177721986
15241.9583333284.415410317549
16183.9222.912777660310
1791.5163.182061709202

\begin{tabular}{lllllllll}
\hline
Actuals and Interpolation \tabularnewline
Time & Actual & Forecast \tabularnewline
1 & 738.1666667 & 737.38883988618 \tabularnewline
2 & 733.4333333 & 702.013587224558 \tabularnewline
3 & 671.625 & 679.86573961518 \tabularnewline
4 & 696.7083333 & 636.184921863945 \tabularnewline
5 & 678.8 & 627.868765768785 \tabularnewline
6 & 692.6583333 & 614.460675199214 \tabularnewline
7 & 733.8833333 & 615.047131681786 \tabularnewline
8 & 697.5416667 & 636.526410902895 \tabularnewline
9 & 546.4166667 & 628.255186240842 \tabularnewline
10 & 716.1166667 & 546.492806998329 \tabularnewline
11 & 600.2583333 & 594.095092729053 \tabularnewline
12 & 387.8083333 & 557.605131041833 \tabularnewline
13 & 137.25 & 430.592686869799 \tabularnewline
14 & 403.4083333 & 240.022177721986 \tabularnewline
15 & 241.9583333 & 284.415410317549 \tabularnewline
16 & 183.9 & 222.912777660310 \tabularnewline
17 & 91.5 & 163.182061709202 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75968&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]738.1666667[/C][C]737.38883988618[/C][/ROW]
[ROW][C]2[/C][C]733.4333333[/C][C]702.013587224558[/C][/ROW]
[ROW][C]3[/C][C]671.625[/C][C]679.86573961518[/C][/ROW]
[ROW][C]4[/C][C]696.7083333[/C][C]636.184921863945[/C][/ROW]
[ROW][C]5[/C][C]678.8[/C][C]627.868765768785[/C][/ROW]
[ROW][C]6[/C][C]692.6583333[/C][C]614.460675199214[/C][/ROW]
[ROW][C]7[/C][C]733.8833333[/C][C]615.047131681786[/C][/ROW]
[ROW][C]8[/C][C]697.5416667[/C][C]636.526410902895[/C][/ROW]
[ROW][C]9[/C][C]546.4166667[/C][C]628.255186240842[/C][/ROW]
[ROW][C]10[/C][C]716.1166667[/C][C]546.492806998329[/C][/ROW]
[ROW][C]11[/C][C]600.2583333[/C][C]594.095092729053[/C][/ROW]
[ROW][C]12[/C][C]387.8083333[/C][C]557.605131041833[/C][/ROW]
[ROW][C]13[/C][C]137.25[/C][C]430.592686869799[/C][/ROW]
[ROW][C]14[/C][C]403.4083333[/C][C]240.022177721986[/C][/ROW]
[ROW][C]15[/C][C]241.9583333[/C][C]284.415410317549[/C][/ROW]
[ROW][C]16[/C][C]183.9[/C][C]222.912777660310[/C][/ROW]
[ROW][C]17[/C][C]91.5[/C][C]163.182061709202[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75968&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75968&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
1738.1666667737.38883988618
2733.4333333702.013587224558
3671.625679.86573961518
4696.7083333636.184921863945
5678.8627.868765768785
6692.6583333614.460675199214
7733.8833333615.047131681786
8697.5416667636.526410902895
9546.4166667628.255186240842
10716.1166667546.492806998329
11600.2583333594.095092729053
12387.8083333557.605131041833
13137.25430.592686869799
14403.4083333240.022177721986
15241.9583333284.415410317549
16183.9222.912777660310
1791.5163.182061709202







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

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