Home » date » 2010 » Apr » 26 »

B58A,steven,coomans,thesis,forecasting,croston,permaand

*Unverified author*
R Software Module: Patrick.Wessa/rwasp_demand_forecasting_croston.wasp (opens new window with default values)
Title produced by software: Croston Forecasting
Date of computation: Mon, 26 Apr 2010 13:43:29 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Apr/26/t1272289835xuk25ug5rwm7lvk.htm/, Retrieved Mon, 26 Apr 2010 15:50:38 +0200
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2010/Apr/26/t1272289835xuk25ug5rwm7lvk.htm/},
    year = {2010},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2010},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
B58A,steven,coomans,thesis,forecasting,croston,permaand
 
Dataseries X:
» Textbox « » Textfile « » CSV «
567,5 531,25 781,25 572,5 591,5 548,75 744 634,25 634,25 313,25 674,25 769,55 758,25 488,775 690,45 559,5 687,1 796,5 756,65 794,5 0 387,5 683 762,25 742 731,5 643 573,44 574,751 440,025 350,75 562,75 642,251 411 646 558,525 647,15 591 797 642,25 726,275 652,75 678,75 602,25 689,775 393 580,525 462,25 725,65 501 675 691 769,025 688,25 518,8 386,275 491,35 269,5 379 375,25 337,5 296 375 399,525 336 483,5 370,25 625,5 736,75 496,05 740,5 690,525 568,75 341,1 519,75 408,75 278,35 217 266 319,025 454,75 378,3 509,575 453,75 252 187,525 401,5 403,75
 
Output produced by software:


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
89395.436387955306119.354510449894214.916151294640575.956624615972671.518265460718
90395.436387955306117.977534937814214.015795401806576.856980508806672.895240972798
91395.436387955306116.607359429488213.119885792437577.752890118175674.265416481124
92395.436387955306115.243884166356212.228357237917578.644418672695675.628891744256
93395.436387955306113.887011805421211.341146089081579.531629821531676.985764105191
94395.436387955306112.536647338142210.458190223184580.414585687428678.33612857247
95395.436387955306111.192698012806209.57942899314581.293346917472679.680077897806
96395.436387955306109.855073260179208.704803178909582.167972731703681.017702650433
97395.436387955306108.523684622278207.834254940927583.038520969685682.349091288334
98395.436387955306107.198445684107206.967727775463583.905048135149683.674330226506


Actuals and Interpolation
TimeActualForecast
1567.5NA
2531.25567.5
3781.25563.875
4572.5585.6125
5591.5584.30125
6548.75585.021125
7744581.3940125
8634.25597.65461125
9634.25601.314150125
10313.25604.6077351125
11674.25575.47196160125
12769.55585.349765441125
13758.25603.769788897013
14488.775619.217810007311
15690.45606.17352900658
16559.5614.601176105922
17687.1609.09105849533
18796.5616.891952645797
19756.65634.852757381217
20794.5647.032481643096
210661.779233478786
22387.5661.779233478786
23683576.683009209916
24762.25586.436861575979
25742602.700796675333
26731.5615.684225077297
27643626.552720579657
28573.44628.105744039416
29574.751622.915025690482
30440.025618.318474728991
31350.75601.224947551411
32562.75577.111651298828
33642.251575.723874938594
34411582.17417034024
35646565.526920803258
36558.525573.374747497914
37647.15571.922984430509
38591579.293924860485
39797580.443235417777
40642.25601.743680483357
41726.275605.734413670788
42652.75617.627810153039
43678.75621.097841655595
44602.25626.800657851697
45689.775624.369533075915
46393630.852620565083
47580.525607.255583678534
48462.25604.601578361445
49725.65590.457804605759
50501603.898864734033
51675593.662549772689
52691601.75816341329
53769.025610.644676115314
54688.25626.42251283416
55518.8632.584104592815
56386.275621.240748681428
57491.35597.809343203964
58269.5587.189990774062
59379555.4924012927
60375.25537.878873576511
61337.5521.645608686526
62296503.261240838885
63375482.565706581923
64399.525471.823426158782
65336464.602229132008
66483.5451.755848532616
67370.25454.927188197459
68625.5446.466853526991
69736.75464.356115859601
70496.05491.576260582693
71740.5492.023350055455
72690.525516.856794384388
73568.75534.21466908752
74341.1537.666601035452
75519.75518.01814329439
76408.75518.191263921763
77278.35507.250836916728
78217484.367717136711
79266457.638266425667
80319.025438.479162568693
81454.75426.536395851922
82378.3429.357193044329
83509.575424.252391078067
84453.75432.783272262939
85252434.879639893912
86187.525416.594071351501
87401.5393.689864664596
88403.75394.470795332286


