Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationTue, 11 Dec 2007 09:36:10 -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/2007/Dec/11/t1197390660e91z4brgjx8k80w.htm/, Retrieved Sun, 28 Apr 2024 21:45:40 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3129, Retrieved Sun, 28 Apr 2024 21:45:40 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact206
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA forcasting ...] [2007-12-11 16:36:10] [a98121933c09d0d44a9f89053acd1df1] [Current]
Feedback Forum

Post a new message
Dataseries X:
112,1
104,2
102,4
100,3
102,6
101,5
103,4
99,4
97,9
98
90,2
87,1
91,8
94,8
91,8
89,3
91,7
86,2
82,8
82,3
79,8
79,4
85,3
87,5
88,3
88,6
94,9
94,7
92,6
91,8
96,4
96,4
107,1
111,9
107,8
109,2
115,3
119,2
107,8
106,8
104,2
94,8
97,5
98,3
100,6
94,9
93,6
98
104,3
103,9
105,3
102,6
103,3
107,9
107,8
109,8
110,6
110,8
119,3
128,1
127,6
137,9
151,4
143,6
143,4
141,9
135,2
133,1
129,6
134,1
136,8
143,5
162,5
163,1
157,2
158,8
155,4
148,5
154,2
153,3
149,4
147,9
156
163
159,1
159,5
157,3
156,4
156,6
162,4
166,8
162,6
168,1




Summary of compuational 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 compuational 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=3129&T=0

[TABLE]
[ROW][C]Summary of compuational 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=3129&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3129&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 compuational 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[81])
69129.6-------
70134.1-------
71136.8-------
72143.5-------
73162.5-------
74163.1-------
75157.2-------
76158.8-------
77155.4-------
78148.5-------
79154.2-------
80153.3-------
81149.4-------
82147.9149.871140.284159.45790.34350.53840.99940.5384
83156149.6409134.1391165.14260.21070.58710.94780.5121
84163149.7533130.795168.71160.08540.25920.7410.5146
85159.1149.6984127.5075171.88930.20320.120.12910.5105
86159.5149.7252124.8542174.59620.22060.230.14590.5102
87157.3149.7121122.3618177.06240.29330.24150.29580.5089
88156.4149.7185120.1234179.31360.32910.30780.27380.5084
89156.6149.7154118.0215181.40930.33510.33970.36260.5078
90162.4149.7169116.0606183.37320.23010.34430.52820.5074
91166.8149.7161114.2031185.22920.17290.2420.40230.507
92162.6149.7165112.4403186.99270.24910.18450.42530.5066
93168.1149.7163110.7561188.67660.17750.25840.50630.5063

