Home » date » 2010 » Apr » 26 »

B28A,steven, coomans, thesis, croston,forecast,per maand

*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 10:32:28 +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/t1272278403trvawrpx09un5jv.htm/, Retrieved Mon, 26 Apr 2010 12:40:06 +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/t1272278403trvawrpx09un5jv.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, croston,forecast,per maand
 
Dataseries X:
» Textbox « » Textfile « » CSV «
647,5 174 781 277,1 653 435,75 613,775 509,75 509,75 314,5 486 212 503,825 435 563 457,05 451,25 500,75 437,75 470,5 0 313,25 314 454 570,5 485 243 310 421,752 494,5 253,5 417,5 182,826 339,25 199 412,25 438,25 356 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 time6 seconds
R Serverwessa.org @ wessa.org


Demand Forecast
PointForecast95% LB80% LB80% UB95% UB
89233.208640990627-35.109488442298157.7648463336253408.652435647628501.526770423552
90233.208640990627-36.447741778644556.8898095105928409.527472470661502.865023759898
91233.208640990627-37.779386335363256.0190939362899410.398188044964504.196668316617
92233.208640990627-39.104519065686655.1526362164054411.264645764848505.52180104694
93233.208640990627-40.423234575212954.2903744916635412.12690748959506.840516556467
94233.208640990627-41.735625200728853.4322483862848412.985033594969508.152907181983
95233.208640990627-43.041781085660552.5781989586509413.839083022603509.459063066914
96233.208640990627-44.34179025232951.7281686540597414.689113327194510.759072233583
97233.208640990627-45.63573867117450.8821012594622415.535180721792512.053020652428
98233.208640990627-46.923710327100150.0399418600809416.377340121173513.340992308354


Actuals and Interpolation
TimeActualForecast
1647.5NA
2174647.5
3781600.15
4277.1618.235
5653584.1215
6435.75591.00935
7613.775575.483415
8509.75579.3125735
9509.75572.35631615
10314.5566.095684535
11486540.9361160815
12212535.44250447335
13503.825503.098254026015
14435503.170928623414
15563496.353835761072
16457.05503.018452184965
17451.25498.421606966469
18500.75493.704446269822
19437.75494.40900164284
20470.5488.743101478556
210486.9187913307
22313.25486.9187913307
23314426.865374725118
24454416.510753190704
25570.5419.978768621721
26485434.008149866784
27243438.793376181591
28310420.305716386663
29421.752409.831773040575
30494.5410.969384149822
31253.5418.977713419108
32417.5403.047125686153
33182.826404.443716989816
34339.25382.956244932318
35199378.705669251030
36412.25361.180566913621
37438.25366.173292671316
38356373.235557631406
39266.25371.543358656898
40235.25361.186741969498
41323.775348.779296867306
42305.25346.312194080942
43383.527342.255297069515
44515.25346.337797060351
45496.15363.064299624115
46115.25376.255952855418
47170.5350.361905177886
48154.25332.50391679931
49170314.792957080459
50534.05300.397371324982
51193.75323.640989268148
52564.5310.712783852665
53346335.984376260037
54308.25336.982131992129
55437.05334.118750738797
56410.275344.380164659061
57149.75350.951371800566
58154.75330.88147269893
59240.1313.307915840071
60127.525306.001937535911
61222.25288.186752937644
6285.525281.603888815437
63427.75262.024939349910
6463.5278.575428638886
65118.3257.093604921059
6699.5243.229183708365
67182.25228.870190312110
68401224.212236725820
69119.5241.877136978712
70450.25229.648068804622
71147.5251.694234642319
72237241.280774359579
7380.025240.852917431464
7410.5224.777582068153
75176.75203.358765270464
76234200.698888086440
77282.5204.027873617320
78320211.872698877006
79167.5222.682468271893
80163.25217.165581376469
81238.15211.775219107528
82325.125214.412170682427
83126.3225.481464450692
84154.875215.564921817256
85327.25209.496812896323
86336.25221.270589217846
87188232.767174827398
88277.25228.290932326186


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


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


 
Parameters (Session):
par1 = Input box ; par2 = Croston ; par3 = NA ; par4 = NA ; par5 = ZZZ ; par6 = 12 ; par7 = dum ; par8 = B28Acrostonm ; par9 = 3 ; par10 = 0.1 ;
 
Parameters (R input):
par1 = Input box ; par2 = Croston ; par3 = NA ; par4 = NA ; par5 = ZZZ ; par6 = 12 ; par7 = dum ; par8 = B28Acrostonm ; 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#output',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