Home » date » 2010 » May » 13 »

B58A,steven,coomans,thesis,Arima

*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 12:13:51 +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/t12737528707gigi53l7kssute.htm/, Retrieved Thu, 13 May 2010 14:14:32 +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/t12737528707gigi53l7kssute.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,Arima
 
Dataseries X:
» Textbox « » Textfile « » CSV «
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
51338.070445003524118.734910570406194.654647698306481.486242308743557.405979436643
52311.88827596509135.6817126687886131.286511647908492.490040282275588.094839261394
53332.639555111514-15.3591285773044105.095446440801560.183663782226680.638238800331
54360.098882353676-29.1476289950759105.584268852331614.61349585502749.345393702428
55422.869420052317-17.5964247786097134.864284516897710.874555587737863.335264883244
56388.053178826374-87.433889928830277.1488958058652698.957461846883863.540247581579
57449.220121174636-67.4469692004157111.389669310029787.050573039243965.887211549688
58423.788356304916-124.17129086788065.4968013433286782.079911266503971.748003477712
59326.707888973003-256.342433124503-54.5282250419647707.94400298797909.758211070508
60296.837601229282-314.860080839313-103.130014644524696.805217103088908.535283297877
61398.040188818173-244.630075863431-22.1793102788732818.259687915221040.71045349978
62399.720461040223-269.547740904814-37.890494435145837.3314165155911068.98866298526
63367.91878462912-365.530429874777-111.657879283664847.4954485419041101.36799913302
64355.889288218968-425.011764950192-154.714465277663866.4930417155981136.79034138813
65365.397566926991-469.471171992877-180.49375955985911.2888934138321200.26630584686
66378.79643389878-499.297889418914-195.358583040319952.9514508378781256.89075721647
67408.422015168179-516.903169316534-196.6156019350331013.459632271391333.74719965289
68392.070747311511-573.26604295554-239.1290525842291023.270547207251357.40753757856
69421.007431793546-586.76284110123-237.9381310458091079.95299463291428.77770468832
70409.062260225559-636.128327699261-274.351131455651092.475651906771454.25284815038
71362.679219705706-721.343319746871-346.1250203105191071.483459721931446.70175915828
72348.573722283442-770.704651909711-383.2830689851311080.430513552021467.85209647659
73396.673252518131-758.624371122333-358.7352600489211152.081765085181551.97087615860
74397.561924698866-791.141531846723-379.6894879396021174.813337337331586.26538124446


Actuals and Interpolation
TimeActualForecast
1797796.20300065502
2642.25762.952337247724
3726.275704.410416896747
4652.75665.581080920744
5678.75704.818827828887
6602.25631.816961296255
7689.775654.598278915382
8393606.863336282914
9580.525509.418190174305
10462.25465.80488389292
11725.65584.551182892532
12501584.24363832272
13675643.519082911609
14691520.449547068052
15769.025758.07019155421
16688.25708.310127515555
17518.8727.053151603044
18386.275508.80532190237
19491.35434.2318942773
20269.5331.248437042921
21379389.269640545343
22375.25299.1481893675
23337.5502.876183618978
24296267.453582131041
25375340.713876999818
26399.525407.070535873498
27336417.641465716004
28483.5332.898922218684
29370.25337.338283908306
30625.5355.134629732789
31736.75571.23916170188
32496.05681.062633873284
33740.5549.057121163136
34690.525693.072231556067
35568.75712.003500002354
36341.1548.996333351918
37519.75427.493775297068
38408.75468.264830665661
39278.35446.239032991459
40217330.312869791279
41266205.218731892318
42319.025337.419117389042
43454.75419.036160167183
44378.3291.687302641049
45509.575515.635322954833
46453.75469.396122015109
47252413.361749776128
48187.525166.430760748899
49401.5248.202334497077
50403.75333.451042483504


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


http://www.freestatistics.org/blog/date/2010/May/13/t12737528707gigi53l7kssute/2crts1273752825.png (open in new window)
http://www.freestatistics.org/blog/date/2010/May/13/t12737528707gigi53l7kssute/2crts1273752825.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):
par10 <- '0.1'
par9 <- '3'
par8 <- 'dumresult'
par7 <- 'dum'
par6 <- '12'
par5 <- 'ZZZ'
par4 <- 'NA'
par3 <- 'NA'
par2 <- 'ETS'
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