Home » date » 2008 » Dec » 14 »

W9Q1

*Unverified author*
R Software Module: rwasp_arimaforecasting.wasp (opens new window with default values)
Title produced by software: ARIMA Forecasting
Date of computation: Sun, 14 Dec 2008 05:45:50 -0700
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2008/Dec/14/t1229258781zel8r9pvccf1yiq.htm/, Retrieved Sun, 14 Dec 2008 13:46:23 +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/2008/Dec/14/t1229258781zel8r9pvccf1yiq.htm/},
    year = {2008},
}
@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 = {2008},
    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 «
95,4 98,7 99,9 98,6 100,3 100,2 100,4 101,4 103 109,1 111,4 114,1 121,8 127,6 129,9 128 123,5 124 127,4 127,6 128,4 131,4 135,1 134 144,5 147,3 150,9 148,7 141,4 138,9 139,8 145,6 147,9 148,5 151,1 157,5 167,5 172,3 173,5 187,5 205,5 195,1 204,5 204,5 201,7 207 206,6 210,6 211,1 215 223,9 238,2 238,9 229,6 232,2 222,1 221,6 227,3 221 213,6 243,4 253,8 265,3 268,2 268,5 266,9 268,4 250,8 231,2 192
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'George Udny Yule' @ 72.249.76.132


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[20])
8101.4-------
9103-------
10109.1-------
11111.4-------
12114.1-------
13121.8-------
14127.6-------
15129.9-------
16128-------
17123.5-------
18124-------
19127.4-------
20127.6-------
21128.40-221.0822221.08220.12750.1290.18060.129
22131.40-221.0822221.08220.1220.12750.16670.129
23135.10-221.0822221.08220.11550.1220.16170.129
241340-221.0822221.08220.11740.11550.15590.129
25144.50-221.0822221.08220.10010.11740.14010.129
26147.30-221.0822221.08220.09580.10010.1290.129
27150.90-221.0822221.08220.09050.09580.12470.129
28148.70-221.0822221.08220.09370.09050.12820.129
29141.40-221.0822221.08220.1050.09370.13680.129
30138.90-221.0822221.08220.10910.1050.13580.129
31139.80-221.0822221.08220.10760.10910.12940.129
32145.60-221.0822221.08220.09840.10760.1290.129
33147.90-221.0822221.08220.09490.09840.12750.129
34148.50-221.0822221.08220.0940.09490.1220.129
35151.10-221.0822221.08220.09020.0940.11550.129
36157.50-221.0822221.08220.08130.09020.11740.129
37167.50-221.0822221.08220.06880.08130.10010.129
38172.30-221.0822221.08220.06330.06880.09580.129
39173.50-221.0822221.08220.0620.06330.09050.129
40187.50-221.0822221.08220.04820.0620.09370.129
41205.50-221.0822221.08220.03420.04820.1050.129
42195.10-221.0822221.08220.04180.03420.10910.129
43204.50-221.0822221.08220.03490.04180.10760.129
44204.50-221.0822221.08220.03490.03490.09840.129
45201.70-221.0822221.08220.03690.03490.09490.129
462070-221.0822221.08220.03320.03690.0940.129
47206.60-221.0822221.08220.03350.03320.09020.129
48210.60-221.0822221.08220.03090.03350.08130.129
49211.10-221.0822221.08220.03060.03090.06880.129
502150-221.0822221.08220.02830.03060.06330.129
51223.90-221.0822221.08220.02360.02830.0620.129
52238.20-221.0822221.08220.01740.02360.04820.129
53238.90-221.0822221.08220.01710.01740.03420.129
54229.60-221.0822221.08220.02090.01710.04180.129
55232.20-221.0822221.08220.01980.02090.03490.129
56222.10-221.0822221.08220.02450.01980.03490.129
57221.60-221.0822221.08220.02470.02450.03690.129
58227.30-221.0822221.08220.02190.02470.03320.129
592210-221.0822221.08220.0250.02190.03350.129
60213.60-221.0822221.08220.02910.0250.03090.129
61243.40-221.0822221.08220.01550.02910.03060.129
62253.80-221.0822221.08220.01220.01550.02830.129
63265.30-221.0822221.08220.00930.01220.02360.129
64268.20-221.0822221.08220.00870.00930.01740.129
65268.50-221.0822221.08220.00860.00870.01710.129
66266.90-221.0822221.08220.0090.00860.02090.129
67268.40-221.0822221.08220.00870.0090.01980.129
68250.80-221.0822221.08220.01310.00870.02450.129
69231.20-221.0822221.08220.02020.01310.02470.129
701920-221.0822221.08220.04440.02020.02190.129


Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
21InfInfInf16486.56329.731218.1585
22InfInfInf17265.96345.319218.5828
23InfInfInf18252.01365.040219.106
24InfInfInf17956359.1218.9505
25InfInfInf20880.25417.60520.4354
26InfInfInf21697.29433.945820.8314
27InfInfInf22770.81455.416221.3405
28InfInfInf22111.69442.233821.0294
29InfInfInf19993.96399.879219.997
30InfInfInf19293.21385.864219.6434
31InfInfInf19544.04390.880819.7707
32InfInfInf21199.36423.987220.5909
33InfInfInf21874.41437.488220.9162
34InfInfInf22052.25441.04521.0011
35InfInfInf22831.21456.624221.3688
36InfInfInf24806.25496.12522.2739
37InfInfInf28056.25561.12523.6881
38InfInfInf29687.29593.745824.3669
39InfInfInf30102.25602.04524.5366
40InfInfInf35156.25703.12526.5165
41InfInfInf42230.25844.60529.0621
42InfInfInf38064.01761.280227.5913
43InfInfInf41820.25836.40528.9207
44InfInfInf41820.25836.40528.9207
45InfInfInf40682.89813.657828.5247
46InfInfInf42849856.9829.2742
47InfInfInf42683.56853.671229.2177
48InfInfInf44352.36887.047229.7833
49InfInfInf44563.21891.264229.854
50InfInfInf46225924.530.4056
51InfInfInf50131.211002.624231.6642
52InfInfInf56739.241134.784833.6866
53InfInfInf57073.211141.464233.7856
54InfInfInf52716.161054.323232.4703
55InfInfInf53916.841078.336832.838
56InfInfInf49328.41986.568231.4097
57InfInfInf49106.56982.131231.339
58InfInfInf51665.291033.305832.1451
59InfInfInf48841976.8231.2541
60InfInfInf45624.96912.499230.2076
61InfInfInf59243.561184.871234.422
62InfInfInf64414.441288.288835.8927
63InfInfInf70384.091407.681837.5191
64InfInfInf71931.241438.624837.9292
65InfInfInf72092.251441.84537.9716
66InfInfInf71235.611424.712237.7454
67InfInfInf72038.561440.771237.9575
68InfInfInf62900.641258.012835.4685
69InfInfInf53453.441069.068832.6966
70InfInfInf36864737.2827.1529
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/14/t1229258781zel8r9pvccf1yiq/1pl651229258748.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/14/t1229258781zel8r9pvccf1yiq/1pl651229258748.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/14/t1229258781zel8r9pvccf1yiq/2hdjv1229258748.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/14/t1229258781zel8r9pvccf1yiq/2hdjv1229258748.ps (open in new window)


 
Parameters (Session):
par1 = 50 ; par2 = 1 ; par3 = 0 ; par4 = 0 ; par5 = 12 ; par6 = 0 ; par7 = 0 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
 
Parameters (R input):
par1 = 50 ; par2 = 1 ; par3 = 0 ; 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
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,fx))
(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.se <- array(0, dim=fx)
perf.mse <- 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.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[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