Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationWed, 09 Dec 2009 12:29:01 -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/2009/Dec/09/t1260389082z3p39l7opfpg2nm.htm/, Retrieved Mon, 29 Apr 2024 14:27:35 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=65192, Retrieved Mon, 29 Apr 2024 14:27:35 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact161
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-06 10:44:58] [1e83ffa964db6f7ea6ccc4e7b5acbbff]
-   PD    [ARIMA Forecasting] [ws 10 deel 2 prblm] [2009-12-09 19:29:01] [4f297b039e1043ebee7ff7a83b1eaaaa] [Current]
- RMP       [(Partial) Autocorrelation Function] [WS 10 forum ACF] [2009-12-11 10:14:54] [83058a88a37d754675a5cd22dab372fc]
- RMP       [Standard Deviation-Mean Plot] [WS 10 Forum SMP] [2009-12-11 10:18:43] [83058a88a37d754675a5cd22dab372fc]
- RMP       [(Partial) Autocorrelation Function] [] [2009-12-11 10:27:22] [83058a88a37d754675a5cd22dab372fc]
- RM        [ARIMA Backward Selection] [WS 10 Forum ARIMA] [2009-12-11 10:33:01] [83058a88a37d754675a5cd22dab372fc]
-   P       [ARIMA Forecasting] [ws 10 deel 2 arim...] [2009-12-12 09:45:03] [134dc66689e3d457a82860db6471d419]
-    D        [ARIMA Forecasting] [WS 10 ] [2009-12-12 11:53:20] [3425351e86519d261a643e224a0c8ee1]
-   PD          [ARIMA Forecasting] [] [2009-12-19 16:24:22] [3425351e86519d261a643e224a0c8ee1]
-   P             [ARIMA Forecasting] [] [2009-12-20 10:24:37] [3425351e86519d261a643e224a0c8ee1]
-   PD              [ARIMA Forecasting] [ARIMA forecasting] [2009-12-21 15:59:35] [76ab39dc7a55316678260825bd5ad46c]
-   PD        [ARIMA Forecasting] [Forecasting] [2009-12-14 15:18:19] [24c4941ee50deadff4640c9c09cc70cb]
-   P         [ARIMA Forecasting] [Paper ARIMA F IGP] [2009-12-14 21:07:10] [134dc66689e3d457a82860db6471d419]
-   PD          [ARIMA Forecasting] [Paper ARIMA F ICP] [2009-12-15 20:21:11] [134dc66689e3d457a82860db6471d419]
-   P           [ARIMA Forecasting] [Paper ARIMA F IGP 12] [2009-12-15 20:24:19] [134dc66689e3d457a82860db6471d419]
- R PD            [ARIMA Forecasting] [Paper arima forec...] [2009-12-23 22:37:42] [62d3ced7fb1c10c35a82e9cb1d0d0e2b]
- R PD            [ARIMA Forecasting] [Paper arima forec...] [2009-12-23 23:25:41] [62d3ced7fb1c10c35a82e9cb1d0d0e2b]
-   P         [ARIMA Forecasting] [workshop 10] [2009-12-18 17:50:14] [28d531aeb5ea2ff1b676cbab66947a19]
- R P       [ARIMA Forecasting] [ws 10 deel 2 arim...] [2009-12-12 09:39:49] [134dc66689e3d457a82860db6471d419]
-    D        [ARIMA Forecasting] [WS 10] [2009-12-12 11:57:08] [3425351e86519d261a643e224a0c8ee1]
- R P         [ARIMA Forecasting] [] [2009-12-12 19:34:20] [b98453cac15ba1066b407e146608df68]
Feedback Forum

Post a new message
Dataseries X:
100.01
103.84
104.48
95.43
104.80
108.64
105.65
108.42
115.35
113.64
115.24
100.33
101.29
104.48
99.26
100.11
103.52
101.18
96.39
97.56
96.39
85.10
79.77
79.13
80.84
82.75
92.55
96.60
96.92
95.32
98.52
100.22
104.91
103.10
97.13
103.42
111.72
118.11
111.62
100.22
102.03
105.76
107.68
110.77
105.44
112.26
114.07
117.90
124.72
126.42
134.73
135.79
143.36
140.37
144.74
151.98
150.92
163.38
154.43
146.66
157.95
162.10
180.42
179.57
171.58
185.43
190.64
203.00
202.36
193.41
186.17
192.24
209.60
206.41
209.82
230.37
235.80
232.07
244.64
242.19
217.48
209.39
211.73
221.00
203.11
214.71
224.19
238.04
238.36
246.24
259.87
249.97
266.48
282.98
306.31
301.73
314.62
332.62
355.51
370.32
408.13
433.58
440.51
386.29
342.84
254.97
203.42
170.09
174.03
167.85
177.01
188.19
211.20
240.91
230.26
251.25
241.66




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135
R Engine error message
Error in plot.window(...) : need finite 'ylim' values
Calls: plot -> plot.default -> localWindow -> plot.window
Execution halted

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 1 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
R Engine error message & 
Error in plot.window(...) : need finite 'ylim' values
Calls: plot -> plot.default -> localWindow -> plot.window
Execution halted
\tabularnewline \hline \end{tabular} %Source: https://freestatistics.org/blog/index.php?pk=65192&T=0

[TABLE]
[ROW][C]Summary of computational 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]1 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[ROW][C]R Engine error message[/C][C]
Error in plot.window(...) : need finite 'ylim' values
Calls: plot -> plot.default -> localWindow -> plot.window
Execution halted
[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=65192&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65192&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 computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135
R Engine error message
Error in plot.window(...) : need finite 'ylim' values
Calls: plot -> plot.default -> localWindow -> plot.window
Execution halted



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