Home » date » 2008 » Dec » 15 »

Gilliam Schoorel

*Unverified author*
R Software Module: rwasp_arimaforecasting.wasp (opens new window with default values)
Title produced by software: ARIMA Forecasting
Date of computation: Mon, 15 Dec 2008 13:58:10 -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/15/t1229374760xtga7jav95oyzno.htm/, Retrieved Mon, 15 Dec 2008 21:59:22 +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/15/t1229374760xtga7jav95oyzno.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 «
467 460 448 443 436 431 484 510 513 503 471 471 476 475 470 461 455 456 517 525 523 519 509 512 519 517 510 509 501 507 569 580 578 565 547 555 562 561 555 544 537 543 594 611 613 611 594 595 591 589 584 573 567 569 621 629 628 612 595 597 593 590 580 574 573 573 620 626 620 588 566 557 561 549 532 526 511 499 555 565 542 527 510 514
 
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[34])
22519-------
23509-------
24512-------
25519-------
26517-------
27510-------
28509-------
29501-------
30507-------
31569-------
32580-------
33578-------
34565-------
35547556.1203544.0685568.17210.0690.074410.0744
36555560.26540.687579.83290.29920.907910.3175
37562568.4567543.185593.72840.30830.85170.99990.6057
38561564.5419537.4849591.59880.39880.5730.99970.4868
39555557.6536527.8601587.44720.43070.41290.99910.3144
40544557.5268524.2789590.77470.21260.55920.99790.3298
41537549.4481513.6652585.23110.24770.61730.9960.1971
42543554.8696517.1801592.55910.26850.82360.99360.2992
43594617.0445577.1374656.95160.12890.99990.99090.9947
44611628.3475586.1611670.53390.21010.94470.98770.9984
45613626.2011582.1011670.30110.27870.75040.98390.9967
46611613.0385567.1654658.91150.46530.50070.97990.9799
47594604.2755551.9209656.63020.35020.40060.9840.9293
48595608.493548.8184668.16750.32880.6830.96050.9234
49591616.6073550.3167682.89790.22450.73850.94680.9365
50589612.6588542.6291682.68850.25390.72780.92590.9089
51584605.8258531.2705680.3810.28310.67090.90930.8584
52573605.7101526.1358685.28450.21020.70360.93570.842
53567597.5964513.8274681.36550.2370.71750.92190.7772
54569603.0169515.6452690.38860.22270.79040.91090.8031
55621665.213574.006756.42010.1710.98070.9370.9844
56629676.5132581.4801771.54620.16360.87390.91170.9893
57628674.3545575.872772.83690.17810.81660.8890.9852
58612661.1955559.4291762.9620.17170.73870.83320.968
59595652.4394543.7183761.16060.15020.7670.8540.9425
60597656.6535540.2293773.07760.15760.85040.85040.9386
61593664.7642541.0394788.4890.12780.85850.87870.943
62590660.8184532.0758789.56090.14050.84910.86290.9277
63580653.9871519.5837788.39050.14030.82460.84630.9028
64574653.8696513.4035794.33570.13250.84870.87040.8925
65573645.7551499.9257791.58450.16410.83260.85510.8611
66573651.1768500.5169801.83670.15460.84540.85750.8689
67620713.3732557.7013869.04510.11990.96140.87760.9691
68626724.6726564.0172885.32790.11430.89920.87840.9743
69620722.5138557.2285887.79920.11210.87380.86880.9691
70588709.3554539.6097879.10110.08060.84890.86950.9522
71566700.5992523.2788877.91970.06840.89340.87840.933
72557704.813519.2603890.36580.05920.92870.87260.9301
73561712.9239519.4245906.42320.06190.94290.88780.933
74549708.9781509.4677908.48850.0580.9270.87880.9214
75532702.1468496.0698908.22370.05280.92740.87730.904
76526702.0292489.0368915.02160.05260.94120.88060.8963
77511693.9148474.6198913.20980.0510.93330.86010.8754
78499699.3365474.2218924.45120.04060.94950.86430.8789
79555761.5329530.4465992.61930.03990.9870.8850.9522
80565772.8322535.80931009.85510.04280.96420.88770.9572
81542770.6735528.04381013.30320.03240.95170.88820.9517
82527757.5151509.4451005.58520.03430.95570.90980.9359
83510748.7589492.49461005.02320.03390.95510.91890.9201
84514752.9727487.92491018.02040.03860.96380.92640.9177


Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
350.0111-0.01643e-0483.18041.66361.2898
360.0178-0.00942e-0427.66740.55330.7439
370.0227-0.01142e-0441.68920.83380.9131
380.0245-0.00631e-0412.54480.25090.5009
390.0273-0.00481e-047.04170.14080.3753
400.0304-0.02435e-04182.97483.65951.913
410.0332-0.02275e-04154.95573.09911.7604
420.0347-0.02144e-04140.88672.81771.6786
430.033-0.03737e-04531.048810.6213.259
440.0343-0.02766e-04300.93536.01872.4533
450.0359-0.02114e-04174.26923.48541.8669
460.0382-0.00331e-044.15530.08310.2883
470.0442-0.0173e-04105.58692.11171.4532
480.05-0.02224e-04182.063.64121.9082
490.0549-0.04158e-04655.731913.11463.6214
500.0583-0.03868e-04559.738811.19483.3459
510.0628-0.0367e-04476.36519.52733.0866
520.067-0.0540.00111069.952521.39914.6259
530.0715-0.05120.001936.140218.72284.327
540.0739-0.05640.00111157.146423.14294.8107
550.07-0.06650.00131954.79239.09586.2527
560.0717-0.07020.00142257.499545.156.7194
570.0745-0.06870.00142148.735142.97476.5555
580.0785-0.07440.00152420.201148.4046.9573
590.085-0.0880.00183299.288865.98588.1232
600.0905-0.09080.00183558.538471.17088.4363
610.095-0.1080.00225150.1066103.002110.149
620.0994-0.10720.00215015.2432100.304910.0152
630.1049-0.11310.00235474.0881109.481810.4634
640.1096-0.12210.00246379.1491127.58311.2953
650.1152-0.11270.00235293.3086105.866210.2891
660.118-0.12010.00246111.6125122.232311.0559
670.1113-0.13090.00268718.5572174.371113.205
680.1131-0.13620.00279736.2737194.725513.9544
690.1167-0.14190.002810509.0877210.181814.4976
700.1221-0.17110.003414727.1334294.542717.1622
710.1291-0.19210.003818116.9528362.339119.0352
720.1343-0.20970.004221848.6855436.973720.9039
730.1385-0.21310.004323080.8563461.617121.4853
740.1436-0.22560.004525593.005511.860122.6243
750.1497-0.24230.004828949.9206578.998424.0624
760.1548-0.25070.00530986.272619.725424.8943
770.1612-0.26360.005333457.8203669.156425.8681
780.1642-0.28650.005740134.7141802.694328.3319
790.1548-0.27120.005442655.8276853.116629.2082
800.1565-0.26890.005443194.2236863.884529.3919
810.1606-0.29670.005952291.57481045.831532.3393
820.1671-0.30430.006153137.20031062.74432.5998
830.1746-0.31890.006457005.80661140.116133.7656
840.1796-0.31740.006357107.93511142.158733.7958
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/15/t1229374760xtga7jav95oyzno/1sv8w1229374688.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/15/t1229374760xtga7jav95oyzno/1sv8w1229374688.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/15/t1229374760xtga7jav95oyzno/242261229374688.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/15/t1229374760xtga7jav95oyzno/242261229374688.ps (open in new window)


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