Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationFri, 11 Dec 2009 06:22:54 -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/11/t1260537849log5c8huwx8mgzw.htm/, Retrieved Sun, 28 Apr 2024 22:27:11 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=66174, Retrieved Sun, 28 Apr 2024 22:27:11 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact159
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-06 12:06:08] [8b1aef4e7013bd33fbc2a5833375c5f5]
-         [ARIMA Forecasting] [] [2009-12-11 13:22:54] [2a6f24d4847085573f343c759dfbabef] [Current]
-           [ARIMA Forecasting] [] [2009-12-11 15:40:36] [4d62210f0915d3a20cbf115865da7cd4]
-             [ARIMA Forecasting] [] [2009-12-11 15:56:14] [8d2349dc1d6314bc274adc9ad027c980]
Feedback Forum

Post a new message
Dataseries X:
153.3
154.5
155.2
156.9
157
157.4
157.2
157.5
158
158.5
159
159.3
160
160.8
161.9
162.5
162.7
162.8
162.9
163
164
164.7
164.8
164.9
165
165.8
166.1
167.2
167.7
168.3
168.6
168.9
169.1
169.5
169.6
169.7
169.8
170.4
170.9
171.9
171.9
172
172
172.4
173
173.7
173.8
173.8
173.9
174.6
175
175.9
176
175.1
175.6
175.9
176.7
176.1
176.1
176.2
176.3
177.8
178.5
179.4
179.5
179.6
179.7
179.7
179.8
179.9
180.2
180.4
180.4
181.3
181.9
182.5
182.7
183.1
183.6
183.7
183.8
183.9
184.1
184.4
184.5
185.9
186.6
187.6
187.8
187.9
188
188.3
188.4
188.5
188.5
188.6
188.6
189.4
190
191.9
192.5
193
193.5
193.9
194.2
194.9
194.9
194.9
194.9
195.5
196
196.2
196.2
196.2
196.2
197
197.7
198
198.2
198.5
198.6
199.5
200
201.3
202.2
202.9
203.5
203.5
204
204.1
204.3
204.5
204.8
205.1
205.7
206.5
206.9
207.1
207.8
208
208.5
208.6
209
209.1
209.7
209.8
209.9
210
210.8
211.4
211.7
212
212.2
212.4
212.9
213.4
213.7
214
214.3
214.8
215
215.9
216.4
216.9
217.2
217.5
217.9
218.1
218.6
218.9
219.3
220.4
220.9
221
221.8
222
222.2
222.5
222.9
223.1
223.4
224
225.1
225.5
225.9
226.3
226.5
227
227.3
227.8
228.1
228.4
228.5
228.8
229
229.1
229.3
229.6
229.9
230
230.2
230.8
231
231.7
231.9
233
235.1
236
236.9
237.1
237.5
238.2
238.9
239.1
240
240.2
240.5
240.7
241.1
241.4
242.2
242.9
243.2
243.9




Summary of computational 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 computational 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=66174&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]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=66174&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66174&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 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[212])
200230-------
201230.2-------
202230.8-------
203231-------
204231.7-------
205231.9-------
206233-------
207235.1-------
208236-------
209236.9-------
210237.1-------
211237.5-------
212238.2-------
213238.9238.5618237.9173239.20640.15190.864410.8644
214239.1238.9931238.0141239.97210.41530.573910.9438
215240239.2994238.0072240.59170.1440.618910.9523
216240.2239.6442238.0852241.20320.24230.327310.9653
217240.5239.8947238.0987241.69060.25440.369510.9678
218240.7240.5078238.4997242.51590.42560.50310.9879
219241.1241.3397239.1382243.54120.41550.715510.9974
220241.4241.9953239.6155244.37520.3120.769510.9991
221242.2242.4786239.9326245.02450.41510.796810.9995
222242.9242.8067240.1047245.50880.4730.670110.9996
223243.2243.2021240.3525246.05170.49940.582310.9997
224243.9243.5786240.5887246.56860.41660.5980.99980.9998

