Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationSun, 12 Aug 2012 08:28:50 -0400
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2012/Aug/12/t1344774560j2azpu8mahx09l7.htm/, Retrieved Sun, 28 Apr 2024 07:15:06 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=169229, Retrieved Sun, 28 Apr 2024 07:15:06 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact178
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [] [2008-12-08 19:22:39] [d2d412c7f4d35ffbf5ee5ee89db327d4]
- RMP   [ARIMA Backward Selection] [] [2011-12-06 19:59:13] [b98453cac15ba1066b407e146608df68]
- RMP     [ARIMA Forecasting] [] [2011-12-06 20:08:12] [b98453cac15ba1066b407e146608df68]
- R PD      [ARIMA Forecasting] [Berekening 15] [2012-08-11 15:08:30] [eb6e95800005ec22b7fd76eead8d8a59]
-   P           [ARIMA Forecasting] [Berekening 15] [2012-08-12 12:28:50] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
-6
-3
-3
-7
-9
-11
-13
-11
-9
-17
-22
-25
-20
-24
-24
-22
-19
-18
-17
-11
-11
-12
-10
-15
-15
-15
-13
-8
-13
-9
-7
-4
-4
-2
0
-2
-3
1
-2
-1
1
-3
-4
-9
-9
-7
-14
-12
-16
-20
-12
-12
-10
-10




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Gertrude Mary Cox' @ cox.wessa.net

\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 & 2 seconds \tabularnewline
R Server & 'Gertrude Mary Cox' @ cox.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=169229&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]2 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gertrude Mary Cox' @ cox.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=169229&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=169229&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 time2 seconds
R Server'Gertrude Mary Cox' @ cox.wessa.net







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[42])
30-9-------
31-7-------
32-4-------
33-4-------
34-2-------
350-------
36-2-------
37-3-------
381-------
39-2-------
40-1-------
411-------
42-3-------
43-4-3-9.17533.17530.37550.50.89790.5
44-9-3-11.73335.73330.08910.58880.58880.5
45-9-3-13.6967.6960.13580.86420.57270.5
46-7-3-15.35079.35070.26280.82950.4370.5
47-14-3-16.808510.80850.05920.71490.33510.5
48-12-3-18.126412.12640.12180.9230.44850.5
49-16-3-19.338413.33840.05940.85990.50.5
50-20-3-20.466514.46650.02820.92770.32680.5
51-12-3-21.52615.5260.17050.9640.45790.5
52-12-3-22.528216.52820.18320.81680.42050.5
53-10-3-23.481317.48130.25150.80550.35090.5
54-10-3-24.39218.3920.26060.73940.50.5

