Home » date » 2009 » Dec » 10 »

ws10

*The author of this computation has been verified*
R Software Module: /rwasp_arimaforecasting.wasp (opens new window with default values)
Title produced by software: ARIMA Forecasting
Date of computation: Thu, 10 Dec 2009 11:16:04 -0700
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2009/Dec/10/t1260469005miaq9yyl61benyz.htm/, Retrieved Thu, 10 Dec 2009 19:16:48 +0100
 
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/2009/Dec/10/t1260469005miaq9yyl61benyz.htm/},
    year = {2009},
}
@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 = {2009},
    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:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
325412 326011 328282 317480 317539 313737 312276 309391 302950 300316 304035 333476 337698 335932 323931 313927 314485 313218 309664 302963 298989 298423 310631 329765 335083 327616 309119 295916 291413 291542 284678 276475 272566 264981 263290 296806 303598 286994 276427 266424 267153 268381 262522 255542 253158 243803 250741 280445 285257 270976 261076 255603 260376 263903 264291 263276 262572 256167 264221 293860 300713 287224
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Univariate ARIMA Extrapolation Forecast
timeY[t]F[t]95% LB95% UBp-value
(H0: Y[t] = F[t])
P(F[t]>Y[t-1])P(F[t]>Y[t-s])P(F[t]>Y[34])
22298423-------
23310631-------
24329765-------
25335083-------
26327616-------
27309119-------
28295916-------
29291413-------
30291542-------
31284678-------
32276475-------
33272566-------
34264981-------
35263290275098.5995265768.4789284428.72010.00660.983200.9832
36296806288258.7659273313.6256303203.90620.13120.999500.9989
37303598292535.448271822.9165313247.97950.14760.343100.9954
38286994288108.9499264016.7366312201.16320.46390.10387e-040.9701
39276427273788.8638247730.1655299847.56210.42140.16030.00390.7462
40266424262476.2446234278.6433290673.84580.39190.16610.01010.4309
41267153258583.4031227745.1668289421.63940.2930.30910.01850.3421
42268381259216.4237226032.1625292400.68490.29420.31960.02810.3667
43262522254132.5784219147.1114289118.04540.31920.21240.04350.2717
44255542247377.7243210700.9029284054.54570.33130.20920.060.1734
45253158244025.3359205506.1715282544.50040.32110.27890.07320.1431
46243803238184.0859197850.1887278517.9830.39240.23340.09640.0964
47250741246365.1744201841.482290888.86680.42360.54490.22810.2063
48280445256687.7449207677.0833305698.40650.1710.5940.05430.3701
49285257259914.2148205836.9979313991.43170.17920.22840.05670.4271
50270976256431.421198258.6102314604.23190.31210.16570.15160.3867
51261076245239.135183906.8318306571.43830.30640.20540.15950.2641
52255603236334.7824171842.2146300827.35020.27910.22610.18020.192
53260376233204.5805165268.7594301140.40150.21650.25910.16370.1796
54263903233682.7541162490.5254304874.98270.20270.23120.16970.1944
55264291229711.3412155670.5489303752.13350.180.18270.19250.1752
56263276224406.8503147658.6747301155.02580.16040.15420.21330.1501
57262572221743.9074142226.3741301261.44080.15710.1530.21940.1433
58256167217121.4829134876.3206299366.64520.17610.13940.26240.127
59264221223580.9641137186.7509309975.17730.17830.22990.26890.1738
60293860231732.1756141004.4965322459.85480.08980.24140.14630.2363
61300713234271.7761138850.6118329692.94040.08620.11050.14750.2641
62287224231516.5117131940.8102331092.21310.13640.08660.21870.255


Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
350.0173-0.04290139443022.363600
360.02650.02970.036373055210.5206106249116.442110307.7212
370.03610.03780.0368122380057.0904111626096.658210565.3252
380.0427-0.00390.02861243113.316584030350.82289166.807
390.04860.00960.02486959762.590268616233.17638283.4916
400.05480.0150.023215584773.063559777656.49087731.6012
410.06080.03310.024673437990.970761729132.84517856.789
420.06530.03540.025983989458.550964511673.55838031.9159
430.07020.0330.026770382394.892265163975.92878072.4207
440.07560.0330.027366655397.898465313118.12578081.6532
450.08050.03740.028383405552.670866957884.90258182.7798
460.08640.02360.027931572196.150664009077.50658000.5673
470.09220.01780.027119147849.305560558213.79887781.9158
480.09740.09260.0318564407170.490796547424.9919825.8549
490.10620.09750.0362642256763.2638132928047.542611529.4426
500.11570.05670.0374211544777.0027137841593.133811740.5959
510.12760.06460.039250806291.7939144486575.407912020.2569
520.13920.08150.0414371264208.5661157085332.805612533.3688
530.14860.11650.0453738286039.7788187674843.698913699.4468
540.15540.12930.0495913263265.0296223954264.765514965.1016
550.16440.15050.05441195752801.8127270230385.577216438.6856
560.17450.17320.05981510810801.9781326620404.504618072.6424
570.1830.18410.06521666933141.4308384894871.327419618.7378
580.19330.17980.06991524552406.2208432380601.94820793.7635
590.19710.18180.07441651612515.7663481149878.500721935.1289
600.19980.26810.08193859866560.2027611100520.104624720.4474
610.20780.28360.08934414436233.8814751964805.800127421.9767
620.21940.24060.09473103324254.3528835941928.962728912.6604
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/10/t1260469005miaq9yyl61benyz/104a51260468962.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/10/t1260469005miaq9yyl61benyz/104a51260468962.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/10/t1260469005miaq9yyl61benyz/21f4x1260468962.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/10/t1260469005miaq9yyl61benyz/21f4x1260468962.ps (open in new window)


 
Parameters (Session):
par1 = 1 ; par2 = 1 ; par3 = 1 ; par4 = 12 ; par5 = 1 ; par6 = 1 ; par7 = 1 ; par8 = 3 ;
 
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 1 ; par9 = 0 ; par10 = FALSE ;
 