What is next?
Simulate Time Series
Generate Forecasts
Forecast Analysis
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Apr/26/t1272289835xuk25ug5rwm7lvk/1h74d1272289404.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Apr/26/t1272289835xuk25ug5rwm7lvk/1h74d1272289404.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Apr/26/t1272289835xuk25ug5rwm7lvk/2ayly1272289404.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Apr/26/t1272289835xuk25ug5rwm7lvk/2ayly1272289404.ps (open in new window)


 
Parameters (Session):
par1 = Input box ; par2 = Croston ; par3 = NA ; par4 = NA ; par5 = ZZZ ; par6 = 12 ; par7 = dum ; par8 = B58Acrostonm ; par9 = 3 ; par10 = 0.1 ;
 
Parameters (R input):
par1 = Input box ; par2 = Croston ; par3 = NA ; par4 = NA ; par5 = ZZZ ; par6 = 12 ; par7 = dum ; par8 = B58Acrostonm ; par9 = 3 ; par10 = 0.1 ;
 
R code (references can be found in the software module):
par10 <- '0.1'
par9 <- '3'
par8 <- 'B521crostonm'
par7 <- 'dum'
par6 <- '12'
par5 <- 'ZZZ'
par4 <- 'NA'
par3 <- 'NA'
par2 <- 'Croston'
par1 <- 'Input box'
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('http://www.wessa.net/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('http://www.wessa.net/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('http://www.wessa.net/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
 





Copyright

Creative Commons License

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

Software written by Ed van Stee & Patrick Wessa


Disclaimer

Information provided on this web site is provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, warranties of merchantability, fitness for a particular purpose, and noninfringement. We use reasonable efforts to include accurate and timely information and periodically update the information, and software without notice. However, we make no warranties or representations as to the accuracy or completeness of such information (or software), and we assume no liability or responsibility for errors or omissions in the content of this web site, or any software bugs in online applications. Your use of this web site is AT YOUR OWN RISK. Under no circumstances and under no legal theory shall we be liable to you or any other person for any direct, indirect, special, incidental, exemplary, or consequential damages arising from your access to, or use of, this web site.


Privacy Policy

We may request personal information to be submitted to our servers in order to be able to:

  • personalize online software applications according to your needs
  • enforce strict security rules with respect to the data that you upload (e.g. statistical data)
  • manage user sessions of online applications
  • alert you about important changes or upgrades in resources or applications

We NEVER allow other companies to directly offer registered users information about their products and services. Banner references and hyperlinks of third parties NEVER contain any personal data of the visitor.

We do NOT sell, nor transmit by any means, personal information, nor statistical data series uploaded by you to third parties.

We carefully protect your data from loss, misuse, alteration, and destruction. However, at any time, and under any circumstance you are solely responsible for managing your passwords, and keeping them secret.

We store a unique ANONYMOUS USER ID in the form of a small 'Cookie' on your computer. This allows us to track your progress when using this website which is necessary to create state-dependent features. The cookie is used for NO OTHER PURPOSE. At any time you may opt to disallow cookies from this website - this will not affect other features of this website.

We examine cookies that are used by third-parties (banner and online ads) very closely: abuse from third-parties automatically results in termination of the advertising contract without refund. We have very good reason to believe that the cookies that are produced by third parties (banner ads) do NOT cause any privacy or security risk.

FreeStatistics.org is safe. There is no need to download any software to use the applications and services contained in this website. Hence, your system's security is not compromised by their use, and your personal data - other than data you submit in the account application form, and the user-agent information that is transmitted by your browser - is never transmitted to our servers.

As a general rule, we do not log on-line behavior of individuals (other than normal logging of webserver 'hits'). However, in cases of abuse, hacking, unauthorized access, Denial of Service attacks, illegal copying, hotlinking, non-compliance with international webstandards (such as robots.txt), or any other harmful behavior, our system engineers are empowered to log, track, identify, publish, and ban misbehaving individuals - even if this leads to ban entire blocks of IP addresses, or disclosing user's identity.


FreeStatistics.org is powered by