Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationWed, 09 Jan 2008 07:02:56 -0700
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2008/Jan/09/t11998872569708xcybisv5qzh.htm/, Retrieved Wed, 15 May 2024 15:24:05 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=7938, Retrieved Wed, 15 May 2024 15:24:05 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact282
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2008-01-09 14:02:56] [ba3202e2798d2e4685d19d988e9c69df] [Current]
Feedback Forum

Post a new message
Dataseries X:
88
88,4
95
101,8
107,6
118,9
126,9
106,3
109,2
104,6
100,8
92,1
86,4
96
98,5
112
113,9
120
126,7
112,8
116,2
110,6
105
101,2
99,3
101,9
106,4
118,9
121,9
132
121,4
117
122,7
113
104
101,2
100,8
98,9
103
117,8
126,6
127,6
115,8
114,8
119,2
109,9
98,9
98,6
96,6
96,7
103,5
115,3
122,5
125,3
111,2
110,7
114,2
105,6
95,5
97,3
95,5
96,3
100,2
113,4
121,4
122,1
119,3
110,8
110,1
99,7
104,8
105,4




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

\begin{tabular}{lllllllll}
\hline
Summary of compuational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 4 seconds \tabularnewline
R Server & 'George Udny Yule' @ 72.249.76.132 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=7938&T=0

[TABLE]
[ROW][C]Summary of compuational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]4 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'George Udny Yule' @ 72.249.76.132[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=7938&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=7938&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 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[60])
4898.6-------
4996.6-------
5096.7-------
51103.5-------
52115.3-------
53122.5-------
54125.3-------
55111.2-------
56110.7-------
57114.2-------
58105.6-------
5995.5-------
6097.3-------
6195.592.273183.1749100.55140.22240.1170.15280.117
6296.392.757883.4289101.23070.20630.26290.18090.1467
63100.2100.593391.9222108.57410.46150.85410.23770.7907
64113.4112.9006104.8375120.4250.44830.99950.2661
65121.4119.5882111.1181127.49690.32670.93740.23531
66122.1122.5918114.0707130.5580.45180.61530.25261
67119.3108.404398.381117.57630.00990.00170.27510.9912
68110.8107.859597.336117.44380.27380.00970.28070.9846
69110.1111.2539100.604120.96980.4080.53650.27620.9976
7099.7102.485290.4554113.24420.30590.08270.28520.8276
71104.892.140878.132104.28450.02050.11120.29380.2025
72105.493.964279.8139106.24630.0340.04190.29720.2972

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast \tabularnewline
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[60]) \tabularnewline
48 & 98.6 & - & - & - & - & - & - & - \tabularnewline
49 & 96.6 & - & - & - & - & - & - & - \tabularnewline
50 & 96.7 & - & - & - & - & - & - & - \tabularnewline
51 & 103.5 & - & - & - & - & - & - & - \tabularnewline
52 & 115.3 & - & - & - & - & - & - & - \tabularnewline
53 & 122.5 & - & - & - & - & - & - & - \tabularnewline
54 & 125.3 & - & - & - & - & - & - & - \tabularnewline
55 & 111.2 & - & - & - & - & - & - & - \tabularnewline
56 & 110.7 & - & - & - & - & - & - & - \tabularnewline
57 & 114.2 & - & - & - & - & - & - & - \tabularnewline
58 & 105.6 & - & - & - & - & - & - & - \tabularnewline
59 & 95.5 & - & - & - & - & - & - & - \tabularnewline
60 & 97.3 & - & - & - & - & - & - & - \tabularnewline
61 & 95.5 & 92.2731 & 83.1749 & 100.5514 & 0.2224 & 0.117 & 0.1528 & 0.117 \tabularnewline
62 & 96.3 & 92.7578 & 83.4289 & 101.2307 & 0.2063 & 0.2629 & 0.1809 & 0.1467 \tabularnewline
63 & 100.2 & 100.5933 & 91.9222 & 108.5741 & 0.4615 & 0.8541 & 0.2377 & 0.7907 \tabularnewline
64 & 113.4 & 112.9006 & 104.8375 & 120.425 & 0.4483 & 0.9995 & 0.266 & 1 \tabularnewline
65 & 121.4 & 119.5882 & 111.1181 & 127.4969 & 0.3267 & 0.9374 & 0.2353 & 1 \tabularnewline
66 & 122.1 & 122.5918 & 114.0707 & 130.558 & 0.4518 & 0.6153 & 0.2526 & 1 \tabularnewline
67 & 119.3 & 108.4043 & 98.381 & 117.5763 & 0.0099 & 0.0017 & 0.2751 & 0.9912 \tabularnewline
68 & 110.8 & 107.8595 & 97.336 & 117.4438 & 0.2738 & 0.0097 & 0.2807 & 0.9846 \tabularnewline
69 & 110.1 & 111.2539 & 100.604 & 120.9698 & 0.408 & 0.5365 & 0.2762 & 0.9976 \tabularnewline
70 & 99.7 & 102.4852 & 90.4554 & 113.2442 & 0.3059 & 0.0827 & 0.2852 & 0.8276 \tabularnewline
71 & 104.8 & 92.1408 & 78.132 & 104.2845 & 0.0205 & 0.1112 & 0.2938 & 0.2025 \tabularnewline
72 & 105.4 & 93.9642 & 79.8139 & 106.2463 & 0.034 & 0.0419 & 0.2972 & 0.2972 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=7938&T=1

