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 computationSat, 19 Dec 2009 03:06:44 -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/19/t12612183311y2kk2nfxo8v0k1.htm/, Retrieved Fri, 03 May 2024 14:37:33 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=69478, Retrieved Fri, 03 May 2024 14:37:33 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact166
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Multiple Regression] [Q1 The Seatbeltlaw] [2007-11-14 19:27:43] [8cd6641b921d30ebe00b648d1481bba0]
- RM D  [Multiple Regression] [Seatbelt] [2009-11-12 14:06:21] [b98453cac15ba1066b407e146608df68]
- R PD    [Multiple Regression] [] [2009-11-19 08:06:13] [639dd97b6eeebe46a3c92d62cb04fb95]
- RMPD      [ARIMA Forecasting] [] [2009-12-14 08:41:55] [639dd97b6eeebe46a3c92d62cb04fb95]
-   PD          [ARIMA Forecasting] [] [2009-12-19 10:06:44] [21edaefb91319406e70b6c03c71b58b3] [Current]
- R PD            [ARIMA Forecasting] [Arima forecast 6 ...] [2009-12-21 17:12:24] [9dbb467a28ad600d808a4e47d5e0774e]
-   P               [ARIMA Forecasting] [Arima forecast 12...] [2009-12-21 17:19:37] [9dbb467a28ad600d808a4e47d5e0774e]
-                     [ARIMA Forecasting] [paper] [2010-12-28 17:28:42] [654616a560d52fe6eb611aa3bbf6b3c7]
-   P               [ARIMA Forecasting] [Arima forecast 24...] [2009-12-21 17:25:53] [9dbb467a28ad600d808a4e47d5e0774e]
-                     [ARIMA Forecasting] [paper] [2010-12-28 17:32:12] [654616a560d52fe6eb611aa3bbf6b3c7]
-                   [ARIMA Forecasting] [paper] [2010-12-28 17:26:19] [654616a560d52fe6eb611aa3bbf6b3c7]
Feedback Forum

Post a new message
Dataseries X:
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
517
508
493
490
469
478
528
534
518
506
502
516
528
533
536
537
524
536
587
597
581
564
558




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

\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
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69478&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]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69478&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69478&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







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[89])
77469-------
78478-------
79528-------
80534-------
81518-------
82506-------
83502-------
84516-------
85528-------
86533-------
87536-------
88537-------
89524-------
90536535.2826520.0951550.91350.46420.921410.9214
91587591.4359566.4332617.54220.3696111
92597598.1762566.6611631.4440.47240.74490.99991
93581580.2556544.7097618.1210.48460.1930.99940.9982
94564566.8136527.882608.61640.44750.2530.99780.9776
95558562.3329519.9826608.13240.42640.47160.99510.9495

