Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationSun, 14 Dec 2008 03:28:56 -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/14/t1229250580dfusdjlhhy0y1hc.htm/, Retrieved Wed, 15 May 2024 17:12:19 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=33263, Retrieved Wed, 15 May 2024 17:12:19 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordskleuter
Estimated Impact198
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2008-12-14 10:28:56] [c233791e22ae82ed03fa45b0d63a2757] [Current]
Feedback Forum

Post a new message
Dataseries X:
112
118
132
129
121
135
148
148
136
119
104
118
115
126
141
135
125
149
170
170
158
133
114
140
145
150
178
163
172
178
199
199
184
162
146
166
171
180
193
181
183
218
230
242
209
191
172
194
196
196
236
235
229
243
264
272
237
211
180
201
204
188
235
227
234
264
302
293
259
229
203
229
242
233
267
269
270
315
364
347
312
274
237
278
284
277
317
313
318
374
413
405
355
306
271
306
315
301
356
348
355
422
465
467
404
347
305
336
340
318
362
348
363
435
491
505
404
359
310
337
360
342
406
396
420
472
548
559
463
407
362
405
417
391
419
461
472
535
622
606
508
461
390
432




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

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33263&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'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[132])
120337-------
121360-------
122342-------
123406-------
124396-------
125420-------
126472-------
127548-------
128559-------
129463-------
130407-------
131362-------
132405-------
133417422.9845402.555443.41390.28290.957810.9578
134391404.7081378.7575430.65880.15030.176610.4912
135419467.0908436.603497.57860.001111
136461456.7989422.3666491.23110.40550.98430.99970.9984
137472479.9818442.0127517.95080.34020.83640.9990.9999
138535533.6253492.4219574.82870.47390.99830.99831
139622607.8447563.6429652.04640.26510.99940.9961
140606619.0059571.9967666.01510.29380.45030.99381
141508522.863473.2048572.52120.27875e-040.99091
142461467.7105415.5377519.88340.40050.06510.98870.9908
143390422.4272367.8554476.99890.12210.0830.9850.7343
144432464.1092407.2396520.97880.13420.99470.97920.9792

