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 computationWed, 17 Dec 2008 07:14:31 -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/17/t1229523451roqbue7om8r89rr.htm/, Retrieved Sun, 19 May 2024 07:48:01 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=34359, Retrieved Sun, 19 May 2024 07:48:01 +0000
QR Codes:

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

Post a new message
Dataseries X:
15044.5
14944.2
16754.8
14254
15454.9
15644.8
14568.3
12520.2
14803
15873.2
14755.3
12875.1
14291.1
14205.3
15859.4
15258.9
15498.6
15106.5
15023.6
12083
15761.3
16943
15070.3
13659.6
14768.9
14725.1
15998.1
15370.6
14956.9
15469.7
15101.8
11703.7
16283.6
16726.5
14968.9
14861
14583.3
15305.8
17903.9
16379.4
15420.3
17870.5
15912.8
13866.5
17823.2
17872
17420.4
16704.4
15991.2
16583.6
19123.5
17838.7
17209.4
18586.5
16258.1
15141.6
19202.1
17746.5
19090.1
18040.3
17515.5
17751.8
21072.4
17170
19439.5
19795.4
17574.9
16165.4
19464.6
19932.1
19961.2
17343.4
18924.2
18574.1
21350.6
18594.6
19823.1
20844.4
19640.2
17735.4
19813.6
22160
20664.3
17877.4
21211.2
21423.1
21688.7
23243.2
21490.2
22925.8
23184.8
18562.2




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34359&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[80])
6816165.4-------
6919464.6-------
7019932.1-------
7119961.2-------
7217343.4000000000-------
7318924.2-------
7418574.1-------
7521350.6-------
7618594.6-------
7719823.1-------
7820844.4-------
7919640.2-------
8017735.4-------
8119813.620917.496819466.802922431.19330.076410.971
822216021873.660920379.749823431.42110.35930.99520.99271
8320664.321462.382919911.634223083.42580.16730.19950.96521
8417877.419078.754417411.774120837.99630.09040.03870.97340.9328
8521211.220270.754518522.037522114.96420.15880.99450.92380.9965
8621423.120020.754518200.266721946.34150.07670.11280.92960.99
8721688.722840.041320759.533325040.88410.15260.89650.90771
8823243.220481.316218500.811622583.86480.0050.13020.96070.9948
8921490.221038.728418951.802623257.78980.3450.02580.85850.9982
9022925.822244.494820020.43324610.56650.28620.7340.87690.9999
9123184.820610.308218447.142422918.93580.01440.02470.79490.9927
9218562.218771.538616674.975921018.79050.42761e-040.81690.8169

