| Paper Forecasting ARIMA 24m | *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: Sat, 11 Dec 2010 12:59:41 +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/11/t12920722547mq6pwoiudghf9o.htm/, Retrieved Sat, 11 Dec 2010 13:57:36 +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/11/t12920722547mq6pwoiudghf9o.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 « | 17848
19592
21092
20899
25890
24965
22225
20977
22897
22785
22769
19637
20203
20450
23083
21738
26766
25280
22574
22729
21378
22902
24989
21116
15169
15846
20927
18273
22538
15596
14034
11366
14861
15149
13577
13026
13190
13196
15826
14733
16307
15703
14589
12043
15057
14053
12698
10888
10045
11549
13767
12434
13116
14211
12266
12602
15714
13742
12745
10491
10057
10900
11771
11992
11933
14504
11727
11477
13578
11555
11846
11397
10066
10269
14279
13870
13695
14420
11424
9704
12464
14301
13464
9893
11572
12380
16692
16052
16459
14761
13654
13480
18068
16560
14530
10650
11651
13735
13360
17818
20613
16231
13862
12004
17734
15034
12609
12320
10833
11350
13648
14890
16325
18045
15616
11926
16855
15083
12520
12355 | | 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[96]) | 84 | 9893 | - | - | - | - | - | - | - | 85 | 11572 | - | - | - | - | - | - | - | 86 | 12380 | - | - | - | - | - | - | - | 87 | 16692 | - | - | - | - | - | - | - | 88 | 16052 | - | - | - | - | - | - | - | 89 | 16459 | - | - | - | - | - | - | - | 90 | 14761 | - | - | - | - | - | - | - | 91 | 13654 | - | - | - | - | - | - | - | 92 | 13480 | - | - | - | - | - | - | - | 93 | 18068 | - | - | - | - | - | - | - | 94 | 16560 | - | - | - | - | - | - | - | 95 | 14530 | - | - | - | - | - | - | - | 96 | 10650 | - | - | - | - | - | - | - | 97 | 11651 | 10547.6976 | 6980.6036 | 14114.7915 | 0.2722 | 0.4776 | 0.2868 | 0.4776 | 98 | 13735 | 11238.2191 | 6194.4144 | 16282.0238 | 0.166 | 0.4363 | 0.3286 | 0.5904 | 99 | 13360 | 14571.782 | 8394.7461 | 20748.8179 | 0.3503 | 0.6047 | 0.2506 | 0.8933 | 100 | 17818 | 13922.6163 | 6790.1849 | 21055.0478 | 0.1422 | 0.5614 | 0.2792 | 0.8158 | 101 | 20613 | 14648.8933 | 6674.7234 | 22623.0632 | 0.0713 | 0.218 | 0.3282 | 0.8372 | 102 | 16231 | 14286.4203 | 5551.2505 | 23021.5902 | 0.3313 | 0.0779 | 0.4576 | 0.7927 | 103 | 13862 | 12302.4413 | 2867.4533 | 21737.4293 | 0.373 | 0.2072 | 0.3894 | 0.6343 | 104 | 12004 | 11535.8736 | 1449.5063 | 21622.2409 | 0.4638 | 0.3256 | 0.3528 | 0.5683 | 105 | 17734 | 14792.7228 | 4094.5635 | 25490.882 | 0.295 | 0.6953 | 0.2742 | 0.7761 | 106 | 15034 | 14175.9909 | 2899.182 | 25452.7997 | 0.4407 | 0.2682 | 0.3393 | 0.73 | 107 | 12609 | 13106.5993 | 1279.4178 | 24933.7809 | 0.4671 | 0.3747 | 0.4068 | 0.658 | 108 | 12320 | 10254.0909 | -2098.9666 | 22607.1484 | 0.3715 | 0.3543 | 0.475 | 0.475 | 109 | 10833 | 10151.7884 | -3122.416 | 23425.9928 | 0.4599 | 0.3744 | 0.4124 | 0.4707 | 110 | 11350 | 10842.31 | -3292.2547 | 24976.8747 | 0.4719 | 0.5005 | 0.3442 | 0.5106 | 111 | 13648 | 14175.8728 | -769.6059 | 29121.3516 | 0.4724 | 0.6445 | 0.5426 | 0.6781 | 112 | 14890 | 13526.7072 | -2187.8959 | 29241.3103 | 0.4325 | 0.494 | 0.2962 | 0.6401 | 113 | 16325 | 14252.9842 | -2194.8172 | 30700.7855 | 0.4025 | 0.4697 | 0.2243 | 0.6662 | 114 | 18045 | 13890.5112 | -3259.1705 | 31040.1929 | 0.3175 | 0.3904 | 0.3945 | 0.6444 | 115 | 15616 | 11906.5322 | -5917.4124 | 29730.4767 | 0.3417 | 0.2498 | 0.4149 | 0.5549 | 116 | 11926 | 11139.9645 | -7333.6496 | 29613.5785 | 0.4668 | 0.3174 | 0.4635 | 0.5207 | 117 | 16855 | 14396.8136 | -4704.3861 | 33498.0134 | 0.4004 | 0.6001 | 0.366 | 0.6497 | 118 | 15083 | 13780.0817 | -5928.7297 | 33488.8931 | 0.4485 | 0.3799 | 0.4504 | 0.6222 | 119 | 12520 | 12710.6902 | -7587.5526 | 33008.9331 | 0.4927 | 0.4094 | 0.5039 | 0.5789 | 120 | 12355 | 9858.1817 | -11012.8527 | 30729.2162 | 0.4073 | 0.4013 | 0.4086 | 0.4704 |
Univariate ARIMA Extrapolation Forecast Performance | time | % S.E. | PE | MAPE | Sq.E | MSE | RMSE | 97 | 0.1725 | 0.1046 | 0 | 1217276.2452 | 0 | 0 | 98 | 0.229 | 0.2222 | 0.1634 | 6233914.806 | 3725595.5256 | 1930.1802 | 99 | 0.2163 | -0.0832 | 0.1366 | 1468415.5518 | 2973202.201 | 1724.2976 | 100 | 0.2614 | 0.2798 | 0.1724 | 15174013.8185 | 6023405.1053 | 2454.2626 | 101 | 0.2777 | 0.4071 | 0.2194 | 35570568.9192 | 11932837.8681 | 3454.394 | 102 | 0.312 | 0.1361 | 0.2055 | 3781390.0437 | 10574263.2307 | 3251.8092 | 103 | 0.3913 | 0.1268 | 0.1942 | 2432223.277 | 9411114.6659 | 3067.754 | 104 | 0.4461 | 0.0406 | 0.175 | 219142.3281 | 8262118.1237 | 2874.39 | 105 | 0.369 | 0.1988 | 0.1777 | 8651111.7291 | 8305339.6354 | 2881.8986 | 106 | 0.4059 | 0.0605 | 0.166 | 736179.6704 | 7548423.6389 | 2747.4395 | 107 | 0.4604 | -0.038 | 0.1543 | 247605.1129 | 6884712.8638 | 2623.8736 | 108 | 0.6146 | 0.2015 | 0.1583 | 4267980.5466 | 6666651.8374 | 2581.986 | 109 | 0.6671 | 0.0671 | 0.1512 | 464049.1896 | 6189528.5568 | 2487.8763 | 110 | 0.6651 | 0.0468 | 0.1438 | 257749.1583 | 5765830.0283 | 2401.2143 | 111 | 0.5379 | -0.0372 | 0.1367 | 278649.7357 | 5400018.0088 | 2323.7939 | 112 | 0.5927 | 0.1008 | 0.1344 | 1858567.2259 | 5178677.3349 | 2275.6707 | 113 | 0.5888 | 0.1454 | 0.1351 | 4293249.6791 | 5126593.3551 | 2264.1982 | 114 | 0.6299 | 0.2991 | 0.1442 | 17259777.1105 | 5800659.1193 | 2408.4558 | 115 | 0.7638 | 0.3115 | 0.153 | 13760151.4586 | 6219579.7687 | 2493.9085 | 116 | 0.8461 | 0.0706 | 0.1489 | 617851.8623 | 5939493.3734 | 2437.1076 | 117 | 0.6769 | 0.1707 | 0.1499 | 6042680.184 | 5944407.0311 | 2438.1155 | 118 | 0.7297 | 0.0946 | 0.1474 | 1697596.0055 | 5751370.1663 | 2398.2014 | 119 | 0.8148 | -0.015 | 0.1416 | 36362.7587 | 5502891.5833 | 2345.8243 | 120 | 1.0802 | 0.2533 | 0.1463 | 6234101.4554 | 5533358.6613 | 2352.3092 |
| | Charts produced by software: | | http://www.freestatistics.org/blog/date/2010/Dec/11/t12920722547mq6pwoiudghf9o/14c3j1292072378.png (open in new window) | http://www.freestatistics.org/blog/date/2010/Dec/11/t12920722547mq6pwoiudghf9o/14c3j1292072378.ps (open in new window) |
| http://www.freestatistics.org/blog/date/2010/Dec/11/t12920722547mq6pwoiudghf9o/2tv0c1292072378.png (open in new window) | http://www.freestatistics.org/blog/date/2010/Dec/11/t12920722547mq6pwoiudghf9o/2tv0c1292072378.ps (open in new window) |
| | Parameters (Session): | par1 = 24 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 0 ; par7 = 0 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ; | | Parameters (R input): | par1 = 24 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 0 ; par7 = 0 ; par8 = 0 ; 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
|