Home » date » 2007 » Dec » 08 » attachments

steenkool

R Software Module: rwasp_arimaforecasting.wasp (opens new window with default values)
Title produced by software: ARIMA Forecasting
Date of computation: Sat, 08 Dec 2007 07:02:57 -0700
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2007/Dec/08/t1197121799dechwu8vjk1vsk2.htm/, Retrieved Sat, 08 Dec 2007 14:50:02 +0100
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
95,4 101,2 101,5 101,9 101,7 100,1 97,4 96,5 99,2 102,2 105,3 111,1 114,9 124,5 142,2 159,7 165,2 198,6 207,8 219,6 239,6 235,3 218,5 213,8 205,5 198,4 198,5 190,2 180,7 193,6 192,8 195,5 197,2 196,9 178,9 172,4 156,4 143,7 153,6 168,8 185,8 199,9 205,4 197,5 199,6 200,5 193,7 179,6 169,1 169,8 195,5 194,8 204,5 203,8 204,8 204,9 240,0 248,3 258,4 254,9
 
Text written by user:
lambda -0,6 d=1 D=0 ARIMA parameters op max
 
Output produced by software:


Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 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[24])
12111.1-------
13114.9-------
14124.5-------
15142.2-------
16159.7-------
17165.2-------
18198.6-------
19207.8-------
20219.6-------
21239.6-------
22235.3-------
23218.5-------
24213.8-------
25205.5189.9999190.3194189.68131101
26198.4174.616175.0706174.16331101
27198.5174.1792174.9014173.46161101
28190.2173.4605174.468172.46241101
29180.7173.9903175.2336172.7611101
30193.6178.2154179.7441176.707510.999411
31192.8185.4642187.3753183.58411111
32195.5188.1295190.3381185.96161111
33197.2180.8274183.1154178.58481111
34196.9173.398175.7537171.09241111
35178.9166.4637168.8622164.11921111
36172.4155.4856157.7898153.23471111
37156.4149.2025151.51146.95071111
38143.7136.3709138.4978134.29591111
39153.6119.7744121.5995117.99271111
40168.8108.5699110.2122106.96641111
41185.8105.7459107.4001104.13211111
42199.993.027794.435591.65311111
43205.490.474191.877589.10461111
44197.587.574988.960886.22331111
45199.683.432184.762182.13511111
46200.584.221885.619182.86061111
47193.787.75789.299586.25661111
48179.688.83690.458587.25951111
49169.195.610197.463193.81291111
50169.8101.2807103.330599.29521111
51195.5101.347103.409199.34991111
52194.8101.5556103.626599.55011111
53204.5101.3052103.372999.30291111
54203.899.454101.465997.50521111
55204.896.724998.649494.85971111
56204.995.768897.664193.93181111
5724098.33100.309896.41211111
58248.3101.3091103.386999.29731111
59258.4104.4643106.6477102.35151111
60254.9110.2211112.6028107.91891111


Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
25-9e-040.08160.0023240.25186.67372.5833
26-0.00130.13620.0038565.679515.71333.964
27-0.00210.13960.0039591.503616.43074.0535
28-0.00290.09650.0027280.20987.78362.7899
29-0.00360.03860.001145.02071.25061.1183
30-0.00430.08630.0024236.68486.57462.5641
31-0.00520.03960.001153.81431.49481.2226
32-0.00590.03920.001154.32411.5091.2284
33-0.00630.09050.0025268.06257.44622.7288
34-0.00680.13550.0038552.345115.34293.917
35-0.00720.07470.0021154.66234.29622.0727
36-0.00740.10880.003286.09867.94722.8191
37-0.00770.04820.001351.80441.4391.1996
38-0.00780.05370.001553.71521.49211.2215
39-0.00760.28240.00781144.171631.78255.6376
40-0.00750.55480.01543627.6658100.768510.0384
41-0.00780.7570.0216408.656178.018213.3423
42-0.00751.14880.031911421.6976317.269417.8121
43-0.00771.27030.035313207.9712366.888119.1543
44-0.00791.25520.034912083.5195335.653318.3208
45-0.00791.39240.038713494.9863374.860719.3613
46-0.00821.38060.038413520.6238375.572919.3797
47-0.00871.20720.033511223.9251311.775717.6572
48-0.00911.02170.02848238.1124228.836515.1273
49-0.00960.76860.02145400.7602150.021112.2483
50-0.010.67650.01884694.8951130.413811.4199
51-0.01010.9290.02588864.7944246.244315.6922
52-0.01010.91820.02558694.5243241.514615.5407
53-0.01011.01870.028310649.1649295.810117.1991
54-0.011.04920.029110888.0889302.446917.391
55-0.00981.11730.03111680.2341324.450918.0125
56-0.00981.13950.031711909.6117330.822518.1885
57-0.011.44080.0420070.3819557.510623.6117
58-0.01011.45090.040321606.3321600.175924.4985
59-0.01031.47360.040923696.2043658.227925.656
60-0.01071.31260.036520931.9919581.444224.1132
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/08/t1197121799dechwu8vjk1vsk2/1qlv11197122571.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/08/t1197121799dechwu8vjk1vsk2/1qlv11197122571.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/08/t1197121799dechwu8vjk1vsk2/2k2nd1197122572.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/08/t1197121799dechwu8vjk1vsk2/2k2nd1197122572.ps (open in new window)


 
Parameters:
par1 = 36 ; par2 = -0.6 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 3 ; par7 = 2 ; par8 = 2 ; 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,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)
}
(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:

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