Home » date » 2009 » Dec » 09 »

ws 11 f

*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: Wed, 09 Dec 2009 14:45:45 -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/09/t1260395194l3h1c6pdvijw04n.htm/, Retrieved Wed, 09 Dec 2009 22:46:37 +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/09/t1260395194l3h1c6pdvijw04n.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 «
87,28 87,28 87,09 86,92 87,59 90,72 90,69 90,3 89,55 88,94 88,41 87,82 87,07 86,82 86,4 86,02 85,66 85,32 85 84,67 83,94 82,83 81,95 81,19 80,48 78,86 69,47 68,77 70,06 73,95 75,8 77,79 81,57 83,07 84,34 85,1 85,25 84,26 83,63 86,44 85,3 84,1 83,36 82,48 81,58 80,47 79,34 82,13 81,69 80,7 79,88 79,16 78,38 77,42 76,47 75,46 74,48 78,27 80,7 79,91 78,75 77,78 81,14 81,08 80,03 78,91 78,01 76,9 75,97 81,93 80,27 78,67 77,42 76,16 74,7 76,39 76,04 74,65 73,29 71,79 74,39 74,91 74,54 73,08 72,75 71,32 70,38 70,35 70,01 69,36 67,77 69,26 69,8 68,38 67,62 68,39 66,95 65,21 66,64 63,45 60,66 62,34 60,32 58,64 60,46 58,59 61,87 61,85 67,44 77,06 91,74 93,15 94,15 93,11 91,51 89,96 88,16 86,98 88,03 86,24 84,65 83,23 81,7 80,25 78,8 77,51 76,2 75,04 74 75,49 77,14 76,15 76,27 78,19 76,49 77,31 76,65 74,99 73,51 72,07 70,59 71,96 76,29 74,86 74,93 71,9 71,01 77,47 75,78 76 etc...
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 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[330])
31846.53-------
31950.51-------
32047.58-------
32148.05-------
32246.84-------
32347.67-------
32449.16-------
32555.54-------
32655.82-------
32758.22-------
32856.19-------
32957.77-------
33063.19-------
33154.7663.827654.124473.53080.03350.55120.99640.5512
33255.7465.27350.581679.96440.10170.91960.99090.6095
33362.5465.19546.370884.01920.39110.83760.96290.5827
33461.3964.216341.483286.94940.40370.55750.9330.5353
33569.663.42737.951788.90230.31740.56230.88730.5073
33679.2363.952636.295791.60950.13950.34450.85280.5215
3378064.83935.177394.50080.15820.17080.73050.5434
33893.6865.039233.110896.96760.03940.17920.71430.5452
339107.6364.326830.15298.50150.00650.04610.63690.526
340100.1863.755227.62199.88930.02410.00870.65920.5122
34197.363.973226.2205101.72590.04180.03010.62630.5162
34290.4564.634725.3223103.94710.0990.05170.52870.5287
34380.6464.842823.8635105.8220.2250.11030.68520.5315
34480.5864.416321.7145107.1180.22910.22820.65480.5224
34575.8263.955119.6797108.23050.29970.23090.5250.5135
34685.5964.041818.3791109.70440.17750.30660.54530.5146
34789.3564.490117.505111.47520.14990.18940.41560.5216
34889.4264.702816.3337113.07190.15830.1590.2780.5244
349104.7364.445214.6522114.23820.05640.16280.27020.5197
35095.3264.100612.9552115.24590.11580.05970.12850.5139
35189.2764.104311.7262116.48230.17320.12140.05170.5136
35290.4464.406710.849117.96440.17040.18140.09520.5178
35386.9764.59359.8286119.35850.21160.17750.12090.52
35479.9864.45028.4488120.45160.29340.21530.18140.5176
35581.2264.19716.9974121.39690.27980.29430.28660.5138
35687.3564.16195.8408122.4830.21790.28320.29060.513
35783.6464.35874.9603123.75710.26230.2240.35260.5154
35882.2264.51384.0283124.99930.28310.26770.24730.5171


Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
3310.0776-0.1421082.22100
3320.1148-0.1460.144190.877986.54949.3032
3330.1473-0.04070.10967.04960.04937.7491
3340.1806-0.0440.09327.987847.03396.8581
3350.20490.09730.09438.105645.24836.7267
3360.22060.23890.1182233.399476.60688.7525
3370.23340.23380.1347229.854498.49939.9247
3380.25050.44040.1729820.2947188.723713.7377
3390.27110.67320.22851875.1691376.106519.3935
3400.28920.57130.26281326.7683471.172721.7065
3410.30110.52090.28621110.6756529.309323.0067
3420.31030.39940.2957666.43540.736123.2537
3430.32240.24360.2917249.5519518.337322.767
3440.33820.25090.2888261.2662499.975122.3601
3450.35320.18550.2819140.7763476.028521.8181
3460.36380.33650.2853464.3265475.297121.8013
3470.37170.38550.2912618.0141483.692221.993
3480.38140.3820.2962610.9404490.761622.1531
3490.39420.62510.31351622.8659550.34623.4595
3500.40710.4870.3222974.6533571.561423.9073
3510.41690.39260.3256633.3132574.501923.9688
3520.42430.40420.3291677.7327579.194224.0665
3530.43260.34640.3299500.7056575.781723.9955
3540.44330.2410.3262241.1746561.839723.7032
3550.45460.26520.3237289.7777550.957223.4725
3560.46380.36140.3252537.6879550.446923.4616
3570.47090.29960.3242371.7687543.829223.3201
3580.47830.27450.3225313.5099535.603523.1431
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/09/t1260395194l3h1c6pdvijw04n/1lmfk1260395143.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/09/t1260395194l3h1c6pdvijw04n/1lmfk1260395143.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/09/t1260395194l3h1c6pdvijw04n/29zel1260395143.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/09/t1260395194l3h1c6pdvijw04n/29zel1260395143.ps (open in new window)


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