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 computationMon, 22 Dec 2008 13:35: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/2008/Dec/22/t1229978192x91z0hvxfvql9yf.htm/, Retrieved Mon, 13 May 2024 02:15:48 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=36218, Retrieved Mon, 13 May 2024 02:15:48 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact165
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
F     [Univariate Explorative Data Analysis] [Investigation Dis...] [2007-10-21 17:06:37] [b9964c45117f7aac638ab9056d451faa]
F    D  [Univariate Explorative Data Analysis] [Reproduce Q2] [2008-10-24 13:27:07] [deb3c14ac9e4607a6d84fc9d0e0e6cc2]
- RMPD    [(Partial) Autocorrelation Function] [Paper H5 Mannen (...] [2008-12-13 14:12:34] [deb3c14ac9e4607a6d84fc9d0e0e6cc2]
- RMP       [ARIMA Backward Selection] [Paper H6 Mannen A...] [2008-12-13 16:00:00] [deb3c14ac9e4607a6d84fc9d0e0e6cc2]
- RMP           [ARIMA Forecasting] [Paper H6 Mannen A...] [2008-12-22 20:35:43] [5e9e099b83e50415d7642e10d74756e4] [Current]
Feedback Forum

Post a new message
Dataseries X:
269645
267037
258113
262813
267413
267366
264777
258863
254844
254868
277267
285351
286602
283042
276687
277915
277128
277103
275037
270150
267140
264993
287259
291186
292300
288186
281477
282656
280190
280408
276836
275216
274352
271311
289802
290726
292300
278506
269826
265861
269034
264176
255198
253353
246057
235372
258556
260993
254663
250643
243422
247105
248541
245039
237080
237085
225554
226839
247934
248333
246969
245098
246263




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36218&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[51])
39269826-------
40265861-------
41269034-------
42264176-------
43255198-------
44253353-------
45246057-------
46235372-------
47258556-------
48260993-------
49254663-------
50250643-------
51243422-------
52247105239457231583.3402247330.65980.02850.161800.1618
53248541242630231494.9635253765.03650.14910.215400.4446
54245039237772224134.4212251409.57880.14810.06081e-040.2084
55237080228794213046.6804244541.31960.15120.02165e-040.0343
56237085226949209342.9615244555.03850.12960.12970.00160.0333
57225554219653200366.5511238939.44890.27440.03820.00360.0079
58226839208968188136.2543229799.74570.04630.05930.00656e-04
59247934232152209881.9271254422.07290.08240.680.01010.1606
60248333234589210968.0206258209.97940.12710.13410.01420.2318
61246969228259203360.3015253157.69850.07040.0570.01880.1163
62245098224239198125.0248250352.97520.05870.0440.02380.075
63246263217018189742.8424244293.15760.01780.02180.02890.0289

