Home » date » 2010 » May » 13 »

B580,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 12:09:33 +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/t1273752610keg0cdfdtwij4k0.htm/, Retrieved Thu, 13 May 2010 14:10:13 +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/t1273752610keg0cdfdtwij4k0.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:
B580,steven,coomans,thesis,ETS
 
Dataseries X:
» Textbox « » Textfile « » CSV «
209 175 247,5 177 188,775 194,825 182,275 145,25 286,3 257,75 335 234,15 276,275 327,052 375,325 199,75 215,875 225 228,1 128,5 242,5 327,275 346,8 221,175 245,275 230,725 335,3 97,25 254,5 71,25 273,575 98,325 184,55 203,025 121,655 135 98,75 69,1 256,525 97,775 202,7 81,9 165,25 75,825 300 238,5 194,5 140,75 211,75 274,8
 
Output produced by software:


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


Demand Forecast
PointForecast95% LB80% LB80% UB95% UB
51308.895645629986213.713534478742246.659408372625371.131882887346404.077756781229
52155.28524821291653.964047031853489.0348757465456221.535620679287256.606449393979
53230.489560744847123.380563296737160.454751714542300.524369775151337.598558192956
54163.55251289402850.95282879187489.9275368336609237.177488954394276.152196996181
55221.055110594817103.220309345482144.007075422803298.103145766831338.889911844153
56114.679998919142-8.1670275448151734.3546458365297195.005352001754237.527025383099
57245.138712841876117.476097184034161.664615231751328.612810452001372.801328499717
58265.437541147905133.134498997819178.929231744686351.945850551124397.740583297991
59255.408202255407118.622068134535165.968556573073344.847847937740392.194336376279
60199.83316587908158.706279662107107.55525495908292.111076799083340.960052096056
61216.44943057096971.1086939351686121.416230960046311.482630181893361.79016720677
62223.88353427624674.4503343125067126.17441672692321.592651825572373.316734239985
63308.895645629986155.479112045862208.581966222607409.209325037364462.312179214109
64155.285248212916-2.0137800820296852.432941966412258.137554459420312.584276507862
65230.48956074484769.4015853149597125.159795131308335.819326358386391.577536174734
66163.552512894028-1.2373149281579955.8022361046781271.302789683377328.342340716213
67221.05511059481752.6447816977118110.937515396957331.172705792677389.465439491923
68114.679998919142-57.27461836343352.24491811186807227.115079726415286.634616201717
69245.13871284187669.711400457622130.432958757277359.844466926475420.56602522613
70265.43754114790586.6049561530887148.505198983323382.369883312487444.270126142722
71255.40820225540773.2339862381726136.290885008613374.5255195022437.582418272641
72199.83316587908114.377520219372178.5702371166125321.09609464155385.288811538791
73216.44943057096927.767348168855793.0768482174273339.822012924511405.131512973083
74223.88353427624632.031300134540898.4381011168046349.328967435687415.735768417951


Actuals and Interpolation
TimeActualForecast
1209207.578503057629
2175215.531763346576
3247.5285.751097248607
4177118.186987745813
5188.775214.853226812988
6194.825138.401727102421
7182.275216.486643563448
8145.2597.6257034058337
9286.3245.459409265308
10257.75280.672235749570
11335262.276026647169
12234.15233.243533537997
13276.275250.184476503336
14327.052267.134675437714
15375.325374.008804029831
16199.75220.89450878188
17215.875288.373712865628
18225194.992809298708
19228.1263.427632470548
20128.5144.169115657069
21242.5268.90584331271
22327.275279.572485861439
23346.8286.95899170416
24221.175253.216947852348
25245.275258.137771298881
26230.725260.877650429826
27335.3334.877745498272
2897.25181.434595292499
29254.5225.904002981947
3071.25169.425310278149
31273.575191.077796826959
3298.325114.816648313125
33184.55239.251961739029
34203.025239.601909862737
35121.655216.235737726035
36135126.133353910805
3798.75145.984252152785
3869.1136.179714477329
39256.525196.708490866528
4097.77564.9287086805014
41202.7152.116753990838
4281.9103.646395070923
43165.25153.209605600343
4475.82551.2266305836655
45300190.651450747171
46238.5250.866635894662
47194.5236.328106963891
48140.75165.487705941164
49211.75173.069538773582
50274.8194.613497545848


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


http://www.freestatistics.org/blog/date/2010/May/13/t1273752610keg0cdfdtwij4k0/2u8la1273752561.png (open in new window)
http://www.freestatistics.org/blog/date/2010/May/13/t1273752610keg0cdfdtwij4k0/2u8la1273752561.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 = 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 <- 'ARIMA'
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