Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationThu, 13 Dec 2007 03:40:08 -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/13/t1197541520e36zwdmln5mofjv.htm/, Retrieved Sun, 05 May 2024 12:00:10 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3413, Retrieved Sun, 05 May 2024 12:00:10 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsPaper G 29
Estimated Impact193
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Forecast Totaal] [2007-12-13 10:40:08] [7a600ca82a81f1b71fd92dcbb183f5b4] [Current]
Feedback Forum

Post a new message
Dataseries X:
153,4
159,5
157,4
169,1
172,6
161,7
159,2
157,4
153,9
144,8
142,2
140,1
143,4
153,3
166,9
170,6
182,8
170,3
156,6
155,2
154,7
151,6
152,1
153,2
149,5
149,7
144,3
140
137,8
132,2
128,9
123,1
120,4
122,8
126
124,5
120,6
114,7
111,7
109,1
108
107,7
99,9
103,7
103,4
103,4
104,7
105,8
105,3
103
103,8
103,4
105,8
101,4
97
94,3
96,6
97,1
95,7
96,9
97,4
95,3
93,6
91,5
93,1
91,7
94,3
93,9
90,9
88,3
91,3
91,7
92,4
92
95,6
95,8
96,4
99
107
109,7
116,2
115,9
113,8
112,6
113,7
115,9
110,3
111,3
113,4
108,2
104,8
106
110,9
115
118,4
121,4
128,8
131,7
141,7
142,9
139,4
134,7
125
113,6
111,5
108,5
112,3
116,6
115,5
120,1
132,9
128,1
129,3
132,5
131
124,9
120,8
122
122,1
127,4
135,2
137,3
135
136
138,4
134,7
138,4
133,9
133,6
141,2
151,8
155,4
156,6
161,6
160,7
156
159,5
168,7
169,9
169,9
185,9




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=3413&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=3413&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3413&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[129])
117120.8-------
118122-------
119122.1-------
120127.4-------
121135.2-------
122137.3-------
123135-------
124136-------
125138.4-------
126134.7-------
127138.4-------
128133.9-------
129133.6-------
130141.2134.0297125.4493143.19690.06260.53660.99490.5366
131151.8134.0297120.2644149.37060.01160.17980.93630.5219
132155.4134.0297116.7249153.89990.01750.03980.74340.5169
133156.6134.0297113.9025157.71350.03090.03850.46140.5142
134161.6134.0297111.5077161.10060.0230.05110.40640.5124
135160.7134.0297109.405164.19690.04160.03660.47490.5111
136156134.0297107.5179167.07870.09630.05690.45350.5102
137159.5134.0297105.7984169.79420.08140.11430.40540.5094
138168.7134.0297104.2137172.37610.03820.09650.48630.5088
139169.9134.0297102.7406174.84760.04250.0480.41690.5082
140169.9134.0297101.3618177.22610.05180.05180.50230.5078
141185.9134.0297100.0639179.52490.01270.06110.50740.5074