\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[80]) \tabularnewline
68 & 16165.4 & - & - & - & - & - & - & - \tabularnewline
69 & 19464.6 & - & - & - & - & - & - & - \tabularnewline
70 & 19932.1 & - & - & - & - & - & - & - \tabularnewline
71 & 19961.2 & - & - & - & - & - & - & - \tabularnewline
72 & 17343.4000000000 & - & - & - & - & - & - & - \tabularnewline
73 & 18924.2 & - & - & - & - & - & - & - \tabularnewline
74 & 18574.1 & - & - & - & - & - & - & - \tabularnewline
75 & 21350.6 & - & - & - & - & - & - & - \tabularnewline
76 & 18594.6 & - & - & - & - & - & - & - \tabularnewline
77 & 19823.1 & - & - & - & - & - & - & - \tabularnewline
78 & 20844.4 & - & - & - & - & - & - & - \tabularnewline
79 & 19640.2 & - & - & - & - & - & - & - \tabularnewline
80 & 17735.4 & - & - & - & - & - & - & - \tabularnewline
81 & 19813.6 & 20917.4968 & 19466.8029 & 22431.1933 & 0.0764 & 1 & 0.97 & 1 \tabularnewline
82 & 22160 & 21873.6609 & 20379.7498 & 23431.4211 & 0.3593 & 0.9952 & 0.9927 & 1 \tabularnewline
83 & 20664.3 & 21462.3829 & 19911.6342 & 23083.4258 & 0.1673 & 0.1995 & 0.9652 & 1 \tabularnewline
84 & 17877.4 & 19078.7544 & 17411.7741 & 20837.9963 & 0.0904 & 0.0387 & 0.9734 & 0.9328 \tabularnewline
85 & 21211.2 & 20270.7545 & 18522.0375 & 22114.9642 & 0.1588 & 0.9945 & 0.9238 & 0.9965 \tabularnewline
86 & 21423.1 & 20020.7545 & 18200.2667 & 21946.3415 & 0.0767 & 0.1128 & 0.9296 & 0.99 \tabularnewline
87 & 21688.7 & 22840.0413 & 20759.5333 & 25040.8841 & 0.1526 & 0.8965 & 0.9077 & 1 \tabularnewline
88 & 23243.2 & 20481.3162 & 18500.8116 & 22583.8648 & 0.005 & 0.1302 & 0.9607 & 0.9948 \tabularnewline
89 & 21490.2 & 21038.7284 & 18951.8026 & 23257.7898 & 0.345 & 0.0258 & 0.8585 & 0.9982 \tabularnewline
90 & 22925.8 & 22244.4948 & 20020.433 & 24610.5665 & 0.2862 & 0.734 & 0.8769 & 0.9999 \tabularnewline
91 & 23184.8 & 20610.3082 & 18447.1424 & 22918.9358 & 0.0144 & 0.0247 & 0.7949 & 0.9927 \tabularnewline
92 & 18562.2 & 18771.5386 & 16674.9759 & 21018.7905 & 0.4276 & 1e-04 & 0.8169 & 0.8169 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=34359&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[80])[/C][/ROW]
[ROW][C]68[/C][C]16165.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]19464.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]70[/C][C]19932.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]71[/C][C]19961.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]72[/C][C]17343.4000000000[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]18924.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]74[/C][C]18574.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]75[/C][C]21350.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]76[/C][C]18594.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]77[/C][C]19823.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]78[/C][C]20844.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]79[/C][C]19640.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]80[/C][C]17735.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]81[/C][C]19813.6[/C][C]20917.4968[/C][C]19466.8029[/C][C]22431.1933[/C][C]0.0764[/C][C]1[/C][C]0.97[/C][C]1[/C][/ROW]
[ROW][C]82[/C][C]22160[/C][C]21873.6609[/C][C]20379.7498[/C][C]23431.4211[/C][C]0.3593[/C][C]0.9952[/C][C]0.9927[/C][C]1[/C][/ROW]
[ROW][C]83[/C][C]20664.3[/C][C]21462.3829[/C][C]19911.6342[/C][C]23083.4258[/C][C]0.1673[/C][C]0.1995[/C][C]0.9652[/C][C]1[/C][/ROW]
[ROW][C]84[/C][C]17877.4[/C][C]19078.7544[/C][C]17411.7741[/C][C]20837.9963[/C][C]0.0904[/C][C]0.0387[/C][C]0.9734[/C][C]0.9328[/C][/ROW]
[ROW][C]85[/C][C]21211.2[/C][C]20270.7545[/C][C]18522.0375[/C][C]22114.9642[/C][C]0.1588[/C][C]0.9945[/C][C]0.9238[/C][C]0.9965[/C][/ROW]
[ROW][C]86[/C][C]21423.1[/C][C]20020.7545[/C][C]18200.2667[/C][C]21946.3415[/C][C]0.0767[/C][C]0.1128[/C][C]0.9296[/C][C]0.99[/C][/ROW]
[ROW][C]87[/C][C]21688.7[/C][C]22840.0413[/C][C]20759.5333[/C][C]25040.8841[/C][C]0.1526[/C][C]0.8965[/C][C]0.9077[/C][C]1[/C][/ROW]
[ROW][C]88[/C][C]23243.2[/C][C]20481.3162[/C][C]18500.8116[/C][C]22583.8648[/C][C]0.005[/C][C]0.1302[/C][C]0.9607[/C][C]0.9948[/C][/ROW]
[ROW][C]89[/C][C]21490.2[/C][C]21038.7284[/C][C]18951.8026[/C][C]23257.7898[/C][C]0.345[/C][C]0.0258[/C][C]0.8585[/C][C]0.9982[/C][/ROW]
[ROW][C]90[/C][C]22925.8[/C][C]22244.4948[/C][C]20020.433[/C][C]24610.5665[/C][C]0.2862[/C][C]0.734[/C][C]0.8769[/C][C]0.9999[/C][/ROW]
[ROW][C]91[/C][C]23184.8[/C][C]20610.3082[/C][C]18447.1424[/C][C]22918.9358[/C][C]0.0144[/C][C]0.0247[/C][C]0.7949[/C][C]0.9927[/C][/ROW]
[ROW][C]92[/C][C]18562.2[/C][C]18771.5386[/C][C]16674.9759[/C][C]21018.7905[/C][C]0.4276[/C][C]1e-04[/C][C]0.8169[/C][C]0.8169[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=34359&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34359&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[80])
6816165.4-------
6919464.6-------
7019932.1-------
7119961.2-------
7217343.4000000000-------
7318924.2-------
7418574.1-------
7521350.6-------
7618594.6-------
7719823.1-------
7820844.4-------
7919640.2-------
8017735.4-------
8119813.620917.496819466.802922431.19330.076410.971
822216021873.660920379.749823431.42110.35930.99520.99271
8320664.321462.382919911.634223083.42580.16730.19950.96521
8417877.419078.754417411.774120837.99630.09040.03870.97340.9328
8521211.220270.754518522.037522114.96420.15880.99450.92380.9965
8621423.120020.754518200.266721946.34150.07670.11280.92960.99
8721688.722840.041320759.533325040.88410.15260.89650.90771
8823243.220481.316218500.811622583.86480.0050.13020.96070.9948
8921490.221038.728418951.802623257.78980.3450.02580.85850.9982
9022925.822244.494820020.43324610.56650.28620.7340.87690.9999
9123184.820610.308218447.142422918.93580.01440.02470.79490.9927
9218562.218771.538616674.975921018.79050.42761e-040.81690.8169







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
810.0369-0.05280.00441218588.1832101549.0153318.6676
820.03630.01310.001181990.06166832.505182.659
830.0385-0.03720.0031636936.25253078.021230.3867
840.047-0.0630.00521443252.4776120271.0398346.8012
850.04640.04640.0039884437.71873703.1432271.4832
860.04910.070.00581966572.7972163881.0664404.8223
870.0492-0.05040.00421325586.9026110465.5752332.3636
880.05240.13480.01127628002.2952635666.8579797.2872
890.05380.02150.0018203826.64616985.5538130.3286
900.05430.03060.0026464176.840138681.4033196.6759
910.05710.12490.01046628007.9872552333.9989743.1918
920.0611-0.01129e-0443822.65763651.888160.4309

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
81 & 0.0369 & -0.0528 & 0.0044 & 1218588.1832 & 101549.0153 & 318.6676 \tabularnewline
82 & 0.0363 & 0.0131 & 0.0011 & 81990.0616 & 6832.5051 & 82.659 \tabularnewline
83 & 0.0385 & -0.0372 & 0.0031 & 636936.252 & 53078.021 & 230.3867 \tabularnewline
84 & 0.047 & -0.063 & 0.0052 & 1443252.4776 & 120271.0398 & 346.8012 \tabularnewline
85 & 0.0464 & 0.0464 & 0.0039 & 884437.718 & 73703.1432 & 271.4832 \tabularnewline
86 & 0.0491 & 0.07 & 0.0058 & 1966572.7972 & 163881.0664 & 404.8223 \tabularnewline
87 & 0.0492 & -0.0504 & 0.0042 & 1325586.9026 & 110465.5752 & 332.3636 \tabularnewline
88 & 0.0524 & 0.1348 & 0.0112 & 7628002.2952 & 635666.8579 & 797.2872 \tabularnewline
89 & 0.0538 & 0.0215 & 0.0018 & 203826.646 & 16985.5538 & 130.3286 \tabularnewline
90 & 0.0543 & 0.0306 & 0.0026 & 464176.8401 & 38681.4033 & 196.6759 \tabularnewline
91 & 0.0571 & 0.1249 & 0.0104 & 6628007.9872 & 552333.9989 & 743.1918 \tabularnewline
92 & 0.0611 & -0.0112 & 9e-04 & 43822.6576 & 3651.8881 & 60.4309 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=34359&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]81[/C][C]0.0369[/C][C]-0.0528[/C][C]0.0044[/C][C]1218588.1832[/C][C]101549.0153[/C][C]318.6676[/C][/ROW]
[ROW][C]82[/C][C]0.0363[/C][C]0.0131[/C][C]0.0011[/C][C]81990.0616[/C][C]6832.5051[/C][C]82.659[/C][/ROW]
[ROW][C]83[/C][C]0.0385[/C][C]-0.0372[/C][C]0.0031[/C][C]636936.252[/C][C]53078.021[/C][C]230.3867[/C][/ROW]
[ROW][C]84[/C][C]0.047[/C][C]-0.063[/C][C]0.0052[/C][C]1443252.4776[/C][C]120271.0398[/C][C]346.8012[/C][/ROW]
[ROW][C]85[/C][C]0.0464[/C][C]0.0464[/C][C]0.0039[/C][C]884437.718[/C][C]73703.1432[/C][C]271.4832[/C][/ROW]
[ROW][C]86[/C][C]0.0491[/C][C]0.07[/C][C]0.0058[/C][C]1966572.7972[/C][C]163881.0664[/C][C]404.8223[/C][/ROW]
[ROW][C]87[/C][C]0.0492[/C][C]-0.0504[/C][C]0.0042[/C][C]1325586.9026[/C][C]110465.5752[/C][C]332.3636[/C][/ROW]
[ROW][C]88[/C][C]0.0524[/C][C]0.1348[/C][C]0.0112[/C][C]7628002.2952[/C][C]635666.8579[/C][C]797.2872[/C][/ROW]
[ROW][C]89[/C][C]0.0538[/C][C]0.0215[/C][C]0.0018[/C][C]203826.646[/C][C]16985.5538[/C][C]130.3286[/C][/ROW]
[ROW][C]90[/C][C]0.0543[/C][C]0.0306[/C][C]0.0026[/C][C]464176.8401[/C][C]38681.4033[/C][C]196.6759[/C][/ROW]
[ROW][C]91[/C][C]0.0571[/C][C]0.1249[/C][C]0.0104[/C][C]6628007.9872[/C][C]552333.9989[/C][C]743.1918[/C][/ROW]
[ROW][C]92[/C][C]0.0611[/C][C]-0.0112[/C][C]9e-04[/C][C]43822.6576[/C][C]3651.8881[/C][C]60.4309[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=34359&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34359&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
810.0369-0.05280.00441218588.1832101549.0153318.6676
820.03630.01310.001181990.06166832.505182.659
830.0385-0.03720.0031636936.25253078.021230.3867
840.047-0.0630.00521443252.4776120271.0398346.8012
850.04640.04640.0039884437.71873703.1432271.4832
860.04910.070.00581966572.7972163881.0664404.8223
870.0492-0.05040.00421325586.9026110465.5752332.3636
880.05240.13480.01127628002.2952635666.8579797.2872
890.05380.02150.0018203826.64616985.5538130.3286
900.05430.03060.0026464176.840138681.4033196.6759
910.05710.12490.01046628007.9872552333.9989743.1918
920.0611-0.01129e-0443822.65763651.888160.4309



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