Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationWed, 12 Dec 2007 10:17:43 -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/12/t1197479024by9bg9nu2brckxf.htm/, Retrieved Thu, 02 May 2024 19:31:09 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3252, Retrieved Thu, 02 May 2024 19:31:09 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsKlaas Van Pelt
Estimated Impact182
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Forecasting] [2007-12-12 17:17:43] [6abd901c2e17b7d5559c695bbff3d863] [Current]
Feedback Forum

Post a new message
Dataseries X:
99,9
99,9
99,9
99,9
99,9
99,7
99,6
99,5
100,6
100,2
100,1
100,2
99,1
99,5
99,5
99,6
99,5
99,6
99,8
99,9
100,5
100,5
100,5
100,5
99,5
99,9
100,4
99,6
99,5
99,6
98,4
99,9
100,3
100,3
101,3
101
99,7
99,4
99,9
100,7
99,8
98,8
99,6
99,1
100,3
100,5
100,8
100,6
99,1
98,8
99
99,9
99,5
99,2
99,6
100,1
99,8
101,6
101,7
101,9
100
102
102
102,9
102,7
102,7
102,7
102,7
102,6
102,6
102,5
102,5
102,1
103,5
103,2
102,1
103,8
104
103,9
104,1




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001

\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 & 3 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ 193.190.124.10:1001 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3252&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]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ 193.190.124.10:1001[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3252&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3252&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 time3 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001







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[68])
56100.1-------
5799.8-------
58101.6-------
59101.7-------
60101.9-------
61100-------
62102-------
63102-------
64102.9-------
65102.7-------
66102.7-------
67102.7-------
68102.7-------
69102.6103.2335102.0738104.39320.14220.816410.8164
70102.6103.9451102.6097105.28040.02420.97580.99970.9662
71102.5104.2093102.7189105.69980.01230.98280.99950.9764
72102.5104.1988102.5679105.82960.02060.97940.99710.9642
73102.1102.6802100.9203104.44010.25910.57950.99860.4912
74103.5103.3967101.5168105.27660.45710.91180.92730.7662
75103.2103.5701101.5774105.56280.35790.52750.93870.804
76102.1104.1795102.0801106.2790.02610.81980.88390.9164
77103.8103.8537101.6526106.05470.48090.94080.84790.8479
78104103.6357101.3375105.93380.3780.44430.78760.7876
79103.9103.7421101.3508106.13340.44850.41630.80350.8035
80104.1103.9362101.4552106.41710.44850.51140.83560.8356

