Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationSat, 19 Dec 2009 09:47:40 -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/t1261241318xa3j9pp9yljboed.htm/, Retrieved Sun, 10 Nov 2024 19:48:01 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=69700, Retrieved Sun, 10 Nov 2024 19:48:01 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact127
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2009-12-19 16:47:40] [e24e91da8d334fb8882bf413603fde71] [Current]
Feedback Forum

Post a new message
Dataseries X:
104.7
86
92.1
106.9
112.6
101.7
92
97.4
97
105.4
102.7
98.1
104.5
87.4
89.9
109.8
111.7
98.6
96.9
95.1
97
112.7
102.9
97.4
111.4
87.4
96.8
114.1
110.3
103.9
101.6
94.6
95.9
104.7
102.8
98.1
113.9
80.9
95.7
113.2
105.9
108.8
102.3
99
100.7
115.5
100.7
109.9
114.6
85.4
100.5
114.8
116.5
112.9
102
106
105.3
118.8
106.1
109.3
117.2
92.5
104.2
112.5
122.4
113.3
100
110.7
112.8
109.8
117.3
109.1
115.9
96
99.8
116.8
115.7
99.4
94.3
91
93.2
103.1
94.1
91.8
102.7
82.6
89.1




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 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 & 4 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69700&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]4 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=69700&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69700&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 time4 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[75])
63104.2-------
64112.5-------
65122.4-------
66113.3-------
67100-------
68110.7-------
69112.8-------
70109.8-------
71117.3-------
72109.1-------
73115.9-------
7496-------
7599.8-------
76116.8116.8022110.7288122.87560.499710.91751
77115.7119.3436113.2686125.41860.11990.79410.1621
7899.4109.2831102.8882115.6780.00120.02460.10910.9982
7994.3103.990496.4826111.49820.00570.88460.85120.863
8091104.940297.4276112.45281e-040.99720.06650.91
8193.2105.826497.8718113.7819e-040.99990.04290.9312
82103.1112.8505104.4731121.22790.011310.76230.9989
8394.1111.2423102.8077119.67700.97080.07960.9961
8491.8106.81697.9939115.6384e-040.99760.30590.9405
85102.7115.974106.9675124.98050.001910.50640.9998
8682.691.81182.6873100.93460.02390.00970.18410.0431
8789.199.714490.2965109.13230.01360.99980.49290.4929

