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:07:42 +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/t12737561011v8nkh5suro4a5n.htm/, Retrieved Mon, 06 May 2024 01:22:50 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=75920, Retrieved Mon, 06 May 2024 01:22:50 +0000
QR Codes:

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

Post a new message
Dataseries X:
66
71
50
66
66
44
76.75
66
65.75
76.75
65
76
88
75.5
97.5
98
88.0115
55.25
88.25
87
75.5
88
74.5
63.5
94




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75920&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
2676.719887020883152.162603356603860.662742311223992.7770317305423101.277170685162
2772.439615621897247.272004513361955.983399246712188.895831997082497.6072267304326
2885.778718891002359.895120759730868.8543437653835102.703094016621111.662317022274
2977.913687118032247.12455655272557.781756741267698.0456174947968108.702817683339
3076.280328104711944.438790287928455.460265613603197.1003905958208108.121865921495
3182.107428348878649.12691446003260.5426294341499103.672227263607115.087942237725
3278.53454679946743.016071029200455.3102638084583101.758829790476114.053022569734
3377.92736401187141.19933608035253.9121973729546101.942530650788114.65539194339
3480.469897543289642.49236083882955.6377210323776105.302074054202118.447434247750
3578.849776666535939.127547055107552.8768067818907104.822746551181118.572006277964
3678.632291766459237.689071430074851.8609589591146105.403624573804119.575512102844
3779.740335897043837.567698742429752.1651306407476107.31554115334121.912973051658
3879.006957670033135.432864457926650.5153895526393107.498525787427122.581050882140
3978.933371803263434.182911241501549.6726184199678108.194125186559123.683832365025
4079.415663551889833.496316315117149.3906162529303109.440710850849125.335010788662
4179.084229645100231.943355027636548.2604685231173109.907990767083126.225104262564
4279.061679627325730.804778156761747.5081877694405110.615171485211127.318581097890
4379.271336700508929.912385936754246.9972535418977111.54541985912128.630287464263
4479.121786597407828.652220285277246.1215109648704112.122062229945129.591352909538
4579.116228691862127.591069009551145.4257376539378112.806719729787130.641388374173
4679.207249089086426.642237471893644.8368354170759113.577662761097131.772260706279
4779.139869809778325.542032155453044.0941274912912114.185612128265132.737707464104
4879.139360153985224.541294169498243.4396036839464114.839116624024133.737426138472
4979.178822051724523.595924290341942.8351186951949115.522525408254134.761719813107