\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[132]) \tabularnewline
120 & 337 & - & - & - & - & - & - & - \tabularnewline
121 & 360 & - & - & - & - & - & - & - \tabularnewline
122 & 342 & - & - & - & - & - & - & - \tabularnewline
123 & 406 & - & - & - & - & - & - & - \tabularnewline
124 & 396 & - & - & - & - & - & - & - \tabularnewline
125 & 420 & - & - & - & - & - & - & - \tabularnewline
126 & 472 & - & - & - & - & - & - & - \tabularnewline
127 & 548 & - & - & - & - & - & - & - \tabularnewline
128 & 559 & - & - & - & - & - & - & - \tabularnewline
129 & 463 & - & - & - & - & - & - & - \tabularnewline
130 & 407 & - & - & - & - & - & - & - \tabularnewline
131 & 362 & - & - & - & - & - & - & - \tabularnewline
132 & 405 & - & - & - & - & - & - & - \tabularnewline
133 & 417 & 422.9845 & 402.555 & 443.4139 & 0.2829 & 0.9578 & 1 & 0.9578 \tabularnewline
134 & 391 & 404.7081 & 378.7575 & 430.6588 & 0.1503 & 0.1766 & 1 & 0.4912 \tabularnewline
135 & 419 & 467.0908 & 436.603 & 497.5786 & 0.001 & 1 & 1 & 1 \tabularnewline
136 & 461 & 456.7989 & 422.3666 & 491.2311 & 0.4055 & 0.9843 & 0.9997 & 0.9984 \tabularnewline
137 & 472 & 479.9818 & 442.0127 & 517.9508 & 0.3402 & 0.8364 & 0.999 & 0.9999 \tabularnewline
138 & 535 & 533.6253 & 492.4219 & 574.8287 & 0.4739 & 0.9983 & 0.9983 & 1 \tabularnewline
139 & 622 & 607.8447 & 563.6429 & 652.0464 & 0.2651 & 0.9994 & 0.996 & 1 \tabularnewline
140 & 606 & 619.0059 & 571.9967 & 666.0151 & 0.2938 & 0.4503 & 0.9938 & 1 \tabularnewline
141 & 508 & 522.863 & 473.2048 & 572.5212 & 0.2787 & 5e-04 & 0.9909 & 1 \tabularnewline
142 & 461 & 467.7105 & 415.5377 & 519.8834 & 0.4005 & 0.0651 & 0.9887 & 0.9908 \tabularnewline
143 & 390 & 422.4272 & 367.8554 & 476.9989 & 0.1221 & 0.083 & 0.985 & 0.7343 \tabularnewline
144 & 432 & 464.1092 & 407.2396 & 520.9788 & 0.1342 & 0.9947 & 0.9792 & 0.9792 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33263&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[132])[/C][/ROW]
[ROW][C]120[/C][C]337[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]360[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]122[/C][C]342[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]123[/C][C]406[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]124[/C][C]396[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]125[/C][C]420[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]126[/C][C]472[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]127[/C][C]548[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]128[/C][C]559[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]129[/C][C]463[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]130[/C][C]407[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]131[/C][C]362[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]132[/C][C]405[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]133[/C][C]417[/C][C]422.9845[/C][C]402.555[/C][C]443.4139[/C][C]0.2829[/C][C]0.9578[/C][C]1[/C][C]0.9578[/C][/ROW]
[ROW][C]134[/C][C]391[/C][C]404.7081[/C][C]378.7575[/C][C]430.6588[/C][C]0.1503[/C][C]0.1766[/C][C]1[/C][C]0.4912[/C][/ROW]
[ROW][C]135[/C][C]419[/C][C]467.0908[/C][C]436.603[/C][C]497.5786[/C][C]0.001[/C][C]1[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]136[/C][C]461[/C][C]456.7989[/C][C]422.3666[/C][C]491.2311[/C][C]0.4055[/C][C]0.9843[/C][C]0.9997[/C][C]0.9984[/C][/ROW]
[ROW][C]137[/C][C]472[/C][C]479.9818[/C][C]442.0127[/C][C]517.9508[/C][C]0.3402[/C][C]0.8364[/C][C]0.999[/C][C]0.9999[/C][/ROW]
[ROW][C]138[/C][C]535[/C][C]533.6253[/C][C]492.4219[/C][C]574.8287[/C][C]0.4739[/C][C]0.9983[/C][C]0.9983[/C][C]1[/C][/ROW]
[ROW][C]139[/C][C]622[/C][C]607.8447[/C][C]563.6429[/C][C]652.0464[/C][C]0.2651[/C][C]0.9994[/C][C]0.996[/C][C]1[/C][/ROW]
[ROW][C]140[/C][C]606[/C][C]619.0059[/C][C]571.9967[/C][C]666.0151[/C][C]0.2938[/C][C]0.4503[/C][C]0.9938[/C][C]1[/C][/ROW]
[ROW][C]141[/C][C]508[/C][C]522.863[/C][C]473.2048[/C][C]572.5212[/C][C]0.2787[/C][C]5e-04[/C][C]0.9909[/C][C]1[/C][/ROW]
[ROW][C]142[/C][C]461[/C][C]467.7105[/C][C]415.5377[/C][C]519.8834[/C][C]0.4005[/C][C]0.0651[/C][C]0.9887[/C][C]0.9908[/C][/ROW]
[ROW][C]143[/C][C]390[/C][C]422.4272[/C][C]367.8554[/C][C]476.9989[/C][C]0.1221[/C][C]0.083[/C][C]0.985[/C][C]0.7343[/C][/ROW]
[ROW][C]144[/C][C]432[/C][C]464.1092[/C][C]407.2396[/C][C]520.9788[/C][C]0.1342[/C][C]0.9947[/C][C]0.9792[/C][C]0.9792[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33263&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33263&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[132])
120337-------
121360-------
122342-------
123406-------
124396-------
125420-------
126472-------
127548-------
128559-------
129463-------
130407-------
131362-------
132405-------
133417422.9845402.555443.41390.28290.957810.9578
134391404.7081378.7575430.65880.15030.176610.4912
135419467.0908436.603497.57860.001111
136461456.7989422.3666491.23110.40550.98430.99970.9984
137472479.9818442.0127517.95080.34020.83640.9990.9999
138535533.6253492.4219574.82870.47390.99830.99831
139622607.8447563.6429652.04640.26510.99940.9961
140606619.0059571.9967666.01510.29380.45030.99381
141508522.863473.2048572.52120.27875e-040.99091
142461467.7105415.5377519.88340.40050.06510.98870.9908
143390422.4272367.8554476.99890.12210.0830.9850.7343
144432464.1092407.2396520.97880.13420.99470.97920.9792







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1330.0246-0.01410.001235.81372.98451.7276
1340.0327-0.03390.0028187.913115.65943.9572
1350.0333-0.1030.00862312.7254192.727113.8826
1360.03850.00928e-0417.64961.47081.2128
1370.0404-0.01660.001463.70875.30912.3041
1380.03940.00262e-041.88980.15750.3968
1390.03710.02330.0019200.373916.69784.0863
1400.0387-0.0210.0018169.152914.09613.7545
1410.0485-0.02840.0024220.908818.40914.2906
1420.0569-0.01430.001245.03143.75261.9372
1430.0659-0.07680.00641051.522387.62699.3609
1440.0625-0.06920.00581031.002185.91689.2691

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
133 & 0.0246 & -0.0141 & 0.0012 & 35.8137 & 2.9845 & 1.7276 \tabularnewline
134 & 0.0327 & -0.0339 & 0.0028 & 187.9131 & 15.6594 & 3.9572 \tabularnewline
135 & 0.0333 & -0.103 & 0.0086 & 2312.7254 & 192.7271 & 13.8826 \tabularnewline
136 & 0.0385 & 0.0092 & 8e-04 & 17.6496 & 1.4708 & 1.2128 \tabularnewline
137 & 0.0404 & -0.0166 & 0.0014 & 63.7087 & 5.3091 & 2.3041 \tabularnewline
138 & 0.0394 & 0.0026 & 2e-04 & 1.8898 & 0.1575 & 0.3968 \tabularnewline
139 & 0.0371 & 0.0233 & 0.0019 & 200.3739 & 16.6978 & 4.0863 \tabularnewline
140 & 0.0387 & -0.021 & 0.0018 & 169.1529 & 14.0961 & 3.7545 \tabularnewline
141 & 0.0485 & -0.0284 & 0.0024 & 220.9088 & 18.4091 & 4.2906 \tabularnewline
142 & 0.0569 & -0.0143 & 0.0012 & 45.0314 & 3.7526 & 1.9372 \tabularnewline
143 & 0.0659 & -0.0768 & 0.0064 & 1051.5223 & 87.6269 & 9.3609 \tabularnewline
144 & 0.0625 & -0.0692 & 0.0058 & 1031.0021 & 85.9168 & 9.2691 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33263&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]133[/C][C]0.0246[/C][C]-0.0141[/C][C]0.0012[/C][C]35.8137[/C][C]2.9845[/C][C]1.7276[/C][/ROW]
[ROW][C]134[/C][C]0.0327[/C][C]-0.0339[/C][C]0.0028[/C][C]187.9131[/C][C]15.6594[/C][C]3.9572[/C][/ROW]
[ROW][C]135[/C][C]0.0333[/C][C]-0.103[/C][C]0.0086[/C][C]2312.7254[/C][C]192.7271[/C][C]13.8826[/C][/ROW]
[ROW][C]136[/C][C]0.0385[/C][C]0.0092[/C][C]8e-04[/C][C]17.6496[/C][C]1.4708[/C][C]1.2128[/C][/ROW]
[ROW][C]137[/C][C]0.0404[/C][C]-0.0166[/C][C]0.0014[/C][C]63.7087[/C][C]5.3091[/C][C]2.3041[/C][/ROW]
[ROW][C]138[/C][C]0.0394[/C][C]0.0026[/C][C]2e-04[/C][C]1.8898[/C][C]0.1575[/C][C]0.3968[/C][/ROW]
[ROW][C]139[/C][C]0.0371[/C][C]0.0233[/C][C]0.0019[/C][C]200.3739[/C][C]16.6978[/C][C]4.0863[/C][/ROW]
[ROW][C]140[/C][C]0.0387[/C][C]-0.021[/C][C]0.0018[/C][C]169.1529[/C][C]14.0961[/C][C]3.7545[/C][/ROW]
[ROW][C]141[/C][C]0.0485[/C][C]-0.0284[/C][C]0.0024[/C][C]220.9088[/C][C]18.4091[/C][C]4.2906[/C][/ROW]
[ROW][C]142[/C][C]0.0569[/C][C]-0.0143[/C][C]0.0012[/C][C]45.0314[/C][C]3.7526[/C][C]1.9372[/C][/ROW]
[ROW][C]143[/C][C]0.0659[/C][C]-0.0768[/C][C]0.0064[/C][C]1051.5223[/C][C]87.6269[/C][C]9.3609[/C][/ROW]
[ROW][C]144[/C][C]0.0625[/C][C]-0.0692[/C][C]0.0058[/C][C]1031.0021[/C][C]85.9168[/C][C]9.2691[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33263&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33263&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
1330.0246-0.01410.001235.81372.98451.7276
1340.0327-0.03390.0028187.913115.65943.9572
1350.0333-0.1030.00862312.7254192.727113.8826
1360.03850.00928e-0417.64961.47081.2128
1370.0404-0.01660.001463.70875.30912.3041
1380.03940.00262e-041.88980.15750.3968
1390.03710.02330.0019200.373916.69784.0863
1400.0387-0.0210.0018169.152914.09613.7545
1410.0485-0.02840.0024220.908818.40914.2906
1420.0569-0.01430.001245.03143.75261.9372
1430.0659-0.07680.00641051.522387.62699.3609
1440.0625-0.06920.00581031.002185.91689.2691



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