Home » date » 2009 » Dec » 09 »

*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: Wed, 09 Dec 2009 05:10:54 -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/09/t1260360819mkpgu5bh228lu4f.htm/, Retrieved Wed, 09 Dec 2009 13:13:41 +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/09/t1260360819mkpgu5bh228lu4f.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 «
117,09 116,77 119,39 122,49 124,08 118,29 112,94 113,79 114,43 118,70 120,36 118,27 118,34 117,82 117,65 118,18 121,02 124,78 131,16 130,14 131,75 134,73 135,35 140,32 136,35 131,60 128,90 133,89 138,25 146,23 144,76 149,30 156,80 159,08 165,12 163,14 153,43 151,01 154,72 154,58 155,63 161,67 163,51 162,91 164,80 164,98 154,54 148,60 149,19 150,61
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 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[22])
10118.7-------
11120.36-------
12118.27-------
13118.34-------
14117.82-------
15117.65-------
16118.18-------
17121.02-------
18124.78-------
19131.16-------
20130.14-------
21131.75-------
22134.73-------
23135.35136.1297131.4926140.76670.37090.722910.7229
24140.32138.478130.0959146.86020.33330.767710.8096
25136.35137.4139125.849148.97890.42850.31120.99940.6754
26131.6135.8198121.8706149.7690.27660.47030.99430.5608
27128.9135.5665120.3442150.78890.19530.69520.98950.5429
28133.89137.0117120.5858153.43760.35480.83350.98770.6073
29138.25137.5551119.6669155.44330.46970.6560.9650.6215
30146.23136.8082117.337156.27950.17150.44230.8870.5829
31144.76135.9862115.2921156.68020.2030.1660.67620.5474
32149.3136.3156114.6471157.98420.12010.22250.71180.557
33156.8137.0262114.3707159.68180.04360.14420.6760.5787
34159.08137.0891113.3125160.86570.03490.05210.57710.5771
35165.12136.5389111.6809161.39690.01210.03780.53730.5567
36163.14136.2924110.5105162.07440.02060.01420.37970.5473
37153.43136.6072109.9879163.22640.10770.02540.50760.555
38151.01136.9304109.4378164.4230.15770.11970.6480.5623
39154.72136.8082108.4066165.20970.10820.16350.70740.557
40154.58136.5151107.2534165.77680.11310.11130.56980.5476
41155.63136.491106.4479166.53410.10590.1190.45430.5457
42161.67136.7099105.9102167.50970.05610.11430.27230.5501
43163.51136.8131105.238168.38830.04870.06140.31090.5514
44162.91136.6858104.3351169.03650.05610.05210.22240.5472
45164.8136.5553103.4681169.64250.04710.05920.11520.5431
46164.98136.6028102.8163170.38920.04990.05090.09610.5433
47154.54136.7218102.2435171.20010.15560.05410.05320.5451
48148.6136.7323101.5571171.90750.25420.16050.07060.5444
49149.19136.6443100.7838172.50480.24650.25670.17950.5417
50150.61136.6018100.0818173.12170.22610.24960.21970.54


Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
230.0174-0.005700.607900
240.03090.01330.00953.39282.00031.4143
250.0429-0.00770.00891.13191.71091.308
260.0524-0.03110.014517.80655.73482.3947
270.0573-0.04920.021444.442813.47643.671
280.0612-0.02280.02169.74512.85453.5853
290.06630.00510.01930.482911.08713.3297
300.07260.06890.025588.769420.79744.5604
310.07760.06450.029876.9827.03995.2
320.08110.09530.0363168.593441.19536.4184
330.08440.14430.0462391.002672.99598.5438
340.08850.16040.0557483.5995107.212910.3544
350.09290.20930.0675816.8798161.802612.7202
360.09650.1970.0768720.791201.730414.2032
370.09940.12310.0798283.0073207.148814.3927
380.10240.10280.0813198.2354206.591814.3733
390.10590.13090.0842320.8335213.311914.6052
400.10940.13230.0869326.3403219.591214.8186
410.11230.14020.0897366.302227.312815.0769
420.11490.18260.0943623.0045247.097415.7193
430.11780.19510.0991712.722269.2716.4094
440.12080.19190.1033687.7073288.289916.9791
450.12360.20680.1078797.7632310.440917.6193
460.12620.20770.112805.2673331.058718.195
470.12870.13030.1127317.4874330.515818.1801
480.13130.08680.1117140.8427323.220717.9783
490.13390.09180.111157.3943317.07917.8067
500.13640.10250.1107196.2309312.76317.6851
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/09/t1260360819mkpgu5bh228lu4f/18gkv1260360651.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/09/t1260360819mkpgu5bh228lu4f/18gkv1260360651.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/09/t1260360819mkpgu5bh228lu4f/24vf81260360651.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/09/t1260360819mkpgu5bh228lu4f/24vf81260360651.ps (open in new window)


 
Parameters (Session):
par1 = 24 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 0 ; par7 = 0 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
 
Parameters (R input):
par1 = 24 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 0 ; par7 = 0 ; par8 = 0 ; 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