\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[81]) \tabularnewline
69 & 129.6 & - & - & - & - & - & - & - \tabularnewline
70 & 134.1 & - & - & - & - & - & - & - \tabularnewline
71 & 136.8 & - & - & - & - & - & - & - \tabularnewline
72 & 143.5 & - & - & - & - & - & - & - \tabularnewline
73 & 162.5 & - & - & - & - & - & - & - \tabularnewline
74 & 163.1 & - & - & - & - & - & - & - \tabularnewline
75 & 157.2 & - & - & - & - & - & - & - \tabularnewline
76 & 158.8 & - & - & - & - & - & - & - \tabularnewline
77 & 155.4 & - & - & - & - & - & - & - \tabularnewline
78 & 148.5 & - & - & - & - & - & - & - \tabularnewline
79 & 154.2 & - & - & - & - & - & - & - \tabularnewline
80 & 153.3 & - & - & - & - & - & - & - \tabularnewline
81 & 149.4 & - & - & - & - & - & - & - \tabularnewline
82 & 147.9 & 149.871 & 140.284 & 159.4579 & 0.3435 & 0.5384 & 0.9994 & 0.5384 \tabularnewline
83 & 156 & 149.6409 & 134.1391 & 165.1426 & 0.2107 & 0.5871 & 0.9478 & 0.5121 \tabularnewline
84 & 163 & 149.7533 & 130.795 & 168.7116 & 0.0854 & 0.2592 & 0.741 & 0.5146 \tabularnewline
85 & 159.1 & 149.6984 & 127.5075 & 171.8893 & 0.2032 & 0.12 & 0.1291 & 0.5105 \tabularnewline
86 & 159.5 & 149.7252 & 124.8542 & 174.5962 & 0.2206 & 0.23 & 0.1459 & 0.5102 \tabularnewline
87 & 157.3 & 149.7121 & 122.3618 & 177.0624 & 0.2933 & 0.2415 & 0.2958 & 0.5089 \tabularnewline
88 & 156.4 & 149.7185 & 120.1234 & 179.3136 & 0.3291 & 0.3078 & 0.2738 & 0.5084 \tabularnewline
89 & 156.6 & 149.7154 & 118.0215 & 181.4093 & 0.3351 & 0.3397 & 0.3626 & 0.5078 \tabularnewline
90 & 162.4 & 149.7169 & 116.0606 & 183.3732 & 0.2301 & 0.3443 & 0.5282 & 0.5074 \tabularnewline
91 & 166.8 & 149.7161 & 114.2031 & 185.2292 & 0.1729 & 0.242 & 0.4023 & 0.507 \tabularnewline
92 & 162.6 & 149.7165 & 112.4403 & 186.9927 & 0.2491 & 0.1845 & 0.4253 & 0.5066 \tabularnewline
93 & 168.1 & 149.7163 & 110.7561 & 188.6766 & 0.1775 & 0.2584 & 0.5063 & 0.5063 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3129&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[81])[/C][/ROW]
[ROW][C]69[/C][C]129.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]70[/C][C]134.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]71[/C][C]136.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]72[/C][C]143.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]162.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]74[/C][C]163.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]75[/C][C]157.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]76[/C][C]158.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]77[/C][C]155.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]78[/C][C]148.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]79[/C][C]154.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]80[/C][C]153.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]81[/C][C]149.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]82[/C][C]147.9[/C][C]149.871[/C][C]140.284[/C][C]159.4579[/C][C]0.3435[/C][C]0.5384[/C][C]0.9994[/C][C]0.5384[/C][/ROW]
[ROW][C]83[/C][C]156[/C][C]149.6409[/C][C]134.1391[/C][C]165.1426[/C][C]0.2107[/C][C]0.5871[/C][C]0.9478[/C][C]0.5121[/C][/ROW]
[ROW][C]84[/C][C]163[/C][C]149.7533[/C][C]130.795[/C][C]168.7116[/C][C]0.0854[/C][C]0.2592[/C][C]0.741[/C][C]0.5146[/C][/ROW]
[ROW][C]85[/C][C]159.1[/C][C]149.6984[/C][C]127.5075[/C][C]171.8893[/C][C]0.2032[/C][C]0.12[/C][C]0.1291[/C][C]0.5105[/C][/ROW]
[ROW][C]86[/C][C]159.5[/C][C]149.7252[/C][C]124.8542[/C][C]174.5962[/C][C]0.2206[/C][C]0.23[/C][C]0.1459[/C][C]0.5102[/C][/ROW]
[ROW][C]87[/C][C]157.3[/C][C]149.7121[/C][C]122.3618[/C][C]177.0624[/C][C]0.2933[/C][C]0.2415[/C][C]0.2958[/C][C]0.5089[/C][/ROW]
[ROW][C]88[/C][C]156.4[/C][C]149.7185[/C][C]120.1234[/C][C]179.3136[/C][C]0.3291[/C][C]0.3078[/C][C]0.2738[/C][C]0.5084[/C][/ROW]
[ROW][C]89[/C][C]156.6[/C][C]149.7154[/C][C]118.0215[/C][C]181.4093[/C][C]0.3351[/C][C]0.3397[/C][C]0.3626[/C][C]0.5078[/C][/ROW]
[ROW][C]90[/C][C]162.4[/C][C]149.7169[/C][C]116.0606[/C][C]183.3732[/C][C]0.2301[/C][C]0.3443[/C][C]0.5282[/C][C]0.5074[/C][/ROW]
[ROW][C]91[/C][C]166.8[/C][C]149.7161[/C][C]114.2031[/C][C]185.2292[/C][C]0.1729[/C][C]0.242[/C][C]0.4023[/C][C]0.507[/C][/ROW]
[ROW][C]92[/C][C]162.6[/C][C]149.7165[/C][C]112.4403[/C][C]186.9927[/C][C]0.2491[/C][C]0.1845[/C][C]0.4253[/C][C]0.5066[/C][/ROW]
[ROW][C]93[/C][C]168.1[/C][C]149.7163[/C][C]110.7561[/C][C]188.6766[/C][C]0.1775[/C][C]0.2584[/C][C]0.5063[/C][C]0.5063[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3129&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3129&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[81])
69129.6-------
70134.1-------
71136.8-------
72143.5-------
73162.5-------
74163.1-------
75157.2-------
76158.8-------
77155.4-------
78148.5-------
79154.2-------
80153.3-------
81149.4-------
82147.9149.871140.284159.45790.34350.53840.99940.5384
83156149.6409134.1391165.14260.21070.58710.94780.5121
84163149.7533130.795168.71160.08540.25920.7410.5146
85159.1149.6984127.5075171.88930.20320.120.12910.5105
86159.5149.7252124.8542174.59620.22060.230.14590.5102
87157.3149.7121122.3618177.06240.29330.24150.29580.5089
88156.4149.7185120.1234179.31360.32910.30780.27380.5084
89156.6149.7154118.0215181.40930.33510.33970.36260.5078
90162.4149.7169116.0606183.37320.23010.34430.52820.5074
91166.8149.7161114.2031185.22920.17290.2420.40230.507
92162.6149.7165112.4403186.99270.24910.18450.42530.5066
93168.1149.7163110.7561188.67660.17750.25840.50630.5063







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
820.0326-0.01320.00113.88480.32370.569
830.05290.04250.003540.43863.36991.8357
840.06460.08850.0074175.475214.62293.824
850.07560.06280.005288.39087.36592.714
860.08480.06530.005495.54677.96222.8217
870.09320.05070.004257.57644.7982.1904
880.10090.04460.003744.64253.72021.9288
890.1080.0460.003847.39823.94981.9874
900.11470.08470.0071160.861213.40513.6613
910.1210.11410.0095291.85824.32154.9317
920.1270.08610.0072165.984213.8323.7191
930.13280.12280.0102337.959228.16335.3069

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
82 & 0.0326 & -0.0132 & 0.0011 & 3.8848 & 0.3237 & 0.569 \tabularnewline
83 & 0.0529 & 0.0425 & 0.0035 & 40.4386 & 3.3699 & 1.8357 \tabularnewline
84 & 0.0646 & 0.0885 & 0.0074 & 175.4752 & 14.6229 & 3.824 \tabularnewline
85 & 0.0756 & 0.0628 & 0.0052 & 88.3908 & 7.3659 & 2.714 \tabularnewline
86 & 0.0848 & 0.0653 & 0.0054 & 95.5467 & 7.9622 & 2.8217 \tabularnewline
87 & 0.0932 & 0.0507 & 0.0042 & 57.5764 & 4.798 & 2.1904 \tabularnewline
88 & 0.1009 & 0.0446 & 0.0037 & 44.6425 & 3.7202 & 1.9288 \tabularnewline
89 & 0.108 & 0.046 & 0.0038 & 47.3982 & 3.9498 & 1.9874 \tabularnewline
90 & 0.1147 & 0.0847 & 0.0071 & 160.8612 & 13.4051 & 3.6613 \tabularnewline
91 & 0.121 & 0.1141 & 0.0095 & 291.858 & 24.3215 & 4.9317 \tabularnewline
92 & 0.127 & 0.0861 & 0.0072 & 165.9842 & 13.832 & 3.7191 \tabularnewline
93 & 0.1328 & 0.1228 & 0.0102 & 337.9592 & 28.1633 & 5.3069 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3129&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]82[/C][C]0.0326[/C][C]-0.0132[/C][C]0.0011[/C][C]3.8848[/C][C]0.3237[/C][C]0.569[/C][/ROW]
[ROW][C]83[/C][C]0.0529[/C][C]0.0425[/C][C]0.0035[/C][C]40.4386[/C][C]3.3699[/C][C]1.8357[/C][/ROW]
[ROW][C]84[/C][C]0.0646[/C][C]0.0885[/C][C]0.0074[/C][C]175.4752[/C][C]14.6229[/C][C]3.824[/C][/ROW]
[ROW][C]85[/C][C]0.0756[/C][C]0.0628[/C][C]0.0052[/C][C]88.3908[/C][C]7.3659[/C][C]2.714[/C][/ROW]
[ROW][C]86[/C][C]0.0848[/C][C]0.0653[/C][C]0.0054[/C][C]95.5467[/C][C]7.9622[/C][C]2.8217[/C][/ROW]
[ROW][C]87[/C][C]0.0932[/C][C]0.0507[/C][C]0.0042[/C][C]57.5764[/C][C]4.798[/C][C]2.1904[/C][/ROW]
[ROW][C]88[/C][C]0.1009[/C][C]0.0446[/C][C]0.0037[/C][C]44.6425[/C][C]3.7202[/C][C]1.9288[/C][/ROW]
[ROW][C]89[/C][C]0.108[/C][C]0.046[/C][C]0.0038[/C][C]47.3982[/C][C]3.9498[/C][C]1.9874[/C][/ROW]
[ROW][C]90[/C][C]0.1147[/C][C]0.0847[/C][C]0.0071[/C][C]160.8612[/C][C]13.4051[/C][C]3.6613[/C][/ROW]
[ROW][C]91[/C][C]0.121[/C][C]0.1141[/C][C]0.0095[/C][C]291.858[/C][C]24.3215[/C][C]4.9317[/C][/ROW]
[ROW][C]92[/C][C]0.127[/C][C]0.0861[/C][C]0.0072[/C][C]165.9842[/C][C]13.832[/C][C]3.7191[/C][/ROW]
[ROW][C]93[/C][C]0.1328[/C][C]0.1228[/C][C]0.0102[/C][C]337.9592[/C][C]28.1633[/C][C]5.3069[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3129&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3129&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
820.0326-0.01320.00113.88480.32370.569
830.05290.04250.003540.43863.36991.8357
840.06460.08850.0074175.475214.62293.824
850.07560.06280.005288.39087.36592.714
860.08480.06530.005495.54677.96222.8217
870.09320.05070.004257.57644.7982.1904
880.10090.04460.003744.64253.72021.9288
890.1080.0460.003847.39823.94981.9874
900.11470.08470.0071160.861213.40513.6613
910.1210.11410.0095291.85824.32154.9317
920.1270.08610.0072165.984213.8323.7191
930.13280.12280.0102337.959228.16335.3069



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