\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[129]) \tabularnewline
117 & 120.8 & - & - & - & - & - & - & - \tabularnewline
118 & 122 & - & - & - & - & - & - & - \tabularnewline
119 & 122.1 & - & - & - & - & - & - & - \tabularnewline
120 & 127.4 & - & - & - & - & - & - & - \tabularnewline
121 & 135.2 & - & - & - & - & - & - & - \tabularnewline
122 & 137.3 & - & - & - & - & - & - & - \tabularnewline
123 & 135 & - & - & - & - & - & - & - \tabularnewline
124 & 136 & - & - & - & - & - & - & - \tabularnewline
125 & 138.4 & - & - & - & - & - & - & - \tabularnewline
126 & 134.7 & - & - & - & - & - & - & - \tabularnewline
127 & 138.4 & - & - & - & - & - & - & - \tabularnewline
128 & 133.9 & - & - & - & - & - & - & - \tabularnewline
129 & 133.6 & - & - & - & - & - & - & - \tabularnewline
130 & 141.2 & 134.0297 & 125.4493 & 143.1969 & 0.0626 & 0.5366 & 0.9949 & 0.5366 \tabularnewline
131 & 151.8 & 134.0297 & 120.2644 & 149.3706 & 0.0116 & 0.1798 & 0.9363 & 0.5219 \tabularnewline
132 & 155.4 & 134.0297 & 116.7249 & 153.8999 & 0.0175 & 0.0398 & 0.7434 & 0.5169 \tabularnewline
133 & 156.6 & 134.0297 & 113.9025 & 157.7135 & 0.0309 & 0.0385 & 0.4614 & 0.5142 \tabularnewline
134 & 161.6 & 134.0297 & 111.5077 & 161.1006 & 0.023 & 0.0511 & 0.4064 & 0.5124 \tabularnewline
135 & 160.7 & 134.0297 & 109.405 & 164.1969 & 0.0416 & 0.0366 & 0.4749 & 0.5111 \tabularnewline
136 & 156 & 134.0297 & 107.5179 & 167.0787 & 0.0963 & 0.0569 & 0.4535 & 0.5102 \tabularnewline
137 & 159.5 & 134.0297 & 105.7984 & 169.7942 & 0.0814 & 0.1143 & 0.4054 & 0.5094 \tabularnewline
138 & 168.7 & 134.0297 & 104.2137 & 172.3761 & 0.0382 & 0.0965 & 0.4863 & 0.5088 \tabularnewline
139 & 169.9 & 134.0297 & 102.7406 & 174.8476 & 0.0425 & 0.048 & 0.4169 & 0.5082 \tabularnewline
140 & 169.9 & 134.0297 & 101.3618 & 177.2261 & 0.0518 & 0.0518 & 0.5023 & 0.5078 \tabularnewline
141 & 185.9 & 134.0297 & 100.0639 & 179.5249 & 0.0127 & 0.0611 & 0.5074 & 0.5074 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3413&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[129])[/C][/ROW]
[ROW][C]117[/C][C]120.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]118[/C][C]122[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]119[/C][C]122.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]120[/C][C]127.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]135.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]122[/C][C]137.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]123[/C][C]135[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]124[/C][C]136[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]125[/C][C]138.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]126[/C][C]134.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]127[/C][C]138.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]128[/C][C]133.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]129[/C][C]133.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]130[/C][C]141.2[/C][C]134.0297[/C][C]125.4493[/C][C]143.1969[/C][C]0.0626[/C][C]0.5366[/C][C]0.9949[/C][C]0.5366[/C][/ROW]
[ROW][C]131[/C][C]151.8[/C][C]134.0297[/C][C]120.2644[/C][C]149.3706[/C][C]0.0116[/C][C]0.1798[/C][C]0.9363[/C][C]0.5219[/C][/ROW]
[ROW][C]132[/C][C]155.4[/C][C]134.0297[/C][C]116.7249[/C][C]153.8999[/C][C]0.0175[/C][C]0.0398[/C][C]0.7434[/C][C]0.5169[/C][/ROW]
[ROW][C]133[/C][C]156.6[/C][C]134.0297[/C][C]113.9025[/C][C]157.7135[/C][C]0.0309[/C][C]0.0385[/C][C]0.4614[/C][C]0.5142[/C][/ROW]
[ROW][C]134[/C][C]161.6[/C][C]134.0297[/C][C]111.5077[/C][C]161.1006[/C][C]0.023[/C][C]0.0511[/C][C]0.4064[/C][C]0.5124[/C][/ROW]
[ROW][C]135[/C][C]160.7[/C][C]134.0297[/C][C]109.405[/C][C]164.1969[/C][C]0.0416[/C][C]0.0366[/C][C]0.4749[/C][C]0.5111[/C][/ROW]
[ROW][C]136[/C][C]156[/C][C]134.0297[/C][C]107.5179[/C][C]167.0787[/C][C]0.0963[/C][C]0.0569[/C][C]0.4535[/C][C]0.5102[/C][/ROW]
[ROW][C]137[/C][C]159.5[/C][C]134.0297[/C][C]105.7984[/C][C]169.7942[/C][C]0.0814[/C][C]0.1143[/C][C]0.4054[/C][C]0.5094[/C][/ROW]
[ROW][C]138[/C][C]168.7[/C][C]134.0297[/C][C]104.2137[/C][C]172.3761[/C][C]0.0382[/C][C]0.0965[/C][C]0.4863[/C][C]0.5088[/C][/ROW]
[ROW][C]139[/C][C]169.9[/C][C]134.0297[/C][C]102.7406[/C][C]174.8476[/C][C]0.0425[/C][C]0.048[/C][C]0.4169[/C][C]0.5082[/C][/ROW]
[ROW][C]140[/C][C]169.9[/C][C]134.0297[/C][C]101.3618[/C][C]177.2261[/C][C]0.0518[/C][C]0.0518[/C][C]0.5023[/C][C]0.5078[/C][/ROW]
[ROW][C]141[/C][C]185.9[/C][C]134.0297[/C][C]100.0639[/C][C]179.5249[/C][C]0.0127[/C][C]0.0611[/C][C]0.5074[/C][C]0.5074[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3413&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3413&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[129])
117120.8-------
118122-------
119122.1-------
120127.4-------
121135.2-------
122137.3-------
123135-------
124136-------
125138.4-------
126134.7-------
127138.4-------
128133.9-------
129133.6-------
130141.2134.0297125.4493143.19690.06260.53660.99490.5366
131151.8134.0297120.2644149.37060.01160.17980.93630.5219
132155.4134.0297116.7249153.89990.01750.03980.74340.5169
133156.6134.0297113.9025157.71350.03090.03850.46140.5142
134161.6134.0297111.5077161.10060.0230.05110.40640.5124
135160.7134.0297109.405164.19690.04160.03660.47490.5111
136156134.0297107.5179167.07870.09630.05690.45350.5102
137159.5134.0297105.7984169.79420.08140.11430.40540.5094
138168.7134.0297104.2137172.37610.03820.09650.48630.5088
139169.9134.0297102.7406174.84760.04250.0480.41690.5082
140169.9134.0297101.3618177.22610.05180.05180.50230.5078
141185.9134.0297100.0639179.52490.01270.06110.50740.5074







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1300.03490.05350.004551.41334.28442.0699
1310.05840.13260.011315.783726.31535.1298
1320.07560.15940.0133456.689938.05756.1691
1330.09020.16840.014509.418642.45166.5155
1340.1030.20570.0171760.121663.34357.9589
1350.11480.1990.0166711.305159.27547.6991
1360.12580.16390.0137482.694240.22456.3423
1370.13610.190.0158648.736454.06147.3526
1380.1460.25870.02161202.03100.169210.0085
1390.15540.26760.02231286.6787107.223210.3549
1400.16440.26760.02231286.6787107.223210.3549
1410.17320.3870.03232690.5284224.210714.9737

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
130 & 0.0349 & 0.0535 & 0.0045 & 51.4133 & 4.2844 & 2.0699 \tabularnewline
131 & 0.0584 & 0.1326 & 0.011 & 315.7837 & 26.3153 & 5.1298 \tabularnewline
132 & 0.0756 & 0.1594 & 0.0133 & 456.6899 & 38.0575 & 6.1691 \tabularnewline
133 & 0.0902 & 0.1684 & 0.014 & 509.4186 & 42.4516 & 6.5155 \tabularnewline
134 & 0.103 & 0.2057 & 0.0171 & 760.1216 & 63.3435 & 7.9589 \tabularnewline
135 & 0.1148 & 0.199 & 0.0166 & 711.3051 & 59.2754 & 7.6991 \tabularnewline
136 & 0.1258 & 0.1639 & 0.0137 & 482.6942 & 40.2245 & 6.3423 \tabularnewline
137 & 0.1361 & 0.19 & 0.0158 & 648.7364 & 54.0614 & 7.3526 \tabularnewline
138 & 0.146 & 0.2587 & 0.0216 & 1202.03 & 100.1692 & 10.0085 \tabularnewline
139 & 0.1554 & 0.2676 & 0.0223 & 1286.6787 & 107.2232 & 10.3549 \tabularnewline
140 & 0.1644 & 0.2676 & 0.0223 & 1286.6787 & 107.2232 & 10.3549 \tabularnewline
141 & 0.1732 & 0.387 & 0.0323 & 2690.5284 & 224.2107 & 14.9737 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3413&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]130[/C][C]0.0349[/C][C]0.0535[/C][C]0.0045[/C][C]51.4133[/C][C]4.2844[/C][C]2.0699[/C][/ROW]
[ROW][C]131[/C][C]0.0584[/C][C]0.1326[/C][C]0.011[/C][C]315.7837[/C][C]26.3153[/C][C]5.1298[/C][/ROW]
[ROW][C]132[/C][C]0.0756[/C][C]0.1594[/C][C]0.0133[/C][C]456.6899[/C][C]38.0575[/C][C]6.1691[/C][/ROW]
[ROW][C]133[/C][C]0.0902[/C][C]0.1684[/C][C]0.014[/C][C]509.4186[/C][C]42.4516[/C][C]6.5155[/C][/ROW]
[ROW][C]134[/C][C]0.103[/C][C]0.2057[/C][C]0.0171[/C][C]760.1216[/C][C]63.3435[/C][C]7.9589[/C][/ROW]
[ROW][C]135[/C][C]0.1148[/C][C]0.199[/C][C]0.0166[/C][C]711.3051[/C][C]59.2754[/C][C]7.6991[/C][/ROW]
[ROW][C]136[/C][C]0.1258[/C][C]0.1639[/C][C]0.0137[/C][C]482.6942[/C][C]40.2245[/C][C]6.3423[/C][/ROW]
[ROW][C]137[/C][C]0.1361[/C][C]0.19[/C][C]0.0158[/C][C]648.7364[/C][C]54.0614[/C][C]7.3526[/C][/ROW]
[ROW][C]138[/C][C]0.146[/C][C]0.2587[/C][C]0.0216[/C][C]1202.03[/C][C]100.1692[/C][C]10.0085[/C][/ROW]
[ROW][C]139[/C][C]0.1554[/C][C]0.2676[/C][C]0.0223[/C][C]1286.6787[/C][C]107.2232[/C][C]10.3549[/C][/ROW]
[ROW][C]140[/C][C]0.1644[/C][C]0.2676[/C][C]0.0223[/C][C]1286.6787[/C][C]107.2232[/C][C]10.3549[/C][/ROW]
[ROW][C]141[/C][C]0.1732[/C][C]0.387[/C][C]0.0323[/C][C]2690.5284[/C][C]224.2107[/C][C]14.9737[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3413&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3413&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
1300.03490.05350.004551.41334.28442.0699
1310.05840.13260.011315.783726.31535.1298
1320.07560.15940.0133456.689938.05756.1691
1330.09020.16840.014509.418642.45166.5155
1340.1030.20570.0171760.121663.34357.9589
1350.11480.1990.0166711.305159.27547.6991
1360.12580.16390.0137482.694240.22456.3423
1370.13610.190.0158648.736454.06147.3526
1380.1460.25870.02161202.03100.169210.0085
1390.15540.26760.02231286.6787107.223210.3549
1400.16440.26760.02231286.6787107.223210.3549
1410.17320.3870.03232690.5284224.210714.9737



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