\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[212]) \tabularnewline
200 & 230 & - & - & - & - & - & - & - \tabularnewline
201 & 230.2 & - & - & - & - & - & - & - \tabularnewline
202 & 230.8 & - & - & - & - & - & - & - \tabularnewline
203 & 231 & - & - & - & - & - & - & - \tabularnewline
204 & 231.7 & - & - & - & - & - & - & - \tabularnewline
205 & 231.9 & - & - & - & - & - & - & - \tabularnewline
206 & 233 & - & - & - & - & - & - & - \tabularnewline
207 & 235.1 & - & - & - & - & - & - & - \tabularnewline
208 & 236 & - & - & - & - & - & - & - \tabularnewline
209 & 236.9 & - & - & - & - & - & - & - \tabularnewline
210 & 237.1 & - & - & - & - & - & - & - \tabularnewline
211 & 237.5 & - & - & - & - & - & - & - \tabularnewline
212 & 238.2 & - & - & - & - & - & - & - \tabularnewline
213 & 238.9 & 238.5618 & 237.9173 & 239.2064 & 0.1519 & 0.8644 & 1 & 0.8644 \tabularnewline
214 & 239.1 & 238.9931 & 238.0141 & 239.9721 & 0.4153 & 0.5739 & 1 & 0.9438 \tabularnewline
215 & 240 & 239.2994 & 238.0072 & 240.5917 & 0.144 & 0.6189 & 1 & 0.9523 \tabularnewline
216 & 240.2 & 239.6442 & 238.0852 & 241.2032 & 0.2423 & 0.3273 & 1 & 0.9653 \tabularnewline
217 & 240.5 & 239.8947 & 238.0987 & 241.6906 & 0.2544 & 0.3695 & 1 & 0.9678 \tabularnewline
218 & 240.7 & 240.5078 & 238.4997 & 242.5159 & 0.4256 & 0.503 & 1 & 0.9879 \tabularnewline
219 & 241.1 & 241.3397 & 239.1382 & 243.5412 & 0.4155 & 0.7155 & 1 & 0.9974 \tabularnewline
220 & 241.4 & 241.9953 & 239.6155 & 244.3752 & 0.312 & 0.7695 & 1 & 0.9991 \tabularnewline
221 & 242.2 & 242.4786 & 239.9326 & 245.0245 & 0.4151 & 0.7968 & 1 & 0.9995 \tabularnewline
222 & 242.9 & 242.8067 & 240.1047 & 245.5088 & 0.473 & 0.6701 & 1 & 0.9996 \tabularnewline
223 & 243.2 & 243.2021 & 240.3525 & 246.0517 & 0.4994 & 0.5823 & 1 & 0.9997 \tabularnewline
224 & 243.9 & 243.5786 & 240.5887 & 246.5686 & 0.4166 & 0.598 & 0.9998 & 0.9998 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66174&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[212])[/C][/ROW]
[ROW][C]200[/C][C]230[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]230.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]202[/C][C]230.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]203[/C][C]231[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]204[/C][C]231.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]205[/C][C]231.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]206[/C][C]233[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]207[/C][C]235.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]208[/C][C]236[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]209[/C][C]236.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]210[/C][C]237.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]211[/C][C]237.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]212[/C][C]238.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]213[/C][C]238.9[/C][C]238.5618[/C][C]237.9173[/C][C]239.2064[/C][C]0.1519[/C][C]0.8644[/C][C]1[/C][C]0.8644[/C][/ROW]
[ROW][C]214[/C][C]239.1[/C][C]238.9931[/C][C]238.0141[/C][C]239.9721[/C][C]0.4153[/C][C]0.5739[/C][C]1[/C][C]0.9438[/C][/ROW]
[ROW][C]215[/C][C]240[/C][C]239.2994[/C][C]238.0072[/C][C]240.5917[/C][C]0.144[/C][C]0.6189[/C][C]1[/C][C]0.9523[/C][/ROW]
[ROW][C]216[/C][C]240.2[/C][C]239.6442[/C][C]238.0852[/C][C]241.2032[/C][C]0.2423[/C][C]0.3273[/C][C]1[/C][C]0.9653[/C][/ROW]
[ROW][C]217[/C][C]240.5[/C][C]239.8947[/C][C]238.0987[/C][C]241.6906[/C][C]0.2544[/C][C]0.3695[/C][C]1[/C][C]0.9678[/C][/ROW]
[ROW][C]218[/C][C]240.7[/C][C]240.5078[/C][C]238.4997[/C][C]242.5159[/C][C]0.4256[/C][C]0.503[/C][C]1[/C][C]0.9879[/C][/ROW]
[ROW][C]219[/C][C]241.1[/C][C]241.3397[/C][C]239.1382[/C][C]243.5412[/C][C]0.4155[/C][C]0.7155[/C][C]1[/C][C]0.9974[/C][/ROW]
[ROW][C]220[/C][C]241.4[/C][C]241.9953[/C][C]239.6155[/C][C]244.3752[/C][C]0.312[/C][C]0.7695[/C][C]1[/C][C]0.9991[/C][/ROW]
[ROW][C]221[/C][C]242.2[/C][C]242.4786[/C][C]239.9326[/C][C]245.0245[/C][C]0.4151[/C][C]0.7968[/C][C]1[/C][C]0.9995[/C][/ROW]
[ROW][C]222[/C][C]242.9[/C][C]242.8067[/C][C]240.1047[/C][C]245.5088[/C][C]0.473[/C][C]0.6701[/C][C]1[/C][C]0.9996[/C][/ROW]
[ROW][C]223[/C][C]243.2[/C][C]243.2021[/C][C]240.3525[/C][C]246.0517[/C][C]0.4994[/C][C]0.5823[/C][C]1[/C][C]0.9997[/C][/ROW]
[ROW][C]224[/C][C]243.9[/C][C]243.5786[/C][C]240.5887[/C][C]246.5686[/C][C]0.4166[/C][C]0.598[/C][C]0.9998[/C][C]0.9998[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66174&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66174&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[212])
200230-------
201230.2-------
202230.8-------
203231-------
204231.7-------
205231.9-------
206233-------
207235.1-------
208236-------
209236.9-------
210237.1-------
211237.5-------
212238.2-------
213238.9238.5618237.9173239.20640.15190.864410.8644
214239.1238.9931238.0141239.97210.41530.573910.9438
215240239.2994238.0072240.59170.1440.618910.9523
216240.2239.6442238.0852241.20320.24230.327310.9653
217240.5239.8947238.0987241.69060.25440.369510.9678
218240.7240.5078238.4997242.51590.42560.50310.9879
219241.1241.3397239.1382243.54120.41550.715510.9974
220241.4241.9953239.6155244.37520.3120.769510.9991
221242.2242.4786239.9326245.02450.41510.796810.9995
222242.9242.8067240.1047245.50880.4730.670110.9996
223243.2243.2021240.3525246.05170.49940.582310.9997
224243.9243.5786240.5887246.56860.41660.5980.99980.9998







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
2130.00140.00141e-040.11440.00950.0976
2140.00214e-0400.01140.0010.0309
2150.00280.00292e-040.49080.04090.2022
2160.00330.00232e-040.30890.02570.1604
2170.00380.00252e-040.36640.03050.1747
2180.00438e-041e-040.03690.00310.0555
2190.0047-0.0011e-040.05750.00480.0692
2200.005-0.00252e-040.35440.02950.1719
2210.0054-0.00111e-040.07760.00650.0804
2220.00574e-0400.00877e-040.0269
2230.00600006e-04
2240.00630.00131e-040.10330.00860.0928

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
213 & 0.0014 & 0.0014 & 1e-04 & 0.1144 & 0.0095 & 0.0976 \tabularnewline
214 & 0.0021 & 4e-04 & 0 & 0.0114 & 0.001 & 0.0309 \tabularnewline
215 & 0.0028 & 0.0029 & 2e-04 & 0.4908 & 0.0409 & 0.2022 \tabularnewline
216 & 0.0033 & 0.0023 & 2e-04 & 0.3089 & 0.0257 & 0.1604 \tabularnewline
217 & 0.0038 & 0.0025 & 2e-04 & 0.3664 & 0.0305 & 0.1747 \tabularnewline
218 & 0.0043 & 8e-04 & 1e-04 & 0.0369 & 0.0031 & 0.0555 \tabularnewline
219 & 0.0047 & -0.001 & 1e-04 & 0.0575 & 0.0048 & 0.0692 \tabularnewline
220 & 0.005 & -0.0025 & 2e-04 & 0.3544 & 0.0295 & 0.1719 \tabularnewline
221 & 0.0054 & -0.0011 & 1e-04 & 0.0776 & 0.0065 & 0.0804 \tabularnewline
222 & 0.0057 & 4e-04 & 0 & 0.0087 & 7e-04 & 0.0269 \tabularnewline
223 & 0.006 & 0 & 0 & 0 & 0 & 6e-04 \tabularnewline
224 & 0.0063 & 0.0013 & 1e-04 & 0.1033 & 0.0086 & 0.0928 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66174&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]213[/C][C]0.0014[/C][C]0.0014[/C][C]1e-04[/C][C]0.1144[/C][C]0.0095[/C][C]0.0976[/C][/ROW]
[ROW][C]214[/C][C]0.0021[/C][C]4e-04[/C][C]0[/C][C]0.0114[/C][C]0.001[/C][C]0.0309[/C][/ROW]
[ROW][C]215[/C][C]0.0028[/C][C]0.0029[/C][C]2e-04[/C][C]0.4908[/C][C]0.0409[/C][C]0.2022[/C][/ROW]
[ROW][C]216[/C][C]0.0033[/C][C]0.0023[/C][C]2e-04[/C][C]0.3089[/C][C]0.0257[/C][C]0.1604[/C][/ROW]
[ROW][C]217[/C][C]0.0038[/C][C]0.0025[/C][C]2e-04[/C][C]0.3664[/C][C]0.0305[/C][C]0.1747[/C][/ROW]
[ROW][C]218[/C][C]0.0043[/C][C]8e-04[/C][C]1e-04[/C][C]0.0369[/C][C]0.0031[/C][C]0.0555[/C][/ROW]
[ROW][C]219[/C][C]0.0047[/C][C]-0.001[/C][C]1e-04[/C][C]0.0575[/C][C]0.0048[/C][C]0.0692[/C][/ROW]
[ROW][C]220[/C][C]0.005[/C][C]-0.0025[/C][C]2e-04[/C][C]0.3544[/C][C]0.0295[/C][C]0.1719[/C][/ROW]
[ROW][C]221[/C][C]0.0054[/C][C]-0.0011[/C][C]1e-04[/C][C]0.0776[/C][C]0.0065[/C][C]0.0804[/C][/ROW]
[ROW][C]222[/C][C]0.0057[/C][C]4e-04[/C][C]0[/C][C]0.0087[/C][C]7e-04[/C][C]0.0269[/C][/ROW]
[ROW][C]223[/C][C]0.006[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]6e-04[/C][/ROW]
[ROW][C]224[/C][C]0.0063[/C][C]0.0013[/C][C]1e-04[/C][C]0.1033[/C][C]0.0086[/C][C]0.0928[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66174&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66174&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
2130.00140.00141e-040.11440.00950.0976
2140.00214e-0400.01140.0010.0309
2150.00280.00292e-040.49080.04090.2022
2160.00330.00232e-040.30890.02570.1604
2170.00380.00252e-040.36640.03050.1747
2180.00438e-041e-040.03690.00310.0555
2190.0047-0.0011e-040.05750.00480.0692
2200.005-0.00252e-040.35440.02950.1719
2210.0054-0.00111e-040.07760.00650.0804
2220.00574e-0400.00877e-040.0269
2230.00600006e-04
2240.00630.00131e-040.10330.00860.0928



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 2 ; par7 = 0 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 2 ; par7 = 0 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ; par11 = ; par12 = ; par13 = ; par14 = ; par15 = ; par16 = ; par17 = ; par18 = ; par19 = ; par20 = ;
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)
}
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.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')