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:30:24 +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/t1273757456jx2b2fx3v3ls3pn.htm/, Retrieved Mon, 06 May 2024 04:09:54 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=75937, Retrieved Mon, 06 May 2024 04:09:54 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsFM22,steven,coomans,thesis,ETS,per2maand
Estimated Impact122
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 13:30:24] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
724
762.275
721.125
653.275
663.7125
735.5125
628.1375
792.55
636.5
800.825
728.05
618.2625
450.625
767.525
675.65
583.25
690.7875
208.0625
142.5
205.925
462.5625
251.4375
195.725
191.625
137.25




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time7 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 & 7 seconds \tabularnewline
R Server & wessa.org @ wessa.org \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75937&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]7 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]wessa.org @ wessa.org[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75937&T=0

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







Demand Forecast
PointForecast95% LB80% LB80% UB95% UB
26172.4810696524-117.467047794635-17.1058139699319362.067953274732462.429187099435
27172.4810696524-157.930523819749-43.5634588329983388.525598137798502.892663124549
28172.4810696524-193.952732541843-67.1171150972524412.079254402053538.914871846643
29172.4810696524-226.737719585099-88.5540658795414433.516205184342571.699858889899
30172.4810696524-257.027430810606-108.359443502361453.321582807161601.989570115406
31172.4810696524-285.317425604744-126.857276831775471.819416136575630.279564909544
32172.4810696524-311.958165494207-144.276720342938489.238859647738656.920304799008
33172.4810696524-337.208328745443-160.786914662897505.749053967697682.170468050243
34172.4810696524-361.265305631667-176.516926353926521.479065658726706.227444936467
35172.4810696524-384.283785038164-191.567901041492536.530040346292729.245924342964
36172.4810696524-406.387666511793-206.020852284771550.982991589571751.349805816593
37172.4810696524-427.678012590013-219.941861325114564.904000629914772.640151894813
38172.4810696524-448.238540387254-233.385667841366578.347807146166793.200679692054
39172.4810696524-468.139523661229-246.398221373886591.360360678686813.101662966029
40172.4810696524-487.440633936163-259.018539035180603.98067833998832.402773240963
41172.4810696524-506.193053293919-271.280086989757616.242226294557851.15519259872
42172.4810696524-524.441074813308-283.211826925147628.173966229947869.403214118108
43172.4810696524-542.223334794925-294.839021760419639.80116106522887.185474099725
44172.4810696524-559.573775305361-306.183865020003651.146004324803904.53591461016
45172.4810696524-576.522405850789-317.265978865288662.228118170088921.484545155589
46172.4810696524-593.095913155718-328.10281280751673.06495211231938.058052460518
47172.4810696524-609.318154506403-338.709966287676683.672105592476954.280293811203
48172.4810696524-625.210560731818-349.101452171652694.063591476452970.172700036618
49172.4810696524-640.792468263815-359.28991387264704.25205317744985.754607568615

\begin{tabular}{lllllllll}
\hline
Demand Forecast \tabularnewline
Point & Forecast & 95% LB & 80% LB & 80% UB & 95% UB \tabularnewline
26 & 172.4810696524 & -117.467047794635 & -17.1058139699319 & 362.067953274732 & 462.429187099435 \tabularnewline
27 & 172.4810696524 & -157.930523819749 & -43.5634588329983 & 388.525598137798 & 502.892663124549 \tabularnewline
28 & 172.4810696524 & -193.952732541843 & -67.1171150972524 & 412.079254402053 & 538.914871846643 \tabularnewline
29 & 172.4810696524 & -226.737719585099 & -88.5540658795414 & 433.516205184342 & 571.699858889899 \tabularnewline
30 & 172.4810696524 & -257.027430810606 & -108.359443502361 & 453.321582807161 & 601.989570115406 \tabularnewline
31 & 172.4810696524 & -285.317425604744 & -126.857276831775 & 471.819416136575 & 630.279564909544 \tabularnewline
32 & 172.4810696524 & -311.958165494207 & -144.276720342938 & 489.238859647738 & 656.920304799008 \tabularnewline
33 & 172.4810696524 & -337.208328745443 & -160.786914662897 & 505.749053967697 & 682.170468050243 \tabularnewline
34 & 172.4810696524 & -361.265305631667 & -176.516926353926 & 521.479065658726 & 706.227444936467 \tabularnewline
35 & 172.4810696524 & -384.283785038164 & -191.567901041492 & 536.530040346292 & 729.245924342964 \tabularnewline
36 & 172.4810696524 & -406.387666511793 & -206.020852284771 & 550.982991589571 & 751.349805816593 \tabularnewline
37 & 172.4810696524 & -427.678012590013 & -219.941861325114 & 564.904000629914 & 772.640151894813 \tabularnewline
38 & 172.4810696524 & -448.238540387254 & -233.385667841366 & 578.347807146166 & 793.200679692054 \tabularnewline
39 & 172.4810696524 & -468.139523661229 & -246.398221373886 & 591.360360678686 & 813.101662966029 \tabularnewline
40 & 172.4810696524 & -487.440633936163 & -259.018539035180 & 603.98067833998 & 832.402773240963 \tabularnewline
41 & 172.4810696524 & -506.193053293919 & -271.280086989757 & 616.242226294557 & 851.15519259872 \tabularnewline
42 & 172.4810696524 & -524.441074813308 & -283.211826925147 & 628.173966229947 & 869.403214118108 \tabularnewline
43 & 172.4810696524 & -542.223334794925 & -294.839021760419 & 639.80116106522 & 887.185474099725 \tabularnewline
44 & 172.4810696524 & -559.573775305361 & -306.183865020003 & 651.146004324803 & 904.53591461016 \tabularnewline
45 & 172.4810696524 & -576.522405850789 & -317.265978865288 & 662.228118170088 & 921.484545155589 \tabularnewline
46 & 172.4810696524 & -593.095913155718 & -328.10281280751 & 673.06495211231 & 938.058052460518 \tabularnewline
47 & 172.4810696524 & -609.318154506403 & -338.709966287676 & 683.672105592476 & 954.280293811203 \tabularnewline
48 & 172.4810696524 & -625.210560731818 & -349.101452171652 & 694.063591476452 & 970.172700036618 \tabularnewline
49 & 172.4810696524 & -640.792468263815 & -359.28991387264 & 704.25205317744 & 985.754607568615 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75937&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]172.4810696524[/C][C]-117.467047794635[/C][C]-17.1058139699319[/C][C]362.067953274732[/C][C]462.429187099435[/C][/ROW]
[ROW][C]27[/C][C]172.4810696524[/C][C]-157.930523819749[/C][C]-43.5634588329983[/C][C]388.525598137798[/C][C]502.892663124549[/C][/ROW]
[ROW][C]28[/C][C]172.4810696524[/C][C]-193.952732541843[/C][C]-67.1171150972524[/C][C]412.079254402053[/C][C]538.914871846643[/C][/ROW]
[ROW][C]29[/C][C]172.4810696524[/C][C]-226.737719585099[/C][C]-88.5540658795414[/C][C]433.516205184342[/C][C]571.699858889899[/C][/ROW]
[ROW][C]30[/C][C]172.4810696524[/C][C]-257.027430810606[/C][C]-108.359443502361[/C][C]453.321582807161[/C][C]601.989570115406[/C][/ROW]
[ROW][C]31[/C][C]172.4810696524[/C][C]-285.317425604744[/C][C]-126.857276831775[/C][C]471.819416136575[/C][C]630.279564909544[/C][/ROW]
[ROW][C]32[/C][C]172.4810696524[/C][C]-311.958165494207[/C][C]-144.276720342938[/C][C]489.238859647738[/C][C]656.920304799008[/C][/ROW]
[ROW][C]33[/C][C]172.4810696524[/C][C]-337.208328745443[/C][C]-160.786914662897[/C][C]505.749053967697[/C][C]682.170468050243[/C][/ROW]
[ROW][C]34[/C][C]172.4810696524[/C][C]-361.265305631667[/C][C]-176.516926353926[/C][C]521.479065658726[/C][C]706.227444936467[/C][/ROW]
[ROW][C]35[/C][C]172.4810696524[/C][C]-384.283785038164[/C][C]-191.567901041492[/C][C]536.530040346292[/C][C]729.245924342964[/C][/ROW]
[ROW][C]36[/C][C]172.4810696524[/C][C]-406.387666511793[/C][C]-206.020852284771[/C][C]550.982991589571[/C][C]751.349805816593[/C][/ROW]
[ROW][C]37[/C][C]172.4810696524[/C][C]-427.678012590013[/C][C]-219.941861325114[/C][C]564.904000629914[/C][C]772.640151894813[/C][/ROW]
[ROW][C]38[/C][C]172.4810696524[/C][C]-448.238540387254[/C][C]-233.385667841366[/C][C]578.347807146166[/C][C]793.200679692054[/C][/ROW]
[ROW][C]39[/C][C]172.4810696524[/C][C]-468.139523661229[/C][C]-246.398221373886[/C][C]591.360360678686[/C][C]813.101662966029[/C][/ROW]
[ROW][C]40[/C][C]172.4810696524[/C][C]-487.440633936163[/C][C]-259.018539035180[/C][C]603.98067833998[/C][C]832.402773240963[/C][/ROW]
[ROW][C]41[/C][C]172.4810696524[/C][C]-506.193053293919[/C][C]-271.280086989757[/C][C]616.242226294557[/C][C]851.15519259872[/C][/ROW]
[ROW][C]42[/C][C]172.4810696524[/C][C]-524.441074813308[/C][C]-283.211826925147[/C][C]628.173966229947[/C][C]869.403214118108[/C][/ROW]
[ROW][C]43[/C][C]172.4810696524[/C][C]-542.223334794925[/C][C]-294.839021760419[/C][C]639.80116106522[/C][C]887.185474099725[/C][/ROW]
[ROW][C]44[/C][C]172.4810696524[/C][C]-559.573775305361[/C][C]-306.183865020003[/C][C]651.146004324803[/C][C]904.53591461016[/C][/ROW]
[ROW][C]45[/C][C]172.4810696524[/C][C]-576.522405850789[/C][C]-317.265978865288[/C][C]662.228118170088[/C][C]921.484545155589[/C][/ROW]
[ROW][C]46[/C][C]172.4810696524[/C][C]-593.095913155718[/C][C]-328.10281280751[/C][C]673.06495211231[/C][C]938.058052460518[/C][/ROW]
[ROW][C]47[/C][C]172.4810696524[/C][C]-609.318154506403[/C][C]-338.709966287676[/C][C]683.672105592476[/C][C]954.280293811203[/C][/ROW]
[ROW][C]48[/C][C]172.4810696524[/C][C]-625.210560731818[/C][C]-349.101452171652[/C][C]694.063591476452[/C][C]970.172700036618[/C][/ROW]
[ROW][C]49[/C][C]172.4810696524[/C][C]-640.792468263815[/C][C]-359.28991387264[/C][C]704.25205317744[/C][C]985.754607568615[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75937&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75937&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
26172.4810696524-117.467047794635-17.1058139699319362.067953274732462.429187099435
27172.4810696524-157.930523819749-43.5634588329983388.525598137798502.892663124549
28172.4810696524-193.952732541843-67.1171150972524412.079254402053538.914871846643
29172.4810696524-226.737719585099-88.5540658795414433.516205184342571.699858889899
30172.4810696524-257.027430810606-108.359443502361453.321582807161601.989570115406
31172.4810696524-285.317425604744-126.857276831775471.819416136575630.279564909544
32172.4810696524-311.958165494207-144.276720342938489.238859647738656.920304799008
33172.4810696524-337.208328745443-160.786914662897505.749053967697682.170468050243
34172.4810696524-361.265305631667-176.516926353926521.479065658726706.227444936467
35172.4810696524-384.283785038164-191.567901041492536.530040346292729.245924342964
36172.4810696524-406.387666511793-206.020852284771550.982991589571751.349805816593
37172.4810696524-427.678012590013-219.941861325114564.904000629914772.640151894813
38172.4810696524-448.238540387254-233.385667841366578.347807146166793.200679692054
39172.4810696524-468.139523661229-246.398221373886591.360360678686813.101662966029
40172.4810696524-487.440633936163-259.018539035180603.98067833998832.402773240963
41172.4810696524-506.193053293919-271.280086989757616.242226294557851.15519259872
42172.4810696524-524.441074813308-283.211826925147628.173966229947869.403214118108
43172.4810696524-542.223334794925-294.839021760419639.80116106522887.185474099725
44172.4810696524-559.573775305361-306.183865020003651.146004324803904.53591461016
45172.4810696524-576.522405850789-317.265978865288662.228118170088921.484545155589
46172.4810696524-593.095913155718-328.10281280751673.06495211231938.058052460518
47172.4810696524-609.318154506403-338.709966287676683.672105592476954.280293811203
48172.4810696524-625.210560731818-349.101452171652694.063591476452970.172700036618
49172.4810696524-640.792468263815-359.28991387264704.25205317744985.754607568615







Actuals and Interpolation
TimeActualForecast
1724726.178301126702
2762.275724.988015993228
3721.125745.362675029711
4653.275732.118526227605
5663.7125689.036201204222
6735.5125675.198617089505
7628.1375708.15582272578
8792.55664.431555782846
9636.5734.439084864176
10800.825680.922408372177
11728.05746.440564025738
12618.2625736.39144148354
13450.625671.84245826112
14767.525550.963003806743
15675.65669.298582567855
16583.25672.769176074555
17690.7875623.853375069715
18208.0625660.4280675445
19142.5413.24277101072
20205.925265.301289743849
21462.5625232.856411440937
22251.4375358.374292751612
23195.725299.941015059498
24191.625242.994446986505
25137.25214.924733247989

\begin{tabular}{lllllllll}
\hline
Actuals and Interpolation \tabularnewline
Time & Actual & Forecast \tabularnewline
1 & 724 & 726.178301126702 \tabularnewline
2 & 762.275 & 724.988015993228 \tabularnewline
3 & 721.125 & 745.362675029711 \tabularnewline
4 & 653.275 & 732.118526227605 \tabularnewline
5 & 663.7125 & 689.036201204222 \tabularnewline
6 & 735.5125 & 675.198617089505 \tabularnewline
7 & 628.1375 & 708.15582272578 \tabularnewline
8 & 792.55 & 664.431555782846 \tabularnewline
9 & 636.5 & 734.439084864176 \tabularnewline
10 & 800.825 & 680.922408372177 \tabularnewline
11 & 728.05 & 746.440564025738 \tabularnewline
12 & 618.2625 & 736.39144148354 \tabularnewline
13 & 450.625 & 671.84245826112 \tabularnewline
14 & 767.525 & 550.963003806743 \tabularnewline
15 & 675.65 & 669.298582567855 \tabularnewline
16 & 583.25 & 672.769176074555 \tabularnewline
17 & 690.7875 & 623.853375069715 \tabularnewline
18 & 208.0625 & 660.4280675445 \tabularnewline
19 & 142.5 & 413.24277101072 \tabularnewline
20 & 205.925 & 265.301289743849 \tabularnewline
21 & 462.5625 & 232.856411440937 \tabularnewline
22 & 251.4375 & 358.374292751612 \tabularnewline
23 & 195.725 & 299.941015059498 \tabularnewline
24 & 191.625 & 242.994446986505 \tabularnewline
25 & 137.25 & 214.924733247989 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=75937&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]724[/C][C]726.178301126702[/C][/ROW]
[ROW][C]2[/C][C]762.275[/C][C]724.988015993228[/C][/ROW]
[ROW][C]3[/C][C]721.125[/C][C]745.362675029711[/C][/ROW]
[ROW][C]4[/C][C]653.275[/C][C]732.118526227605[/C][/ROW]
[ROW][C]5[/C][C]663.7125[/C][C]689.036201204222[/C][/ROW]
[ROW][C]6[/C][C]735.5125[/C][C]675.198617089505[/C][/ROW]
[ROW][C]7[/C][C]628.1375[/C][C]708.15582272578[/C][/ROW]
[ROW][C]8[/C][C]792.55[/C][C]664.431555782846[/C][/ROW]
[ROW][C]9[/C][C]636.5[/C][C]734.439084864176[/C][/ROW]
[ROW][C]10[/C][C]800.825[/C][C]680.922408372177[/C][/ROW]
[ROW][C]11[/C][C]728.05[/C][C]746.440564025738[/C][/ROW]
[ROW][C]12[/C][C]618.2625[/C][C]736.39144148354[/C][/ROW]
[ROW][C]13[/C][C]450.625[/C][C]671.84245826112[/C][/ROW]
[ROW][C]14[/C][C]767.525[/C][C]550.963003806743[/C][/ROW]
[ROW][C]15[/C][C]675.65[/C][C]669.298582567855[/C][/ROW]
[ROW][C]16[/C][C]583.25[/C][C]672.769176074555[/C][/ROW]
[ROW][C]17[/C][C]690.7875[/C][C]623.853375069715[/C][/ROW]
[ROW][C]18[/C][C]208.0625[/C][C]660.4280675445[/C][/ROW]
[ROW][C]19[/C][C]142.5[/C][C]413.24277101072[/C][/ROW]
[ROW][C]20[/C][C]205.925[/C][C]265.301289743849[/C][/ROW]
[ROW][C]21[/C][C]462.5625[/C][C]232.856411440937[/C][/ROW]
[ROW][C]22[/C][C]251.4375[/C][C]358.374292751612[/C][/ROW]
[ROW][C]23[/C][C]195.725[/C][C]299.941015059498[/C][/ROW]
[ROW][C]24[/C][C]191.625[/C][C]242.994446986505[/C][/ROW]
[ROW][C]25[/C][C]137.25[/C][C]214.924733247989[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=75937&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=75937&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
1724726.178301126702
2762.275724.988015993228
3721.125745.362675029711
4653.275732.118526227605
5663.7125689.036201204222
6735.5125675.198617089505
7628.1375708.15582272578
8792.55664.431555782846
9636.5734.439084864176
10800.825680.922408372177
11728.05746.440564025738
12618.2625736.39144148354
13450.625671.84245826112
14767.525550.963003806743
15675.65669.298582567855
16583.25672.769176074555
17690.7875623.853375069715
18208.0625660.4280675445
19142.5413.24277101072
20205.925265.301289743849
21462.5625232.856411440937
22251.4375358.374292751612
23195.725299.941015059498
24191.625242.994446986505
25137.25214.924733247989







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

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