Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationThu, 13 Dec 2007 03:48:05 -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/13/t1197541983wsvb5l13v9ogt7s.htm/, Retrieved Sun, 05 May 2024 14:13:56 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3418, Retrieved Sun, 05 May 2024 14:13:56 +0000
QR Codes:

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

Post a new message
Dataseries X:
145,3
143,6
142,8
155,9
156,2
149,8
152,7
155,5
159,3
143
141,4
142,8
146,4
152,3
164,3
168
171,3
162,7
150,2
142,5
138,2
138
145,1
138,4
131,8
130,8
126,3
123
124
120,8
122,1
106,5
104,3
108,7
113,8
112,5
106,1
98,4
96
99,3
97,5
95,3
88
94,7
99,4
98,9
96,4
95,3
99,5
101,6
103,9
106,6
108,3
102
93,8
91,6
97,7
94,8
98
103,8
97,8
91,2
89,3
87,5
90,4
94,2
102,2
101,3
96
90,8
93,2
90,9
91,1
90,2
94,3
96
99
103,3
113,1
112,8
112,1
107,4
111
110,5
110,8
112,4
111,5
116,2
122,5
121,3
113,9
110,7
120,8
141,1
147,4
148
158,1
165
187
190,3
182,4
168,8
151,2
120,1
112,5
106,2
107,1
108,5
106,5
108,3
125,6
124
127,2
136,9
135,8
124,3
115,4
113,6
114,4
118,4
117
116,5
115,4
113,6
117,4
116,9
116,4
111,1
110,2
118,9
131,8
130,6
138,3
148,4
148,7
144,3
152,5
162,9
167,2
166,5
185,6




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3418&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 time6 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[129])
117115.4-------
118113.6-------
119114.4-------
120118.4-------
121117-------
122116.5-------
123115.4-------
124113.6-------
125117.4-------
126116.9-------
127116.4-------
128111.1-------
129110.2-------
130118.9111.278101.1473122.42340.09010.57520.34150.5752
131131.8114.622897.4781134.7830.04750.33880.50860.6664
132130.6115.058593.9195140.95540.11970.10260.40020.6435
133138.3116.020491.8171146.60370.07670.17510.4750.6454
134148.4116.250389.7466150.5810.03320.1040.49430.6351
135148.7120.00890.7674158.66840.07290.0750.59240.6905
136144.3122.277890.898164.49050.15330.10990.65650.7125
137152.5123.8690.7219169.10260.10740.18790.61020.723
138162.9121.464487.8375167.96480.04040.09540.57630.6825
139167.2118.12784.4794165.17610.02050.03110.52870.6294
140166.5110.655478.3699156.24140.00820.00750.49240.5078
141185.6110.893277.8696157.92179e-040.01020.51150.5115