\begin{tabular}{lllllllll}
\hline
Demand Forecast \tabularnewline
Point & Forecast & 95% LB & 80% LB & 80% UB & 95% UB \tabularnewline
26 & 76.7198870208831 & 52.1626033566038 & 60.6627423112239 & 92.7770317305423 & 101.277170685162 \tabularnewline
27 & 72.4396156218972 & 47.2720045133619 & 55.9833992467121 & 88.8958319970824 & 97.6072267304326 \tabularnewline
28 & 85.7787188910023 & 59.8951207597308 & 68.8543437653835 & 102.703094016621 & 111.662317022274 \tabularnewline
29 & 77.9136871180322 & 47.124556552725 & 57.7817567412676 & 98.0456174947968 & 108.702817683339 \tabularnewline
30 & 76.2803281047119 & 44.4387902879284 & 55.4602656136031 & 97.1003905958208 & 108.121865921495 \tabularnewline
31 & 82.1074283488786 & 49.126914460032 & 60.5426294341499 & 103.672227263607 & 115.087942237725 \tabularnewline
32 & 78.534546799467 & 43.0160710292004 & 55.3102638084583 & 101.758829790476 & 114.053022569734 \tabularnewline
33 & 77.927364011871 & 41.199336080352 & 53.9121973729546 & 101.942530650788 & 114.65539194339 \tabularnewline
34 & 80.4698975432896 & 42.492360838829 & 55.6377210323776 & 105.302074054202 & 118.447434247750 \tabularnewline
35 & 78.8497766665359 & 39.1275470551075 & 52.8768067818907 & 104.822746551181 & 118.572006277964 \tabularnewline
36 & 78.6322917664592 & 37.6890714300748 & 51.8609589591146 & 105.403624573804 & 119.575512102844 \tabularnewline
37 & 79.7403358970438 & 37.5676987424297 & 52.1651306407476 & 107.31554115334 & 121.912973051658 \tabularnewline
38 & 79.0069576700331 & 35.4328644579266 & 50.5153895526393 & 107.498525787427 & 122.581050882140 \tabularnewline
39 & 78.9333718032634 & 34.1829112415015 & 49.6726184199678 & 108.194125186559 & 123.683832365025 \tabularnewline
40 & 79.4156635518898 & 33.4963163151171 & 49.3906162529303 & 109.440710850849 & 125.335010788662 \tabularnewline
41 & 79.0842296451002 & 31.9433550276365 & 48.2604685231173 & 109.907990767083 & 126.225104262564 \tabularnewline
42 & 79.0616796273257 & 30.8047781567617 & 47.5081877694405 & 110.615171485211 & 127.318581097890 \tabularnewline
43 & 79.2713367005089 & 29.9123859367542 & 46.9972535418977 & 111.54541985912 & 128.630287464263 \tabularnewline
44 & 79.1217865974078 & 28.6522202852772 & 46.1215109648704 & 112.122062229945 & 129.591352909538 \tabularnewline
45 & 79.1162286918621 & 27.5910690095511 & 45.4257376539378 & 112.806719729787 & 130.641388374173 \tabularnewline
46 & 79.2072490890864 & 26.6422374718936 & 44.8368354170759 & 113.577662761097 & 131.772260706279 \tabularnewline
47 & 79.1398698097783 & 25.5420321554530 & 44.0941274912912 & 114.185612128265 & 132.737707464104 \tabularnewline
48 & 79.1393601539852 & 24.5412941694982 & 43.4396036839464 & 114.839116624024 & 133.737426138472 \tabularnewline
49 & 79.1788220517245 & 23.5959242903419 & 42.8351186951949 & 115.522525408254 & 134.761719813107 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75920&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]76.7198870208831[/C][C]52.1626033566038[/C][C]60.6627423112239[/C][C]92.7770317305423[/C][C]101.277170685162[/C][/ROW]
[ROW][C]27[/C][C]72.4396156218972[/C][C]47.2720045133619[/C][C]55.9833992467121[/C][C]88.8958319970824[/C][C]97.6072267304326[/C][/ROW]
[ROW][C]28[/C][C]85.7787188910023[/C][C]59.8951207597308[/C][C]68.8543437653835[/C][C]102.703094016621[/C][C]111.662317022274[/C][/ROW]
[ROW][C]29[/C][C]77.9136871180322[/C][C]47.124556552725[/C][C]57.7817567412676[/C][C]98.0456174947968[/C][C]108.702817683339[/C][/ROW]
[ROW][C]30[/C][C]76.2803281047119[/C][C]44.4387902879284[/C][C]55.4602656136031[/C][C]97.1003905958208[/C][C]108.121865921495[/C][/ROW]
[ROW][C]31[/C][C]82.1074283488786[/C][C]49.126914460032[/C][C]60.5426294341499[/C][C]103.672227263607[/C][C]115.087942237725[/C][/ROW]
[ROW][C]32[/C][C]78.534546799467[/C][C]43.0160710292004[/C][C]55.3102638084583[/C][C]101.758829790476[/C][C]114.053022569734[/C][/ROW]
[ROW][C]33[/C][C]77.927364011871[/C][C]41.199336080352[/C][C]53.9121973729546[/C][C]101.942530650788[/C][C]114.65539194339[/C][/ROW]
[ROW][C]34[/C][C]80.4698975432896[/C][C]42.492360838829[/C][C]55.6377210323776[/C][C]105.302074054202[/C][C]118.447434247750[/C][/ROW]
[ROW][C]35[/C][C]78.8497766665359[/C][C]39.1275470551075[/C][C]52.8768067818907[/C][C]104.822746551181[/C][C]118.572006277964[/C][/ROW]
[ROW][C]36[/C][C]78.6322917664592[/C][C]37.6890714300748[/C][C]51.8609589591146[/C][C]105.403624573804[/C][C]119.575512102844[/C][/ROW]
[ROW][C]37[/C][C]79.7403358970438[/C][C]37.5676987424297[/C][C]52.1651306407476[/C][C]107.31554115334[/C][C]121.912973051658[/C][/ROW]
[ROW][C]38[/C][C]79.0069576700331[/C][C]35.4328644579266[/C][C]50.5153895526393[/C][C]107.498525787427[/C][C]122.581050882140[/C][/ROW]
[ROW][C]39[/C][C]78.9333718032634[/C][C]34.1829112415015[/C][C]49.6726184199678[/C][C]108.194125186559[/C][C]123.683832365025[/C][/ROW]
[ROW][C]40[/C][C]79.4156635518898[/C][C]33.4963163151171[/C][C]49.3906162529303[/C][C]109.440710850849[/C][C]125.335010788662[/C][/ROW]
[ROW][C]41[/C][C]79.0842296451002[/C][C]31.9433550276365[/C][C]48.2604685231173[/C][C]109.907990767083[/C][C]126.225104262564[/C][/ROW]
[ROW][C]42[/C][C]79.0616796273257[/C][C]30.8047781567617[/C][C]47.5081877694405[/C][C]110.615171485211[/C][C]127.318581097890[/C][/ROW]
[ROW][C]43[/C][C]79.2713367005089[/C][C]29.9123859367542[/C][C]46.9972535418977[/C][C]111.54541985912[/C][C]128.630287464263[/C][/ROW]
[ROW][C]44[/C][C]79.1217865974078[/C][C]28.6522202852772[/C][C]46.1215109648704[/C][C]112.122062229945[/C][C]129.591352909538[/C][/ROW]
[ROW][C]45[/C][C]79.1162286918621[/C][C]27.5910690095511[/C][C]45.4257376539378[/C][C]112.806719729787[/C][C]130.641388374173[/C][/ROW]
[ROW][C]46[/C][C]79.2072490890864[/C][C]26.6422374718936[/C][C]44.8368354170759[/C][C]113.577662761097[/C][C]131.772260706279[/C][/ROW]
[ROW][C]47[/C][C]79.1398698097783[/C][C]25.5420321554530[/C][C]44.0941274912912[/C][C]114.185612128265[/C][C]132.737707464104[/C][/ROW]
[ROW][C]48[/C][C]79.1393601539852[/C][C]24.5412941694982[/C][C]43.4396036839464[/C][C]114.839116624024[/C][C]133.737426138472[/C][/ROW]
[ROW][C]49[/C][C]79.1788220517245[/C][C]23.5959242903419[/C][C]42.8351186951949[/C][C]115.522525408254[/C][C]134.761719813107[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75920&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75920&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
2676.719887020883152.162603356603860.662742311223992.7770317305423101.277170685162
2772.439615621897247.272004513361955.983399246712188.895831997082497.6072267304326
2885.778718891002359.895120759730868.8543437653835102.703094016621111.662317022274
2977.913687118032247.12455655272557.781756741267698.0456174947968108.702817683339
3076.280328104711944.438790287928455.460265613603197.1003905958208108.121865921495
3182.107428348878649.12691446003260.5426294341499103.672227263607115.087942237725
3278.53454679946743.016071029200455.3102638084583101.758829790476114.053022569734
3377.92736401187141.19933608035253.9121973729546101.942530650788114.65539194339
3480.469897543289642.49236083882955.6377210323776105.302074054202118.447434247750
3578.849776666535939.127547055107552.8768067818907104.822746551181118.572006277964
3678.632291766459237.689071430074851.8609589591146105.403624573804119.575512102844
3779.740335897043837.567698742429752.1651306407476107.31554115334121.912973051658
3879.006957670033135.432864457926650.5153895526393107.498525787427122.581050882140
3978.933371803263434.182911241501549.6726184199678108.194125186559123.683832365025
4079.415663551889833.496316315117149.3906162529303109.440710850849125.335010788662
4179.084229645100231.943355027636548.2604685231173109.907990767083126.225104262564
4279.061679627325730.804778156761747.5081877694405110.615171485211127.318581097890
4379.271336700508929.912385936754246.9972535418977111.54541985912128.630287464263
4479.121786597407828.652220285277246.1215109648704112.122062229945129.591352909538
4579.116228691862127.591069009551145.4257376539378112.806719729787130.641388374173
4679.207249089086426.642237471893644.8368354170759113.577662761097131.772260706279
4779.139869809778325.542032155453044.0941274912912114.185612128265132.737707464104
4879.139360153985224.541294169498243.4396036839464114.839116624024133.737426138472
4979.178822051724523.595924290341942.8351186951949115.522525408254134.761719813107







Actuals and Interpolation
TimeActualForecast
16665.9340000655022
27167.4510134015007
35065.1096772035754
46663.3900574001068
56665.7651067120978
64456.7231840728576
776.7561.0647320143803
86664.1024412875046
965.7555.3499659970663
1076.7572.1767781103031
116568.3625842416714
127667.7363072850427
138874.280295689305
1475.572.3141534058821
1597.578.2382585173593
169887.6827804286996
1788.011584.8565432816706
1855.2595.469375671624
1988.2586.4534430561582
208781.6480522907467
2175.568.8361541965404
228885.1449520700068
2374.584.9718409849175
2463.577.7240276566534
259479.8596794457166

\begin{tabular}{lllllllll}
\hline
Actuals and Interpolation \tabularnewline
Time & Actual & Forecast \tabularnewline
1 & 66 & 65.9340000655022 \tabularnewline
2 & 71 & 67.4510134015007 \tabularnewline
3 & 50 & 65.1096772035754 \tabularnewline
4 & 66 & 63.3900574001068 \tabularnewline
5 & 66 & 65.7651067120978 \tabularnewline
6 & 44 & 56.7231840728576 \tabularnewline
7 & 76.75 & 61.0647320143803 \tabularnewline
8 & 66 & 64.1024412875046 \tabularnewline
9 & 65.75 & 55.3499659970663 \tabularnewline
10 & 76.75 & 72.1767781103031 \tabularnewline
11 & 65 & 68.3625842416714 \tabularnewline
12 & 76 & 67.7363072850427 \tabularnewline
13 & 88 & 74.280295689305 \tabularnewline
14 & 75.5 & 72.3141534058821 \tabularnewline
15 & 97.5 & 78.2382585173593 \tabularnewline
16 & 98 & 87.6827804286996 \tabularnewline
17 & 88.0115 & 84.8565432816706 \tabularnewline
18 & 55.25 & 95.469375671624 \tabularnewline
19 & 88.25 & 86.4534430561582 \tabularnewline
20 & 87 & 81.6480522907467 \tabularnewline
21 & 75.5 & 68.8361541965404 \tabularnewline
22 & 88 & 85.1449520700068 \tabularnewline
23 & 74.5 & 84.9718409849175 \tabularnewline
24 & 63.5 & 77.7240276566534 \tabularnewline
25 & 94 & 79.8596794457166 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75920&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]66[/C][C]65.9340000655022[/C][/ROW]
[ROW][C]2[/C][C]71[/C][C]67.4510134015007[/C][/ROW]
[ROW][C]3[/C][C]50[/C][C]65.1096772035754[/C][/ROW]
[ROW][C]4[/C][C]66[/C][C]63.3900574001068[/C][/ROW]
[ROW][C]5[/C][C]66[/C][C]65.7651067120978[/C][/ROW]
[ROW][C]6[/C][C]44[/C][C]56.7231840728576[/C][/ROW]
[ROW][C]7[/C][C]76.75[/C][C]61.0647320143803[/C][/ROW]
[ROW][C]8[/C][C]66[/C][C]64.1024412875046[/C][/ROW]
[ROW][C]9[/C][C]65.75[/C][C]55.3499659970663[/C][/ROW]
[ROW][C]10[/C][C]76.75[/C][C]72.1767781103031[/C][/ROW]
[ROW][C]11[/C][C]65[/C][C]68.3625842416714[/C][/ROW]
[ROW][C]12[/C][C]76[/C][C]67.7363072850427[/C][/ROW]
[ROW][C]13[/C][C]88[/C][C]74.280295689305[/C][/ROW]
[ROW][C]14[/C][C]75.5[/C][C]72.3141534058821[/C][/ROW]
[ROW][C]15[/C][C]97.5[/C][C]78.2382585173593[/C][/ROW]
[ROW][C]16[/C][C]98[/C][C]87.6827804286996[/C][/ROW]
[ROW][C]17[/C][C]88.0115[/C][C]84.8565432816706[/C][/ROW]
[ROW][C]18[/C][C]55.25[/C][C]95.469375671624[/C][/ROW]
[ROW][C]19[/C][C]88.25[/C][C]86.4534430561582[/C][/ROW]
[ROW][C]20[/C][C]87[/C][C]81.6480522907467[/C][/ROW]
[ROW][C]21[/C][C]75.5[/C][C]68.8361541965404[/C][/ROW]
[ROW][C]22[/C][C]88[/C][C]85.1449520700068[/C][/ROW]
[ROW][C]23[/C][C]74.5[/C][C]84.9718409849175[/C][/ROW]
[ROW][C]24[/C][C]63.5[/C][C]77.7240276566534[/C][/ROW]
[ROW][C]25[/C][C]94[/C][C]79.8596794457166[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75920&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75920&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
16665.9340000655022
27167.4510134015007
35065.1096772035754
46663.3900574001068
56665.7651067120978
64456.7231840728576
776.7561.0647320143803
86664.1024412875046
965.7555.3499659970663
1076.7572.1767781103031
116568.3625842416714
127667.7363072850427
138874.280295689305
1475.572.3141534058821
1597.578.2382585173593
169887.6827804286996
1788.011584.8565432816706
1855.2595.469375671624
1988.2586.4534430561582
208781.6480522907467
2175.568.8361541965404
228885.1449520700068
2374.584.9718409849175
2463.577.7240276566534
259479.8596794457166







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

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