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 computationTue, 25 May 2010 14:48:31 +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/25/t1274798974bhztgao1bz145hi.htm/, Retrieved Thu, 02 May 2024 11:57:42 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=76402, Retrieved Thu, 02 May 2024 11:57:42 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordssteven,coomans,ETS,thesis,per 3 maand
Estimated Impact174
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:23:43] [74be16979710d4c4e7c6647856088456]
-   PD    [Croston Forecasting] [steven,coomans,ET...] [2010-05-25 14:48:31] [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 time4 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 & 4 seconds \tabularnewline
R Server & wessa.org @ wessa.org \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=76402&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]4 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]wessa.org @ wessa.org[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=76402&T=0

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







Demand Forecast
PointForecast95% LB80% LB80% UB95% UB
18-0.831039871276687-1.18888392512106-1.06502152147150-0.597058221081871-0.473195817432309
19-89.322926990837-127.785616717761-114.472328012184-64.1735259694899-50.8602372639134
20-177.814814110397-256.791033846844-229.454588536043-126.175039684752-98.8385943739507
21-266.306701229958-389.758214156735-347.027306765619-185.586095694296-142.855188303180
22-354.798588349518-527.908716331132-467.989216991873-241.607959707163-181.688460367904
23-443.290475469078-672.477317283893-593.147696441904-293.433254496253-214.103633654264
24-531.782362588639-824.668882350297-723.290564212837-340.274160964441-238.895842826980
25-620.274249708199-985.632398725818-859.169102650043-381.379396766355-254.91610069058
26-708.766136827759-1156.45126540123-1001.49170827698-416.040565378543-261.081008254287
27-797.25802394732-1338.14567005681-1150.92544596274-443.590601931902-256.370377837833
28-885.74991106688-1531.68238235875-1308.10245241444-463.397369719316-239.817439775010
29-974.24179818644-1737.98814334718-1473.62869102744-474.854905345442-210.495453025695
30-1062.733685306-1957.96408931709-1648.09338315411-477.373987457894-167.503281294911
31-1151.22557242556-2192.49976977167-1832.07817395092-470.372970900199-109.951375079447
32-1239.71745954512-2442.48611325159-2026.16561027847-453.269308811771-36.9488058386546
33-1328.20934666468-2708.8271750214-2230.94682210077-425.47187122859452.4084816920395
34-1416.70123378424-2992.45075108947-2447.02846261981-386.374004948675159.048283520990
35-1505.19312090380-3294.31805012932-2675.03903240503-335.347209402577283.931808321713
36-1593.68500802336-3615.43264287098-2915.63473108579-271.735284960936428.062626824251
37-1682.17689514292-3956.84889828295-3169.50497347426-194.84881681159592.495107997109
38-1770.66878226248-4319.68009057938-3437.37769045245-103.959874072519778.34252605441
39-1859.16066938204-4705.10633269345-3720.024516391711.70317762762238986.78499392936
40-1947.65255650160-5114.38246577975-4018.26594782098122.9608348177761219.07735277655
41-2036.14444362116-5548.84601251388-4332.97654380991260.6876565675831476.55712527155

\begin{tabular}{lllllllll}
\hline
Demand Forecast \tabularnewline
Point & Forecast & 95% LB & 80% LB & 80% UB & 95% UB \tabularnewline
18 & -0.831039871276687 & -1.18888392512106 & -1.06502152147150 & -0.597058221081871 & -0.473195817432309 \tabularnewline
19 & -89.322926990837 & -127.785616717761 & -114.472328012184 & -64.1735259694899 & -50.8602372639134 \tabularnewline
20 & -177.814814110397 & -256.791033846844 & -229.454588536043 & -126.175039684752 & -98.8385943739507 \tabularnewline
21 & -266.306701229958 & -389.758214156735 & -347.027306765619 & -185.586095694296 & -142.855188303180 \tabularnewline
22 & -354.798588349518 & -527.908716331132 & -467.989216991873 & -241.607959707163 & -181.688460367904 \tabularnewline
23 & -443.290475469078 & -672.477317283893 & -593.147696441904 & -293.433254496253 & -214.103633654264 \tabularnewline
24 & -531.782362588639 & -824.668882350297 & -723.290564212837 & -340.274160964441 & -238.895842826980 \tabularnewline
25 & -620.274249708199 & -985.632398725818 & -859.169102650043 & -381.379396766355 & -254.91610069058 \tabularnewline
26 & -708.766136827759 & -1156.45126540123 & -1001.49170827698 & -416.040565378543 & -261.081008254287 \tabularnewline
27 & -797.25802394732 & -1338.14567005681 & -1150.92544596274 & -443.590601931902 & -256.370377837833 \tabularnewline
28 & -885.74991106688 & -1531.68238235875 & -1308.10245241444 & -463.397369719316 & -239.817439775010 \tabularnewline
29 & -974.24179818644 & -1737.98814334718 & -1473.62869102744 & -474.854905345442 & -210.495453025695 \tabularnewline
30 & -1062.733685306 & -1957.96408931709 & -1648.09338315411 & -477.373987457894 & -167.503281294911 \tabularnewline
31 & -1151.22557242556 & -2192.49976977167 & -1832.07817395092 & -470.372970900199 & -109.951375079447 \tabularnewline
32 & -1239.71745954512 & -2442.48611325159 & -2026.16561027847 & -453.269308811771 & -36.9488058386546 \tabularnewline
33 & -1328.20934666468 & -2708.8271750214 & -2230.94682210077 & -425.471871228594 & 52.4084816920395 \tabularnewline
34 & -1416.70123378424 & -2992.45075108947 & -2447.02846261981 & -386.374004948675 & 159.048283520990 \tabularnewline
35 & -1505.19312090380 & -3294.31805012932 & -2675.03903240503 & -335.347209402577 & 283.931808321713 \tabularnewline
36 & -1593.68500802336 & -3615.43264287098 & -2915.63473108579 & -271.735284960936 & 428.062626824251 \tabularnewline
37 & -1682.17689514292 & -3956.84889828295 & -3169.50497347426 & -194.84881681159 & 592.495107997109 \tabularnewline
38 & -1770.66878226248 & -4319.68009057938 & -3437.37769045245 & -103.959874072519 & 778.34252605441 \tabularnewline
39 & -1859.16066938204 & -4705.10633269345 & -3720.02451639171 & 1.70317762762238 & 986.78499392936 \tabularnewline
40 & -1947.65255650160 & -5114.38246577975 & -4018.26594782098 & 122.960834817776 & 1219.07735277655 \tabularnewline
41 & -2036.14444362116 & -5548.84601251388 & -4332.97654380991 & 260.687656567583 & 1476.55712527155 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=76402&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]-0.831039871276687[/C][C]-1.18888392512106[/C][C]-1.06502152147150[/C][C]-0.597058221081871[/C][C]-0.473195817432309[/C][/ROW]
[ROW][C]19[/C][C]-89.322926990837[/C][C]-127.785616717761[/C][C]-114.472328012184[/C][C]-64.1735259694899[/C][C]-50.8602372639134[/C][/ROW]
[ROW][C]20[/C][C]-177.814814110397[/C][C]-256.791033846844[/C][C]-229.454588536043[/C][C]-126.175039684752[/C][C]-98.8385943739507[/C][/ROW]
[ROW][C]21[/C][C]-266.306701229958[/C][C]-389.758214156735[/C][C]-347.027306765619[/C][C]-185.586095694296[/C][C]-142.855188303180[/C][/ROW]
[ROW][C]22[/C][C]-354.798588349518[/C][C]-527.908716331132[/C][C]-467.989216991873[/C][C]-241.607959707163[/C][C]-181.688460367904[/C][/ROW]
[ROW][C]23[/C][C]-443.290475469078[/C][C]-672.477317283893[/C][C]-593.147696441904[/C][C]-293.433254496253[/C][C]-214.103633654264[/C][/ROW]
[ROW][C]24[/C][C]-531.782362588639[/C][C]-824.668882350297[/C][C]-723.290564212837[/C][C]-340.274160964441[/C][C]-238.895842826980[/C][/ROW]
[ROW][C]25[/C][C]-620.274249708199[/C][C]-985.632398725818[/C][C]-859.169102650043[/C][C]-381.379396766355[/C][C]-254.91610069058[/C][/ROW]
[ROW][C]26[/C][C]-708.766136827759[/C][C]-1156.45126540123[/C][C]-1001.49170827698[/C][C]-416.040565378543[/C][C]-261.081008254287[/C][/ROW]
[ROW][C]27[/C][C]-797.25802394732[/C][C]-1338.14567005681[/C][C]-1150.92544596274[/C][C]-443.590601931902[/C][C]-256.370377837833[/C][/ROW]
[ROW][C]28[/C][C]-885.74991106688[/C][C]-1531.68238235875[/C][C]-1308.10245241444[/C][C]-463.397369719316[/C][C]-239.817439775010[/C][/ROW]
[ROW][C]29[/C][C]-974.24179818644[/C][C]-1737.98814334718[/C][C]-1473.62869102744[/C][C]-474.854905345442[/C][C]-210.495453025695[/C][/ROW]
[ROW][C]30[/C][C]-1062.733685306[/C][C]-1957.96408931709[/C][C]-1648.09338315411[/C][C]-477.373987457894[/C][C]-167.503281294911[/C][/ROW]
[ROW][C]31[/C][C]-1151.22557242556[/C][C]-2192.49976977167[/C][C]-1832.07817395092[/C][C]-470.372970900199[/C][C]-109.951375079447[/C][/ROW]
[ROW][C]32[/C][C]-1239.71745954512[/C][C]-2442.48611325159[/C][C]-2026.16561027847[/C][C]-453.269308811771[/C][C]-36.9488058386546[/C][/ROW]
[ROW][C]33[/C][C]-1328.20934666468[/C][C]-2708.8271750214[/C][C]-2230.94682210077[/C][C]-425.471871228594[/C][C]52.4084816920395[/C][/ROW]
[ROW][C]34[/C][C]-1416.70123378424[/C][C]-2992.45075108947[/C][C]-2447.02846261981[/C][C]-386.374004948675[/C][C]159.048283520990[/C][/ROW]
[ROW][C]35[/C][C]-1505.19312090380[/C][C]-3294.31805012932[/C][C]-2675.03903240503[/C][C]-335.347209402577[/C][C]283.931808321713[/C][/ROW]
[ROW][C]36[/C][C]-1593.68500802336[/C][C]-3615.43264287098[/C][C]-2915.63473108579[/C][C]-271.735284960936[/C][C]428.062626824251[/C][/ROW]
[ROW][C]37[/C][C]-1682.17689514292[/C][C]-3956.84889828295[/C][C]-3169.50497347426[/C][C]-194.84881681159[/C][C]592.495107997109[/C][/ROW]
[ROW][C]38[/C][C]-1770.66878226248[/C][C]-4319.68009057938[/C][C]-3437.37769045245[/C][C]-103.959874072519[/C][C]778.34252605441[/C][/ROW]
[ROW][C]39[/C][C]-1859.16066938204[/C][C]-4705.10633269345[/C][C]-3720.02451639171[/C][C]1.70317762762238[/C][C]986.78499392936[/C][/ROW]
[ROW][C]40[/C][C]-1947.65255650160[/C][C]-5114.38246577975[/C][C]-4018.26594782098[/C][C]122.960834817776[/C][C]1219.07735277655[/C][/ROW]
[ROW][C]41[/C][C]-2036.14444362116[/C][C]-5548.84601251388[/C][C]-4332.97654380991[/C][C]260.687656567583[/C][C]1476.55712527155[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=76402&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=76402&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
18-0.831039871276687-1.18888392512106-1.06502152147150-0.597058221081871-0.473195817432309
19-89.322926990837-127.785616717761-114.472328012184-64.1735259694899-50.8602372639134
20-177.814814110397-256.791033846844-229.454588536043-126.175039684752-98.8385943739507
21-266.306701229958-389.758214156735-347.027306765619-185.586095694296-142.855188303180
22-354.798588349518-527.908716331132-467.989216991873-241.607959707163-181.688460367904
23-443.290475469078-672.477317283893-593.147696441904-293.433254496253-214.103633654264
24-531.782362588639-824.668882350297-723.290564212837-340.274160964441-238.895842826980
25-620.274249708199-985.632398725818-859.169102650043-381.379396766355-254.91610069058
26-708.766136827759-1156.45126540123-1001.49170827698-416.040565378543-261.081008254287
27-797.25802394732-1338.14567005681-1150.92544596274-443.590601931902-256.370377837833
28-885.74991106688-1531.68238235875-1308.10245241444-463.397369719316-239.817439775010
29-974.24179818644-1737.98814334718-1473.62869102744-474.854905345442-210.495453025695
30-1062.733685306-1957.96408931709-1648.09338315411-477.373987457894-167.503281294911
31-1151.22557242556-2192.49976977167-1832.07817395092-470.372970900199-109.951375079447
32-1239.71745954512-2442.48611325159-2026.16561027847-453.269308811771-36.9488058386546
33-1328.20934666468-2708.8271750214-2230.94682210077-425.47187122859452.4084816920395
34-1416.70123378424-2992.45075108947-2447.02846261981-386.374004948675159.048283520990
35-1505.19312090380-3294.31805012932-2675.03903240503-335.347209402577283.931808321713
36-1593.68500802336-3615.43264287098-2915.63473108579-271.735284960936428.062626824251
37-1682.17689514292-3956.84889828295-3169.50497347426-194.84881681159592.495107997109
38-1770.66878226248-4319.68009057938-3437.37769045245-103.959874072519778.34252605441
39-1859.16066938204-4705.10633269345-3720.024516391711.70317762762238986.78499392936
40-1947.65255650160-5114.38246577975-4018.26594782098122.9608348177761219.07735277655
41-2036.14444362116-5548.84601251388-4332.97654380991260.6876565675831476.55712527155







Actuals and Interpolation
TimeActualForecast
1738.1666667738.152921347285
2733.4333333733.416796580491
3671.625671.688090788884
4696.7083333696.703220818828
5678.8678.803412946959
6692.6583333692.620540786813
7733.8833333733.777035245815
8697.5416667697.514261007328
9546.4166667546.619024233637
10716.1166667715.99231242607
11600.2583333600.33360683679
12387.8083333388.188389871526
13137.25137.989810918791
14403.4083333403.233247579343
15241.9583333242.063007969908
16183.9183.838304767512
1791.591.4424249895746

\begin{tabular}{lllllllll}
\hline
Actuals and Interpolation \tabularnewline
Time & Actual & Forecast \tabularnewline
1 & 738.1666667 & 738.152921347285 \tabularnewline
2 & 733.4333333 & 733.416796580491 \tabularnewline
3 & 671.625 & 671.688090788884 \tabularnewline
4 & 696.7083333 & 696.703220818828 \tabularnewline
5 & 678.8 & 678.803412946959 \tabularnewline
6 & 692.6583333 & 692.620540786813 \tabularnewline
7 & 733.8833333 & 733.777035245815 \tabularnewline
8 & 697.5416667 & 697.514261007328 \tabularnewline
9 & 546.4166667 & 546.619024233637 \tabularnewline
10 & 716.1166667 & 715.99231242607 \tabularnewline
11 & 600.2583333 & 600.33360683679 \tabularnewline
12 & 387.8083333 & 388.188389871526 \tabularnewline
13 & 137.25 & 137.989810918791 \tabularnewline
14 & 403.4083333 & 403.233247579343 \tabularnewline
15 & 241.9583333 & 242.063007969908 \tabularnewline
16 & 183.9 & 183.838304767512 \tabularnewline
17 & 91.5 & 91.4424249895746 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=76402&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]738.152921347285[/C][/ROW]
[ROW][C]2[/C][C]733.4333333[/C][C]733.416796580491[/C][/ROW]
[ROW][C]3[/C][C]671.625[/C][C]671.688090788884[/C][/ROW]
[ROW][C]4[/C][C]696.7083333[/C][C]696.703220818828[/C][/ROW]
[ROW][C]5[/C][C]678.8[/C][C]678.803412946959[/C][/ROW]
[ROW][C]6[/C][C]692.6583333[/C][C]692.620540786813[/C][/ROW]
[ROW][C]7[/C][C]733.8833333[/C][C]733.777035245815[/C][/ROW]
[ROW][C]8[/C][C]697.5416667[/C][C]697.514261007328[/C][/ROW]
[ROW][C]9[/C][C]546.4166667[/C][C]546.619024233637[/C][/ROW]
[ROW][C]10[/C][C]716.1166667[/C][C]715.99231242607[/C][/ROW]
[ROW][C]11[/C][C]600.2583333[/C][C]600.33360683679[/C][/ROW]
[ROW][C]12[/C][C]387.8083333[/C][C]388.188389871526[/C][/ROW]
[ROW][C]13[/C][C]137.25[/C][C]137.989810918791[/C][/ROW]
[ROW][C]14[/C][C]403.4083333[/C][C]403.233247579343[/C][/ROW]
[ROW][C]15[/C][C]241.9583333[/C][C]242.063007969908[/C][/ROW]
[ROW][C]16[/C][C]183.9[/C][C]183.838304767512[/C][/ROW]
[ROW][C]17[/C][C]91.5[/C][C]91.4424249895746[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=76402&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=76402&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.1666667738.152921347285
2733.4333333733.416796580491
3671.625671.688090788884
4696.7083333696.703220818828
5678.8678.803412946959
6692.6583333692.620540786813
7733.8833333733.777035245815
8697.5416667697.514261007328
9546.4166667546.619024233637
10716.1166667715.99231242607
11600.2583333600.33360683679
12387.8083333388.188389871526
13137.25137.989810918791
14403.4083333403.233247579343
15241.9583333242.063007969908
16183.9183.838304767512
1791.591.4424249895746







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

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