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 computationSat, 19 Dec 2009 07:17:23 -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/19/t1261232325c312fp1en0jbyqw.htm/, Retrieved Fri, 03 May 2024 21:37:35 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=69605, Retrieved Fri, 03 May 2024 21:37:35 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact121
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2009-12-19 14:17:23] [c4328af89eba9af53ee195d6fed304d9] [Current]
Feedback Forum

Post a new message
Dataseries X:
353.4
329.08
331.89
339.94
330.8
361.26
358.02
356.15
322.56
306.1
303.99
322.23
330.2
343.91
367.07
375.22
375.35
389.81
371.18
387.18
395.43
387.86
392.46
375.11
417.03
408.79
412.68
403.67
414.95
415.35
408.2
424.19
414.03
417.8
418.66
431.35
435.7
438.78
443.38
451.67
440.19
450.23
450.54
448.13
463.55
458.93
467.83
461.93
466.51
481.6
467.19
445.66
450.91
456.5
444.27
458.28
475.49
462.69
472.26
453.55
459.21
470.42
487.39
500.7
514.76
533.4
544.75
562.06
561.88
584.41
581.5
605.37
615.93
636.02
640.43
645.5
654.17
669.12
670.63
639.95
651.99
687.31
705.27
757.02
740.74
786.16
790.82
757.12
801.34
848.28
885.14
954.29
899.47
947.28
914.62
955.4
970.43
980.28
1049.34
1101.75
1111.75
1090.82
1133.84
1120.67
957.28
1017.01
1098.67
1163.63
1129.23
1279.64
1238.33
1286.37
1335.18
1301.84
1372.71
1328.72
1320.41
1282.71
1362.93
1388.91
1469.25
1394.46
1366.42
1498.58
1452.43
1420.6
1454.6
1430.83
1517.68
1436.52
1429.4
1314.95
1320.28
1366.01
1239.94
1160.33
1249.46
1255.82
1224.42
1211.23
1133.58
1040.94
1059.78
1139.45
1148.08
1130.2
1106.73
1147.39
1076.92
1067.14
989.82
911.62
916.07
815.28
885.76
936.31
879.82
855.7
841.15
848.18
916.92
963.59
974.5
990.31
1008.01
995.97
1050.71
1058.2
1111.92
1131.13
1144.94
1113.89
1107.3
1120.68
1140.84
1101.72
1104.24
1114.58
1130.2
1173.78
1211.92
1181.27
1203.6
1180.59
1156.85
1191.5
1191.33
1234.18
1220.33
1228.81
1207.01
1249.48
1248.29
1280.08
1280.66
1302.88
1310.61
1270.05
1270.06
1278.53
1303.8
1335.83
1377.76
1400.63
1418.03
1437.9
1406.8
1420.83
1482.37
1530.63
1504.66
1455.18
1473.96
1527.29
1545.79
1479.63
1467.97
1378.6
1330.45
1326.41
1385.97
1399.62
1276.69
1269.42
1287.83
1164.17
968.67
888.61
902.99
823.09
729.57
793.59
872.74
923.26
920.82
990.22
1019.52
1054.91
1036.18
1098.89




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69605&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 time2 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[228])
2161479.63-------
2171467.97-------
2181378.6-------
2191330.45-------
2201326.41-------
2211385.97-------
2221399.62-------
2231276.69-------
2241269.42-------
2251287.83-------
2261164.17-------
227968.67-------
228888.61-------
229902.99888.2123815.8883966.94750.35650.496100.4961
230823.09885.0615784.8898998.01780.14110.377900.4755
231729.57883.2832762.451023.26590.01570.800300.4703
232793.59883.1312745.1661046.64020.14160.967200.4738
233872.74885.3286732.19151070.49410.4470.834200.4861
234923.26885.8196719.43771090.680.36010.549800.4894
235920.82881.2244703.87431103.26010.36330.35532e-040.474
236990.22880.9397692.81391120.1490.18530.37197e-040.4749
2371019.52881.6576683.34771137.51780.14550.20289e-040.4788
2381054.91876.6365670.15541146.73640.09790.14990.01850.4654
2391036.18867.5659654.58371149.84620.12080.09670.24130.4419
2401098.89863.342643.28841158.67060.0590.12570.43340.4334

