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

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

Post a new message
Dataseries X:
1201,42
1157,2125
1722,05
1918,2475
1930,4575
1264,1775
1456,3725
2168,985
1983,765
1672,695
1938,575
1307,6425
1523,3425
1928,39
2208,435
2290,175
2578,245
1152,84
1398,7575
1393,9175
1972,2525
2410,4775
2363,27
1341,6075
1437,0425




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75933&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
261886.160389859081198.886717769231436.776290267562335.54448945062573.43406194893
271974.100211830571229.493343948401487.227950515222460.972473145932718.70707971275
281974.530461338721229.923593456551487.658200023372461.402722654082719.1373292209
292115.081055498801370.474187616631628.208794183452601.953316814162859.68792338098
301543.63573349335799.0288656111761056.7634721782030.507994808712288.24260137553
311626.41258227450881.805714392321139.540320959142113.284843589852371.01945015667
321478.14244728837733.535579406189991.2701859730131965.014708603722222.74931517054
331803.245439272431058.638571390261316.373177957082290.117700587792547.85230715461
342084.533157715931339.926289833751597.660896400572571.405419031282829.14002559810
352006.66710612981262.060238247621519.794844814452493.539367445152751.27397401198
361617.09484773718873.1087043729161130.628456368412103.561239105952361.08099110144
371579.64445442548839.2398784149241095.519924073262063.768984777692320.04903043603
381703.48120229323881.8452708944371166.242343570572240.72006101592525.11713369203
391736.90779526647901.9594752923981190.964433525202282.851157007732571.85611524054
401736.90779526647901.9594752923981190.964433525202282.851157007732571.85611524054
411736.90779526647901.9594752923981190.964433525202282.851157007732571.85611524054
421736.90779526647901.9594752923981190.964433525202282.851157007732571.85611524054
431736.90779526647901.9594752923981190.964433525202282.851157007732571.85611524054
441736.90779526647901.9594752923981190.964433525202282.851157007732571.85611524054
451736.90779526647901.9594752923981190.964433525202282.851157007732571.85611524054
461736.90779526647901.9594752923981190.964433525202282.851157007732571.85611524054
471736.90779526647901.9594752923981190.964433525202282.851157007732571.85611524054
481736.90779526647901.9594752923981190.964433525202282.851157007732571.85611524054
491736.90779526647901.9594752923981190.964433525202282.851157007732571.85611524054

