Home » date » 2009 » Dec » 11 »

*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: Fri, 11 Dec 2009 08:47:09 -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/11/t1260546462kas8s9pf80y57vj.htm/, Retrieved Fri, 11 Dec 2009 16:47:44 +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/11/t1260546462kas8s9pf80y57vj.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 «
255 280.2 299.9 339.2 374.2 393.5 389.2 381.7 375.2 369 357.4 352.1 346.5 342.9 340.3 328.3 322.9 314.3 308.9 294 285.6 281.2 280.3 278.8 274.5 270.4 263.4 259.9 258 262.7 284.7 311.3 322.1 327 331.3 333.3 321.4 327 320 314.7 316.7 314.4 321.3 318.2 307.2 301.3 287.5 277.7 274.4 258.8 253.3 251 248.4 249.5 246.1 244.5 243.6 244 240.8 249.8 248 259.4 260.5 260.8 261.3 259.5 256.6 257.9 256.5 254.2 253.3 253.8 255.5 257.1 257.3 253.2 252.8 252 250.7 252.2 250 251 253.4 251.2 255.6 261.1 258.9 259.9 261.2 264.7 267.1 266.4 267.7 268.6 267.5 268.5 268.5 270.5 270.9 270.1 269.3 269.8 270.1 264.9 263.7 264.8 263.7 255.9 276.2 360.1 380.5 373.7 369.8 366.6 359.3 345.8 326.2 324.5 328.1 327.5 324.4 316.5 310.9 301.5 291.7 290.4 287.4 277.7 281.6 288 276 272.9 283 283.3 276.8 284.5 282.7 281.2 287.4 283.1 284 285.5 289.2 292.5 296.4 305.2 303.9 311.5 316.3 316.7 322.5 3 etc...
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 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[332])
320292.1-------
321291.9-------
322282.5-------
323277.9-------
324287.5-------
325289.2-------
326285.6-------
327293.2-------
328290.8-------
329283.1-------
330275-------
331287.8-------
332287.8-------
333287.4284.5819264.3269304.83690.39250.37770.23940.3777
334284286.1327249.0674323.1980.45510.47330.57620.4649
335277.8287.0441237.15336.93820.35830.54760.64030.4882
336277.6287.4762225.7542349.19820.37690.62070.49970.4959
337304.9287.3275215.0808359.57420.31680.60410.47970.4949
338294286.824205.6187368.02920.43120.33130.51180.4906
339300.9286.2795197.627374.9320.37330.43220.43920.4866
340324285.9419191.0093380.87460.2160.37870.46010.4847
341332.9285.9022185.4072386.39730.17970.22870.52180.4852
342341.6286.0974180.3627391.8320.15180.19280.58150.4874
343333.4286.3793175.4757397.28290.2030.16460.490.49
344348.2286.602170.5149402.68910.14920.21470.49190.4919
345344.7286.6847165.4487407.92070.17410.160.49540.4928
346344.7286.6291160.3888412.86950.18360.18360.51630.4927
347329.3286.4967155.4893417.50410.2610.19190.55180.4922
348323.5286.3657150.8604421.8710.29560.26730.55040.4917
349323.2286.2927146.5294426.05590.30240.30090.39710.4916
350317.4286.2938142.4488430.13870.33580.30750.45820.4918
351330.1286.3485138.5327434.16430.28090.34030.42350.4923
352329.2286.4187134.6988438.13860.29020.28630.31370.4929
353334.9286.4696130.8976442.04150.27090.29520.27930.4933
354315.8286.4843127.1211445.84750.35920.27580.24890.4935
355315.4286.4662123.3912449.54120.3640.36220.28630.4936
356319.6286.432119.7393453.12460.34830.36670.23380.4936
357317.3286.4008116.188456.61370.3610.35110.2510.4936
358313.8286.3855112.7421460.02890.37850.36360.25520.4936
359315.8286.3884109.3894463.38740.37230.38070.31730.4938
360311.3286.4033106.1094466.69720.39330.37460.34340.4939


Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
3330.03630.009907.941800
3340.0661-0.00750.00874.54846.24512.499
3350.0887-0.03220.016585.453932.6485.7138
3360.1095-0.03440.02197.539248.87086.9908
3370.12830.06120.029308.7924100.855110.0427
3380.14440.0250.028351.495692.62869.6244
3390.1580.05110.0316213.7586109.932910.4849
3400.16940.13310.04431448.4165277.243316.6506
3410.17930.16440.05762208.792491.859822.1779
3420.18860.1940.07133080.5431750.728227.3994
3430.19760.16420.07972210.9503883.475629.7233
3440.20670.21490.0913794.31511126.045633.5566
3450.21580.20240.09953365.7781298.332736.0324
3460.22470.20260.10693372.22851446.468138.0325
3470.23330.14940.10971832.12281472.178438.369
3480.24140.12970.1111378.95581466.35238.293
3490.24910.12890.1121362.14921460.222438.2129
3500.25630.10870.1119967.5971432.854337.8531
3510.26340.15280.1141914.1921458.187938.1862
3520.27030.14940.11581830.24261476.790638.429
3530.27710.16910.11832345.50641518.158138.9635
3540.28380.10230.1176859.41061488.21538.5774
3550.29040.1010.1169837.16581459.908538.2087
3560.29690.11580.11681100.11911444.917338.0121
3570.30320.10790.1165954.75821425.310937.7533
3580.30940.09570.1157751.55391399.397237.4085
3590.31530.10270.1152865.04261379.606337.1431
3600.32120.08690.1142619.84481352.471936.776
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/11/t1260546462kas8s9pf80y57vj/1mjh91260546424.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/11/t1260546462kas8s9pf80y57vj/1mjh91260546424.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/11/t1260546462kas8s9pf80y57vj/2nc7e1260546424.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/11/t1260546462kas8s9pf80y57vj/2nc7e1260546424.ps (open in new window)


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