[TABLE]
[ROW][C]Univariate ARIMA Extrapolation Forecast[/C][/ROW]
[ROW][C]time[/C][C]Y[t][/C][C]F[t][/C][C]95% LB[/C][C]95% UB[/C][C]p-value(H0: Y[t] = F[t])[/C][C]P(F[t]>Y[t-1])[/C][C]P(F[t]>Y[t-s])[/C][C]P(F[t]>Y[60])[/C][/ROW]
[ROW][C]48[/C][C]98.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]96.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]96.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]103.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]115.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]122.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]125.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]111.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]110.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]114.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]105.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]95.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]97.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]95.5[/C][C]92.2731[/C][C]83.1749[/C][C]100.5514[/C][C]0.2224[/C][C]0.117[/C][C]0.1528[/C][C]0.117[/C][/ROW]
[ROW][C]62[/C][C]96.3[/C][C]92.7578[/C][C]83.4289[/C][C]101.2307[/C][C]0.2063[/C][C]0.2629[/C][C]0.1809[/C][C]0.1467[/C][/ROW]
[ROW][C]63[/C][C]100.2[/C][C]100.5933[/C][C]91.9222[/C][C]108.5741[/C][C]0.4615[/C][C]0.8541[/C][C]0.2377[/C][C]0.7907[/C][/ROW]
[ROW][C]64[/C][C]113.4[/C][C]112.9006[/C][C]104.8375[/C][C]120.425[/C][C]0.4483[/C][C]0.9995[/C][C]0.266[/C][C]1[/C][/ROW]
[ROW][C]65[/C][C]121.4[/C][C]119.5882[/C][C]111.1181[/C][C]127.4969[/C][C]0.3267[/C][C]0.9374[/C][C]0.2353[/C][C]1[/C][/ROW]
[ROW][C]66[/C][C]122.1[/C][C]122.5918[/C][C]114.0707[/C][C]130.558[/C][C]0.4518[/C][C]0.6153[/C][C]0.2526[/C][C]1[/C][/ROW]
[ROW][C]67[/C][C]119.3[/C][C]108.4043[/C][C]98.381[/C][C]117.5763[/C][C]0.0099[/C][C]0.0017[/C][C]0.2751[/C][C]0.9912[/C][/ROW]
[ROW][C]68[/C][C]110.8[/C][C]107.8595[/C][C]97.336[/C][C]117.4438[/C][C]0.2738[/C][C]0.0097[/C][C]0.2807[/C][C]0.9846[/C][/ROW]
[ROW][C]69[/C][C]110.1[/C][C]111.2539[/C][C]100.604[/C][C]120.9698[/C][C]0.408[/C][C]0.5365[/C][C]0.2762[/C][C]0.9976[/C][/ROW]
[ROW][C]70[/C][C]99.7[/C][C]102.4852[/C][C]90.4554[/C][C]113.2442[/C][C]0.3059[/C][C]0.0827[/C][C]0.2852[/C][C]0.8276[/C][/ROW]
[ROW][C]71[/C][C]104.8[/C][C]92.1408[/C][C]78.132[/C][C]104.2845[/C][C]0.0205[/C][C]0.1112[/C][C]0.2938[/C][C]0.2025[/C][/ROW]
[ROW][C]72[/C][C]105.4[/C][C]93.9642[/C][C]79.8139[/C][C]106.2463[/C][C]0.034[/C][C]0.0419[/C][C]0.2972[/C][C]0.2972[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=7938&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=7938&T=1

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

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[60])
4898.6-------
4996.6-------
5096.7-------
51103.5-------
52115.3-------
53122.5-------
54125.3-------
55111.2-------
56110.7-------
57114.2-------
58105.6-------
5995.5-------
6097.3-------
6195.592.273183.1749100.55140.22240.1170.15280.117
6296.392.757883.4289101.23070.20630.26290.18090.1467
63100.2100.593391.9222108.57410.46150.85410.23770.7907
64113.4112.9006104.8375120.4250.44830.99950.2661
65121.4119.5882111.1181127.49690.32670.93740.23531
66122.1122.5918114.0707130.5580.45180.61530.25261
67119.3108.404398.381117.57630.00990.00170.27510.9912
68110.8107.859597.336117.44380.27380.00970.28070.9846
69110.1111.2539100.604120.96980.4080.53650.27620.9976
7099.7102.485290.4554113.24420.30590.08270.28520.8276
71104.892.140878.132104.28450.02050.11120.29380.2025
72105.493.964279.8139106.24630.0340.04190.29720.2972



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