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 computationTue, 15 Dec 2009 21:15:07 -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/16/t1260936976tmw1vy0yqh8ts12.htm/, Retrieved Tue, 30 Apr 2024 15:13:04 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=68225, Retrieved Tue, 30 Apr 2024 15:13:04 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact185
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Bivariate Granger Causality] [] [2009-12-07 09:26:51] [b98453cac15ba1066b407e146608df68]
- RM D  [ARIMA Forecasting] [Shwws10_v1] [2009-12-09 19:58:16] [5f89c040fdf1f8599c99d7f78a662321]
-   P     [ARIMA Forecasting] [Shwws10_v1] [2009-12-11 21:28:43] [5f89c040fdf1f8599c99d7f78a662321]
-   PD      [ARIMA Forecasting] [Paper] [2009-12-16 04:00:10] [5f89c040fdf1f8599c99d7f78a662321]
-   PD          [ARIMA Forecasting] [Paper] [2009-12-16 04:15:07] [93b66894f6318f3da4fcda772f2ffa6f] [Current]
Feedback Forum

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




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=68225&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[35])
232.9-------
243.1-------
253.5-------
263.6-------
274.4-------
284.1-------
295.1-------
305.8-------
315.9-------
325.4-------
335.5-------
344.8-------
353.2-------
362.72.73462.16223.3070.45290.05550.10540.0555
372.12.57991.64583.51410.1570.40060.02680.0966
381.92.40981.21373.60580.20180.69410.02560.0977
390.61.58680.17642.99730.08510.331700.0125
400.71.89540.29923.49170.07110.94420.00340.0546
41-0.21.2006-0.5622.96320.05970.711100.0131
42-10.4806-1.4342.39510.06480.75700.0027
43-1.70.3777-1.67762.4330.02380.905500.0036
44-0.70.9588-1.22823.14580.06860.991400.0223
45-10.7224-1.58883.03360.07210.886100.0178
46-0.90.9083-1.52073.33740.07230.93828e-040.0322
4702.0868-0.45464.62830.05380.98940.19530.1953

