Home » date » 2009 » Dec » 10 »

forecasting

*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 08:24:18 -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/t1260458745clkbdz1peg3q7v0.htm/, Retrieved Thu, 10 Dec 2009 16:25: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/t1260458745clkbdz1peg3q7v0.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:
sdws10
 
Dataseries X:
» Textbox « » Textfile « » CSV «
593530.00 610943.00 612613.00 611324.00 594167.00 595454.00 590865.00 589379.00 584428.00 573100.00 567456.00 569028.00 620735.00 628884.00 628232.00 612117.00 595404.00 597141.00 593408.00 590072.00 579799.00 574205.00 572775.00 572942.00 619567.00 625809.00 619916.00 587625.00 565742.00 557274.00 560576.00 548854.00 531673.00 525919.00 511038.00 498662.00 555362.00 564591.00 541657.00 527070.00 509846.00 514258.00 516922.00 507561.00 492622.00 490243.00 469357.00 477580.00 528379.00 533590.00 517945.00 506174.00 501866.00 516141.00 528222.00 532638.00 536322.00 536535.00 523597.00 536214.00 586570.00 596594.00 580523.00
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 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[35])
23572775-------
24572942-------
25619567-------
26625809-------
27619916-------
28587625-------
29565742-------
30557274-------
31560576-------
32548854-------
33531673-------
34525919-------
35511038-------
36498662512130.2152501214.7536523045.67690.00780.577700.5777
37555362549465.7592533408.0408565523.47770.2359101
38564591555090.6579531776.2661578405.04960.21220.490900.9999
39541657546133.7926519239.7878573027.79730.37210.089300.9947
40527070508801.9867478001.2313539602.74210.12250.018300.4434
41509846484641.0185449763.91519518.1270.07830.008600.069
42514258472528.1681434347.4486510708.88760.01610.027700.024
43516922472042.061430408.3015513675.82050.01730.023400.0332
44507561457282.9456412278.8699502287.02130.01430.004700.0096
45492622436513.2664388350.9362484675.59660.01120.00191e-040.0012
46490243427281.9954375929.8554478634.13530.00810.00631e-047e-04
47469357409088.4787354619.1752463557.78220.01510.00171e-041e-04
48477580406683.1556344594.4641468771.8470.01260.02390.00185e-04
49528379440600.3053371190.1245510010.48610.00660.14826e-040.0233
50533590442829.1652364384.1708521274.15950.01170.01630.00120.0442
51517945430423.6774345188.6284515658.72640.02210.00880.00530.0319
52506174389678.7213297415.1482481942.29430.00670.00320.00180.005
53501866362101.936262687.1985461516.67350.00290.00230.00180.0017
54516141346561.4801240655.7555452467.20488e-040.0020.0010.0012
55528222342661.0971230169.1137455153.08066e-040.00130.00120.0017
56532638324484.5044205507.416443461.59273e-044e-040.00130.0011
57536322300296.2099175049.5262425542.89351e-041e-040.00135e-04
58536535287651.1047156133.2612419168.94821e-041e-040.00134e-04
59523597266042.6961128343.5945403741.79771e-041e-040.00192e-04
60536214260223.5134112602.4113407844.61551e-042e-040.0024e-04
61586570290728.8023133304.0188448153.58571e-040.00110.00150.003
62596594289546.0375120848.208458243.86712e-043e-040.00230.005
63580523273730.170295468.4555451991.88494e-042e-040.00360.0045


Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
360.0109-0.02630181392821.245100
370.01490.01070.018534765655.2056108079238.225410396.1165
380.02140.01710.01890256500.4155102138325.622110106.3508
390.0251-0.00820.015620041671.604281614162.11769034.0557
400.03090.03590.0196333720310.1956132035391.733211490.6654
410.03670.0520.025635291091.3917215911341.676314693.9219
420.04120.08830.03411741378870.9551433835274.430420828.7127
430.0450.09510.04172014208924.8599631381980.734125127.3154
440.05020.10990.04932527882750.9526842104288.536129019.0332
450.05630.12850.05723148189987.74641072712858.457232752.2955
460.06130.14740.06543964088104.73281335565153.573136545.3848
470.06790.14730.07223632294657.75451526959278.921639076.3263
480.07790.17430.08015026362549.69481796144145.904142380.9408
490.08040.19920.08867705099237.68122218212366.745447097.9019
500.09040.2050.09648237529141.94342619500151.758651181.0527
510.1010.20330.1037659981910.2582934530261.664854171.3048
520.12080.2990.114613571149966.03873560213773.686859667.527
530.14010.3860.129619533993585.64294447645985.462166690.6739
540.15590.48930.148628757213553.38625727096910.089775677.5853
550.16750.54150.168234432848669.887162384498.079284630.872
560.18710.64150.190843327877747.93068884550843.310294257.8954
570.21280.7860.217855708173610.739311012897332.7388104942.3524
580.23330.86520.24661943193337.0313227258028.5776115009.8171
590.26410.96810.276166334219461.48215440048088.2819124257.99
600.28941.06060.307476170748703.534317869276112.892133676.0117
610.27631.01760.334787522014269.460220548227580.4523143346.5297
620.29731.06040.361694278451249.137223278976605.2184152574.4953
630.33231.12080.388794121840418.439925809078884.2621160652.0429
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/10/t1260458745clkbdz1peg3q7v0/1109x1260458654.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/10/t1260458745clkbdz1peg3q7v0/1109x1260458654.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/10/t1260458745clkbdz1peg3q7v0/2zddh1260458654.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/10/t1260458745clkbdz1peg3q7v0/2zddh1260458654.ps (open in new window)


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