\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[42]) \tabularnewline
30 & -9 & - & - & - & - & - & - & - \tabularnewline
31 & -7 & - & - & - & - & - & - & - \tabularnewline
32 & -4 & - & - & - & - & - & - & - \tabularnewline
33 & -4 & - & - & - & - & - & - & - \tabularnewline
34 & -2 & - & - & - & - & - & - & - \tabularnewline
35 & 0 & - & - & - & - & - & - & - \tabularnewline
36 & -2 & - & - & - & - & - & - & - \tabularnewline
37 & -3 & - & - & - & - & - & - & - \tabularnewline
38 & 1 & - & - & - & - & - & - & - \tabularnewline
39 & -2 & - & - & - & - & - & - & - \tabularnewline
40 & -1 & - & - & - & - & - & - & - \tabularnewline
41 & 1 & - & - & - & - & - & - & - \tabularnewline
42 & -3 & - & - & - & - & - & - & - \tabularnewline
43 & -4 & -3 & -9.1753 & 3.1753 & 0.3755 & 0.5 & 0.8979 & 0.5 \tabularnewline
44 & -9 & -3 & -11.7333 & 5.7333 & 0.0891 & 0.5888 & 0.5888 & 0.5 \tabularnewline
45 & -9 & -3 & -13.696 & 7.696 & 0.1358 & 0.8642 & 0.5727 & 0.5 \tabularnewline
46 & -7 & -3 & -15.3507 & 9.3507 & 0.2628 & 0.8295 & 0.437 & 0.5 \tabularnewline
47 & -14 & -3 & -16.8085 & 10.8085 & 0.0592 & 0.7149 & 0.3351 & 0.5 \tabularnewline
48 & -12 & -3 & -18.1264 & 12.1264 & 0.1218 & 0.923 & 0.4485 & 0.5 \tabularnewline
49 & -16 & -3 & -19.3384 & 13.3384 & 0.0594 & 0.8599 & 0.5 & 0.5 \tabularnewline
50 & -20 & -3 & -20.4665 & 14.4665 & 0.0282 & 0.9277 & 0.3268 & 0.5 \tabularnewline
51 & -12 & -3 & -21.526 & 15.526 & 0.1705 & 0.964 & 0.4579 & 0.5 \tabularnewline
52 & -12 & -3 & -22.5282 & 16.5282 & 0.1832 & 0.8168 & 0.4205 & 0.5 \tabularnewline
53 & -10 & -3 & -23.4813 & 17.4813 & 0.2515 & 0.8055 & 0.3509 & 0.5 \tabularnewline
54 & -10 & -3 & -24.392 & 18.392 & 0.2606 & 0.7394 & 0.5 & 0.5 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=169229&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[42])[/C][/ROW]
[ROW][C]30[/C][C]-9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]31[/C][C]-7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]32[/C][C]-4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]33[/C][C]-4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]34[/C][C]-2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]0[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]-2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]-3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]-2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]-1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]-3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]-4[/C][C]-3[/C][C]-9.1753[/C][C]3.1753[/C][C]0.3755[/C][C]0.5[/C][C]0.8979[/C][C]0.5[/C][/ROW]
[ROW][C]44[/C][C]-9[/C][C]-3[/C][C]-11.7333[/C][C]5.7333[/C][C]0.0891[/C][C]0.5888[/C][C]0.5888[/C][C]0.5[/C][/ROW]
[ROW][C]45[/C][C]-9[/C][C]-3[/C][C]-13.696[/C][C]7.696[/C][C]0.1358[/C][C]0.8642[/C][C]0.5727[/C][C]0.5[/C][/ROW]
[ROW][C]46[/C][C]-7[/C][C]-3[/C][C]-15.3507[/C][C]9.3507[/C][C]0.2628[/C][C]0.8295[/C][C]0.437[/C][C]0.5[/C][/ROW]
[ROW][C]47[/C][C]-14[/C][C]-3[/C][C]-16.8085[/C][C]10.8085[/C][C]0.0592[/C][C]0.7149[/C][C]0.3351[/C][C]0.5[/C][/ROW]
[ROW][C]48[/C][C]-12[/C][C]-3[/C][C]-18.1264[/C][C]12.1264[/C][C]0.1218[/C][C]0.923[/C][C]0.4485[/C][C]0.5[/C][/ROW]
[ROW][C]49[/C][C]-16[/C][C]-3[/C][C]-19.3384[/C][C]13.3384[/C][C]0.0594[/C][C]0.8599[/C][C]0.5[/C][C]0.5[/C][/ROW]
[ROW][C]50[/C][C]-20[/C][C]-3[/C][C]-20.4665[/C][C]14.4665[/C][C]0.0282[/C][C]0.9277[/C][C]0.3268[/C][C]0.5[/C][/ROW]
[ROW][C]51[/C][C]-12[/C][C]-3[/C][C]-21.526[/C][C]15.526[/C][C]0.1705[/C][C]0.964[/C][C]0.4579[/C][C]0.5[/C][/ROW]
[ROW][C]52[/C][C]-12[/C][C]-3[/C][C]-22.5282[/C][C]16.5282[/C][C]0.1832[/C][C]0.8168[/C][C]0.4205[/C][C]0.5[/C][/ROW]
[ROW][C]53[/C][C]-10[/C][C]-3[/C][C]-23.4813[/C][C]17.4813[/C][C]0.2515[/C][C]0.8055[/C][C]0.3509[/C][C]0.5[/C][/ROW]
[ROW][C]54[/C][C]-10[/C][C]-3[/C][C]-24.392[/C][C]18.392[/C][C]0.2606[/C][C]0.7394[/C][C]0.5[/C][C]0.5[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=169229&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=169229&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[42])
30-9-------
31-7-------
32-4-------
33-4-------
34-2-------
350-------
36-2-------
37-3-------
381-------
39-2-------
40-1-------
411-------
42-3-------
43-4-3-9.17533.17530.37550.50.89790.5
44-9-3-11.73335.73330.08910.58880.58880.5
45-9-3-13.6967.6960.13580.86420.57270.5
46-7-3-15.35079.35070.26280.82950.4370.5
47-14-3-16.808510.80850.05920.71490.33510.5
48-12-3-18.126412.12640.12180.9230.44850.5
49-16-3-19.338413.33840.05940.85990.50.5
50-20-3-20.466514.46650.02820.92770.32680.5
51-12-3-21.52615.5260.17050.9640.45790.5
52-12-3-22.528216.52820.18320.81680.42050.5
53-10-3-23.481317.48130.25150.80550.35090.5
54-10-3-24.39218.3920.26060.73940.50.5







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
43-1.05020.33330100
44-1.485221.16673618.54.3012
45-1.819121.44443624.33334.9329
46-2.10051.33331.41671622.254.717
47-2.34843.66671.8667121426.4807
48-2.572532.05568148.56.9642
49-2.77864.33332.38116965.71438.1064
50-2.97055.66672.791728993.6259.676
51-3.150732.81488192.22229.6032
52-3.321132.83338191.19.5446
53-3.48322.33332.78794987.27279.342
54-3.63812.33332.754984.08339.1697

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
43 & -1.0502 & 0.3333 & 0 & 1 & 0 & 0 \tabularnewline
44 & -1.4852 & 2 & 1.1667 & 36 & 18.5 & 4.3012 \tabularnewline
45 & -1.8191 & 2 & 1.4444 & 36 & 24.3333 & 4.9329 \tabularnewline
46 & -2.1005 & 1.3333 & 1.4167 & 16 & 22.25 & 4.717 \tabularnewline
47 & -2.3484 & 3.6667 & 1.8667 & 121 & 42 & 6.4807 \tabularnewline
48 & -2.5725 & 3 & 2.0556 & 81 & 48.5 & 6.9642 \tabularnewline
49 & -2.7786 & 4.3333 & 2.381 & 169 & 65.7143 & 8.1064 \tabularnewline
50 & -2.9705 & 5.6667 & 2.7917 & 289 & 93.625 & 9.676 \tabularnewline
51 & -3.1507 & 3 & 2.8148 & 81 & 92.2222 & 9.6032 \tabularnewline
52 & -3.3211 & 3 & 2.8333 & 81 & 91.1 & 9.5446 \tabularnewline
53 & -3.4832 & 2.3333 & 2.7879 & 49 & 87.2727 & 9.342 \tabularnewline
54 & -3.6381 & 2.3333 & 2.75 & 49 & 84.0833 & 9.1697 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=169229&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]43[/C][C]-1.0502[/C][C]0.3333[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]44[/C][C]-1.4852[/C][C]2[/C][C]1.1667[/C][C]36[/C][C]18.5[/C][C]4.3012[/C][/ROW]
[ROW][C]45[/C][C]-1.8191[/C][C]2[/C][C]1.4444[/C][C]36[/C][C]24.3333[/C][C]4.9329[/C][/ROW]
[ROW][C]46[/C][C]-2.1005[/C][C]1.3333[/C][C]1.4167[/C][C]16[/C][C]22.25[/C][C]4.717[/C][/ROW]
[ROW][C]47[/C][C]-2.3484[/C][C]3.6667[/C][C]1.8667[/C][C]121[/C][C]42[/C][C]6.4807[/C][/ROW]
[ROW][C]48[/C][C]-2.5725[/C][C]3[/C][C]2.0556[/C][C]81[/C][C]48.5[/C][C]6.9642[/C][/ROW]
[ROW][C]49[/C][C]-2.7786[/C][C]4.3333[/C][C]2.381[/C][C]169[/C][C]65.7143[/C][C]8.1064[/C][/ROW]
[ROW][C]50[/C][C]-2.9705[/C][C]5.6667[/C][C]2.7917[/C][C]289[/C][C]93.625[/C][C]9.676[/C][/ROW]
[ROW][C]51[/C][C]-3.1507[/C][C]3[/C][C]2.8148[/C][C]81[/C][C]92.2222[/C][C]9.6032[/C][/ROW]
[ROW][C]52[/C][C]-3.3211[/C][C]3[/C][C]2.8333[/C][C]81[/C][C]91.1[/C][C]9.5446[/C][/ROW]
[ROW][C]53[/C][C]-3.4832[/C][C]2.3333[/C][C]2.7879[/C][C]49[/C][C]87.2727[/C][C]9.342[/C][/ROW]
[ROW][C]54[/C][C]-3.6381[/C][C]2.3333[/C][C]2.75[/C][C]49[/C][C]84.0833[/C][C]9.1697[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=169229&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=169229&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
43-1.05020.33330100
44-1.485221.16673618.54.3012
45-1.819121.44443624.33334.9329
46-2.10051.33331.41671622.254.717
47-2.34843.66671.8667121426.4807
48-2.572532.05568148.56.9642
49-2.77864.33332.38116965.71438.1064
50-2.97055.66672.791728993.6259.676
51-3.150732.81488192.22229.6032
52-3.321132.83338191.19.5446
53-3.48322.33332.78794987.27279.342
54-3.63812.33332.754984.08339.1697



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