| | *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, 24 Dec 2010 16:08:55 +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/24/t1293206804mhvk6vk0hh07oty.htm/, Retrieved Fri, 24 Dec 2010 17:06:47 +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/24/t1293206804mhvk6vk0hh07oty.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: |
Univariate ARIMA Extrapolation Forecast | time | Y[t] | F[t] | 95% LB | 95% UB | p-value (H0: Y[t] = F[t]) | P(F[t]>Y[t-1]) | P(F[t]>Y[t-s]) | P(F[t]>Y[108]) | 96 | 9.893 | - | - | - | - | - | - | - | 97 | 11.572 | - | - | - | - | - | - | - | 98 | 12.38 | - | - | - | - | - | - | - | 99 | 16.692 | - | - | - | - | - | - | - | 100 | 16.052 | - | - | - | - | - | - | - | 101 | 16.459 | - | - | - | - | - | - | - | 102 | 14.761 | - | - | - | - | - | - | - | 103 | 13.654 | - | - | - | - | - | - | - | 104 | 13.48 | - | - | - | - | - | - | - | 105 | 18.068 | - | - | - | - | - | - | - | 106 | 16.56 | - | - | - | - | - | - | - | 107 | 14.53 | - | - | - | - | - | - | - | 108 | 10.65 | - | - | - | - | - | - | - | 109 | 11.651 | 11.3113 | 8.0834 | 14.5392 | 0.4183 | 0.656 | 0.4371 | 0.656 | 110 | 13.735 | 12.111 | 8.2202 | 16.0018 | 0.2067 | 0.5916 | 0.4461 | 0.7691 | 111 | 13.36 | 15.6091 | 11.2966 | 19.9216 | 0.1533 | 0.8028 | 0.3113 | 0.9879 | 112 | 17.818 | 15.1242 | 10.4641 | 19.7842 | 0.1286 | 0.771 | 0.3482 | 0.9701 | 113 | 20.613 | 16.6913 | 11.7178 | 21.6648 | 0.0611 | 0.3285 | 0.5365 | 0.9914 | 114 | 16.231 | 15.6174 | 10.3518 | 20.8829 | 0.4097 | 0.0315 | 0.6251 | 0.9678 | 115 | 13.862 | 13.9987 | 8.4572 | 19.5401 | 0.4807 | 0.2149 | 0.5485 | 0.8819 | 116 | 12.004 | 13.1649 | 7.3609 | 18.9689 | 0.3475 | 0.4069 | 0.4576 | 0.8021 | 117 | 17.734 | 16.0337 | 9.9785 | 22.0889 | 0.291 | 0.9039 | 0.2551 | 0.9593 | 118 | 15.034 | 15.4432 | 9.1468 | 21.7396 | 0.4493 | 0.2379 | 0.364 | 0.9322 | 119 | 12.609 | 14.5833 | 8.0544 | 21.1123 | 0.2767 | 0.4462 | 0.5064 | 0.8812 | 120 | 12.32 | 11.5522 | 4.7979 | 18.3065 | 0.4118 | 0.3795 | 0.6033 | 0.6033 | 121 | 10.833 | 11.3568 | 4.0076 | 18.7061 | 0.4444 | 0.3986 | 0.4687 | 0.5748 | 122 | 11.35 | 11.9754 | 4.2189 | 19.7319 | 0.4372 | 0.6136 | 0.3283 | 0.6312 | 123 | 13.648 | 15.2116 | 7.1011 | 23.3221 | 0.3528 | 0.8246 | 0.6727 | 0.8648 | 124 | 14.89 | 14.7502 | 6.3097 | 23.1906 | 0.487 | 0.601 | 0.2381 | 0.8295 | 125 | 16.325 | 16.609 | 7.8537 | 25.3643 | 0.4747 | 0.6498 | 0.185 | 0.9089 | 126 | 18.045 | 15.6932 | 6.6347 | 24.7517 | 0.3054 | 0.4456 | 0.4537 | 0.8624 | 127 | 15.616 | 13.9433 | 4.5916 | 23.2949 | 0.3629 | 0.195 | 0.5068 | 0.755 | 128 | 11.926 | 12.9407 | 3.3049 | 22.5765 | 0.4182 | 0.2932 | 0.5756 | 0.6794 | 129 | 16.855 | 15.37 | 5.4581 | 25.2818 | 0.3845 | 0.7521 | 0.3201 | 0.8247 | 130 | 15.083 | 15.014 | 4.8334 | 25.1945 | 0.4947 | 0.3615 | 0.4985 | 0.7996 | 131 | 12.52 | 14.4532 | 4.0105 | 24.896 | 0.3584 | 0.453 | 0.6354 | 0.7623 | 132 | 12.355 | 11.6391 | 0.9392 | 22.339 | 0.4478 | 0.4359 | 0.4504 | 0.5719 |
Univariate ARIMA Extrapolation Forecast Performance | time | % S.E. | PE | MAPE | Sq.E | MSE | RMSE | 109 | 0.1456 | 0.03 | 0 | 0.1154 | 0 | 0 | 110 | 0.1639 | 0.1341 | 0.0821 | 2.6372 | 1.3763 | 1.1732 | 111 | 0.141 | -0.1441 | 0.1027 | 5.0584 | 2.6037 | 1.6136 | 112 | 0.1572 | 0.1781 | 0.1216 | 7.2568 | 3.7669 | 1.9409 | 113 | 0.152 | 0.235 | 0.1443 | 15.3801 | 6.0896 | 2.4677 | 114 | 0.172 | 0.0393 | 0.1268 | 0.3765 | 5.1374 | 2.2666 | 115 | 0.202 | -0.0098 | 0.11 | 0.0187 | 4.4062 | 2.0991 | 116 | 0.2249 | -0.0882 | 0.1073 | 1.3477 | 4.0238 | 2.006 | 117 | 0.1927 | 0.106 | 0.1072 | 2.891 | 3.898 | 1.9743 | 118 | 0.208 | -0.0265 | 0.0991 | 0.1674 | 3.5249 | 1.8775 | 119 | 0.2284 | -0.1354 | 0.1024 | 3.8979 | 3.5588 | 1.8865 | 120 | 0.2983 | 0.0665 | 0.0994 | 0.5896 | 3.3114 | 1.8197 | 121 | 0.3302 | -0.0461 | 0.0953 | 0.2744 | 3.0778 | 1.7544 | 122 | 0.3305 | -0.0522 | 0.0922 | 0.3912 | 2.8859 | 1.6988 | 123 | 0.272 | -0.1028 | 0.0929 | 2.4449 | 2.8565 | 1.6901 | 124 | 0.292 | 0.0095 | 0.0877 | 0.0195 | 2.6792 | 1.6368 | 125 | 0.269 | -0.0171 | 0.0836 | 0.0807 | 2.5263 | 1.5894 | 126 | 0.2945 | 0.1499 | 0.0872 | 5.5308 | 2.6932 | 1.6411 | 127 | 0.3422 | 0.12 | 0.089 | 2.7981 | 2.6987 | 1.6428 | 128 | 0.3799 | -0.0784 | 0.0884 | 1.0296 | 2.6153 | 1.6172 | 129 | 0.329 | 0.0966 | 0.0888 | 2.2053 | 2.5958 | 1.6111 | 130 | 0.346 | 0.0046 | 0.085 | 0.0048 | 2.478 | 1.5742 | 131 | 0.3686 | -0.1338 | 0.0871 | 3.7374 | 2.5328 | 1.5915 | 132 | 0.469 | 0.0615 | 0.0861 | 0.5125 | 2.4486 | 1.5648 |
| | Charts produced by software: | | http://www.freestatistics.org/blog/date/2010/Dec/24/t1293206804mhvk6vk0hh07oty/1j1g81293206931.png (open in new window) | http://www.freestatistics.org/blog/date/2010/Dec/24/t1293206804mhvk6vk0hh07oty/1j1g81293206931.ps (open in new window) |
| http://www.freestatistics.org/blog/date/2010/Dec/24/t1293206804mhvk6vk0hh07oty/2qkd21293206931.png (open in new window) | http://www.freestatistics.org/blog/date/2010/Dec/24/t1293206804mhvk6vk0hh07oty/2qkd21293206931.ps (open in new window) |
| | Parameters (Session): | par1 = 24 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 1 ; par7 = 1 ; par8 = 1 ; par9 = 1 ; par10 = FALSE ; | | 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
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
|