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 06:55:01 -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/t1197380445vy4glizdhljkun6.htm/, Retrieved Sun, 28 Apr 2024 21:23:15 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3110, Retrieved Sun, 28 Apr 2024 21:23:15 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsWS 12 G 29
Estimated Impact212
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Forecast totaal] [2007-12-11 13:55:01] [7a600ca82a81f1b71fd92dcbb183f5b4] [Current]
Feedback Forum

Post a new message
Dataseries X:
153,4
159,5
157,4
169,1
172,6
161,7
159,2
157,4
153,9
144,8
142,2
140,1
143,4
153,3
166,9
170,6
182,8
170,3
156,6
155,2
154,7
151,6
152,1
153,2
149,5
149,7
144,3
140
137,8
132,2
128,9
123,1
120,4
122,8
126
124,5
120,6
114,7
111,7
109,1
108
107,7
99,9
103,7
103,4
103,4
104,7
105,8
105,3
103
103,8
103,4
105,8
101,4
97
94,3
96,6
97,1
95,7
96,9
97,4
95,3
93,6
91,5
93,1
91,7
94,3
93,9
90,9
88,3
91,3
91,7
92,4
92
95,6
95,8
96,4
99
107
109,7
116,2
115,9
113,8
112,6
113,7
115,9
110,3
111,3
113,4
108,2
104,8
106
110,9
115
118,4
121,4
128,8
131,7
141,7
142,9
139,4
134,7
125
113,6
111,5
108,5
112,3
116,6
115,5
120,1
132,9
128,1
129,3
132,5
131
124,9
120,8
122
122,1
127,4
135,2
137,3
135
136
138,4
134,7
138,4
133,9
133,6




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time8 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001

\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 & 8 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ 193.190.124.10:1001 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3110&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]8 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ 193.190.124.10:1001[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3110&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3110&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 time8 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001







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[117])
105111.5-------
106108.5-------
107112.3-------
108116.6-------
109115.5-------
110120.1-------
111132.9-------
112128.1-------
113129.3-------
114132.5-------
115131-------
116124.9-------
117120.8-------
118122118.5894111.0686126.61960.20260.29480.99310.2948
119122.1117.4268105.6579130.50660.24190.24660.77880.3066
120127.4116.962101.8882134.26580.11850.28030.51640.3319
121135.2115.611497.6096136.93330.03590.13930.50410.3167
122137.3115.881195.1957141.06120.04770.06630.37130.3509
123135115.401592.4868143.99360.08960.06670.11520.3557
124136114.611789.7894146.29620.09290.10360.2020.3509
125138.4115.372688.5147150.380.09870.12410.21780.3806
126134.7115.790387.1206153.89450.16540.12240.1950.3983
127138.4116.248785.8803157.35580.14540.18950.24090.4141
128133.9117.255585.1412161.48290.23040.17440.36740.4376
129133.6117.019483.5879163.82190.24370.23980.43710.4371