\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[228]) \tabularnewline
216 & 1479.63 & - & - & - & - & - & - & - \tabularnewline
217 & 1467.97 & - & - & - & - & - & - & - \tabularnewline
218 & 1378.6 & - & - & - & - & - & - & - \tabularnewline
219 & 1330.45 & - & - & - & - & - & - & - \tabularnewline
220 & 1326.41 & - & - & - & - & - & - & - \tabularnewline
221 & 1385.97 & - & - & - & - & - & - & - \tabularnewline
222 & 1399.62 & - & - & - & - & - & - & - \tabularnewline
223 & 1276.69 & - & - & - & - & - & - & - \tabularnewline
224 & 1269.42 & - & - & - & - & - & - & - \tabularnewline
225 & 1287.83 & - & - & - & - & - & - & - \tabularnewline
226 & 1164.17 & - & - & - & - & - & - & - \tabularnewline
227 & 968.67 & - & - & - & - & - & - & - \tabularnewline
228 & 888.61 & - & - & - & - & - & - & - \tabularnewline
229 & 902.99 & 888.2123 & 815.8883 & 966.9475 & 0.3565 & 0.4961 & 0 & 0.4961 \tabularnewline
230 & 823.09 & 885.0615 & 784.8898 & 998.0178 & 0.1411 & 0.3779 & 0 & 0.4755 \tabularnewline
231 & 729.57 & 883.2832 & 762.45 & 1023.2659 & 0.0157 & 0.8003 & 0 & 0.4703 \tabularnewline
232 & 793.59 & 883.1312 & 745.166 & 1046.6402 & 0.1416 & 0.9672 & 0 & 0.4738 \tabularnewline
233 & 872.74 & 885.3286 & 732.1915 & 1070.4941 & 0.447 & 0.8342 & 0 & 0.4861 \tabularnewline
234 & 923.26 & 885.8196 & 719.4377 & 1090.68 & 0.3601 & 0.5498 & 0 & 0.4894 \tabularnewline
235 & 920.82 & 881.2244 & 703.8743 & 1103.2601 & 0.3633 & 0.3553 & 2e-04 & 0.474 \tabularnewline
236 & 990.22 & 880.9397 & 692.8139 & 1120.149 & 0.1853 & 0.3719 & 7e-04 & 0.4749 \tabularnewline
237 & 1019.52 & 881.6576 & 683.3477 & 1137.5178 & 0.1455 & 0.2028 & 9e-04 & 0.4788 \tabularnewline
238 & 1054.91 & 876.6365 & 670.1554 & 1146.7364 & 0.0979 & 0.1499 & 0.0185 & 0.4654 \tabularnewline
239 & 1036.18 & 867.5659 & 654.5837 & 1149.8462 & 0.1208 & 0.0967 & 0.2413 & 0.4419 \tabularnewline
240 & 1098.89 & 863.342 & 643.2884 & 1158.6706 & 0.059 & 0.1257 & 0.4334 & 0.4334 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69605&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[228])[/C][/ROW]
[ROW][C]216[/C][C]1479.63[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]217[/C][C]1467.97[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]218[/C][C]1378.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]219[/C][C]1330.45[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]220[/C][C]1326.41[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]221[/C][C]1385.97[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]222[/C][C]1399.62[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]223[/C][C]1276.69[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]224[/C][C]1269.42[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]225[/C][C]1287.83[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]226[/C][C]1164.17[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]227[/C][C]968.67[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]228[/C][C]888.61[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]229[/C][C]902.99[/C][C]888.2123[/C][C]815.8883[/C][C]966.9475[/C][C]0.3565[/C][C]0.4961[/C][C]0[/C][C]0.4961[/C][/ROW]
[ROW][C]230[/C][C]823.09[/C][C]885.0615[/C][C]784.8898[/C][C]998.0178[/C][C]0.1411[/C][C]0.3779[/C][C]0[/C][C]0.4755[/C][/ROW]
[ROW][C]231[/C][C]729.57[/C][C]883.2832[/C][C]762.45[/C][C]1023.2659[/C][C]0.0157[/C][C]0.8003[/C][C]0[/C][C]0.4703[/C][/ROW]
[ROW][C]232[/C][C]793.59[/C][C]883.1312[/C][C]745.166[/C][C]1046.6402[/C][C]0.1416[/C][C]0.9672[/C][C]0[/C][C]0.4738[/C][/ROW]
[ROW][C]233[/C][C]872.74[/C][C]885.3286[/C][C]732.1915[/C][C]1070.4941[/C][C]0.447[/C][C]0.8342[/C][C]0[/C][C]0.4861[/C][/ROW]
[ROW][C]234[/C][C]923.26[/C][C]885.8196[/C][C]719.4377[/C][C]1090.68[/C][C]0.3601[/C][C]0.5498[/C][C]0[/C][C]0.4894[/C][/ROW]
[ROW][C]235[/C][C]920.82[/C][C]881.2244[/C][C]703.8743[/C][C]1103.2601[/C][C]0.3633[/C][C]0.3553[/C][C]2e-04[/C][C]0.474[/C][/ROW]
[ROW][C]236[/C][C]990.22[/C][C]880.9397[/C][C]692.8139[/C][C]1120.149[/C][C]0.1853[/C][C]0.3719[/C][C]7e-04[/C][C]0.4749[/C][/ROW]
[ROW][C]237[/C][C]1019.52[/C][C]881.6576[/C][C]683.3477[/C][C]1137.5178[/C][C]0.1455[/C][C]0.2028[/C][C]9e-04[/C][C]0.4788[/C][/ROW]
[ROW][C]238[/C][C]1054.91[/C][C]876.6365[/C][C]670.1554[/C][C]1146.7364[/C][C]0.0979[/C][C]0.1499[/C][C]0.0185[/C][C]0.4654[/C][/ROW]
[ROW][C]239[/C][C]1036.18[/C][C]867.5659[/C][C]654.5837[/C][C]1149.8462[/C][C]0.1208[/C][C]0.0967[/C][C]0.2413[/C][C]0.4419[/C][/ROW]
[ROW][C]240[/C][C]1098.89[/C][C]863.342[/C][C]643.2884[/C][C]1158.6706[/C][C]0.059[/C][C]0.1257[/C][C]0.4334[/C][C]0.4334[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69605&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69605&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[228])
2161479.63-------
2171467.97-------
2181378.6-------
2191330.45-------
2201326.41-------
2211385.97-------
2221399.62-------
2231276.69-------
2241269.42-------
2251287.83-------
2261164.17-------
227968.67-------
228888.61-------
229902.99888.2123815.8883966.94750.35650.496100.4961
230823.09885.0615784.8898998.01780.14110.377900.4755
231729.57883.2832762.451023.26590.01570.800300.4703
232793.59883.1312745.1661046.64020.14160.967200.4738
233872.74885.3286732.19151070.49410.4470.834200.4861
234923.26885.8196719.43771090.680.36010.549800.4894
235920.82881.2244703.87431103.26010.36330.35532e-040.474
236990.22880.9397692.81391120.1490.18530.37197e-040.4749
2371019.52881.6576683.34771137.51780.14550.20289e-040.4788
2381054.91876.6365670.15541146.73640.09790.14990.01850.4654
2391036.18867.5659654.58371149.84620.12080.09670.24130.4419
2401098.89863.342643.28841158.67060.0590.12570.43340.4334







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
2290.04520.01660218.379200
2300.0651-0.070.04333840.47142029.425345.0491
2310.0809-0.1740.086923627.73369228.861496.067
2320.0945-0.10140.09058017.62478926.052294.4778
2330.1067-0.01420.0753158.47187172.536184.6908
2340.1180.04230.06981401.78466210.744278.8083
2350.12860.04490.06621567.81495547.468674.4813
2360.13850.1240.073411942.18626346.808379.6669
2370.14810.15640.082719006.03927753.389588.0533
2380.15720.20340.094731781.447910156.1954100.778
2390.1660.19440.103828430.719411817.5157108.7084
2400.17450.27280.117955482.868815456.2951124.3233

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
229 & 0.0452 & 0.0166 & 0 & 218.3792 & 0 & 0 \tabularnewline
230 & 0.0651 & -0.07 & 0.0433 & 3840.4714 & 2029.4253 & 45.0491 \tabularnewline
231 & 0.0809 & -0.174 & 0.0869 & 23627.7336 & 9228.8614 & 96.067 \tabularnewline
232 & 0.0945 & -0.1014 & 0.0905 & 8017.6247 & 8926.0522 & 94.4778 \tabularnewline
233 & 0.1067 & -0.0142 & 0.0753 & 158.4718 & 7172.5361 & 84.6908 \tabularnewline
234 & 0.118 & 0.0423 & 0.0698 & 1401.7846 & 6210.7442 & 78.8083 \tabularnewline
235 & 0.1286 & 0.0449 & 0.0662 & 1567.8149 & 5547.4686 & 74.4813 \tabularnewline
236 & 0.1385 & 0.124 & 0.0734 & 11942.1862 & 6346.8083 & 79.6669 \tabularnewline
237 & 0.1481 & 0.1564 & 0.0827 & 19006.0392 & 7753.3895 & 88.0533 \tabularnewline
238 & 0.1572 & 0.2034 & 0.0947 & 31781.4479 & 10156.1954 & 100.778 \tabularnewline
239 & 0.166 & 0.1944 & 0.1038 & 28430.7194 & 11817.5157 & 108.7084 \tabularnewline
240 & 0.1745 & 0.2728 & 0.1179 & 55482.8688 & 15456.2951 & 124.3233 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69605&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]229[/C][C]0.0452[/C][C]0.0166[/C][C]0[/C][C]218.3792[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]230[/C][C]0.0651[/C][C]-0.07[/C][C]0.0433[/C][C]3840.4714[/C][C]2029.4253[/C][C]45.0491[/C][/ROW]
[ROW][C]231[/C][C]0.0809[/C][C]-0.174[/C][C]0.0869[/C][C]23627.7336[/C][C]9228.8614[/C][C]96.067[/C][/ROW]
[ROW][C]232[/C][C]0.0945[/C][C]-0.1014[/C][C]0.0905[/C][C]8017.6247[/C][C]8926.0522[/C][C]94.4778[/C][/ROW]
[ROW][C]233[/C][C]0.1067[/C][C]-0.0142[/C][C]0.0753[/C][C]158.4718[/C][C]7172.5361[/C][C]84.6908[/C][/ROW]
[ROW][C]234[/C][C]0.118[/C][C]0.0423[/C][C]0.0698[/C][C]1401.7846[/C][C]6210.7442[/C][C]78.8083[/C][/ROW]
[ROW][C]235[/C][C]0.1286[/C][C]0.0449[/C][C]0.0662[/C][C]1567.8149[/C][C]5547.4686[/C][C]74.4813[/C][/ROW]
[ROW][C]236[/C][C]0.1385[/C][C]0.124[/C][C]0.0734[/C][C]11942.1862[/C][C]6346.8083[/C][C]79.6669[/C][/ROW]
[ROW][C]237[/C][C]0.1481[/C][C]0.1564[/C][C]0.0827[/C][C]19006.0392[/C][C]7753.3895[/C][C]88.0533[/C][/ROW]
[ROW][C]238[/C][C]0.1572[/C][C]0.2034[/C][C]0.0947[/C][C]31781.4479[/C][C]10156.1954[/C][C]100.778[/C][/ROW]
[ROW][C]239[/C][C]0.166[/C][C]0.1944[/C][C]0.1038[/C][C]28430.7194[/C][C]11817.5157[/C][C]108.7084[/C][/ROW]
[ROW][C]240[/C][C]0.1745[/C][C]0.2728[/C][C]0.1179[/C][C]55482.8688[/C][C]15456.2951[/C][C]124.3233[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69605&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69605&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
2290.04520.01660218.379200
2300.0651-0.070.04333840.47142029.425345.0491
2310.0809-0.1740.086923627.73369228.861496.067
2320.0945-0.10140.09058017.62478926.052294.4778
2330.1067-0.01420.0753158.47187172.536184.6908
2340.1180.04230.06981401.78466210.744278.8083
2350.12860.04490.06621567.81495547.468674.4813
2360.13850.1240.073411942.18626346.808379.6669
2370.14810.15640.082719006.03927753.389588.0533
2380.15720.20340.094731781.447910156.1954100.778
2390.1660.19440.103828430.719411817.5157108.7084
2400.17450.27280.117955482.868815456.2951124.3233



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