\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[75]) \tabularnewline
63 & 104.2 & - & - & - & - & - & - & - \tabularnewline
64 & 112.5 & - & - & - & - & - & - & - \tabularnewline
65 & 122.4 & - & - & - & - & - & - & - \tabularnewline
66 & 113.3 & - & - & - & - & - & - & - \tabularnewline
67 & 100 & - & - & - & - & - & - & - \tabularnewline
68 & 110.7 & - & - & - & - & - & - & - \tabularnewline
69 & 112.8 & - & - & - & - & - & - & - \tabularnewline
70 & 109.8 & - & - & - & - & - & - & - \tabularnewline
71 & 117.3 & - & - & - & - & - & - & - \tabularnewline
72 & 109.1 & - & - & - & - & - & - & - \tabularnewline
73 & 115.9 & - & - & - & - & - & - & - \tabularnewline
74 & 96 & - & - & - & - & - & - & - \tabularnewline
75 & 99.8 & - & - & - & - & - & - & - \tabularnewline
76 & 116.8 & 116.8022 & 110.7288 & 122.8756 & 0.4997 & 1 & 0.9175 & 1 \tabularnewline
77 & 115.7 & 119.3436 & 113.2686 & 125.4186 & 0.1199 & 0.7941 & 0.162 & 1 \tabularnewline
78 & 99.4 & 109.2831 & 102.8882 & 115.678 & 0.0012 & 0.0246 & 0.1091 & 0.9982 \tabularnewline
79 & 94.3 & 103.9904 & 96.4826 & 111.4982 & 0.0057 & 0.8846 & 0.8512 & 0.863 \tabularnewline
80 & 91 & 104.9402 & 97.4276 & 112.4528 & 1e-04 & 0.9972 & 0.0665 & 0.91 \tabularnewline
81 & 93.2 & 105.8264 & 97.8718 & 113.781 & 9e-04 & 0.9999 & 0.0429 & 0.9312 \tabularnewline
82 & 103.1 & 112.8505 & 104.4731 & 121.2279 & 0.0113 & 1 & 0.7623 & 0.9989 \tabularnewline
83 & 94.1 & 111.2423 & 102.8077 & 119.677 & 0 & 0.9708 & 0.0796 & 0.9961 \tabularnewline
84 & 91.8 & 106.816 & 97.9939 & 115.638 & 4e-04 & 0.9976 & 0.3059 & 0.9405 \tabularnewline
85 & 102.7 & 115.974 & 106.9675 & 124.9805 & 0.0019 & 1 & 0.5064 & 0.9998 \tabularnewline
86 & 82.6 & 91.811 & 82.6873 & 100.9346 & 0.0239 & 0.0097 & 0.1841 & 0.0431 \tabularnewline
87 & 89.1 & 99.7144 & 90.2965 & 109.1323 & 0.0136 & 0.9998 & 0.4929 & 0.4929 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69700&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[75])[/C][/ROW]
[ROW][C]63[/C][C]104.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]112.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]65[/C][C]122.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]66[/C][C]113.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]67[/C][C]100[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]68[/C][C]110.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]112.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]70[/C][C]109.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]71[/C][C]117.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]72[/C][C]109.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]115.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]74[/C][C]96[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]75[/C][C]99.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]76[/C][C]116.8[/C][C]116.8022[/C][C]110.7288[/C][C]122.8756[/C][C]0.4997[/C][C]1[/C][C]0.9175[/C][C]1[/C][/ROW]
[ROW][C]77[/C][C]115.7[/C][C]119.3436[/C][C]113.2686[/C][C]125.4186[/C][C]0.1199[/C][C]0.7941[/C][C]0.162[/C][C]1[/C][/ROW]
[ROW][C]78[/C][C]99.4[/C][C]109.2831[/C][C]102.8882[/C][C]115.678[/C][C]0.0012[/C][C]0.0246[/C][C]0.1091[/C][C]0.9982[/C][/ROW]
[ROW][C]79[/C][C]94.3[/C][C]103.9904[/C][C]96.4826[/C][C]111.4982[/C][C]0.0057[/C][C]0.8846[/C][C]0.8512[/C][C]0.863[/C][/ROW]
[ROW][C]80[/C][C]91[/C][C]104.9402[/C][C]97.4276[/C][C]112.4528[/C][C]1e-04[/C][C]0.9972[/C][C]0.0665[/C][C]0.91[/C][/ROW]
[ROW][C]81[/C][C]93.2[/C][C]105.8264[/C][C]97.8718[/C][C]113.781[/C][C]9e-04[/C][C]0.9999[/C][C]0.0429[/C][C]0.9312[/C][/ROW]
[ROW][C]82[/C][C]103.1[/C][C]112.8505[/C][C]104.4731[/C][C]121.2279[/C][C]0.0113[/C][C]1[/C][C]0.7623[/C][C]0.9989[/C][/ROW]
[ROW][C]83[/C][C]94.1[/C][C]111.2423[/C][C]102.8077[/C][C]119.677[/C][C]0[/C][C]0.9708[/C][C]0.0796[/C][C]0.9961[/C][/ROW]
[ROW][C]84[/C][C]91.8[/C][C]106.816[/C][C]97.9939[/C][C]115.638[/C][C]4e-04[/C][C]0.9976[/C][C]0.3059[/C][C]0.9405[/C][/ROW]
[ROW][C]85[/C][C]102.7[/C][C]115.974[/C][C]106.9675[/C][C]124.9805[/C][C]0.0019[/C][C]1[/C][C]0.5064[/C][C]0.9998[/C][/ROW]
[ROW][C]86[/C][C]82.6[/C][C]91.811[/C][C]82.6873[/C][C]100.9346[/C][C]0.0239[/C][C]0.0097[/C][C]0.1841[/C][C]0.0431[/C][/ROW]
[ROW][C]87[/C][C]89.1[/C][C]99.7144[/C][C]90.2965[/C][C]109.1323[/C][C]0.0136[/C][C]0.9998[/C][C]0.4929[/C][C]0.4929[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69700&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69700&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[75])
63104.2-------
64112.5-------
65122.4-------
66113.3-------
67100-------
68110.7-------
69112.8-------
70109.8-------
71117.3-------
72109.1-------
73115.9-------
7496-------
7599.8-------
76116.8116.8022110.7288122.87560.499710.91751
77115.7119.3436113.2686125.41860.11990.79410.1621
7899.4109.2831102.8882115.6780.00120.02460.10910.9982
7994.3103.990496.4826111.49820.00570.88460.85120.863
8091104.940297.4276112.45281e-040.99720.06650.91
8193.2105.826497.8718113.7819e-040.99990.04290.9312
82103.1112.8505104.4731121.22790.011310.76230.9989
8394.1111.2423102.8077119.67700.97080.07960.9961
8491.8106.81697.9939115.6384e-040.99760.30590.9405
85102.7115.974106.9675124.98050.001910.50640.9998
8682.691.81182.6873100.93460.02390.00970.18410.0431
8789.199.714490.2965109.13230.01360.99980.49290.4929







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
760.026500000
770.026-0.03050.015313.27566.63782.5764
780.0299-0.09040.040397.674936.98356.0814
790.0368-0.09320.053593.903451.21357.1564
800.0365-0.13280.0694194.328579.83658.9351
810.0384-0.11930.0777159.425193.10139.6489
820.0379-0.08640.07995.072293.38289.6635
830.0387-0.15410.0884293.8601118.442510.8831
840.0421-0.14060.0942225.4792130.335511.4165
850.0396-0.11450.0962176.199134.921811.6156
860.0507-0.10030.096684.8418130.369111.4179
870.0482-0.10640.0974112.6655128.893811.3531

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
76 & 0.0265 & 0 & 0 & 0 & 0 & 0 \tabularnewline
77 & 0.026 & -0.0305 & 0.0153 & 13.2756 & 6.6378 & 2.5764 \tabularnewline
78 & 0.0299 & -0.0904 & 0.0403 & 97.6749 & 36.9835 & 6.0814 \tabularnewline
79 & 0.0368 & -0.0932 & 0.0535 & 93.9034 & 51.2135 & 7.1564 \tabularnewline
80 & 0.0365 & -0.1328 & 0.0694 & 194.3285 & 79.8365 & 8.9351 \tabularnewline
81 & 0.0384 & -0.1193 & 0.0777 & 159.4251 & 93.1013 & 9.6489 \tabularnewline
82 & 0.0379 & -0.0864 & 0.079 & 95.0722 & 93.3828 & 9.6635 \tabularnewline
83 & 0.0387 & -0.1541 & 0.0884 & 293.8601 & 118.4425 & 10.8831 \tabularnewline
84 & 0.0421 & -0.1406 & 0.0942 & 225.4792 & 130.3355 & 11.4165 \tabularnewline
85 & 0.0396 & -0.1145 & 0.0962 & 176.199 & 134.9218 & 11.6156 \tabularnewline
86 & 0.0507 & -0.1003 & 0.0966 & 84.8418 & 130.3691 & 11.4179 \tabularnewline
87 & 0.0482 & -0.1064 & 0.0974 & 112.6655 & 128.8938 & 11.3531 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69700&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]76[/C][C]0.0265[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]77[/C][C]0.026[/C][C]-0.0305[/C][C]0.0153[/C][C]13.2756[/C][C]6.6378[/C][C]2.5764[/C][/ROW]
[ROW][C]78[/C][C]0.0299[/C][C]-0.0904[/C][C]0.0403[/C][C]97.6749[/C][C]36.9835[/C][C]6.0814[/C][/ROW]
[ROW][C]79[/C][C]0.0368[/C][C]-0.0932[/C][C]0.0535[/C][C]93.9034[/C][C]51.2135[/C][C]7.1564[/C][/ROW]
[ROW][C]80[/C][C]0.0365[/C][C]-0.1328[/C][C]0.0694[/C][C]194.3285[/C][C]79.8365[/C][C]8.9351[/C][/ROW]
[ROW][C]81[/C][C]0.0384[/C][C]-0.1193[/C][C]0.0777[/C][C]159.4251[/C][C]93.1013[/C][C]9.6489[/C][/ROW]
[ROW][C]82[/C][C]0.0379[/C][C]-0.0864[/C][C]0.079[/C][C]95.0722[/C][C]93.3828[/C][C]9.6635[/C][/ROW]
[ROW][C]83[/C][C]0.0387[/C][C]-0.1541[/C][C]0.0884[/C][C]293.8601[/C][C]118.4425[/C][C]10.8831[/C][/ROW]
[ROW][C]84[/C][C]0.0421[/C][C]-0.1406[/C][C]0.0942[/C][C]225.4792[/C][C]130.3355[/C][C]11.4165[/C][/ROW]
[ROW][C]85[/C][C]0.0396[/C][C]-0.1145[/C][C]0.0962[/C][C]176.199[/C][C]134.9218[/C][C]11.6156[/C][/ROW]
[ROW][C]86[/C][C]0.0507[/C][C]-0.1003[/C][C]0.0966[/C][C]84.8418[/C][C]130.3691[/C][C]11.4179[/C][/ROW]
[ROW][C]87[/C][C]0.0482[/C][C]-0.1064[/C][C]0.0974[/C][C]112.6655[/C][C]128.8938[/C][C]11.3531[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69700&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69700&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
760.026500000
770.026-0.03050.015313.27566.63782.5764
780.0299-0.09040.040397.674936.98356.0814
790.0368-0.09320.053593.903451.21357.1564
800.0365-0.13280.0694194.328579.83658.9351
810.0384-0.11930.0777159.425193.10139.6489
820.0379-0.08640.07995.072293.38289.6635
830.0387-0.15410.0884293.8601118.442510.8831
840.0421-0.14060.0942225.4792130.335511.4165
850.0396-0.11450.0962176.199134.921811.6156
860.0507-0.10030.096684.8418130.369111.4179
870.0482-0.10640.0974112.6655128.893811.3531



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