Home » date » 2010 » May » 13 »

B11A,steven,coomans,Arima,thesis,per3maand

*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: Thu, 13 May 2010 13:52: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/May/13/t12737588040nds1cuw2841ziq.htm/, Retrieved Thu, 13 May 2010 15:53:27 +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/May/13/t12737588040nds1cuw2841ziq.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:
B11A,steven,coomans,Arima,thesis,per3maand
 
Dataseries X:
» Textbox « » Textfile « » CSV «
41 31.66666667 23.83333333 12.33333333 30.83333333 20.83333333 25.50166667 5.166666667 11.66666667 0.833333333 2.341666667 0 0.666666667 8.666666667 2.333333333 11.66666667 0.275
 
Output produced by software:


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


Demand Forecast
PointForecast95% LB80% LB80% UB95% UB
181.42452929851498-11.1450066566587-6.794248499742439.643307096772413.9940652536886
19-3.81956978616952-17.6979005497924-12.89412251140275.2549829390636110.0587609774534
204.04244107448406-12.7421060758005-6.932384405511815.017266554479920.8269882247687
21-2.70387022706694-21.1075525885833-14.73739131634439.3296508622104615.6998121344495
220.046387055341242-20.2482994701005-13.223595196409313.316369307091820.341073580783
23-4.01612398175038-25.8377055371885-18.284489230101410.252241266600617.8054575736877
24-5.98653813322253-29.3346920430646-21.25307539194489.279999125499717.3616157766196
25-9.6116858691682-34.3422075527044-25.78210483107996.558733092743515.118835814368
26-17.3971771114423-43.462119334948-34.4401267655412-0.3542274573433178.66776511206344
27-17.0833599831679-44.404778483154-34.94787531495000.78115534861419510.2380585168183
28-25.6155046315076-54.1446568559233-44.2697145992689-6.961294663746372.91364759290805
29-22.4506479453084-52.1350902530181-41.8602614952692-3.041034395347637.23379436240128
30-26.3636781858072-56.0690619651101-45.7869846280439-6.940371743570423.34170559349574
31-26.6682900062467-56.7725389979845-46.3524003925708-6.984179619922593.43595898549111
32-34.3682257140401-64.6098647885727-54.1421706468583-14.5942807812218-4.12658663950739
33-33.8254906448588-64.3234642290533-53.7670437045363-13.8839375851813-3.3275170606643
34-38.6411133451462-69.3256553430267-58.7046569334897-18.5775697568026-7.95657134726566
35-39.6127166353796-70.5171799117912-59.8200590185077-19.4053742522514-8.70825335896797
36-41.7647768461957-72.8690354017221-62.1027583404288-21.4267953519626-10.6605182906692
37-42.9831712066616-74.2956651470544-63.4573105005186-22.5090319128045-11.6706772662688
38-41.8542025920564-73.3683938683809-62.4602246851222-21.2481804989906-10.3400113157319
39-45.2950693972828-77.0123959509488-66.033914508908-24.5562242856576-13.5777428436169
40-43.7448165046797-75.6625453038045-64.61469760137-22.8749354079893-11.8270877055548
41-48.7943159362552-80.9119572910056-69.7949128270392-27.7937190454712-16.6766745815047


Actuals and Interpolation
TimeActualForecast
14140.9569135138413
231.6666666736.7345324696379
323.8333333331.758263136203
412.3333333322.6335077092444
530.8333333317.9625206650331
620.8333333318.3414307638322
725.5016666723.370763577192
85.16666666717.3223286042793
911.6666666712.4854037188620
100.8333333334.48602028418904
112.3416666672.83130750565654
120-0.655209184125606
130.666666667-2.94484720752371
148.6666666671.07220255011467
152.3333333336.63228634277377
1611.666666679.5419036881876
170.275-5.28462981551762


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


http://www.freestatistics.org/blog/date/2010/May/13/t12737588040nds1cuw2841ziq/2m9ji1273758767.png (open in new window)
http://www.freestatistics.org/blog/date/2010/May/13/t12737588040nds1cuw2841ziq/2m9ji1273758767.ps (open in new window)


 
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('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