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, 28 Dec 2009 13:48:56 -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/28/t1262033377o359vc963o2fvpt.htm/, Retrieved Sun, 05 May 2024 01:40:46 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=71054, Retrieved Sun, 05 May 2024 01:40:46 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact138
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [Shw10: ARIMA Fore...] [2009-12-04 15:42:20] [3c8b83428ce260cd44df892bb7619588]
-    D  [ARIMA Forecasting] [Shw10: Forecastin...] [2009-12-05 10:55:15] [3c8b83428ce260cd44df892bb7619588]
-   PD      [ARIMA Forecasting] [arima forecasting] [2009-12-28 20:48:56] [454b2df2fae01897bad5ff38ed3cc924] [Current]
-   PD        [ARIMA Forecasting] [arima forecasting] [2009-12-29 15:27:01] [b5ba85a7ae9f50cb97d92cbc56161b32]
Feedback Forum

Post a new message
Dataseries X:
8,7
8,2
8,3
8,5
8,6
8,5
8,2
8,1
7,9
8,6
8,7
8,7
8,5
8,4
8,5
8,7
8,7
8,6
8,5
8,3
8
8,2
8,1
8,1
8
7,9
7,9
8
8
7,9
8
7,7
7,2
7,5
7,3
7
7
7
7,2
7,3
7,1
6,8
6,4
6,1
6,5
7,7
7,9
7,5
6,9
6,6
6,9
7,7
8
8
7,7
7,3
7,4
8,1
8,3
8,2




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71054&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 time3 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[48])
367-------
377-------
387-------
397.2-------
407.3-------
417.1-------
426.8-------
436.4-------
446.1-------
456.5-------
467.7-------
477.9-------
487.5-------
496.97.56697.06838.06560.00440.60380.98710.6038
506.67.97936.86279.09590.00770.97090.95720.7999
516.98.71266.975110.45010.02040.99140.9560.9143
527.79.1716.884311.45770.10370.97420.94560.924
5389.16636.318412.01420.21110.84350.92250.8743
5489.07755.581612.57330.27290.72710.89920.8118
557.79.00534.764113.24660.27320.67890.88570.7567
567.39.08574.049414.12190.24350.70520.87740.7314
577.49.82123.972915.66960.20860.80090.86720.7817
588.111.29784.614417.98130.17420.87350.85430.8673
598.311.77094.209219.33250.18420.82930.84220.8659
608.211.67953.190720.16840.21090.78240.83270.8327