\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[117]) \tabularnewline
105 & 111.5 & - & - & - & - & - & - & - \tabularnewline
106 & 108.5 & - & - & - & - & - & - & - \tabularnewline
107 & 112.3 & - & - & - & - & - & - & - \tabularnewline
108 & 116.6 & - & - & - & - & - & - & - \tabularnewline
109 & 115.5 & - & - & - & - & - & - & - \tabularnewline
110 & 120.1 & - & - & - & - & - & - & - \tabularnewline
111 & 132.9 & - & - & - & - & - & - & - \tabularnewline
112 & 128.1 & - & - & - & - & - & - & - \tabularnewline
113 & 129.3 & - & - & - & - & - & - & - \tabularnewline
114 & 132.5 & - & - & - & - & - & - & - \tabularnewline
115 & 131 & - & - & - & - & - & - & - \tabularnewline
116 & 124.9 & - & - & - & - & - & - & - \tabularnewline
117 & 120.8 & - & - & - & - & - & - & - \tabularnewline
118 & 122 & 118.5894 & 111.0686 & 126.6196 & 0.2026 & 0.2948 & 0.9931 & 0.2948 \tabularnewline
119 & 122.1 & 117.4268 & 105.6579 & 130.5066 & 0.2419 & 0.2466 & 0.7788 & 0.3066 \tabularnewline
120 & 127.4 & 116.962 & 101.8882 & 134.2658 & 0.1185 & 0.2803 & 0.5164 & 0.3319 \tabularnewline
121 & 135.2 & 115.6114 & 97.6096 & 136.9333 & 0.0359 & 0.1393 & 0.5041 & 0.3167 \tabularnewline
122 & 137.3 & 115.8811 & 95.1957 & 141.0612 & 0.0477 & 0.0663 & 0.3713 & 0.3509 \tabularnewline
123 & 135 & 115.4015 & 92.4868 & 143.9936 & 0.0896 & 0.0667 & 0.1152 & 0.3557 \tabularnewline
124 & 136 & 114.6117 & 89.7894 & 146.2962 & 0.0929 & 0.1036 & 0.202 & 0.3509 \tabularnewline
125 & 138.4 & 115.3726 & 88.5147 & 150.38 & 0.0987 & 0.1241 & 0.2178 & 0.3806 \tabularnewline
126 & 134.7 & 115.7903 & 87.1206 & 153.8945 & 0.1654 & 0.1224 & 0.195 & 0.3983 \tabularnewline
127 & 138.4 & 116.2487 & 85.8803 & 157.3558 & 0.1454 & 0.1895 & 0.2409 & 0.4141 \tabularnewline
128 & 133.9 & 117.2555 & 85.1412 & 161.4829 & 0.2304 & 0.1744 & 0.3674 & 0.4376 \tabularnewline
129 & 133.6 & 117.0194 & 83.5879 & 163.8219 & 0.2437 & 0.2398 & 0.4371 & 0.4371 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3110&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[117])[/C][/ROW]
[ROW][C]105[/C][C]111.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]108.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]112.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]116.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]115.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]120.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]132.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]128.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]129.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]132.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]131[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]116[/C][C]124.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]117[/C][C]120.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]118[/C][C]122[/C][C]118.5894[/C][C]111.0686[/C][C]126.6196[/C][C]0.2026[/C][C]0.2948[/C][C]0.9931[/C][C]0.2948[/C][/ROW]
[ROW][C]119[/C][C]122.1[/C][C]117.4268[/C][C]105.6579[/C][C]130.5066[/C][C]0.2419[/C][C]0.2466[/C][C]0.7788[/C][C]0.3066[/C][/ROW]
[ROW][C]120[/C][C]127.4[/C][C]116.962[/C][C]101.8882[/C][C]134.2658[/C][C]0.1185[/C][C]0.2803[/C][C]0.5164[/C][C]0.3319[/C][/ROW]
[ROW][C]121[/C][C]135.2[/C][C]115.6114[/C][C]97.6096[/C][C]136.9333[/C][C]0.0359[/C][C]0.1393[/C][C]0.5041[/C][C]0.3167[/C][/ROW]
[ROW][C]122[/C][C]137.3[/C][C]115.8811[/C][C]95.1957[/C][C]141.0612[/C][C]0.0477[/C][C]0.0663[/C][C]0.3713[/C][C]0.3509[/C][/ROW]
[ROW][C]123[/C][C]135[/C][C]115.4015[/C][C]92.4868[/C][C]143.9936[/C][C]0.0896[/C][C]0.0667[/C][C]0.1152[/C][C]0.3557[/C][/ROW]
[ROW][C]124[/C][C]136[/C][C]114.6117[/C][C]89.7894[/C][C]146.2962[/C][C]0.0929[/C][C]0.1036[/C][C]0.202[/C][C]0.3509[/C][/ROW]
[ROW][C]125[/C][C]138.4[/C][C]115.3726[/C][C]88.5147[/C][C]150.38[/C][C]0.0987[/C][C]0.1241[/C][C]0.2178[/C][C]0.3806[/C][/ROW]
[ROW][C]126[/C][C]134.7[/C][C]115.7903[/C][C]87.1206[/C][C]153.8945[/C][C]0.1654[/C][C]0.1224[/C][C]0.195[/C][C]0.3983[/C][/ROW]
[ROW][C]127[/C][C]138.4[/C][C]116.2487[/C][C]85.8803[/C][C]157.3558[/C][C]0.1454[/C][C]0.1895[/C][C]0.2409[/C][C]0.4141[/C][/ROW]
[ROW][C]128[/C][C]133.9[/C][C]117.2555[/C][C]85.1412[/C][C]161.4829[/C][C]0.2304[/C][C]0.1744[/C][C]0.3674[/C][C]0.4376[/C][/ROW]
[ROW][C]129[/C][C]133.6[/C][C]117.0194[/C][C]83.5879[/C][C]163.8219[/C][C]0.2437[/C][C]0.2398[/C][C]0.4371[/C][C]0.4371[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3110&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3110&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[117])
105111.5-------
106108.5-------
107112.3-------
108116.6-------
109115.5-------
110120.1-------
111132.9-------
112128.1-------
113129.3-------
114132.5-------
115131-------
116124.9-------
117120.8-------
118122118.5894111.0686126.61960.20260.29480.99310.2948
119122.1117.4268105.6579130.50660.24190.24660.77880.3066
120127.4116.962101.8882134.26580.11850.28030.51640.3319
121135.2115.611497.6096136.93330.03590.13930.50410.3167
122137.3115.881195.1957141.06120.04770.06630.37130.3509
123135115.401592.4868143.99360.08960.06670.11520.3557
124136114.611789.7894146.29620.09290.10360.2020.3509
125138.4115.372688.5147150.380.09870.12410.21780.3806
126134.7115.790387.1206153.89450.16540.12240.1950.3983
127138.4116.248785.8803157.35580.14540.18950.24090.4141
128133.9117.255585.1412161.48290.23040.17440.36740.4376
129133.6117.019483.5879163.82190.24370.23980.43710.4371







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1180.03450.02880.002411.63190.96930.9845
1190.05680.03980.003321.83841.81991.349
1200.07550.08920.0074108.95269.07943.0132
1210.09410.16940.0141383.712931.97615.6547
1220.11090.18480.0154458.770238.23086.1831
1230.12640.16980.0142384.101632.00855.6576
1240.1410.18660.0156457.45838.12156.1743
1250.15480.19960.0166530.258944.18826.6474
1260.16790.16330.0136357.57829.79825.4588
1270.18040.19060.0159490.679940.896.3945
1280.19240.1420.0118277.038723.08664.8048
1290.20410.14170.0118274.917522.90984.7864

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
118 & 0.0345 & 0.0288 & 0.0024 & 11.6319 & 0.9693 & 0.9845 \tabularnewline
119 & 0.0568 & 0.0398 & 0.0033 & 21.8384 & 1.8199 & 1.349 \tabularnewline
120 & 0.0755 & 0.0892 & 0.0074 & 108.9526 & 9.0794 & 3.0132 \tabularnewline
121 & 0.0941 & 0.1694 & 0.0141 & 383.7129 & 31.9761 & 5.6547 \tabularnewline
122 & 0.1109 & 0.1848 & 0.0154 & 458.7702 & 38.2308 & 6.1831 \tabularnewline
123 & 0.1264 & 0.1698 & 0.0142 & 384.1016 & 32.0085 & 5.6576 \tabularnewline
124 & 0.141 & 0.1866 & 0.0156 & 457.458 & 38.1215 & 6.1743 \tabularnewline
125 & 0.1548 & 0.1996 & 0.0166 & 530.2589 & 44.1882 & 6.6474 \tabularnewline
126 & 0.1679 & 0.1633 & 0.0136 & 357.578 & 29.7982 & 5.4588 \tabularnewline
127 & 0.1804 & 0.1906 & 0.0159 & 490.6799 & 40.89 & 6.3945 \tabularnewline
128 & 0.1924 & 0.142 & 0.0118 & 277.0387 & 23.0866 & 4.8048 \tabularnewline
129 & 0.2041 & 0.1417 & 0.0118 & 274.9175 & 22.9098 & 4.7864 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3110&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]118[/C][C]0.0345[/C][C]0.0288[/C][C]0.0024[/C][C]11.6319[/C][C]0.9693[/C][C]0.9845[/C][/ROW]
[ROW][C]119[/C][C]0.0568[/C][C]0.0398[/C][C]0.0033[/C][C]21.8384[/C][C]1.8199[/C][C]1.349[/C][/ROW]
[ROW][C]120[/C][C]0.0755[/C][C]0.0892[/C][C]0.0074[/C][C]108.9526[/C][C]9.0794[/C][C]3.0132[/C][/ROW]
[ROW][C]121[/C][C]0.0941[/C][C]0.1694[/C][C]0.0141[/C][C]383.7129[/C][C]31.9761[/C][C]5.6547[/C][/ROW]
[ROW][C]122[/C][C]0.1109[/C][C]0.1848[/C][C]0.0154[/C][C]458.7702[/C][C]38.2308[/C][C]6.1831[/C][/ROW]
[ROW][C]123[/C][C]0.1264[/C][C]0.1698[/C][C]0.0142[/C][C]384.1016[/C][C]32.0085[/C][C]5.6576[/C][/ROW]
[ROW][C]124[/C][C]0.141[/C][C]0.1866[/C][C]0.0156[/C][C]457.458[/C][C]38.1215[/C][C]6.1743[/C][/ROW]
[ROW][C]125[/C][C]0.1548[/C][C]0.1996[/C][C]0.0166[/C][C]530.2589[/C][C]44.1882[/C][C]6.6474[/C][/ROW]
[ROW][C]126[/C][C]0.1679[/C][C]0.1633[/C][C]0.0136[/C][C]357.578[/C][C]29.7982[/C][C]5.4588[/C][/ROW]
[ROW][C]127[/C][C]0.1804[/C][C]0.1906[/C][C]0.0159[/C][C]490.6799[/C][C]40.89[/C][C]6.3945[/C][/ROW]
[ROW][C]128[/C][C]0.1924[/C][C]0.142[/C][C]0.0118[/C][C]277.0387[/C][C]23.0866[/C][C]4.8048[/C][/ROW]
[ROW][C]129[/C][C]0.2041[/C][C]0.1417[/C][C]0.0118[/C][C]274.9175[/C][C]22.9098[/C][C]4.7864[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3110&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3110&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
1180.03450.02880.002411.63190.96930.9845
1190.05680.03980.003321.83841.81991.349
1200.07550.08920.0074108.95269.07943.0132
1210.09410.16940.0141383.712931.97615.6547
1220.11090.18480.0154458.770238.23086.1831
1230.12640.16980.0142384.101632.00855.6576
1240.1410.18660.0156457.45838.12156.1743
1250.15480.19960.0166530.258944.18826.6474
1260.16790.16330.0136357.57829.79825.4588
1270.18040.19060.0159490.679940.896.3945
1280.19240.1420.0118277.038723.08664.8048
1290.20410.14170.0118274.917522.90984.7864



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