Home » date » 2010 » Apr » 26 »

B611,steven,coomans,thesis,forecast,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:56:50 +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/t12722904886xrg6j7d4xpzmnr.htm/, Retrieved Mon, 26 Apr 2010 16:01:30 +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/t12722904886xrg6j7d4xpzmnr.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:
B611,steven,coomans,thesis,forecast,croston,permaand
 
Dataseries X:
» Textbox « » Textfile « » CSV «
0 0.5 0 0.5 0 0 0 4.5 4.5 10 3.75 58.45 7.45 22.275 22.21 5.8 36.43 31.65 50 43 0 68.5 33.5 23 0.5 69.25 32 39,213 46.426 46.855 153.135 64 31 2.25 2.25 2.3 22.6 1.5 10.65 34 81.75 106.5 0.525 24.025 5.25 9 12.8 25.05 0.3 75.75 54.75 1.526 102 3.752 17.25 9.2 50.25 2.25 3.95 60 55.8 6.75 61.95 7.025 85.75 18.525 6 25.35 46.775 51.025 30 3 30 44 80.75 27.5 39.725 29.25 32.725 56.25 28.65 51.75 32.26 72 65.4 33.75 77.85 10.875
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time5 seconds
R Serverwessa.org @ wessa.org


Demand Forecast
PointForecast95% LB80% LB80% UB95% UB
8942.4449816896765-17.4861832208233.2580992664333281.6318641129196102.376146600176
9042.4449816896765-17.78509362826403.0626522563682781.8273111229847102.675057007617
9142.4449816896765-18.08252790786172.8681704344206382.0217929449323102.972491287215
9242.4449816896765-18.37850771495542.6746396409251682.2153237384278103.268471094308
9342.4449816896765-18.67305418052032.4820460590798882.4079173202731103.563017559873
9442.4449816896765-18.96618792877292.2903762034344582.5995871759185103.856151308126
9542.4449816896765-19.25792909402362.0996169088708782.790346470482104.147892473377
9642.4449816896765-19.5482973368161.9097553200507682.9802080593022104.438260716169
9742.4449816896765-19.83731185938801.7207788813055183.1691844980475104.727275238741
9842.4449816896765-20.12499142049151.5326753269466783.3572880524063105.014954799844


Actuals and Interpolation
TimeActualForecast
10NA
20.5NA
300.25
40.50.25
500.25
600.25
700.25
84.50.25
94.50.409090909090909
10100.60576923076923
113.751.08215010141988
1258.451.22445060806486
137.454.42620235883893
1422.2754.60317876515579
1522.215.68222292183592
165.86.73230145884357
1736.436.67082673591613
1831.658.70230192769576
195010.3201438271359
204313.2026545533481
21015.4281382898409
2268.515.4281382898409
2333.518.1073612864325
242319.2354225596963
250.519.5188849719695
2669.2518.0505427550403
273222.0955766284452
2839.21322.8948602472724
2946.42624.2376448062988
3046.85526.0963992922845
31153.13527.8640673133504
326438.6920867129805
333140.9096998383156
342.2540.0304794602628
352.2536.6402430694141
362.333.5222239475904
3722.630.6647637477155
381.529.9203635247716
3910.6527.2767360320706
403425.7192643044733
4181.7526.4998825937528
42106.531.7382869668445
430.52538.8635976359932
4424.02535.1924339553087
455.2534.118524073019
46931.3317099801819
4712.829.16842879075
4825.0527.5778349475401
490.327.3314978305258
5075.7524.6905477905730
5154.7529.6905096700156
521.52632.1495472812321
5310229.1388839334106
543.75236.3141202793457
5517.2533.102572024096
569.231.5369114376114
5750.2529.3281022302393
582.2531.3992934872701
593.9528.510721034102
606026.0746541221805
6155.829.4422988599490
626.7532.0606522375897
6361.9529.5446493440406
647.02532.767818138103
6585.7530.2059591749421
6618.52535.7362278415582
67634.021838860801
6825.3531.2295258955398
6946.77530.6434379625934
7051.02532.251988279695
713034.1244640074976
72333.7129719948635
733030.6480724731703
744430.5833867484609
7580.7531.9227834274344
7627.536.7980862576207
7739.72535.8695493045712
7829.2536.2546197401134
7932.72535.5549339492932
8056.2535.2722228125884
8128.6537.3681172482578
8251.7536.4970099899227
8332.2638.0211996367501
847237.4454568127827
8565.440.8988751893646
8633.7543.3476883555938
8777.8542.3883776203165
8810.87545.9330164519578


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


http://www.freestatistics.org/blog/date/2010/Apr/26/t12722904886xrg6j7d4xpzmnr/24bkj1272290205.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Apr/26/t12722904886xrg6j7d4xpzmnr/24bkj1272290205.ps (open in new window)


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