\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[48]) \tabularnewline
36 & 7 & - & - & - & - & - & - & - \tabularnewline
37 & 7 & - & - & - & - & - & - & - \tabularnewline
38 & 7 & - & - & - & - & - & - & - \tabularnewline
39 & 7.2 & - & - & - & - & - & - & - \tabularnewline
40 & 7.3 & - & - & - & - & - & - & - \tabularnewline
41 & 7.1 & - & - & - & - & - & - & - \tabularnewline
42 & 6.8 & - & - & - & - & - & - & - \tabularnewline
43 & 6.4 & - & - & - & - & - & - & - \tabularnewline
44 & 6.1 & - & - & - & - & - & - & - \tabularnewline
45 & 6.5 & - & - & - & - & - & - & - \tabularnewline
46 & 7.7 & - & - & - & - & - & - & - \tabularnewline
47 & 7.9 & - & - & - & - & - & - & - \tabularnewline
48 & 7.5 & - & - & - & - & - & - & - \tabularnewline
49 & 6.9 & 7.5669 & 7.0683 & 8.0656 & 0.0044 & 0.6038 & 0.9871 & 0.6038 \tabularnewline
50 & 6.6 & 7.9793 & 6.8627 & 9.0959 & 0.0077 & 0.9709 & 0.9572 & 0.7999 \tabularnewline
51 & 6.9 & 8.7126 & 6.9751 & 10.4501 & 0.0204 & 0.9914 & 0.956 & 0.9143 \tabularnewline
52 & 7.7 & 9.171 & 6.8843 & 11.4577 & 0.1037 & 0.9742 & 0.9456 & 0.924 \tabularnewline
53 & 8 & 9.1663 & 6.3184 & 12.0142 & 0.2111 & 0.8435 & 0.9225 & 0.8743 \tabularnewline
54 & 8 & 9.0775 & 5.5816 & 12.5733 & 0.2729 & 0.7271 & 0.8992 & 0.8118 \tabularnewline
55 & 7.7 & 9.0053 & 4.7641 & 13.2466 & 0.2732 & 0.6789 & 0.8857 & 0.7567 \tabularnewline
56 & 7.3 & 9.0857 & 4.0494 & 14.1219 & 0.2435 & 0.7052 & 0.8774 & 0.7314 \tabularnewline
57 & 7.4 & 9.8212 & 3.9729 & 15.6696 & 0.2086 & 0.8009 & 0.8672 & 0.7817 \tabularnewline
58 & 8.1 & 11.2978 & 4.6144 & 17.9813 & 0.1742 & 0.8735 & 0.8543 & 0.8673 \tabularnewline
59 & 8.3 & 11.7709 & 4.2092 & 19.3325 & 0.1842 & 0.8293 & 0.8422 & 0.8659 \tabularnewline
60 & 8.2 & 11.6795 & 3.1907 & 20.1684 & 0.2109 & 0.7824 & 0.8327 & 0.8327 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71054&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[48])[/C][/ROW]
[ROW][C]36[/C][C]7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]7.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]7.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]7.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]6.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]6.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]6.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]6.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]7.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]7.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]7.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]6.9[/C][C]7.5669[/C][C]7.0683[/C][C]8.0656[/C][C]0.0044[/C][C]0.6038[/C][C]0.9871[/C][C]0.6038[/C][/ROW]
[ROW][C]50[/C][C]6.6[/C][C]7.9793[/C][C]6.8627[/C][C]9.0959[/C][C]0.0077[/C][C]0.9709[/C][C]0.9572[/C][C]0.7999[/C][/ROW]
[ROW][C]51[/C][C]6.9[/C][C]8.7126[/C][C]6.9751[/C][C]10.4501[/C][C]0.0204[/C][C]0.9914[/C][C]0.956[/C][C]0.9143[/C][/ROW]
[ROW][C]52[/C][C]7.7[/C][C]9.171[/C][C]6.8843[/C][C]11.4577[/C][C]0.1037[/C][C]0.9742[/C][C]0.9456[/C][C]0.924[/C][/ROW]
[ROW][C]53[/C][C]8[/C][C]9.1663[/C][C]6.3184[/C][C]12.0142[/C][C]0.2111[/C][C]0.8435[/C][C]0.9225[/C][C]0.8743[/C][/ROW]
[ROW][C]54[/C][C]8[/C][C]9.0775[/C][C]5.5816[/C][C]12.5733[/C][C]0.2729[/C][C]0.7271[/C][C]0.8992[/C][C]0.8118[/C][/ROW]
[ROW][C]55[/C][C]7.7[/C][C]9.0053[/C][C]4.7641[/C][C]13.2466[/C][C]0.2732[/C][C]0.6789[/C][C]0.8857[/C][C]0.7567[/C][/ROW]
[ROW][C]56[/C][C]7.3[/C][C]9.0857[/C][C]4.0494[/C][C]14.1219[/C][C]0.2435[/C][C]0.7052[/C][C]0.8774[/C][C]0.7314[/C][/ROW]
[ROW][C]57[/C][C]7.4[/C][C]9.8212[/C][C]3.9729[/C][C]15.6696[/C][C]0.2086[/C][C]0.8009[/C][C]0.8672[/C][C]0.7817[/C][/ROW]
[ROW][C]58[/C][C]8.1[/C][C]11.2978[/C][C]4.6144[/C][C]17.9813[/C][C]0.1742[/C][C]0.8735[/C][C]0.8543[/C][C]0.8673[/C][/ROW]
[ROW][C]59[/C][C]8.3[/C][C]11.7709[/C][C]4.2092[/C][C]19.3325[/C][C]0.1842[/C][C]0.8293[/C][C]0.8422[/C][C]0.8659[/C][/ROW]
[ROW][C]60[/C][C]8.2[/C][C]11.6795[/C][C]3.1907[/C][C]20.1684[/C][C]0.2109[/C][C]0.7824[/C][C]0.8327[/C][C]0.8327[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71054&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71054&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[48])
367-------
377-------
387-------
397.2-------
407.3-------
417.1-------
426.8-------
436.4-------
446.1-------
456.5-------
467.7-------
477.9-------
487.5-------
496.97.56697.06838.06560.00440.60380.98710.6038
506.67.97936.86279.09590.00770.97090.95720.7999
516.98.71266.975110.45010.02040.99140.9560.9143
527.79.1716.884311.45770.10370.97420.94560.924
5389.16636.318412.01420.21110.84350.92250.8743
5489.07755.581612.57330.27290.72710.89920.8118
557.79.00534.764113.24660.27320.67890.88570.7567
567.39.08574.049414.12190.24350.70520.87740.7314
577.49.82123.972915.66960.20860.80090.86720.7817
588.111.29784.614417.98130.17420.87350.85430.8673
598.311.77094.209219.33250.18420.82930.84220.8659
608.211.67953.190720.16840.21090.78240.83270.8327







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0336-0.08810.00730.44480.03710.1925
500.0714-0.17290.01441.90250.15850.3982
510.1017-0.2080.01733.28550.27380.5233
520.1272-0.16040.01342.16380.18030.4246
530.1585-0.12720.01061.36020.11340.3367
540.1965-0.11870.00991.16090.09670.311
550.2403-0.1450.01211.70390.1420.3768
560.2828-0.19650.01643.18860.26570.5155
570.3038-0.24650.02055.86240.48850.699
580.3018-0.2830.023610.22620.85220.9231
590.3278-0.29490.024612.04691.00391.002
600.3708-0.29790.024812.10721.00891.0045

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0336 & -0.0881 & 0.0073 & 0.4448 & 0.0371 & 0.1925 \tabularnewline
50 & 0.0714 & -0.1729 & 0.0144 & 1.9025 & 0.1585 & 0.3982 \tabularnewline
51 & 0.1017 & -0.208 & 0.0173 & 3.2855 & 0.2738 & 0.5233 \tabularnewline
52 & 0.1272 & -0.1604 & 0.0134 & 2.1638 & 0.1803 & 0.4246 \tabularnewline
53 & 0.1585 & -0.1272 & 0.0106 & 1.3602 & 0.1134 & 0.3367 \tabularnewline
54 & 0.1965 & -0.1187 & 0.0099 & 1.1609 & 0.0967 & 0.311 \tabularnewline
55 & 0.2403 & -0.145 & 0.0121 & 1.7039 & 0.142 & 0.3768 \tabularnewline
56 & 0.2828 & -0.1965 & 0.0164 & 3.1886 & 0.2657 & 0.5155 \tabularnewline
57 & 0.3038 & -0.2465 & 0.0205 & 5.8624 & 0.4885 & 0.699 \tabularnewline
58 & 0.3018 & -0.283 & 0.0236 & 10.2262 & 0.8522 & 0.9231 \tabularnewline
59 & 0.3278 & -0.2949 & 0.0246 & 12.0469 & 1.0039 & 1.002 \tabularnewline
60 & 0.3708 & -0.2979 & 0.0248 & 12.1072 & 1.0089 & 1.0045 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71054&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]49[/C][C]0.0336[/C][C]-0.0881[/C][C]0.0073[/C][C]0.4448[/C][C]0.0371[/C][C]0.1925[/C][/ROW]
[ROW][C]50[/C][C]0.0714[/C][C]-0.1729[/C][C]0.0144[/C][C]1.9025[/C][C]0.1585[/C][C]0.3982[/C][/ROW]
[ROW][C]51[/C][C]0.1017[/C][C]-0.208[/C][C]0.0173[/C][C]3.2855[/C][C]0.2738[/C][C]0.5233[/C][/ROW]
[ROW][C]52[/C][C]0.1272[/C][C]-0.1604[/C][C]0.0134[/C][C]2.1638[/C][C]0.1803[/C][C]0.4246[/C][/ROW]
[ROW][C]53[/C][C]0.1585[/C][C]-0.1272[/C][C]0.0106[/C][C]1.3602[/C][C]0.1134[/C][C]0.3367[/C][/ROW]
[ROW][C]54[/C][C]0.1965[/C][C]-0.1187[/C][C]0.0099[/C][C]1.1609[/C][C]0.0967[/C][C]0.311[/C][/ROW]
[ROW][C]55[/C][C]0.2403[/C][C]-0.145[/C][C]0.0121[/C][C]1.7039[/C][C]0.142[/C][C]0.3768[/C][/ROW]
[ROW][C]56[/C][C]0.2828[/C][C]-0.1965[/C][C]0.0164[/C][C]3.1886[/C][C]0.2657[/C][C]0.5155[/C][/ROW]
[ROW][C]57[/C][C]0.3038[/C][C]-0.2465[/C][C]0.0205[/C][C]5.8624[/C][C]0.4885[/C][C]0.699[/C][/ROW]
[ROW][C]58[/C][C]0.3018[/C][C]-0.283[/C][C]0.0236[/C][C]10.2262[/C][C]0.8522[/C][C]0.9231[/C][/ROW]
[ROW][C]59[/C][C]0.3278[/C][C]-0.2949[/C][C]0.0246[/C][C]12.0469[/C][C]1.0039[/C][C]1.002[/C][/ROW]
[ROW][C]60[/C][C]0.3708[/C][C]-0.2979[/C][C]0.0248[/C][C]12.1072[/C][C]1.0089[/C][C]1.0045[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71054&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71054&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
490.0336-0.08810.00730.44480.03710.1925
500.0714-0.17290.01441.90250.15850.3982
510.1017-0.2080.01733.28550.27380.5233
520.1272-0.16040.01342.16380.18030.4246
530.1585-0.12720.01061.36020.11340.3367
540.1965-0.11870.00991.16090.09670.311
550.2403-0.1450.01211.70390.1420.3768
560.2828-0.19650.01643.18860.26570.5155
570.3038-0.24650.02055.86240.48850.699
580.3018-0.2830.023610.22620.85220.9231
590.3278-0.29490.024612.04691.00391.002
600.3708-0.29790.024812.10721.00891.0045



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