R code (references can be found in the software module):
par1 <- as.numeric(par1) #cut off periods
par1 <- 28
par2 <- as.numeric(par2) #lambda
par3 <- as.numeric(par3) #degree of non-seasonal differencing
par4 <- as.numeric(par4) #degree of seasonal differencing
par5 <- as.numeric(par5) #seasonal period
par6 <- as.numeric(par6) #p
par6 <- 3
par7 <- as.numeric(par7) #q
par7 <- 3
par8 <- as.numeric(par8) #P
par9 <- as.numeric(par9) #Q
if (par10 == 'TRUE') par10 <- TRUE
if (par10 == 'FALSE') par10 <- FALSE
if (par2 == 0) x <- log(x)
if (par2 != 0) x <- x^par2
lx <- length(x)
first <- lx - 2*par1
nx <- lx - par1
nx1 <- nx + 1
fx <- lx - nx
if (fx < 1) {
fx <- par5
nx1 <- lx + fx - 1
first <- lx - 2*fx
}
first <- 1
if (fx < 3) fx <- round(lx/10,0)
(arima.out <- arima(x[1:nx], order=c(par6,par3,par7), seasonal=list(order=c(par8,par4,par9), period=par5), include.mean=par10, method='ML'))
(forecast <- predict(arima.out,par1))
(lb <- forecast$pred - 1.96 * forecast$se)
(ub <- forecast$pred + 1.96 * forecast$se)
if (par2 == 0) {
x <- exp(x)
forecast$pred <- exp(forecast$pred)
lb <- exp(lb)
ub <- exp(ub)
}
if (par2 != 0) {
x <- x^(1/par2)
forecast$pred <- forecast$pred^(1/par2)
lb <- lb^(1/par2)
ub <- ub^(1/par2)
}
if (par2 < 0) {
olb <- lb
lb <- ub
ub <- olb
}
(actandfor <- c(x[1:nx], forecast$pred))
(perc.se <- (ub-forecast$pred)/1.96/forecast$pred)
bitmap(file='test1.png')
opar <- par(mar=c(4,4,2,2),las=1)
ylim <- c( min(x[first:nx],lb), max(x[first:nx],ub))
plot(x,ylim=ylim,type='n',xlim=c(first,lx))
usr <- par('usr')
rect(usr[1],usr[3],nx+1,usr[4],border=NA,col='lemonchiffon')
rect(nx1,usr[3],usr[2],usr[4],border=NA,col='lavender')
abline(h= (-3:3)*2 , col ='gray', lty =3)
polygon( c(nx1:lx,lx:nx1), c(lb,rev(ub)), col = 'orange', lty=2,border=NA)
lines(nx1:lx, lb , lty=2)
lines(nx1:lx, ub , lty=2)
lines(x, lwd=2)
lines(nx1:lx, forecast$pred , lwd=2 , col ='white')
box()
par(opar)
dev.off()
prob.dec <- array(NA, dim=fx)
prob.sdec <- array(NA, dim=fx)
prob.ldec <- array(NA, dim=fx)
prob.pval <- array(NA, dim=fx)
perf.pe <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.se <- array(0, dim=fx)
perf.mse <- array(0, dim=fx)
perf.mse1 <- array(0, dim=fx)
perf.rmse <- array(0, dim=fx)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / forecast$pred[i]
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
prob.dec[i] = pnorm((x[nx+i-1] - forecast$pred[i]) / locSD)
prob.sdec[i] = pnorm((x[nx+i-par5] - forecast$pred[i]) / locSD)
prob.ldec[i] = pnorm((x[nx] - forecast$pred[i]) / locSD)
prob.pval[i] = pnorm(abs(x[nx+i] - forecast$pred[i]) / locSD)
}
perf.mape[1] = abs(perf.pe[1])
perf.mse[1] = abs(perf.se[1])
for (i in 2:fx) {
perf.mape[i] = perf.mape[i-1] + abs(perf.pe[i])
perf.mape1[i] = perf.mape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
}
perf.rmse = sqrt(perf.mse1)
bitmap(file='test2.png')
plot(forecast$pred, pch=19, type='b',main='ARIMA Extrapolation Forecast', ylab='Forecast and 95% CI', xlab='time',ylim=c(min(lb),max(ub)))
dum <- forecast$pred
dum[1:par1] <- x[(nx+1):lx]
lines(dum, lty=1)
lines(ub,lty=3)
lines(lb,lty=3)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Univariate ARIMA Extrapolation Forecast',9,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'time',1,header=TRUE)
a<-table.element(a,'Y[t]',1,header=TRUE)
a<-table.element(a,'F[t]',1,header=TRUE)
a<-table.element(a,'95% LB',1,header=TRUE)
a<-table.element(a,'95% UB',1,header=TRUE)
a<-table.element(a,'p-value<br />(H0: Y[t] = F[t])',1,header=TRUE)
a<-table.element(a,'P(F[t]>Y[t-1])',1,header=TRUE)
a<-table.element(a,'P(F[t]>Y[t-s])',1,header=TRUE)
mylab <- paste('P(F[t]>Y[',nx,sep='')
mylab <- paste(mylab,'])',sep='')
a<-table.element(a,mylab,1,header=TRUE)
a<-table.row.end(a)
for (i in (nx-par5):nx) {
a<-table.row.start(a)
a<-table.element(a,i,header=TRUE)
a<-table.element(a,x[i])
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.row.end(a)
}
for (i in 1:fx) {
a<-table.row.start(a)
a<-table.element(a,nx+i,header=TRUE)
a<-table.element(a,round(x[nx+i],4))
a<-table.element(a,round(forecast$pred[i],4))
a<-table.element(a,round(lb[i],4))
a<-table.element(a,round(ub[i],4))
a<-table.element(a,round((1-prob.pval[i]),4))
a<-table.element(a,round((1-prob.dec[i]),4))
a<-table.element(a,round((1-prob.sdec[i]),4))
a<-table.element(a,round((1-prob.ldec[i]),4))
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,'Univariate ARIMA Extrapolation Forecast Performance',7,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'time',1,header=TRUE)
a<-table.element(a,'% S.E.',1,header=TRUE)
a<-table.element(a,'PE',1,header=TRUE)
a<-table.element(a,'MAPE',1,header=TRUE)
a<-table.element(a,'Sq.E',1,header=TRUE)
a<-table.element(a,'MSE',1,header=TRUE)
a<-table.element(a,'RMSE',1,header=TRUE)
a<-table.row.end(a)
for (i in 1:fx) {
a<-table.row.start(a)
a<-table.element(a,nx+i,header=TRUE)
a<-table.element(a,round(perc.se[i],4))
a<-table.element(a,round(perf.pe[i],4))
a<-table.element(a,round(perf.mape1[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse1[i],4))
a<-table.element(a,round(perf.rmse[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')
 





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