Home » date » 2010 » May » 13 »

B28A,steven,coomans,thesis,ETS

*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 11:56:00 +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/t1273751815rgmq4io3cp8hw5p.htm/, Retrieved Thu, 13 May 2010 13:56:58 +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/t1273751815rgmq4io3cp8hw5p.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:
B28A,steven,coomans,thesis,ETS
 
Dataseries X:
» Textbox « » Textfile « » CSV «
266,25 235,25 323,775 305,25 383,527 515,25 496,15 115,25 170,5 154,25 170 534,05 193,75 564,5 346 308,25 437,05 410,275 149,75 154,75 240,1 127,525 222,25 85,525 427,75 63,5 118,3 99,5 182,25 401 119,5 450,25 147,5 237 80,025 10,5 176,75 234 282,5 320 167,5 163,25 238,15 325,125 126,3 154,875 327,25 336,25 188 277,25
 
Output produced by software:


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


Demand Forecast
PointForecast95% LB80% LB80% UB95% UB
51232.9962050832288.8548547035637786.4380536334458379.554356533010457.137555462892
52232.9962050832288.1855951626107286.0004483410887379.991961825367457.806815003845
53232.9962050832287.5175484894610385.5636361003614380.428774066094458.474861676994
54232.9962050832286.8507030399043785.1276092975238380.864800868932459.141707126551
55232.9962050832286.1850473248430584.692360420259381.300049746196459.807362841612
56232.9962050832285.5205700074142284.2578820557907381.734528110665460.471840159041
57232.9962050832284.8572599001780683.8241668890451382.16824327741461.135150266277
58232.9962050832284.1951059623743383.3912077008573382.601202465598461.797304204081
59232.9962050832283.5340972972415782.9589973662178383.033412800238462.458312869214
60232.9962050832282.8742231494000882.5275288525618383.464881313893463.118187017055
61232.9962050832282.2154729022935682.0967952180964383.895614948359463.776937264162
62232.9962050832281.5578360756917181.6667896101673384.325620556288464.434574090764
63232.9962050832280.90130232324892781.2375052636626384.754904902793465.091107843206
64232.9962050832280.24586143011882280.8089354994534385.183474667002465.746548736337
65232.996205083228-0.40849668937650680.3810737228694385.611336443586466.400906855832
66232.996205083228-1.0617819940252479.9539134222089386.038496744246467.054192160481
67232.996205083228-1.7140043179534579.5274481672826386.464961999173467.706414484409
68232.996205083228-2.3651733728022579.1016716079895386.890738558466468.357583539258
69232.996205083228-3.0152987498568478.6765774729256387.31583269353469.007708916312
70232.996205083228-3.6643899221285578.2521595680215387.740250598434469.656800088584
71232.996205083228-4.3124562463908977.8284117752119388.163998391243470.304866412846
72232.996205083228-4.9595069651706577.4053280511334388.587082115322470.951917131626
73232.996205083228-5.605551208696476.9829024258504389.009507740605471.597961375152
74232.996205083228-6.2505979968032976.5611290016097389.431281164846472.243008163259


Actuals and Interpolation
TimeActualForecast
1266.25266.311321524294
2235.25235.417067752269
3323.775323.615181804147
4305.25305.168540483468
5383.527383.175856621936
6515.25514.478001121786
7496.15495.530485498141
8115.25115.889317709444
9170.5170.941626674590
10154.25154.728866537332
11170170.405904769100
12534.05533.12955044254
13193.75194.095120183447
14564.5563.545138664681
15346345.876293463356
16308.25308.257418801685
17437.05436.641950834438
18410.275409.989624466476
19149.75150.289953421438
20154.75155.256078086846
21240.1240.305758401530
22127.525128.097039005303
23222.25222.473306779830
2485.52586.2214108124829
25427.75427.154471037843
2663.564.2725456009076
27118.3118.852239647829
2899.5100.108382885394
29182.25182.501059010644
30401400.322893463908
31119.5120.022652560074
32450.25449.383742888922
33147.5147.923303679596
34237237.045320771771
3580.02580.7016272696347
3610.511.4554792842250
37176.75176.947324415927
38234233.922575170563
39282.5282.206216960764
40320319.563768371117
41167.5167.770320599499
42163.25163.525233477721
43238.15238.072110692052
44325.125324.661368009176
45126.3126.749158639776
46154.875155.17779201064
47327.25326.745170688580
48336.25335.756140224028
49188188.192458229121
50277.25277.042963328486


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


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


 
Parameters (Session):
par1 = Input box ; par2 = ETS ; 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):
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