\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[68]) \tabularnewline
56 & 100.1 & - & - & - & - & - & - & - \tabularnewline
57 & 99.8 & - & - & - & - & - & - & - \tabularnewline
58 & 101.6 & - & - & - & - & - & - & - \tabularnewline
59 & 101.7 & - & - & - & - & - & - & - \tabularnewline
60 & 101.9 & - & - & - & - & - & - & - \tabularnewline
61 & 100 & - & - & - & - & - & - & - \tabularnewline
62 & 102 & - & - & - & - & - & - & - \tabularnewline
63 & 102 & - & - & - & - & - & - & - \tabularnewline
64 & 102.9 & - & - & - & - & - & - & - \tabularnewline
65 & 102.7 & - & - & - & - & - & - & - \tabularnewline
66 & 102.7 & - & - & - & - & - & - & - \tabularnewline
67 & 102.7 & - & - & - & - & - & - & - \tabularnewline
68 & 102.7 & - & - & - & - & - & - & - \tabularnewline
69 & 102.6 & 103.2335 & 102.0738 & 104.3932 & 0.1422 & 0.8164 & 1 & 0.8164 \tabularnewline
70 & 102.6 & 103.9451 & 102.6097 & 105.2804 & 0.0242 & 0.9758 & 0.9997 & 0.9662 \tabularnewline
71 & 102.5 & 104.2093 & 102.7189 & 105.6998 & 0.0123 & 0.9828 & 0.9995 & 0.9764 \tabularnewline
72 & 102.5 & 104.1988 & 102.5679 & 105.8296 & 0.0206 & 0.9794 & 0.9971 & 0.9642 \tabularnewline
73 & 102.1 & 102.6802 & 100.9203 & 104.4401 & 0.2591 & 0.5795 & 0.9986 & 0.4912 \tabularnewline
74 & 103.5 & 103.3967 & 101.5168 & 105.2766 & 0.4571 & 0.9118 & 0.9273 & 0.7662 \tabularnewline
75 & 103.2 & 103.5701 & 101.5774 & 105.5628 & 0.3579 & 0.5275 & 0.9387 & 0.804 \tabularnewline
76 & 102.1 & 104.1795 & 102.0801 & 106.279 & 0.0261 & 0.8198 & 0.8839 & 0.9164 \tabularnewline
77 & 103.8 & 103.8537 & 101.6526 & 106.0547 & 0.4809 & 0.9408 & 0.8479 & 0.8479 \tabularnewline
78 & 104 & 103.6357 & 101.3375 & 105.9338 & 0.378 & 0.4443 & 0.7876 & 0.7876 \tabularnewline
79 & 103.9 & 103.7421 & 101.3508 & 106.1334 & 0.4485 & 0.4163 & 0.8035 & 0.8035 \tabularnewline
80 & 104.1 & 103.9362 & 101.4552 & 106.4171 & 0.4485 & 0.5114 & 0.8356 & 0.8356 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3252&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[68])[/C][/ROW]
[ROW][C]56[/C][C]100.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]99.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]101.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]101.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]101.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]100[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]102[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]102[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]102.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]65[/C][C]102.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]66[/C][C]102.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]67[/C][C]102.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]68[/C][C]102.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]102.6[/C][C]103.2335[/C][C]102.0738[/C][C]104.3932[/C][C]0.1422[/C][C]0.8164[/C][C]1[/C][C]0.8164[/C][/ROW]
[ROW][C]70[/C][C]102.6[/C][C]103.9451[/C][C]102.6097[/C][C]105.2804[/C][C]0.0242[/C][C]0.9758[/C][C]0.9997[/C][C]0.9662[/C][/ROW]
[ROW][C]71[/C][C]102.5[/C][C]104.2093[/C][C]102.7189[/C][C]105.6998[/C][C]0.0123[/C][C]0.9828[/C][C]0.9995[/C][C]0.9764[/C][/ROW]
[ROW][C]72[/C][C]102.5[/C][C]104.1988[/C][C]102.5679[/C][C]105.8296[/C][C]0.0206[/C][C]0.9794[/C][C]0.9971[/C][C]0.9642[/C][/ROW]
[ROW][C]73[/C][C]102.1[/C][C]102.6802[/C][C]100.9203[/C][C]104.4401[/C][C]0.2591[/C][C]0.5795[/C][C]0.9986[/C][C]0.4912[/C][/ROW]
[ROW][C]74[/C][C]103.5[/C][C]103.3967[/C][C]101.5168[/C][C]105.2766[/C][C]0.4571[/C][C]0.9118[/C][C]0.9273[/C][C]0.7662[/C][/ROW]
[ROW][C]75[/C][C]103.2[/C][C]103.5701[/C][C]101.5774[/C][C]105.5628[/C][C]0.3579[/C][C]0.5275[/C][C]0.9387[/C][C]0.804[/C][/ROW]
[ROW][C]76[/C][C]102.1[/C][C]104.1795[/C][C]102.0801[/C][C]106.279[/C][C]0.0261[/C][C]0.8198[/C][C]0.8839[/C][C]0.9164[/C][/ROW]
[ROW][C]77[/C][C]103.8[/C][C]103.8537[/C][C]101.6526[/C][C]106.0547[/C][C]0.4809[/C][C]0.9408[/C][C]0.8479[/C][C]0.8479[/C][/ROW]
[ROW][C]78[/C][C]104[/C][C]103.6357[/C][C]101.3375[/C][C]105.9338[/C][C]0.378[/C][C]0.4443[/C][C]0.7876[/C][C]0.7876[/C][/ROW]
[ROW][C]79[/C][C]103.9[/C][C]103.7421[/C][C]101.3508[/C][C]106.1334[/C][C]0.4485[/C][C]0.4163[/C][C]0.8035[/C][C]0.8035[/C][/ROW]
[ROW][C]80[/C][C]104.1[/C][C]103.9362[/C][C]101.4552[/C][C]106.4171[/C][C]0.4485[/C][C]0.5114[/C][C]0.8356[/C][C]0.8356[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3252&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3252&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[68])
56100.1-------
5799.8-------
58101.6-------
59101.7-------
60101.9-------
61100-------
62102-------
63102-------
64102.9-------
65102.7-------
66102.7-------
67102.7-------
68102.7-------
69102.6103.2335102.0738104.39320.14220.816410.8164
70102.6103.9451102.6097105.28040.02420.97580.99970.9662
71102.5104.2093102.7189105.69980.01230.98280.99950.9764
72102.5104.1988102.5679105.82960.02060.97940.99710.9642
73102.1102.6802100.9203104.44010.25910.57950.99860.4912
74103.5103.3967101.5168105.27660.45710.91180.92730.7662
75103.2103.5701101.5774105.56280.35790.52750.93870.804
76102.1104.1795102.0801106.2790.02610.81980.88390.9164
77103.8103.8537101.6526106.05470.48090.94080.84790.8479
78104103.6357101.3375105.93380.3780.44430.78760.7876
79103.9103.7421101.3508106.13340.44850.41630.80350.8035
80104.1103.9362101.4552106.41710.44850.51140.83560.8356







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
690.0057-0.00615e-040.40130.03340.1829
700.0066-0.01290.00111.80920.15080.3883
710.0073-0.01640.00142.92190.24350.4934
720.008-0.01630.00142.88580.24050.4904
730.0087-0.00575e-040.33660.02810.1675
740.00930.0011e-040.01079e-040.0298
750.0098-0.00363e-040.1370.01140.1068
760.0103-0.020.00174.32450.36040.6003
770.0108-5e-0400.00292e-040.0155
780.01130.00353e-040.13270.01110.1052
790.01180.00151e-040.02490.00210.0456
800.01220.00161e-040.02680.00220.0473

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
69 & 0.0057 & -0.0061 & 5e-04 & 0.4013 & 0.0334 & 0.1829 \tabularnewline
70 & 0.0066 & -0.0129 & 0.0011 & 1.8092 & 0.1508 & 0.3883 \tabularnewline
71 & 0.0073 & -0.0164 & 0.0014 & 2.9219 & 0.2435 & 0.4934 \tabularnewline
72 & 0.008 & -0.0163 & 0.0014 & 2.8858 & 0.2405 & 0.4904 \tabularnewline
73 & 0.0087 & -0.0057 & 5e-04 & 0.3366 & 0.0281 & 0.1675 \tabularnewline
74 & 0.0093 & 0.001 & 1e-04 & 0.0107 & 9e-04 & 0.0298 \tabularnewline
75 & 0.0098 & -0.0036 & 3e-04 & 0.137 & 0.0114 & 0.1068 \tabularnewline
76 & 0.0103 & -0.02 & 0.0017 & 4.3245 & 0.3604 & 0.6003 \tabularnewline
77 & 0.0108 & -5e-04 & 0 & 0.0029 & 2e-04 & 0.0155 \tabularnewline
78 & 0.0113 & 0.0035 & 3e-04 & 0.1327 & 0.0111 & 0.1052 \tabularnewline
79 & 0.0118 & 0.0015 & 1e-04 & 0.0249 & 0.0021 & 0.0456 \tabularnewline
80 & 0.0122 & 0.0016 & 1e-04 & 0.0268 & 0.0022 & 0.0473 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3252&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]69[/C][C]0.0057[/C][C]-0.0061[/C][C]5e-04[/C][C]0.4013[/C][C]0.0334[/C][C]0.1829[/C][/ROW]
[ROW][C]70[/C][C]0.0066[/C][C]-0.0129[/C][C]0.0011[/C][C]1.8092[/C][C]0.1508[/C][C]0.3883[/C][/ROW]
[ROW][C]71[/C][C]0.0073[/C][C]-0.0164[/C][C]0.0014[/C][C]2.9219[/C][C]0.2435[/C][C]0.4934[/C][/ROW]
[ROW][C]72[/C][C]0.008[/C][C]-0.0163[/C][C]0.0014[/C][C]2.8858[/C][C]0.2405[/C][C]0.4904[/C][/ROW]
[ROW][C]73[/C][C]0.0087[/C][C]-0.0057[/C][C]5e-04[/C][C]0.3366[/C][C]0.0281[/C][C]0.1675[/C][/ROW]
[ROW][C]74[/C][C]0.0093[/C][C]0.001[/C][C]1e-04[/C][C]0.0107[/C][C]9e-04[/C][C]0.0298[/C][/ROW]
[ROW][C]75[/C][C]0.0098[/C][C]-0.0036[/C][C]3e-04[/C][C]0.137[/C][C]0.0114[/C][C]0.1068[/C][/ROW]
[ROW][C]76[/C][C]0.0103[/C][C]-0.02[/C][C]0.0017[/C][C]4.3245[/C][C]0.3604[/C][C]0.6003[/C][/ROW]
[ROW][C]77[/C][C]0.0108[/C][C]-5e-04[/C][C]0[/C][C]0.0029[/C][C]2e-04[/C][C]0.0155[/C][/ROW]
[ROW][C]78[/C][C]0.0113[/C][C]0.0035[/C][C]3e-04[/C][C]0.1327[/C][C]0.0111[/C][C]0.1052[/C][/ROW]
[ROW][C]79[/C][C]0.0118[/C][C]0.0015[/C][C]1e-04[/C][C]0.0249[/C][C]0.0021[/C][C]0.0456[/C][/ROW]
[ROW][C]80[/C][C]0.0122[/C][C]0.0016[/C][C]1e-04[/C][C]0.0268[/C][C]0.0022[/C][C]0.0473[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3252&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3252&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
690.0057-0.00615e-040.40130.03340.1829
700.0066-0.01290.00111.80920.15080.3883
710.0073-0.01640.00142.92190.24350.4934
720.008-0.01630.00142.88580.24050.4904
730.0087-0.00575e-040.33660.02810.1675
740.00930.0011e-040.01079e-040.0298
750.0098-0.00363e-040.1370.01140.1068
760.0103-0.020.00174.32450.36040.6003
770.0108-5e-0400.00292e-040.0155
780.01130.00353e-040.13270.01110.1052
790.01180.00151e-040.02490.00210.0456
800.01220.00161e-040.02680.00220.0473



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