Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationMon, 10 Dec 2007 12:56:00 -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/2007/Dec/10/t11973159924hx84anmfw0g7sr.htm/, Retrieved Mon, 06 May 2024 21:57:33 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3031, Retrieved Mon, 06 May 2024 21:57:33 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact203
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [W9] [2007-12-10 19:56:00] [3463f71ebce131edf0c83e066f45702c] [Current]
Feedback Forum

Post a new message
Dataseries X:
8,5
8,5
8,5
8,4
8,5
8,5
8,3
8,4
8,4
8,4
8,4
8,4
8,5
8,5
8,5
8,5
8,5
8,5
8,3
8,3
8,4
8,2
8,2
8,1
8,1
8
7,8
7,9
7,8
7,7
7,9
7,8
7,7
7,7
7,6
7,5




Summary of compuational 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 compuational 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=3031&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]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=3031&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3031&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 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[24])
128.4-------
138.5-------
148.5-------
158.5-------
168.5-------
178.5-------
188.5-------
198.3-------
208.3-------
218.4-------
228.2-------
238.2-------
248.1-------
258.18.22658.06388.39240.06760.93246e-040.9324
2688.22658.02568.43230.01550.88570.00460.8857
277.88.22657.99388.46592e-040.96810.01260.8497
287.98.23777.97698.50710.0070.99930.02820.8419
297.88.22657.9418.52210.00240.98480.03490.799
307.78.22657.91828.54686e-040.99550.04710.7805
317.98.03297.71118.36810.21850.97420.05910.3474
327.88.02187.68118.37750.11090.74880.06260.3332
337.78.12977.7668.51040.01350.95520.0820.5607
347.77.9147.54288.30340.14070.85930.0750.1746
357.67.9147.52668.32130.06540.84840.08440.1854
367.57.80647.40898.22520.07580.83290.08470.0847