\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[89]) \tabularnewline
77 & 469 & - & - & - & - & - & - & - \tabularnewline
78 & 478 & - & - & - & - & - & - & - \tabularnewline
79 & 528 & - & - & - & - & - & - & - \tabularnewline
80 & 534 & - & - & - & - & - & - & - \tabularnewline
81 & 518 & - & - & - & - & - & - & - \tabularnewline
82 & 506 & - & - & - & - & - & - & - \tabularnewline
83 & 502 & - & - & - & - & - & - & - \tabularnewline
84 & 516 & - & - & - & - & - & - & - \tabularnewline
85 & 528 & - & - & - & - & - & - & - \tabularnewline
86 & 533 & - & - & - & - & - & - & - \tabularnewline
87 & 536 & - & - & - & - & - & - & - \tabularnewline
88 & 537 & - & - & - & - & - & - & - \tabularnewline
89 & 524 & - & - & - & - & - & - & - \tabularnewline
90 & 536 & 535.2826 & 520.0951 & 550.9135 & 0.4642 & 0.9214 & 1 & 0.9214 \tabularnewline
91 & 587 & 591.4359 & 566.4332 & 617.5422 & 0.3696 & 1 & 1 & 1 \tabularnewline
92 & 597 & 598.1762 & 566.6611 & 631.444 & 0.4724 & 0.7449 & 0.9999 & 1 \tabularnewline
93 & 581 & 580.2556 & 544.7097 & 618.121 & 0.4846 & 0.193 & 0.9994 & 0.9982 \tabularnewline
94 & 564 & 566.8136 & 527.882 & 608.6164 & 0.4475 & 0.253 & 0.9978 & 0.9776 \tabularnewline
95 & 558 & 562.3329 & 519.9826 & 608.1324 & 0.4264 & 0.4716 & 0.9951 & 0.9495 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69478&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[89])[/C][/ROW]
[ROW][C]77[/C][C]469[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]78[/C][C]478[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]79[/C][C]528[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]80[/C][C]534[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]81[/C][C]518[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]82[/C][C]506[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]83[/C][C]502[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]84[/C][C]516[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]528[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]86[/C][C]533[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]87[/C][C]536[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]537[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]524[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]536[/C][C]535.2826[/C][C]520.0951[/C][C]550.9135[/C][C]0.4642[/C][C]0.9214[/C][C]1[/C][C]0.9214[/C][/ROW]
[ROW][C]91[/C][C]587[/C][C]591.4359[/C][C]566.4332[/C][C]617.5422[/C][C]0.3696[/C][C]1[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]92[/C][C]597[/C][C]598.1762[/C][C]566.6611[/C][C]631.444[/C][C]0.4724[/C][C]0.7449[/C][C]0.9999[/C][C]1[/C][/ROW]
[ROW][C]93[/C][C]581[/C][C]580.2556[/C][C]544.7097[/C][C]618.121[/C][C]0.4846[/C][C]0.193[/C][C]0.9994[/C][C]0.9982[/C][/ROW]
[ROW][C]94[/C][C]564[/C][C]566.8136[/C][C]527.882[/C][C]608.6164[/C][C]0.4475[/C][C]0.253[/C][C]0.9978[/C][C]0.9776[/C][/ROW]
[ROW][C]95[/C][C]558[/C][C]562.3329[/C][C]519.9826[/C][C]608.1324[/C][C]0.4264[/C][C]0.4716[/C][C]0.9951[/C][C]0.9495[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69478&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69478&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[89])
77469-------
78478-------
79528-------
80534-------
81518-------
82506-------
83502-------
84516-------
85528-------
86533-------
87536-------
88537-------
89524-------
90536535.2826520.0951550.91350.46420.921410.9214
91587591.4359566.4332617.54220.3696111
92597598.1762566.6611631.4440.47240.74490.99991
93581580.2556544.7097618.1210.48460.1930.99940.9982
94564566.8136527.882608.61640.44750.2530.99780.9776
95558562.3329519.9826608.13240.42640.47160.99510.9495







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
900.01490.001300.514700
910.0225-0.00750.004419.677310.0963.1774
920.0284-0.0020.00361.38347.19182.6818
930.03330.00130.0030.55425.53242.3521
940.0376-0.0050.00347.91646.00922.4514
950.0416-0.00770.004118.7748.13672.8525

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
90 & 0.0149 & 0.0013 & 0 & 0.5147 & 0 & 0 \tabularnewline
91 & 0.0225 & -0.0075 & 0.0044 & 19.6773 & 10.096 & 3.1774 \tabularnewline
92 & 0.0284 & -0.002 & 0.0036 & 1.3834 & 7.1918 & 2.6818 \tabularnewline
93 & 0.0333 & 0.0013 & 0.003 & 0.5542 & 5.5324 & 2.3521 \tabularnewline
94 & 0.0376 & -0.005 & 0.0034 & 7.9164 & 6.0092 & 2.4514 \tabularnewline
95 & 0.0416 & -0.0077 & 0.0041 & 18.774 & 8.1367 & 2.8525 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69478&T=2

[TABLE]
[ROW][C]Univariate ARIMA Extrapolation Forecast Performance[/C][/ROW]
[ROW][C]time[/C][C]% S.E.[/C][C]PE[/C][C]MAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][/ROW]
[ROW][C]90[/C][C]0.0149[/C][C]0.0013[/C][C]0[/C][C]0.5147[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]91[/C][C]0.0225[/C][C]-0.0075[/C][C]0.0044[/C][C]19.6773[/C][C]10.096[/C][C]3.1774[/C][/ROW]
[ROW][C]92[/C][C]0.0284[/C][C]-0.002[/C][C]0.0036[/C][C]1.3834[/C][C]7.1918[/C][C]2.6818[/C][/ROW]
[ROW][C]93[/C][C]0.0333[/C][C]0.0013[/C][C]0.003[/C][C]0.5542[/C][C]5.5324[/C][C]2.3521[/C][/ROW]
[ROW][C]94[/C][C]0.0376[/C][C]-0.005[/C][C]0.0034[/C][C]7.9164[/C][C]6.0092[/C][C]2.4514[/C][/ROW]
[ROW][C]95[/C][C]0.0416[/C][C]-0.0077[/C][C]0.0041[/C][C]18.774[/C][C]8.1367[/C][C]2.8525[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69478&T=2

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

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 Performance
time% S.E.PEMAPESq.EMSERMSE
900.01490.001300.514700
910.0225-0.00750.004419.677310.0963.1774
920.0284-0.0020.00361.38347.19182.6818
930.03330.00130.0030.55425.53242.3521
940.0376-0.0050.00347.91646.00922.4514
950.0416-0.00770.004118.7748.13672.8525



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