\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[35]) \tabularnewline
23 & 2.9 & - & - & - & - & - & - & - \tabularnewline
24 & 3.1 & - & - & - & - & - & - & - \tabularnewline
25 & 3.5 & - & - & - & - & - & - & - \tabularnewline
26 & 3.6 & - & - & - & - & - & - & - \tabularnewline
27 & 4.4 & - & - & - & - & - & - & - \tabularnewline
28 & 4.1 & - & - & - & - & - & - & - \tabularnewline
29 & 5.1 & - & - & - & - & - & - & - \tabularnewline
30 & 5.8 & - & - & - & - & - & - & - \tabularnewline
31 & 5.9 & - & - & - & - & - & - & - \tabularnewline
32 & 5.4 & - & - & - & - & - & - & - \tabularnewline
33 & 5.5 & - & - & - & - & - & - & - \tabularnewline
34 & 4.8 & - & - & - & - & - & - & - \tabularnewline
35 & 3.2 & - & - & - & - & - & - & - \tabularnewline
36 & 2.7 & 2.7346 & 2.1622 & 3.307 & 0.4529 & 0.0555 & 0.1054 & 0.0555 \tabularnewline
37 & 2.1 & 2.5799 & 1.6458 & 3.5141 & 0.157 & 0.4006 & 0.0268 & 0.0966 \tabularnewline
38 & 1.9 & 2.4098 & 1.2137 & 3.6058 & 0.2018 & 0.6941 & 0.0256 & 0.0977 \tabularnewline
39 & 0.6 & 1.5868 & 0.1764 & 2.9973 & 0.0851 & 0.3317 & 0 & 0.0125 \tabularnewline
40 & 0.7 & 1.8954 & 0.2992 & 3.4917 & 0.0711 & 0.9442 & 0.0034 & 0.0546 \tabularnewline
41 & -0.2 & 1.2006 & -0.562 & 2.9632 & 0.0597 & 0.7111 & 0 & 0.0131 \tabularnewline
42 & -1 & 0.4806 & -1.434 & 2.3951 & 0.0648 & 0.757 & 0 & 0.0027 \tabularnewline
43 & -1.7 & 0.3777 & -1.6776 & 2.433 & 0.0238 & 0.9055 & 0 & 0.0036 \tabularnewline
44 & -0.7 & 0.9588 & -1.2282 & 3.1458 & 0.0686 & 0.9914 & 0 & 0.0223 \tabularnewline
45 & -1 & 0.7224 & -1.5888 & 3.0336 & 0.0721 & 0.8861 & 0 & 0.0178 \tabularnewline
46 & -0.9 & 0.9083 & -1.5207 & 3.3374 & 0.0723 & 0.9382 & 8e-04 & 0.0322 \tabularnewline
47 & 0 & 2.0868 & -0.4546 & 4.6283 & 0.0538 & 0.9894 & 0.1953 & 0.1953 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=68225&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[35])[/C][/ROW]
[ROW][C]23[/C][C]2.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]24[/C][C]3.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]25[/C][C]3.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]26[/C][C]3.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]27[/C][C]4.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]28[/C][C]4.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]29[/C][C]5.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]30[/C][C]5.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]31[/C][C]5.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]32[/C][C]5.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]33[/C][C]5.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]34[/C][C]4.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]3.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]2.7[/C][C]2.7346[/C][C]2.1622[/C][C]3.307[/C][C]0.4529[/C][C]0.0555[/C][C]0.1054[/C][C]0.0555[/C][/ROW]
[ROW][C]37[/C][C]2.1[/C][C]2.5799[/C][C]1.6458[/C][C]3.5141[/C][C]0.157[/C][C]0.4006[/C][C]0.0268[/C][C]0.0966[/C][/ROW]
[ROW][C]38[/C][C]1.9[/C][C]2.4098[/C][C]1.2137[/C][C]3.6058[/C][C]0.2018[/C][C]0.6941[/C][C]0.0256[/C][C]0.0977[/C][/ROW]
[ROW][C]39[/C][C]0.6[/C][C]1.5868[/C][C]0.1764[/C][C]2.9973[/C][C]0.0851[/C][C]0.3317[/C][C]0[/C][C]0.0125[/C][/ROW]
[ROW][C]40[/C][C]0.7[/C][C]1.8954[/C][C]0.2992[/C][C]3.4917[/C][C]0.0711[/C][C]0.9442[/C][C]0.0034[/C][C]0.0546[/C][/ROW]
[ROW][C]41[/C][C]-0.2[/C][C]1.2006[/C][C]-0.562[/C][C]2.9632[/C][C]0.0597[/C][C]0.7111[/C][C]0[/C][C]0.0131[/C][/ROW]
[ROW][C]42[/C][C]-1[/C][C]0.4806[/C][C]-1.434[/C][C]2.3951[/C][C]0.0648[/C][C]0.757[/C][C]0[/C][C]0.0027[/C][/ROW]
[ROW][C]43[/C][C]-1.7[/C][C]0.3777[/C][C]-1.6776[/C][C]2.433[/C][C]0.0238[/C][C]0.9055[/C][C]0[/C][C]0.0036[/C][/ROW]
[ROW][C]44[/C][C]-0.7[/C][C]0.9588[/C][C]-1.2282[/C][C]3.1458[/C][C]0.0686[/C][C]0.9914[/C][C]0[/C][C]0.0223[/C][/ROW]
[ROW][C]45[/C][C]-1[/C][C]0.7224[/C][C]-1.5888[/C][C]3.0336[/C][C]0.0721[/C][C]0.8861[/C][C]0[/C][C]0.0178[/C][/ROW]
[ROW][C]46[/C][C]-0.9[/C][C]0.9083[/C][C]-1.5207[/C][C]3.3374[/C][C]0.0723[/C][C]0.9382[/C][C]8e-04[/C][C]0.0322[/C][/ROW]
[ROW][C]47[/C][C]0[/C][C]2.0868[/C][C]-0.4546[/C][C]4.6283[/C][C]0.0538[/C][C]0.9894[/C][C]0.1953[/C][C]0.1953[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=68225&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=68225&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[35])
232.9-------
243.1-------
253.5-------
263.6-------
274.4-------
284.1-------
295.1-------
305.8-------
315.9-------
325.4-------
335.5-------
344.8-------
353.2-------
362.72.73462.16223.3070.45290.05550.10540.0555
372.12.57991.64583.51410.1570.40060.02680.0966
381.92.40981.21373.60580.20180.69410.02560.0977
390.61.58680.17642.99730.08510.331700.0125
400.71.89540.29923.49170.07110.94420.00340.0546
41-0.21.2006-0.5622.96320.05970.711100.0131
42-10.4806-1.4342.39510.06480.75700.0027
43-1.70.3777-1.67762.4330.02380.905500.0036
44-0.70.9588-1.22823.14580.06860.991400.0223
45-10.7224-1.58883.03360.07210.886100.0178
46-0.90.9083-1.52073.33740.07230.93828e-040.0322
4702.0868-0.45464.62830.05380.98940.19530.1953







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
360.1068-0.012700.001200
370.1847-0.1860.09930.23030.11580.3402
380.2532-0.21150.13670.25990.16380.4047
390.4535-0.62190.2580.97380.36630.6052
400.4297-0.63070.33261.4290.57890.7608
410.749-1.16660.47161.96170.80930.8996
422.0327-3.08090.84432.1921.00691.0034
432.7764-5.5011.42644.31681.42061.1919
441.1638-1.73011.46022.75151.56851.2524
451.6324-2.38431.55262.96661.70831.307
461.3644-1.99081.59243.27011.85031.3602
470.6214-11.5434.35492.0591.4349

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
36 & 0.1068 & -0.0127 & 0 & 0.0012 & 0 & 0 \tabularnewline
37 & 0.1847 & -0.186 & 0.0993 & 0.2303 & 0.1158 & 0.3402 \tabularnewline
38 & 0.2532 & -0.2115 & 0.1367 & 0.2599 & 0.1638 & 0.4047 \tabularnewline
39 & 0.4535 & -0.6219 & 0.258 & 0.9738 & 0.3663 & 0.6052 \tabularnewline
40 & 0.4297 & -0.6307 & 0.3326 & 1.429 & 0.5789 & 0.7608 \tabularnewline
41 & 0.749 & -1.1666 & 0.4716 & 1.9617 & 0.8093 & 0.8996 \tabularnewline
42 & 2.0327 & -3.0809 & 0.8443 & 2.192 & 1.0069 & 1.0034 \tabularnewline
43 & 2.7764 & -5.501 & 1.4264 & 4.3168 & 1.4206 & 1.1919 \tabularnewline
44 & 1.1638 & -1.7301 & 1.4602 & 2.7515 & 1.5685 & 1.2524 \tabularnewline
45 & 1.6324 & -2.3843 & 1.5526 & 2.9666 & 1.7083 & 1.307 \tabularnewline
46 & 1.3644 & -1.9908 & 1.5924 & 3.2701 & 1.8503 & 1.3602 \tabularnewline
47 & 0.6214 & -1 & 1.543 & 4.3549 & 2.059 & 1.4349 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=68225&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]36[/C][C]0.1068[/C][C]-0.0127[/C][C]0[/C][C]0.0012[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]37[/C][C]0.1847[/C][C]-0.186[/C][C]0.0993[/C][C]0.2303[/C][C]0.1158[/C][C]0.3402[/C][/ROW]
[ROW][C]38[/C][C]0.2532[/C][C]-0.2115[/C][C]0.1367[/C][C]0.2599[/C][C]0.1638[/C][C]0.4047[/C][/ROW]
[ROW][C]39[/C][C]0.4535[/C][C]-0.6219[/C][C]0.258[/C][C]0.9738[/C][C]0.3663[/C][C]0.6052[/C][/ROW]
[ROW][C]40[/C][C]0.4297[/C][C]-0.6307[/C][C]0.3326[/C][C]1.429[/C][C]0.5789[/C][C]0.7608[/C][/ROW]
[ROW][C]41[/C][C]0.749[/C][C]-1.1666[/C][C]0.4716[/C][C]1.9617[/C][C]0.8093[/C][C]0.8996[/C][/ROW]
[ROW][C]42[/C][C]2.0327[/C][C]-3.0809[/C][C]0.8443[/C][C]2.192[/C][C]1.0069[/C][C]1.0034[/C][/ROW]
[ROW][C]43[/C][C]2.7764[/C][C]-5.501[/C][C]1.4264[/C][C]4.3168[/C][C]1.4206[/C][C]1.1919[/C][/ROW]
[ROW][C]44[/C][C]1.1638[/C][C]-1.7301[/C][C]1.4602[/C][C]2.7515[/C][C]1.5685[/C][C]1.2524[/C][/ROW]
[ROW][C]45[/C][C]1.6324[/C][C]-2.3843[/C][C]1.5526[/C][C]2.9666[/C][C]1.7083[/C][C]1.307[/C][/ROW]
[ROW][C]46[/C][C]1.3644[/C][C]-1.9908[/C][C]1.5924[/C][C]3.2701[/C][C]1.8503[/C][C]1.3602[/C][/ROW]
[ROW][C]47[/C][C]0.6214[/C][C]-1[/C][C]1.543[/C][C]4.3549[/C][C]2.059[/C][C]1.4349[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=68225&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=68225&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
360.1068-0.012700.001200
370.1847-0.1860.09930.23030.11580.3402
380.2532-0.21150.13670.25990.16380.4047
390.4535-0.62190.2580.97380.36630.6052
400.4297-0.63070.33261.4290.57890.7608
410.749-1.16660.47161.96170.80930.8996
422.0327-3.08090.84432.1921.00691.0034
432.7764-5.5011.42644.31681.42061.1919
441.1638-1.73011.46022.75151.56851.2524
451.6324-2.38431.55262.96661.70831.307
461.3644-1.99081.59243.27011.85031.3602
470.6214-11.5434.35492.0591.4349



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