Home » date » 2010 » Dec » 19 »

Arima Forecasting (Paper)

*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: Sun, 19 Dec 2010 13:15:37 +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/Dec/19/t1292764433faiw9jraogmxblq.htm/, Retrieved Sun, 19 Dec 2010 14:13:53 +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/2010/Dec/19/t1292764433faiw9jraogmxblq.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:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
14.458 13.594 17.814 20.235 21.811 21.439 21.393 19.831 20.468 21.080 21.600 17.390 17.848 19.592 21.092 20.899 25.890 24.965 22.225 20.977 22.897 22.785 22.769 19.637 20.203 20.450 23.083 21.738 26.766 25.280 22.574 22.729 21.378 22.902 24.989 21.116 15.169 15.846 20.927 18.273 22.538 15.596 14.034 11.366 14.861 15.149 13.577 13.026 13.190 13.196 15.826 14.733 16.307 15.703 14.589 12.043 15.057 14.053 12.698 10.888 10.045 11.549 13.767 12.434 13.116 14.211 12.266 12.602 15.714 13.742 12.745 10.491 10.057 10.900 11.771 11.992 11.933 14.504 11.727 11.477 13.578 11.555 11.846 11.397 10.066 10.269 14.279 13.870 13.695 14.420 11.424 9.704 12.464 14.301 13.464 9.893 11.572 12.380 16.692 16.052 16.459 14.761 13.654 13.480 18.068 16.560 14.530 10.650 11.651 13.735 13.360 17.818 20.613 16.231 13.862 12.004 17.734 15.034 12.609 12.320 10.833 11.350 13.648 14.890 16.325 18.045 15.616 11.926 16 etc...
 
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'RServer@AstonUniversity' @ vre.aston.ac.uk


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[108])
969.893-------
9711.572-------
9812.38-------
9916.692-------
10016.052-------
10116.459-------
10214.761-------
10313.654-------
10413.48-------
10518.068-------
10616.56-------
10714.53-------
10810.65-------
10911.65111.31138.083414.53920.41830.6560.43710.656
11013.73512.1118.220216.00180.20670.59160.44610.7691
11113.3615.609111.296619.92160.15330.80280.31130.9879
11217.81815.124210.464119.78420.12860.7710.34820.9701
11320.61316.691311.717821.66480.06110.32850.53650.9914
11416.23115.617410.351820.88290.40970.03150.62510.9678
11513.86213.99878.457219.54010.48070.21490.54850.8819
11612.00413.16497.360918.96890.34750.40690.45760.8021
11717.73416.03379.978522.08890.2910.90390.25510.9593
11815.03415.44329.146821.73960.44930.23790.3640.9322
11912.60914.58338.054421.11230.27670.44620.50640.8812
12012.3211.55224.797918.30650.41180.37950.60330.6033
12110.83311.35684.007618.70610.44440.39860.46870.5748
12211.3511.97544.218919.73190.43720.61360.32830.6312
12313.64815.21167.101123.32210.35280.82460.67270.8648
12414.8914.75026.309723.19060.4870.6010.23810.8295
12516.32516.6097.853725.36430.47470.64980.1850.9089
12618.04515.69326.634724.75170.30540.44560.45370.8624
12715.61613.94334.591623.29490.36290.1950.50680.755
12811.92612.94073.304922.57650.41820.29320.57560.6794
12916.85515.375.458125.28180.38450.75210.32010.8247
13015.08315.0144.833425.19450.49470.36150.49850.7996
13112.5214.45324.010524.8960.35840.4530.63540.7623
13212.35511.63910.939222.3390.44780.43590.45040.5719


Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1090.14560.0300.115400
1100.16390.13410.08212.63721.37631.1732
1110.141-0.14410.10275.05842.60371.6136
1120.15720.17810.12167.25673.76691.9409
1130.1520.2350.144315.38016.08962.4677
1140.1720.03930.12680.37655.13742.2666
1150.202-0.00980.110.01874.40612.0991
1160.2249-0.08820.10731.34774.02382.006
1170.19270.1060.10722.8913.8981.9743
1180.208-0.02650.09910.16743.52491.8775
1190.2284-0.13540.10243.89793.55881.8865
1200.29830.06650.09940.58963.31141.8197
1210.3302-0.04610.09530.27443.07781.7544
1220.3305-0.05220.09220.39122.88591.6988
1230.272-0.10280.09292.44492.85651.6901
1240.2920.00950.08770.01952.67921.6368
1250.269-0.01710.08360.08072.52631.5894
1260.29450.14990.08725.53082.69321.6411
1270.34220.120.0892.79812.69871.6428
1280.3799-0.07840.08841.02962.61531.6172
1290.3290.09660.08882.20532.59581.6111
1300.3460.00460.0850.00482.4781.5742
1310.3686-0.13380.08713.73742.53281.5915
1320.4690.06150.08610.51252.44861.5648
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/19/t1292764433faiw9jraogmxblq/1uosl1292764533.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/19/t1292764433faiw9jraogmxblq/1uosl1292764533.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/19/t1292764433faiw9jraogmxblq/2177e1292764533.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/19/t1292764433faiw9jraogmxblq/2177e1292764533.ps (open in new window)


 
Parameters (Session):
par1 = FALSE ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 0 ; par7 = 1 ; par8 = 2 ; par9 = 1 ;
 
Parameters (R input):
par1 = 24 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 1 ; par7 = 1 ; par8 = 1 ; par9 = 1 ; par10 = FALSE ;
 
R code (references can be found in the software module):
par1 <- as.numeric(par1) #cut off periods
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
par7 <- as.numeric(par7) #q
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