\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[24]) \tabularnewline
12 & 8.4 & - & - & - & - & - & - & - \tabularnewline
13 & 8.5 & - & - & - & - & - & - & - \tabularnewline
14 & 8.5 & - & - & - & - & - & - & - \tabularnewline
15 & 8.5 & - & - & - & - & - & - & - \tabularnewline
16 & 8.5 & - & - & - & - & - & - & - \tabularnewline
17 & 8.5 & - & - & - & - & - & - & - \tabularnewline
18 & 8.5 & - & - & - & - & - & - & - \tabularnewline
19 & 8.3 & - & - & - & - & - & - & - \tabularnewline
20 & 8.3 & - & - & - & - & - & - & - \tabularnewline
21 & 8.4 & - & - & - & - & - & - & - \tabularnewline
22 & 8.2 & - & - & - & - & - & - & - \tabularnewline
23 & 8.2 & - & - & - & - & - & - & - \tabularnewline
24 & 8.1 & - & - & - & - & - & - & - \tabularnewline
25 & 8.1 & 8.2265 & 8.0638 & 8.3924 & 0.0676 & 0.9324 & 6e-04 & 0.9324 \tabularnewline
26 & 8 & 8.2265 & 8.0256 & 8.4323 & 0.0155 & 0.8857 & 0.0046 & 0.8857 \tabularnewline
27 & 7.8 & 8.2265 & 7.9938 & 8.4659 & 2e-04 & 0.9681 & 0.0126 & 0.8497 \tabularnewline
28 & 7.9 & 8.2377 & 7.9769 & 8.5071 & 0.007 & 0.9993 & 0.0282 & 0.8419 \tabularnewline
29 & 7.8 & 8.2265 & 7.941 & 8.5221 & 0.0024 & 0.9848 & 0.0349 & 0.799 \tabularnewline
30 & 7.7 & 8.2265 & 7.9182 & 8.5468 & 6e-04 & 0.9955 & 0.0471 & 0.7805 \tabularnewline
31 & 7.9 & 8.0329 & 7.7111 & 8.3681 & 0.2185 & 0.9742 & 0.0591 & 0.3474 \tabularnewline
32 & 7.8 & 8.0218 & 7.6811 & 8.3775 & 0.1109 & 0.7488 & 0.0626 & 0.3332 \tabularnewline
33 & 7.7 & 8.1297 & 7.766 & 8.5104 & 0.0135 & 0.9552 & 0.082 & 0.5607 \tabularnewline
34 & 7.7 & 7.914 & 7.5428 & 8.3034 & 0.1407 & 0.8593 & 0.075 & 0.1746 \tabularnewline
35 & 7.6 & 7.914 & 7.5266 & 8.3213 & 0.0654 & 0.8484 & 0.0844 & 0.1854 \tabularnewline
36 & 7.5 & 7.8064 & 7.4089 & 8.2252 & 0.0758 & 0.8329 & 0.0847 & 0.0847 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3031&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[24])[/C][/ROW]
[ROW][C]12[/C][C]8.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]13[/C][C]8.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]14[/C][C]8.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]15[/C][C]8.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]16[/C][C]8.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]17[/C][C]8.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]18[/C][C]8.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]19[/C][C]8.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]20[/C][C]8.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]21[/C][C]8.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]22[/C][C]8.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]23[/C][C]8.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]24[/C][C]8.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]25[/C][C]8.1[/C][C]8.2265[/C][C]8.0638[/C][C]8.3924[/C][C]0.0676[/C][C]0.9324[/C][C]6e-04[/C][C]0.9324[/C][/ROW]
[ROW][C]26[/C][C]8[/C][C]8.2265[/C][C]8.0256[/C][C]8.4323[/C][C]0.0155[/C][C]0.8857[/C][C]0.0046[/C][C]0.8857[/C][/ROW]
[ROW][C]27[/C][C]7.8[/C][C]8.2265[/C][C]7.9938[/C][C]8.4659[/C][C]2e-04[/C][C]0.9681[/C][C]0.0126[/C][C]0.8497[/C][/ROW]
[ROW][C]28[/C][C]7.9[/C][C]8.2377[/C][C]7.9769[/C][C]8.5071[/C][C]0.007[/C][C]0.9993[/C][C]0.0282[/C][C]0.8419[/C][/ROW]
[ROW][C]29[/C][C]7.8[/C][C]8.2265[/C][C]7.941[/C][C]8.5221[/C][C]0.0024[/C][C]0.9848[/C][C]0.0349[/C][C]0.799[/C][/ROW]
[ROW][C]30[/C][C]7.7[/C][C]8.2265[/C][C]7.9182[/C][C]8.5468[/C][C]6e-04[/C][C]0.9955[/C][C]0.0471[/C][C]0.7805[/C][/ROW]
[ROW][C]31[/C][C]7.9[/C][C]8.0329[/C][C]7.7111[/C][C]8.3681[/C][C]0.2185[/C][C]0.9742[/C][C]0.0591[/C][C]0.3474[/C][/ROW]
[ROW][C]32[/C][C]7.8[/C][C]8.0218[/C][C]7.6811[/C][C]8.3775[/C][C]0.1109[/C][C]0.7488[/C][C]0.0626[/C][C]0.3332[/C][/ROW]
[ROW][C]33[/C][C]7.7[/C][C]8.1297[/C][C]7.766[/C][C]8.5104[/C][C]0.0135[/C][C]0.9552[/C][C]0.082[/C][C]0.5607[/C][/ROW]
[ROW][C]34[/C][C]7.7[/C][C]7.914[/C][C]7.5428[/C][C]8.3034[/C][C]0.1407[/C][C]0.8593[/C][C]0.075[/C][C]0.1746[/C][/ROW]
[ROW][C]35[/C][C]7.6[/C][C]7.914[/C][C]7.5266[/C][C]8.3213[/C][C]0.0654[/C][C]0.8484[/C][C]0.0844[/C][C]0.1854[/C][/ROW]
[ROW][C]36[/C][C]7.5[/C][C]7.8064[/C][C]7.4089[/C][C]8.2252[/C][C]0.0758[/C][C]0.8329[/C][C]0.0847[/C][C]0.0847[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3031&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3031&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[24])
128.4-------
138.5-------
148.5-------
158.5-------
168.5-------
178.5-------
188.5-------
198.3-------
208.3-------
218.4-------
228.2-------
238.2-------
248.1-------
258.18.22658.06388.39240.06760.93246e-040.9324
2688.22658.02568.43230.01550.88570.00460.8857
277.88.22657.99388.46592e-040.96810.01260.8497
287.98.23777.97698.50710.0070.99930.02820.8419
297.88.22657.9418.52210.00240.98480.03490.799
307.78.22657.91828.54686e-040.99550.04710.7805
317.98.03297.71118.36810.21850.97420.05910.3474
327.88.02187.68118.37750.11090.74880.06260.3332
337.78.12977.7668.51040.01350.95520.0820.5607
347.77.9147.54288.30340.14070.85930.0750.1746
357.67.9147.52668.32130.06540.84840.08440.1854
367.57.80647.40898.22520.07580.83290.08470.0847







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
250.0103-0.01540.00130.0160.00130.0365
260.0128-0.02750.00230.05130.00430.0654
270.0148-0.05180.00430.18190.01520.1231
280.0167-0.0410.00340.11410.00950.0975
290.0183-0.05180.00430.18190.01520.1231
300.0199-0.0640.00530.27720.02310.152
310.0213-0.01650.00140.01770.00150.0384
320.0226-0.02760.00230.04920.00410.064
330.0239-0.05290.00440.18460.01540.124
340.0251-0.0270.00230.04580.00380.0618
350.0263-0.03970.00330.09860.00820.0906
360.0274-0.03920.00330.09390.00780.0884

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
25 & 0.0103 & -0.0154 & 0.0013 & 0.016 & 0.0013 & 0.0365 \tabularnewline
26 & 0.0128 & -0.0275 & 0.0023 & 0.0513 & 0.0043 & 0.0654 \tabularnewline
27 & 0.0148 & -0.0518 & 0.0043 & 0.1819 & 0.0152 & 0.1231 \tabularnewline
28 & 0.0167 & -0.041 & 0.0034 & 0.1141 & 0.0095 & 0.0975 \tabularnewline
29 & 0.0183 & -0.0518 & 0.0043 & 0.1819 & 0.0152 & 0.1231 \tabularnewline
30 & 0.0199 & -0.064 & 0.0053 & 0.2772 & 0.0231 & 0.152 \tabularnewline
31 & 0.0213 & -0.0165 & 0.0014 & 0.0177 & 0.0015 & 0.0384 \tabularnewline
32 & 0.0226 & -0.0276 & 0.0023 & 0.0492 & 0.0041 & 0.064 \tabularnewline
33 & 0.0239 & -0.0529 & 0.0044 & 0.1846 & 0.0154 & 0.124 \tabularnewline
34 & 0.0251 & -0.027 & 0.0023 & 0.0458 & 0.0038 & 0.0618 \tabularnewline
35 & 0.0263 & -0.0397 & 0.0033 & 0.0986 & 0.0082 & 0.0906 \tabularnewline
36 & 0.0274 & -0.0392 & 0.0033 & 0.0939 & 0.0078 & 0.0884 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3031&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]25[/C][C]0.0103[/C][C]-0.0154[/C][C]0.0013[/C][C]0.016[/C][C]0.0013[/C][C]0.0365[/C][/ROW]
[ROW][C]26[/C][C]0.0128[/C][C]-0.0275[/C][C]0.0023[/C][C]0.0513[/C][C]0.0043[/C][C]0.0654[/C][/ROW]
[ROW][C]27[/C][C]0.0148[/C][C]-0.0518[/C][C]0.0043[/C][C]0.1819[/C][C]0.0152[/C][C]0.1231[/C][/ROW]
[ROW][C]28[/C][C]0.0167[/C][C]-0.041[/C][C]0.0034[/C][C]0.1141[/C][C]0.0095[/C][C]0.0975[/C][/ROW]
[ROW][C]29[/C][C]0.0183[/C][C]-0.0518[/C][C]0.0043[/C][C]0.1819[/C][C]0.0152[/C][C]0.1231[/C][/ROW]
[ROW][C]30[/C][C]0.0199[/C][C]-0.064[/C][C]0.0053[/C][C]0.2772[/C][C]0.0231[/C][C]0.152[/C][/ROW]
[ROW][C]31[/C][C]0.0213[/C][C]-0.0165[/C][C]0.0014[/C][C]0.0177[/C][C]0.0015[/C][C]0.0384[/C][/ROW]
[ROW][C]32[/C][C]0.0226[/C][C]-0.0276[/C][C]0.0023[/C][C]0.0492[/C][C]0.0041[/C][C]0.064[/C][/ROW]
[ROW][C]33[/C][C]0.0239[/C][C]-0.0529[/C][C]0.0044[/C][C]0.1846[/C][C]0.0154[/C][C]0.124[/C][/ROW]
[ROW][C]34[/C][C]0.0251[/C][C]-0.027[/C][C]0.0023[/C][C]0.0458[/C][C]0.0038[/C][C]0.0618[/C][/ROW]
[ROW][C]35[/C][C]0.0263[/C][C]-0.0397[/C][C]0.0033[/C][C]0.0986[/C][C]0.0082[/C][C]0.0906[/C][/ROW]
[ROW][C]36[/C][C]0.0274[/C][C]-0.0392[/C][C]0.0033[/C][C]0.0939[/C][C]0.0078[/C][C]0.0884[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3031&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3031&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
250.0103-0.01540.00130.0160.00130.0365
260.0128-0.02750.00230.05130.00430.0654
270.0148-0.05180.00430.18190.01520.1231
280.0167-0.0410.00340.11410.00950.0975
290.0183-0.05180.00430.18190.01520.1231
300.0199-0.0640.00530.27720.02310.152
310.0213-0.01650.00140.01770.00150.0384
320.0226-0.02760.00230.04920.00410.064
330.0239-0.05290.00440.18460.01540.124
340.0251-0.0270.00230.04580.00380.0618
350.0263-0.03970.00330.09860.00820.0906
360.0274-0.03920.00330.09390.00780.0884



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