Home » date » 2010 » Apr » 26 »

b521,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:34:45 +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/t1272289155j2refhgteje134u.htm/, Retrieved Mon, 26 Apr 2010 15:39:18 +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/t1272289155j2refhgteje134u.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:
b521,steven,coomans,thesis,forecast,croston,permaand
 
Dataseries X:
» Textbox « » Textfile « » CSV «
268,5 247 250,25 196,5 200,85 192,75 161 270,55 270,55 308 286,2 301,95 364,825 279 261,246 306 268,075 402,05 225,525 359,25 0 250 400,3 432,5 347,2 422,5 330,5 339,175 205,8 377,535 320 356,55 314,9 282,125 440,5 378,1 391,85 292,775 387 295,5 343,35 264,025 322,5 392,5 315,75 274,4 361,875 411,276 518,775 392,55 467 382,852 449,25 564,252 417 450,8 538,675 394 532 461,4 523 405,9 386,25 384,5 382 381,75 151,5 287,775 247,6 290,35 266,55 318,025 213,3 148,75 273 282,25 191,25 142,25 259,25 272,75 173,75 204,75 185,525 267,175 190,25 127,25 183,5 254,125
 
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
89233.64647856527672.38478195186128.203122775348339.089834355203394.908175178691
90233.64647856527671.5804792236997127.677217489039339.615739641513395.712477906851
91233.64647856527670.7801484336917127.153909313491340.13904781706396.512808696859
92233.64647856527669.9837313120402126.633160148134340.659796982417397.309225818511
93233.64647856527669.1911709998984126.114932814966341.178024315585398.101786130653
94233.64647856527668.4024120019972125.599191027581341.693766102970398.890545128554
95233.64647856527667.6174001412973125.085899361516342.207057769035399.675556989254
96233.64647856527666.8360825155632124.575023225860342.717933904691400.456874614988
97233.64647856527666.0584074557594124.066528836046343.226428294505401.234549674792
98233.64647856527665.2843244861754123.560383187780343.732573942771402.008632644376


Actuals and Interpolation
TimeActualForecast
1268.5NA
2247268.5
3250.25266.35
4196.5264.74
5200.85257.916
6192.75252.2094
7161246.26346
8270.55237.737114
9270.55241.0184026
10308243.97156234
11286.2250.374406106
12301.95253.9569654954
13364.825258.75626894586
14279269.363142051274
15261.246270.326827846147
16306269.418745061532
17268.075273.076870555379
18402.05272.576683499841
19225.525285.524015149857
20359.25279.524113634871
210287.496702271384
22250287.496702271384
23400.3257.951847312951
24432.5271.011310862221
25347.2285.950135019278
26422.5291.658948979639
27330.5303.937460913683
28339.175306.445611064084
29205.8309.553389851043
30377.535299.651648104153
31320307.118557335331
32356.55308.358657577572
33314.9313.015420535409
34282.125313.198144412974
35440.5310.176179195247
36378.1322.885507209908
37391.85328.283468449948
38292.775334.511884051027
39387330.414127894790
40295.5335.979893815749
41343.35331.991764121373
42264.025333.112448919392
43322.5326.286689329056
44392.5325.912118907836
45315.75332.505972663929
46274.4330.845095647755
47361.875325.245254027762
48411.276328.882119639941
49518.775337.06861406508
50392.55355.134201741354
51467358.856302043389
52382.852369.619973560947
53449.25370.937590673297
54564.252378.739067378925
55417397.226879340228
56450.8399.198099713454
57538.675404.343977594834
58394417.74353865033
59532415.374521801108
60461.4427.013471000191
61523430.445860474613
62405.9439.686098995604
63386.25436.31247560928
64384.5431.312878909174
65382426.637188995105
66381.75422.17827469332
67151.5418.139364053424
68287.775391.498679540467
69247.6381.134452859780
70290.35367.790441323571
71266.55360.051321349813
72318.025350.706540425969
73213.3347.44006984888
74148.75334.032281929239
75273315.511785224931
76282.25311.262203313761
77191.25308.361963667074
78142.25296.6543302291
79259.25281.218125070793
80272.75279.021853952167
81173.75278.394807669126
82204.75267.932415905076
83185.525261.615309505095
84267.175254.007508971218
85190.25255.324066438843
86127.25248.817512166912
87183.5236.662194084659
88254.125231.346538729213


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


http://www.freestatistics.org/blog/date/2010/Apr/26/t1272289155j2refhgteje134u/2njw51272288879.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Apr/26/t1272289155j2refhgteje134u/2njw51272288879.ps (open in new window)


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