\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[51]) \tabularnewline
39 & 269826 & - & - & - & - & - & - & - \tabularnewline
40 & 265861 & - & - & - & - & - & - & - \tabularnewline
41 & 269034 & - & - & - & - & - & - & - \tabularnewline
42 & 264176 & - & - & - & - & - & - & - \tabularnewline
43 & 255198 & - & - & - & - & - & - & - \tabularnewline
44 & 253353 & - & - & - & - & - & - & - \tabularnewline
45 & 246057 & - & - & - & - & - & - & - \tabularnewline
46 & 235372 & - & - & - & - & - & - & - \tabularnewline
47 & 258556 & - & - & - & - & - & - & - \tabularnewline
48 & 260993 & - & - & - & - & - & - & - \tabularnewline
49 & 254663 & - & - & - & - & - & - & - \tabularnewline
50 & 250643 & - & - & - & - & - & - & - \tabularnewline
51 & 243422 & - & - & - & - & - & - & - \tabularnewline
52 & 247105 & 239457 & 231583.3402 & 247330.6598 & 0.0285 & 0.1618 & 0 & 0.1618 \tabularnewline
53 & 248541 & 242630 & 231494.9635 & 253765.0365 & 0.1491 & 0.2154 & 0 & 0.4446 \tabularnewline
54 & 245039 & 237772 & 224134.4212 & 251409.5788 & 0.1481 & 0.0608 & 1e-04 & 0.2084 \tabularnewline
55 & 237080 & 228794 & 213046.6804 & 244541.3196 & 0.1512 & 0.0216 & 5e-04 & 0.0343 \tabularnewline
56 & 237085 & 226949 & 209342.9615 & 244555.0385 & 0.1296 & 0.1297 & 0.0016 & 0.0333 \tabularnewline
57 & 225554 & 219653 & 200366.5511 & 238939.4489 & 0.2744 & 0.0382 & 0.0036 & 0.0079 \tabularnewline
58 & 226839 & 208968 & 188136.2543 & 229799.7457 & 0.0463 & 0.0593 & 0.0065 & 6e-04 \tabularnewline
59 & 247934 & 232152 & 209881.9271 & 254422.0729 & 0.0824 & 0.68 & 0.0101 & 0.1606 \tabularnewline
60 & 248333 & 234589 & 210968.0206 & 258209.9794 & 0.1271 & 0.1341 & 0.0142 & 0.2318 \tabularnewline
61 & 246969 & 228259 & 203360.3015 & 253157.6985 & 0.0704 & 0.057 & 0.0188 & 0.1163 \tabularnewline
62 & 245098 & 224239 & 198125.0248 & 250352.9752 & 0.0587 & 0.044 & 0.0238 & 0.075 \tabularnewline
63 & 246263 & 217018 & 189742.8424 & 244293.1576 & 0.0178 & 0.0218 & 0.0289 & 0.0289 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36218&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[51])[/C][/ROW]
[ROW][C]39[/C][C]269826[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]265861[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]269034[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]264176[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]255198[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]253353[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]246057[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]235372[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]258556[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]260993[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]254663[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]250643[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]243422[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]247105[/C][C]239457[/C][C]231583.3402[/C][C]247330.6598[/C][C]0.0285[/C][C]0.1618[/C][C]0[/C][C]0.1618[/C][/ROW]
[ROW][C]53[/C][C]248541[/C][C]242630[/C][C]231494.9635[/C][C]253765.0365[/C][C]0.1491[/C][C]0.2154[/C][C]0[/C][C]0.4446[/C][/ROW]
[ROW][C]54[/C][C]245039[/C][C]237772[/C][C]224134.4212[/C][C]251409.5788[/C][C]0.1481[/C][C]0.0608[/C][C]1e-04[/C][C]0.2084[/C][/ROW]
[ROW][C]55[/C][C]237080[/C][C]228794[/C][C]213046.6804[/C][C]244541.3196[/C][C]0.1512[/C][C]0.0216[/C][C]5e-04[/C][C]0.0343[/C][/ROW]
[ROW][C]56[/C][C]237085[/C][C]226949[/C][C]209342.9615[/C][C]244555.0385[/C][C]0.1296[/C][C]0.1297[/C][C]0.0016[/C][C]0.0333[/C][/ROW]
[ROW][C]57[/C][C]225554[/C][C]219653[/C][C]200366.5511[/C][C]238939.4489[/C][C]0.2744[/C][C]0.0382[/C][C]0.0036[/C][C]0.0079[/C][/ROW]
[ROW][C]58[/C][C]226839[/C][C]208968[/C][C]188136.2543[/C][C]229799.7457[/C][C]0.0463[/C][C]0.0593[/C][C]0.0065[/C][C]6e-04[/C][/ROW]
[ROW][C]59[/C][C]247934[/C][C]232152[/C][C]209881.9271[/C][C]254422.0729[/C][C]0.0824[/C][C]0.68[/C][C]0.0101[/C][C]0.1606[/C][/ROW]
[ROW][C]60[/C][C]248333[/C][C]234589[/C][C]210968.0206[/C][C]258209.9794[/C][C]0.1271[/C][C]0.1341[/C][C]0.0142[/C][C]0.2318[/C][/ROW]
[ROW][C]61[/C][C]246969[/C][C]228259[/C][C]203360.3015[/C][C]253157.6985[/C][C]0.0704[/C][C]0.057[/C][C]0.0188[/C][C]0.1163[/C][/ROW]
[ROW][C]62[/C][C]245098[/C][C]224239[/C][C]198125.0248[/C][C]250352.9752[/C][C]0.0587[/C][C]0.044[/C][C]0.0238[/C][C]0.075[/C][/ROW]
[ROW][C]63[/C][C]246263[/C][C]217018[/C][C]189742.8424[/C][C]244293.1576[/C][C]0.0178[/C][C]0.0218[/C][C]0.0289[/C][C]0.0289[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36218&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36218&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[51])
39269826-------
40265861-------
41269034-------
42264176-------
43255198-------
44253353-------
45246057-------
46235372-------
47258556-------
48260993-------
49254663-------
50250643-------
51243422-------
52247105239457231583.3402247330.65980.02850.161800.1618
53248541242630231494.9635253765.03650.14910.215400.4446
54245039237772224134.4212251409.57880.14810.06081e-040.2084
55237080228794213046.6804244541.31960.15120.02165e-040.0343
56237085226949209342.9615244555.03850.12960.12970.00160.0333
57225554219653200366.5511238939.44890.27440.03820.00360.0079
58226839208968188136.2543229799.74570.04630.05930.00656e-04
59247934232152209881.9271254422.07290.08240.680.01010.1606
60248333234589210968.0206258209.97940.12710.13410.01420.2318
61246969228259203360.3015253157.69850.07040.0570.01880.1163
62245098224239198125.0248250352.97520.05870.0440.02380.075
63246263217018189742.8424244293.15760.01780.02180.02890.0289







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
520.01680.03190.0027584919044874325.33332207.7874
530.02340.02440.002349399212911660.08331706.3587
540.02930.03060.0025528092894400774.08332097.8022
550.03510.03620.0036865779657214832391.9622
560.03960.04470.00371027384968561541.33332926.0112
570.04480.02690.0022348218012901816.751703.472
580.05090.08550.007131937264126614386.755158.9133
590.04890.0680.005724907152420755960.33334555.871
600.05140.05860.004918889753615741461.33333967.551
610.05570.0820.006835006410029172008.33335401.1118
620.05940.0930.007843509788136258156.756021.4746
630.06410.13480.011285527002571272502.08338442.3043

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
52 & 0.0168 & 0.0319 & 0.0027 & 58491904 & 4874325.3333 & 2207.7874 \tabularnewline
53 & 0.0234 & 0.0244 & 0.002 & 34939921 & 2911660.0833 & 1706.3587 \tabularnewline
54 & 0.0293 & 0.0306 & 0.0025 & 52809289 & 4400774.0833 & 2097.8022 \tabularnewline
55 & 0.0351 & 0.0362 & 0.003 & 68657796 & 5721483 & 2391.9622 \tabularnewline
56 & 0.0396 & 0.0447 & 0.0037 & 102738496 & 8561541.3333 & 2926.0112 \tabularnewline
57 & 0.0448 & 0.0269 & 0.0022 & 34821801 & 2901816.75 & 1703.472 \tabularnewline
58 & 0.0509 & 0.0855 & 0.0071 & 319372641 & 26614386.75 & 5158.9133 \tabularnewline
59 & 0.0489 & 0.068 & 0.0057 & 249071524 & 20755960.3333 & 4555.871 \tabularnewline
60 & 0.0514 & 0.0586 & 0.0049 & 188897536 & 15741461.3333 & 3967.551 \tabularnewline
61 & 0.0557 & 0.082 & 0.0068 & 350064100 & 29172008.3333 & 5401.1118 \tabularnewline
62 & 0.0594 & 0.093 & 0.0078 & 435097881 & 36258156.75 & 6021.4746 \tabularnewline
63 & 0.0641 & 0.1348 & 0.0112 & 855270025 & 71272502.0833 & 8442.3043 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36218&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]52[/C][C]0.0168[/C][C]0.0319[/C][C]0.0027[/C][C]58491904[/C][C]4874325.3333[/C][C]2207.7874[/C][/ROW]
[ROW][C]53[/C][C]0.0234[/C][C]0.0244[/C][C]0.002[/C][C]34939921[/C][C]2911660.0833[/C][C]1706.3587[/C][/ROW]
[ROW][C]54[/C][C]0.0293[/C][C]0.0306[/C][C]0.0025[/C][C]52809289[/C][C]4400774.0833[/C][C]2097.8022[/C][/ROW]
[ROW][C]55[/C][C]0.0351[/C][C]0.0362[/C][C]0.003[/C][C]68657796[/C][C]5721483[/C][C]2391.9622[/C][/ROW]
[ROW][C]56[/C][C]0.0396[/C][C]0.0447[/C][C]0.0037[/C][C]102738496[/C][C]8561541.3333[/C][C]2926.0112[/C][/ROW]
[ROW][C]57[/C][C]0.0448[/C][C]0.0269[/C][C]0.0022[/C][C]34821801[/C][C]2901816.75[/C][C]1703.472[/C][/ROW]
[ROW][C]58[/C][C]0.0509[/C][C]0.0855[/C][C]0.0071[/C][C]319372641[/C][C]26614386.75[/C][C]5158.9133[/C][/ROW]
[ROW][C]59[/C][C]0.0489[/C][C]0.068[/C][C]0.0057[/C][C]249071524[/C][C]20755960.3333[/C][C]4555.871[/C][/ROW]
[ROW][C]60[/C][C]0.0514[/C][C]0.0586[/C][C]0.0049[/C][C]188897536[/C][C]15741461.3333[/C][C]3967.551[/C][/ROW]
[ROW][C]61[/C][C]0.0557[/C][C]0.082[/C][C]0.0068[/C][C]350064100[/C][C]29172008.3333[/C][C]5401.1118[/C][/ROW]
[ROW][C]62[/C][C]0.0594[/C][C]0.093[/C][C]0.0078[/C][C]435097881[/C][C]36258156.75[/C][C]6021.4746[/C][/ROW]
[ROW][C]63[/C][C]0.0641[/C][C]0.1348[/C][C]0.0112[/C][C]855270025[/C][C]71272502.0833[/C][C]8442.3043[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36218&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36218&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
520.01680.03190.0027584919044874325.33332207.7874
530.02340.02440.002349399212911660.08331706.3587
540.02930.03060.0025528092894400774.08332097.8022
550.03510.03620.0036865779657214832391.9622
560.03960.04470.00371027384968561541.33332926.0112
570.04480.02690.0022348218012901816.751703.472
580.05090.08550.007131937264126614386.755158.9133
590.04890.0680.005724907152420755960.33334555.871
600.05140.05860.004918889753615741461.33333967.551
610.05570.0820.006835006410029172008.33335401.1118
620.05940.0930.007843509788136258156.756021.4746
630.06410.13480.011285527002571272502.08338442.3043



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