\begin{tabular}{lllllllll}
\hline
Demand Forecast \tabularnewline
Point & Forecast & 95% LB & 80% LB & 80% UB & 95% UB \tabularnewline
26 & 1886.16038985908 & 1198.88671776923 & 1436.77629026756 & 2335.5444894506 & 2573.43406194893 \tabularnewline
27 & 1974.10021183057 & 1229.49334394840 & 1487.22795051522 & 2460.97247314593 & 2718.70707971275 \tabularnewline
28 & 1974.53046133872 & 1229.92359345655 & 1487.65820002337 & 2461.40272265408 & 2719.1373292209 \tabularnewline
29 & 2115.08105549880 & 1370.47418761663 & 1628.20879418345 & 2601.95331681416 & 2859.68792338098 \tabularnewline
30 & 1543.63573349335 & 799.028865611176 & 1056.763472178 & 2030.50799480871 & 2288.24260137553 \tabularnewline
31 & 1626.41258227450 & 881.80571439232 & 1139.54032095914 & 2113.28484358985 & 2371.01945015667 \tabularnewline
32 & 1478.14244728837 & 733.535579406189 & 991.270185973013 & 1965.01470860372 & 2222.74931517054 \tabularnewline
33 & 1803.24543927243 & 1058.63857139026 & 1316.37317795708 & 2290.11770058779 & 2547.85230715461 \tabularnewline
34 & 2084.53315771593 & 1339.92628983375 & 1597.66089640057 & 2571.40541903128 & 2829.14002559810 \tabularnewline
35 & 2006.6671061298 & 1262.06023824762 & 1519.79484481445 & 2493.53936744515 & 2751.27397401198 \tabularnewline
36 & 1617.09484773718 & 873.108704372916 & 1130.62845636841 & 2103.56123910595 & 2361.08099110144 \tabularnewline
37 & 1579.64445442548 & 839.239878414924 & 1095.51992407326 & 2063.76898477769 & 2320.04903043603 \tabularnewline
38 & 1703.48120229323 & 881.845270894437 & 1166.24234357057 & 2240.7200610159 & 2525.11713369203 \tabularnewline
39 & 1736.90779526647 & 901.959475292398 & 1190.96443352520 & 2282.85115700773 & 2571.85611524054 \tabularnewline
40 & 1736.90779526647 & 901.959475292398 & 1190.96443352520 & 2282.85115700773 & 2571.85611524054 \tabularnewline
41 & 1736.90779526647 & 901.959475292398 & 1190.96443352520 & 2282.85115700773 & 2571.85611524054 \tabularnewline
42 & 1736.90779526647 & 901.959475292398 & 1190.96443352520 & 2282.85115700773 & 2571.85611524054 \tabularnewline
43 & 1736.90779526647 & 901.959475292398 & 1190.96443352520 & 2282.85115700773 & 2571.85611524054 \tabularnewline
44 & 1736.90779526647 & 901.959475292398 & 1190.96443352520 & 2282.85115700773 & 2571.85611524054 \tabularnewline
45 & 1736.90779526647 & 901.959475292398 & 1190.96443352520 & 2282.85115700773 & 2571.85611524054 \tabularnewline
46 & 1736.90779526647 & 901.959475292398 & 1190.96443352520 & 2282.85115700773 & 2571.85611524054 \tabularnewline
47 & 1736.90779526647 & 901.959475292398 & 1190.96443352520 & 2282.85115700773 & 2571.85611524054 \tabularnewline
48 & 1736.90779526647 & 901.959475292398 & 1190.96443352520 & 2282.85115700773 & 2571.85611524054 \tabularnewline
49 & 1736.90779526647 & 901.959475292398 & 1190.96443352520 & 2282.85115700773 & 2571.85611524054 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75933&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]1886.16038985908[/C][C]1198.88671776923[/C][C]1436.77629026756[/C][C]2335.5444894506[/C][C]2573.43406194893[/C][/ROW]
[ROW][C]27[/C][C]1974.10021183057[/C][C]1229.49334394840[/C][C]1487.22795051522[/C][C]2460.97247314593[/C][C]2718.70707971275[/C][/ROW]
[ROW][C]28[/C][C]1974.53046133872[/C][C]1229.92359345655[/C][C]1487.65820002337[/C][C]2461.40272265408[/C][C]2719.1373292209[/C][/ROW]
[ROW][C]29[/C][C]2115.08105549880[/C][C]1370.47418761663[/C][C]1628.20879418345[/C][C]2601.95331681416[/C][C]2859.68792338098[/C][/ROW]
[ROW][C]30[/C][C]1543.63573349335[/C][C]799.028865611176[/C][C]1056.763472178[/C][C]2030.50799480871[/C][C]2288.24260137553[/C][/ROW]
[ROW][C]31[/C][C]1626.41258227450[/C][C]881.80571439232[/C][C]1139.54032095914[/C][C]2113.28484358985[/C][C]2371.01945015667[/C][/ROW]
[ROW][C]32[/C][C]1478.14244728837[/C][C]733.535579406189[/C][C]991.270185973013[/C][C]1965.01470860372[/C][C]2222.74931517054[/C][/ROW]
[ROW][C]33[/C][C]1803.24543927243[/C][C]1058.63857139026[/C][C]1316.37317795708[/C][C]2290.11770058779[/C][C]2547.85230715461[/C][/ROW]
[ROW][C]34[/C][C]2084.53315771593[/C][C]1339.92628983375[/C][C]1597.66089640057[/C][C]2571.40541903128[/C][C]2829.14002559810[/C][/ROW]
[ROW][C]35[/C][C]2006.6671061298[/C][C]1262.06023824762[/C][C]1519.79484481445[/C][C]2493.53936744515[/C][C]2751.27397401198[/C][/ROW]
[ROW][C]36[/C][C]1617.09484773718[/C][C]873.108704372916[/C][C]1130.62845636841[/C][C]2103.56123910595[/C][C]2361.08099110144[/C][/ROW]
[ROW][C]37[/C][C]1579.64445442548[/C][C]839.239878414924[/C][C]1095.51992407326[/C][C]2063.76898477769[/C][C]2320.04903043603[/C][/ROW]
[ROW][C]38[/C][C]1703.48120229323[/C][C]881.845270894437[/C][C]1166.24234357057[/C][C]2240.7200610159[/C][C]2525.11713369203[/C][/ROW]
[ROW][C]39[/C][C]1736.90779526647[/C][C]901.959475292398[/C][C]1190.96443352520[/C][C]2282.85115700773[/C][C]2571.85611524054[/C][/ROW]
[ROW][C]40[/C][C]1736.90779526647[/C][C]901.959475292398[/C][C]1190.96443352520[/C][C]2282.85115700773[/C][C]2571.85611524054[/C][/ROW]
[ROW][C]41[/C][C]1736.90779526647[/C][C]901.959475292398[/C][C]1190.96443352520[/C][C]2282.85115700773[/C][C]2571.85611524054[/C][/ROW]
[ROW][C]42[/C][C]1736.90779526647[/C][C]901.959475292398[/C][C]1190.96443352520[/C][C]2282.85115700773[/C][C]2571.85611524054[/C][/ROW]
[ROW][C]43[/C][C]1736.90779526647[/C][C]901.959475292398[/C][C]1190.96443352520[/C][C]2282.85115700773[/C][C]2571.85611524054[/C][/ROW]
[ROW][C]44[/C][C]1736.90779526647[/C][C]901.959475292398[/C][C]1190.96443352520[/C][C]2282.85115700773[/C][C]2571.85611524054[/C][/ROW]
[ROW][C]45[/C][C]1736.90779526647[/C][C]901.959475292398[/C][C]1190.96443352520[/C][C]2282.85115700773[/C][C]2571.85611524054[/C][/ROW]
[ROW][C]46[/C][C]1736.90779526647[/C][C]901.959475292398[/C][C]1190.96443352520[/C][C]2282.85115700773[/C][C]2571.85611524054[/C][/ROW]
[ROW][C]47[/C][C]1736.90779526647[/C][C]901.959475292398[/C][C]1190.96443352520[/C][C]2282.85115700773[/C][C]2571.85611524054[/C][/ROW]
[ROW][C]48[/C][C]1736.90779526647[/C][C]901.959475292398[/C][C]1190.96443352520[/C][C]2282.85115700773[/C][C]2571.85611524054[/C][/ROW]
[ROW][C]49[/C][C]1736.90779526647[/C][C]901.959475292398[/C][C]1190.96443352520[/C][C]2282.85115700773[/C][C]2571.85611524054[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75933&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75933&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
261886.160389859081198.886717769231436.776290267562335.54448945062573.43406194893
271974.100211830571229.493343948401487.227950515222460.972473145932718.70707971275
281974.530461338721229.923593456551487.658200023372461.402722654082719.1373292209
292115.081055498801370.474187616631628.208794183452601.953316814162859.68792338098
301543.63573349335799.0288656111761056.7634721782030.507994808712288.24260137553
311626.41258227450881.805714392321139.540320959142113.284843589852371.01945015667
321478.14244728837733.535579406189991.2701859730131965.014708603722222.74931517054
331803.245439272431058.638571390261316.373177957082290.117700587792547.85230715461
342084.533157715931339.926289833751597.660896400572571.405419031282829.14002559810
352006.66710612981262.060238247621519.794844814452493.539367445152751.27397401198
361617.09484773718873.1087043729161130.628456368412103.561239105952361.08099110144
371579.64445442548839.2398784149241095.519924073262063.768984777692320.04903043603
381703.48120229323881.8452708944371166.242343570572240.72006101592525.11713369203
391736.90779526647901.9594752923981190.964433525202282.851157007732571.85611524054
401736.90779526647901.9594752923981190.964433525202282.851157007732571.85611524054
411736.90779526647901.9594752923981190.964433525202282.851157007732571.85611524054
421736.90779526647901.9594752923981190.964433525202282.851157007732571.85611524054
431736.90779526647901.9594752923981190.964433525202282.851157007732571.85611524054
441736.90779526647901.9594752923981190.964433525202282.851157007732571.85611524054
451736.90779526647901.9594752923981190.964433525202282.851157007732571.85611524054
461736.90779526647901.9594752923981190.964433525202282.851157007732571.85611524054
471736.90779526647901.9594752923981190.964433525202282.851157007732571.85611524054
481736.90779526647901.9594752923981190.964433525202282.851157007732571.85611524054
491736.90779526647901.9594752923981190.964433525202282.851157007732571.85611524054







Actuals and Interpolation
TimeActualForecast
11201.421638.54139885537
21157.21251497.05173429845
31722.051595.11391392574
41918.24751810.81733236927
51930.45751804.12932358113
61264.17751735.32747882431
71456.37251507.49011430111
82168.9851765.26576138598
91983.7651934.23830420204
101672.6951750.23627132221
111938.5751727.68342690282
121307.64251736.51705207453
131523.34251352.55910680891
141928.391581.65625637482
152208.4351889.40575429802
162290.1751958.87684384425
172578.2451977.21467180681
181152.841782.30313239910
191398.75751351.50862585308
201393.91751919.78381416109
211972.25251622.49344537309
222410.47751876.91928728301
232363.272058.90251344068
241341.60751699.68606008630
251437.04251590.45807134907

\begin{tabular}{lllllllll}
\hline
Actuals and Interpolation \tabularnewline
Time & Actual & Forecast \tabularnewline
1 & 1201.42 & 1638.54139885537 \tabularnewline
2 & 1157.2125 & 1497.05173429845 \tabularnewline
3 & 1722.05 & 1595.11391392574 \tabularnewline
4 & 1918.2475 & 1810.81733236927 \tabularnewline
5 & 1930.4575 & 1804.12932358113 \tabularnewline
6 & 1264.1775 & 1735.32747882431 \tabularnewline
7 & 1456.3725 & 1507.49011430111 \tabularnewline
8 & 2168.985 & 1765.26576138598 \tabularnewline
9 & 1983.765 & 1934.23830420204 \tabularnewline
10 & 1672.695 & 1750.23627132221 \tabularnewline
11 & 1938.575 & 1727.68342690282 \tabularnewline
12 & 1307.6425 & 1736.51705207453 \tabularnewline
13 & 1523.3425 & 1352.55910680891 \tabularnewline
14 & 1928.39 & 1581.65625637482 \tabularnewline
15 & 2208.435 & 1889.40575429802 \tabularnewline
16 & 2290.175 & 1958.87684384425 \tabularnewline
17 & 2578.245 & 1977.21467180681 \tabularnewline
18 & 1152.84 & 1782.30313239910 \tabularnewline
19 & 1398.7575 & 1351.50862585308 \tabularnewline
20 & 1393.9175 & 1919.78381416109 \tabularnewline
21 & 1972.2525 & 1622.49344537309 \tabularnewline
22 & 2410.4775 & 1876.91928728301 \tabularnewline
23 & 2363.27 & 2058.90251344068 \tabularnewline
24 & 1341.6075 & 1699.68606008630 \tabularnewline
25 & 1437.0425 & 1590.45807134907 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75933&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]1201.42[/C][C]1638.54139885537[/C][/ROW]
[ROW][C]2[/C][C]1157.2125[/C][C]1497.05173429845[/C][/ROW]
[ROW][C]3[/C][C]1722.05[/C][C]1595.11391392574[/C][/ROW]
[ROW][C]4[/C][C]1918.2475[/C][C]1810.81733236927[/C][/ROW]
[ROW][C]5[/C][C]1930.4575[/C][C]1804.12932358113[/C][/ROW]
[ROW][C]6[/C][C]1264.1775[/C][C]1735.32747882431[/C][/ROW]
[ROW][C]7[/C][C]1456.3725[/C][C]1507.49011430111[/C][/ROW]
[ROW][C]8[/C][C]2168.985[/C][C]1765.26576138598[/C][/ROW]
[ROW][C]9[/C][C]1983.765[/C][C]1934.23830420204[/C][/ROW]
[ROW][C]10[/C][C]1672.695[/C][C]1750.23627132221[/C][/ROW]
[ROW][C]11[/C][C]1938.575[/C][C]1727.68342690282[/C][/ROW]
[ROW][C]12[/C][C]1307.6425[/C][C]1736.51705207453[/C][/ROW]
[ROW][C]13[/C][C]1523.3425[/C][C]1352.55910680891[/C][/ROW]
[ROW][C]14[/C][C]1928.39[/C][C]1581.65625637482[/C][/ROW]
[ROW][C]15[/C][C]2208.435[/C][C]1889.40575429802[/C][/ROW]
[ROW][C]16[/C][C]2290.175[/C][C]1958.87684384425[/C][/ROW]
[ROW][C]17[/C][C]2578.245[/C][C]1977.21467180681[/C][/ROW]
[ROW][C]18[/C][C]1152.84[/C][C]1782.30313239910[/C][/ROW]
[ROW][C]19[/C][C]1398.7575[/C][C]1351.50862585308[/C][/ROW]
[ROW][C]20[/C][C]1393.9175[/C][C]1919.78381416109[/C][/ROW]
[ROW][C]21[/C][C]1972.2525[/C][C]1622.49344537309[/C][/ROW]
[ROW][C]22[/C][C]2410.4775[/C][C]1876.91928728301[/C][/ROW]
[ROW][C]23[/C][C]2363.27[/C][C]2058.90251344068[/C][/ROW]
[ROW][C]24[/C][C]1341.6075[/C][C]1699.68606008630[/C][/ROW]
[ROW][C]25[/C][C]1437.0425[/C][C]1590.45807134907[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75933&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75933&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
11201.421638.54139885537
21157.21251497.05173429845
31722.051595.11391392574
41918.24751810.81733236927
51930.45751804.12932358113
61264.17751735.32747882431
71456.37251507.49011430111
82168.9851765.26576138598
91983.7651934.23830420204
101672.6951750.23627132221
111938.5751727.68342690282
121307.64251736.51705207453
131523.34251352.55910680891
141928.391581.65625637482
152208.4351889.40575429802
162290.1751958.87684384425
172578.2451977.21467180681
181152.841782.30313239910
191398.75751351.50862585308
201393.91751919.78381416109
211972.25251622.49344537309
222410.47751876.91928728301
232363.272058.90251344068
241341.60751699.68606008630
251437.04251590.45807134907







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

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