\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[129]) \tabularnewline
117 & 115.4 & - & - & - & - & - & - & - \tabularnewline
118 & 113.6 & - & - & - & - & - & - & - \tabularnewline
119 & 114.4 & - & - & - & - & - & - & - \tabularnewline
120 & 118.4 & - & - & - & - & - & - & - \tabularnewline
121 & 117 & - & - & - & - & - & - & - \tabularnewline
122 & 116.5 & - & - & - & - & - & - & - \tabularnewline
123 & 115.4 & - & - & - & - & - & - & - \tabularnewline
124 & 113.6 & - & - & - & - & - & - & - \tabularnewline
125 & 117.4 & - & - & - & - & - & - & - \tabularnewline
126 & 116.9 & - & - & - & - & - & - & - \tabularnewline
127 & 116.4 & - & - & - & - & - & - & - \tabularnewline
128 & 111.1 & - & - & - & - & - & - & - \tabularnewline
129 & 110.2 & - & - & - & - & - & - & - \tabularnewline
130 & 118.9 & 111.278 & 101.1473 & 122.4234 & 0.0901 & 0.5752 & 0.3415 & 0.5752 \tabularnewline
131 & 131.8 & 114.6228 & 97.4781 & 134.783 & 0.0475 & 0.3388 & 0.5086 & 0.6664 \tabularnewline
132 & 130.6 & 115.0585 & 93.9195 & 140.9554 & 0.1197 & 0.1026 & 0.4002 & 0.6435 \tabularnewline
133 & 138.3 & 116.0204 & 91.8171 & 146.6037 & 0.0767 & 0.1751 & 0.475 & 0.6454 \tabularnewline
134 & 148.4 & 116.2503 & 89.7466 & 150.581 & 0.0332 & 0.104 & 0.4943 & 0.6351 \tabularnewline
135 & 148.7 & 120.008 & 90.7674 & 158.6684 & 0.0729 & 0.075 & 0.5924 & 0.6905 \tabularnewline
136 & 144.3 & 122.2778 & 90.898 & 164.4905 & 0.1533 & 0.1099 & 0.6565 & 0.7125 \tabularnewline
137 & 152.5 & 123.86 & 90.7219 & 169.1026 & 0.1074 & 0.1879 & 0.6102 & 0.723 \tabularnewline
138 & 162.9 & 121.4644 & 87.8375 & 167.9648 & 0.0404 & 0.0954 & 0.5763 & 0.6825 \tabularnewline
139 & 167.2 & 118.127 & 84.4794 & 165.1761 & 0.0205 & 0.0311 & 0.5287 & 0.6294 \tabularnewline
140 & 166.5 & 110.6554 & 78.3699 & 156.2414 & 0.0082 & 0.0075 & 0.4924 & 0.5078 \tabularnewline
141 & 185.6 & 110.8932 & 77.8696 & 157.9217 & 9e-04 & 0.0102 & 0.5115 & 0.5115 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3418&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[129])[/C][/ROW]
[ROW][C]117[/C][C]115.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]118[/C][C]113.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]119[/C][C]114.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]120[/C][C]118.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]117[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]122[/C][C]116.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]123[/C][C]115.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]124[/C][C]113.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]125[/C][C]117.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]126[/C][C]116.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]127[/C][C]116.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]128[/C][C]111.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]129[/C][C]110.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]130[/C][C]118.9[/C][C]111.278[/C][C]101.1473[/C][C]122.4234[/C][C]0.0901[/C][C]0.5752[/C][C]0.3415[/C][C]0.5752[/C][/ROW]
[ROW][C]131[/C][C]131.8[/C][C]114.6228[/C][C]97.4781[/C][C]134.783[/C][C]0.0475[/C][C]0.3388[/C][C]0.5086[/C][C]0.6664[/C][/ROW]
[ROW][C]132[/C][C]130.6[/C][C]115.0585[/C][C]93.9195[/C][C]140.9554[/C][C]0.1197[/C][C]0.1026[/C][C]0.4002[/C][C]0.6435[/C][/ROW]
[ROW][C]133[/C][C]138.3[/C][C]116.0204[/C][C]91.8171[/C][C]146.6037[/C][C]0.0767[/C][C]0.1751[/C][C]0.475[/C][C]0.6454[/C][/ROW]
[ROW][C]134[/C][C]148.4[/C][C]116.2503[/C][C]89.7466[/C][C]150.581[/C][C]0.0332[/C][C]0.104[/C][C]0.4943[/C][C]0.6351[/C][/ROW]
[ROW][C]135[/C][C]148.7[/C][C]120.008[/C][C]90.7674[/C][C]158.6684[/C][C]0.0729[/C][C]0.075[/C][C]0.5924[/C][C]0.6905[/C][/ROW]
[ROW][C]136[/C][C]144.3[/C][C]122.2778[/C][C]90.898[/C][C]164.4905[/C][C]0.1533[/C][C]0.1099[/C][C]0.6565[/C][C]0.7125[/C][/ROW]
[ROW][C]137[/C][C]152.5[/C][C]123.86[/C][C]90.7219[/C][C]169.1026[/C][C]0.1074[/C][C]0.1879[/C][C]0.6102[/C][C]0.723[/C][/ROW]
[ROW][C]138[/C][C]162.9[/C][C]121.4644[/C][C]87.8375[/C][C]167.9648[/C][C]0.0404[/C][C]0.0954[/C][C]0.5763[/C][C]0.6825[/C][/ROW]
[ROW][C]139[/C][C]167.2[/C][C]118.127[/C][C]84.4794[/C][C]165.1761[/C][C]0.0205[/C][C]0.0311[/C][C]0.5287[/C][C]0.6294[/C][/ROW]
[ROW][C]140[/C][C]166.5[/C][C]110.6554[/C][C]78.3699[/C][C]156.2414[/C][C]0.0082[/C][C]0.0075[/C][C]0.4924[/C][C]0.5078[/C][/ROW]
[ROW][C]141[/C][C]185.6[/C][C]110.8932[/C][C]77.8696[/C][C]157.9217[/C][C]9e-04[/C][C]0.0102[/C][C]0.5115[/C][C]0.5115[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3418&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3418&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[129])
117115.4-------
118113.6-------
119114.4-------
120118.4-------
121117-------
122116.5-------
123115.4-------
124113.6-------
125117.4-------
126116.9-------
127116.4-------
128111.1-------
129110.2-------
130118.9111.278101.1473122.42340.09010.57520.34150.5752
131131.8114.622897.4781134.7830.04750.33880.50860.6664
132130.6115.058593.9195140.95540.11970.10260.40020.6435
133138.3116.020491.8171146.60370.07670.17510.4750.6454
134148.4116.250389.7466150.5810.03320.1040.49430.6351
135148.7120.00890.7674158.66840.07290.0750.59240.6905
136144.3122.277890.898164.49050.15330.10990.65650.7125
137152.5123.8690.7219169.10260.10740.18790.61020.723
138162.9121.464487.8375167.96480.04040.09540.57630.6825
139167.2118.12784.4794165.17610.02050.03110.52870.6294
140166.5110.655478.3699156.24140.00820.00750.49240.5078
141185.6110.893277.8696157.92179e-040.01020.51150.5115







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1300.05110.06850.005758.09484.84122.2003
1310.08970.14990.0125295.054624.58794.9586
1320.11480.13510.0113241.539120.12834.4865
1330.13450.1920.016496.382741.36526.4316
1340.15070.27660.0231033.601886.13359.2808
1350.16440.23910.0199823.232168.60278.2827
1360.17610.18010.015484.978640.41496.3573
1370.18640.23120.0193820.248668.3548.2677
1380.19530.34110.02841716.9067143.075611.9614
1390.20320.41540.03462408.1608200.680114.1662
1400.21020.50470.04213118.6169259.884716.1209
1410.21640.67370.05615581.1098465.092521.566

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
130 & 0.0511 & 0.0685 & 0.0057 & 58.0948 & 4.8412 & 2.2003 \tabularnewline
131 & 0.0897 & 0.1499 & 0.0125 & 295.0546 & 24.5879 & 4.9586 \tabularnewline
132 & 0.1148 & 0.1351 & 0.0113 & 241.5391 & 20.1283 & 4.4865 \tabularnewline
133 & 0.1345 & 0.192 & 0.016 & 496.3827 & 41.3652 & 6.4316 \tabularnewline
134 & 0.1507 & 0.2766 & 0.023 & 1033.6018 & 86.1335 & 9.2808 \tabularnewline
135 & 0.1644 & 0.2391 & 0.0199 & 823.2321 & 68.6027 & 8.2827 \tabularnewline
136 & 0.1761 & 0.1801 & 0.015 & 484.9786 & 40.4149 & 6.3573 \tabularnewline
137 & 0.1864 & 0.2312 & 0.0193 & 820.2486 & 68.354 & 8.2677 \tabularnewline
138 & 0.1953 & 0.3411 & 0.0284 & 1716.9067 & 143.0756 & 11.9614 \tabularnewline
139 & 0.2032 & 0.4154 & 0.0346 & 2408.1608 & 200.6801 & 14.1662 \tabularnewline
140 & 0.2102 & 0.5047 & 0.0421 & 3118.6169 & 259.8847 & 16.1209 \tabularnewline
141 & 0.2164 & 0.6737 & 0.0561 & 5581.1098 & 465.0925 & 21.566 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3418&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]130[/C][C]0.0511[/C][C]0.0685[/C][C]0.0057[/C][C]58.0948[/C][C]4.8412[/C][C]2.2003[/C][/ROW]
[ROW][C]131[/C][C]0.0897[/C][C]0.1499[/C][C]0.0125[/C][C]295.0546[/C][C]24.5879[/C][C]4.9586[/C][/ROW]
[ROW][C]132[/C][C]0.1148[/C][C]0.1351[/C][C]0.0113[/C][C]241.5391[/C][C]20.1283[/C][C]4.4865[/C][/ROW]
[ROW][C]133[/C][C]0.1345[/C][C]0.192[/C][C]0.016[/C][C]496.3827[/C][C]41.3652[/C][C]6.4316[/C][/ROW]
[ROW][C]134[/C][C]0.1507[/C][C]0.2766[/C][C]0.023[/C][C]1033.6018[/C][C]86.1335[/C][C]9.2808[/C][/ROW]
[ROW][C]135[/C][C]0.1644[/C][C]0.2391[/C][C]0.0199[/C][C]823.2321[/C][C]68.6027[/C][C]8.2827[/C][/ROW]
[ROW][C]136[/C][C]0.1761[/C][C]0.1801[/C][C]0.015[/C][C]484.9786[/C][C]40.4149[/C][C]6.3573[/C][/ROW]
[ROW][C]137[/C][C]0.1864[/C][C]0.2312[/C][C]0.0193[/C][C]820.2486[/C][C]68.354[/C][C]8.2677[/C][/ROW]
[ROW][C]138[/C][C]0.1953[/C][C]0.3411[/C][C]0.0284[/C][C]1716.9067[/C][C]143.0756[/C][C]11.9614[/C][/ROW]
[ROW][C]139[/C][C]0.2032[/C][C]0.4154[/C][C]0.0346[/C][C]2408.1608[/C][C]200.6801[/C][C]14.1662[/C][/ROW]
[ROW][C]140[/C][C]0.2102[/C][C]0.5047[/C][C]0.0421[/C][C]3118.6169[/C][C]259.8847[/C][C]16.1209[/C][/ROW]
[ROW][C]141[/C][C]0.2164[/C][C]0.6737[/C][C]0.0561[/C][C]5581.1098[/C][C]465.0925[/C][C]21.566[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3418&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3418&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
1300.05110.06850.005758.09484.84122.2003
1310.08970.14990.0125295.054624.58794.9586
1320.11480.13510.0113241.539120.12834.4865
1330.13450.1920.016496.382741.36526.4316
1340.15070.27660.0231033.601886.13359.2808
1350.16440.23910.0199823.232168.60278.2827
1360.17610.18010.015484.978640.41496.3573
1370.18640.23120.0193820.248668.3548.2677
1380.19530.34110.02841716.9067143.075611.9614
1390.20320.41540.03462408.1608200.680114.1662
1400.21020.50470.04213118.6169259.884716.1209
1410.21640.67370.05615581.1098465.092521.566



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