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 computationFri, 30 Nov 2012 11:16:53 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2012/Nov/30/t1354292247mkeqsb3rgwho69m.htm/, Retrieved Fri, 03 May 2024 17:13:49 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=195130, Retrieved Fri, 03 May 2024 17:13:49 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact53
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [data set] [2008-12-01 19:54:57] [b98453cac15ba1066b407e146608df68]
- RMP   [Standard Deviation-Mean Plot] [Unemployment] [2010-11-29 10:34:47] [b98453cac15ba1066b407e146608df68]
- RMP     [ARIMA Forecasting] [Unemployment] [2010-11-29 20:46:45] [b98453cac15ba1066b407e146608df68]
- R PD        [ARIMA Forecasting] [] [2012-11-30 16:16:53] [8202a5611fe794f0e10e9bba0c705a45] [Current]
Feedback Forum

Post a new message
Dataseries X:
274
291
280
258
252
251
224
225
234
233
229
208
224
226
223
205
201
202
183
188
200
206
211
201
299
244
251
241
244
252
234
246
265
277
287
275
320
338
342
322
323
343
315
334
359
362
378
345
422
430
443
431
425
432
387
396
411
421
424
410
464
486
490
459
454
446
406
412
428
429
425
396
429
439
424
379
370
353
322
322
338
348
350
312
358
378
352
312
310
292
276
269
286
292
288
255
304
299
293
275
272
264
234
231
263
264
264
245
297
317
318
315
312
310
306
313
350
354
371
357
419
425
424
399
393
378
371
364
384
377
383
352




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'George Udny Yule' @ yule.wessa.net

\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 & 3 seconds \tabularnewline
R Server & 'George Udny Yule' @ yule.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=195130&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]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'George Udny Yule' @ yule.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=195130&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=195130&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 time3 seconds
R Server'George Udny Yule' @ yule.wessa.net







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[120])
108245-------
109297-------
110317-------
111318-------
112315-------
113312-------
114310-------
115306-------
116313-------
117350-------
118354-------
119371-------
120357-------
121419421.0104393.1594449.81430.4456111
122425434.7533399.1152471.91530.30350.79711
123424438.5019392.8114486.70570.27770.708510.9995
124399421.0183367.6334478.0210.22450.45920.99990.9861
125393424.0813361.5021491.65340.18360.76650.99940.9742
126378428.7753356.8997507.240.10230.81420.99850.9635
127371404.9654326.5013491.87070.22180.72850.98720.8603
128364416.6337328.1665515.64630.14870.81680.97990.8811
129384446.3605345.4528560.18040.14140.92190.95150.9381
130377458.4363346.829585.5870.10470.87440.94630.941
131383468.6999346.4341609.40930.11630.89930.91320.9401
132352447.073318.8699596.8870.10680.79910.88070.8807

\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[120]) \tabularnewline
108 & 245 & - & - & - & - & - & - & - \tabularnewline
109 & 297 & - & - & - & - & - & - & - \tabularnewline
110 & 317 & - & - & - & - & - & - & - \tabularnewline
111 & 318 & - & - & - & - & - & - & - \tabularnewline
112 & 315 & - & - & - & - & - & - & - \tabularnewline
113 & 312 & - & - & - & - & - & - & - \tabularnewline
114 & 310 & - & - & - & - & - & - & - \tabularnewline
115 & 306 & - & - & - & - & - & - & - \tabularnewline
116 & 313 & - & - & - & - & - & - & - \tabularnewline
117 & 350 & - & - & - & - & - & - & - \tabularnewline
118 & 354 & - & - & - & - & - & - & - \tabularnewline
119 & 371 & - & - & - & - & - & - & - \tabularnewline
120 & 357 & - & - & - & - & - & - & - \tabularnewline
121 & 419 & 421.0104 & 393.1594 & 449.8143 & 0.4456 & 1 & 1 & 1 \tabularnewline
122 & 425 & 434.7533 & 399.1152 & 471.9153 & 0.3035 & 0.797 & 1 & 1 \tabularnewline
123 & 424 & 438.5019 & 392.8114 & 486.7057 & 0.2777 & 0.7085 & 1 & 0.9995 \tabularnewline
124 & 399 & 421.0183 & 367.6334 & 478.021 & 0.2245 & 0.4592 & 0.9999 & 0.9861 \tabularnewline
125 & 393 & 424.0813 & 361.5021 & 491.6534 & 0.1836 & 0.7665 & 0.9994 & 0.9742 \tabularnewline
126 & 378 & 428.7753 & 356.8997 & 507.24 & 0.1023 & 0.8142 & 0.9985 & 0.9635 \tabularnewline
127 & 371 & 404.9654 & 326.5013 & 491.8707 & 0.2218 & 0.7285 & 0.9872 & 0.8603 \tabularnewline
128 & 364 & 416.6337 & 328.1665 & 515.6463 & 0.1487 & 0.8168 & 0.9799 & 0.8811 \tabularnewline
129 & 384 & 446.3605 & 345.4528 & 560.1804 & 0.1414 & 0.9219 & 0.9515 & 0.9381 \tabularnewline
130 & 377 & 458.4363 & 346.829 & 585.587 & 0.1047 & 0.8744 & 0.9463 & 0.941 \tabularnewline
131 & 383 & 468.6999 & 346.4341 & 609.4093 & 0.1163 & 0.8993 & 0.9132 & 0.9401 \tabularnewline
132 & 352 & 447.073 & 318.8699 & 596.887 & 0.1068 & 0.7991 & 0.8807 & 0.8807 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=195130&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[120])[/C][/ROW]
[ROW][C]108[/C][C]245[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]297[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]317[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]318[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]315[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]312[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]310[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]306[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]116[/C][C]313[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]117[/C][C]350[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]118[/C][C]354[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]119[/C][C]371[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]120[/C][C]357[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]419[/C][C]421.0104[/C][C]393.1594[/C][C]449.8143[/C][C]0.4456[/C][C]1[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]122[/C][C]425[/C][C]434.7533[/C][C]399.1152[/C][C]471.9153[/C][C]0.3035[/C][C]0.797[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]123[/C][C]424[/C][C]438.5019[/C][C]392.8114[/C][C]486.7057[/C][C]0.2777[/C][C]0.7085[/C][C]1[/C][C]0.9995[/C][/ROW]
[ROW][C]124[/C][C]399[/C][C]421.0183[/C][C]367.6334[/C][C]478.021[/C][C]0.2245[/C][C]0.4592[/C][C]0.9999[/C][C]0.9861[/C][/ROW]
[ROW][C]125[/C][C]393[/C][C]424.0813[/C][C]361.5021[/C][C]491.6534[/C][C]0.1836[/C][C]0.7665[/C][C]0.9994[/C][C]0.9742[/C][/ROW]
[ROW][C]126[/C][C]378[/C][C]428.7753[/C][C]356.8997[/C][C]507.24[/C][C]0.1023[/C][C]0.8142[/C][C]0.9985[/C][C]0.9635[/C][/ROW]
[ROW][C]127[/C][C]371[/C][C]404.9654[/C][C]326.5013[/C][C]491.8707[/C][C]0.2218[/C][C]0.7285[/C][C]0.9872[/C][C]0.8603[/C][/ROW]
[ROW][C]128[/C][C]364[/C][C]416.6337[/C][C]328.1665[/C][C]515.6463[/C][C]0.1487[/C][C]0.8168[/C][C]0.9799[/C][C]0.8811[/C][/ROW]
[ROW][C]129[/C][C]384[/C][C]446.3605[/C][C]345.4528[/C][C]560.1804[/C][C]0.1414[/C][C]0.9219[/C][C]0.9515[/C][C]0.9381[/C][/ROW]
[ROW][C]130[/C][C]377[/C][C]458.4363[/C][C]346.829[/C][C]585.587[/C][C]0.1047[/C][C]0.8744[/C][C]0.9463[/C][C]0.941[/C][/ROW]
[ROW][C]131[/C][C]383[/C][C]468.6999[/C][C]346.4341[/C][C]609.4093[/C][C]0.1163[/C][C]0.8993[/C][C]0.9132[/C][C]0.9401[/C][/ROW]
[ROW][C]132[/C][C]352[/C][C]447.073[/C][C]318.8699[/C][C]596.887[/C][C]0.1068[/C][C]0.7991[/C][C]0.8807[/C][C]0.8807[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=195130&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=195130&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[120])
108245-------
109297-------
110317-------
111318-------
112315-------
113312-------
114310-------
115306-------
116313-------
117350-------
118354-------
119371-------
120357-------
121419421.0104393.1594449.81430.4456111
122425434.7533399.1152471.91530.30350.79711
123424438.5019392.8114486.70570.27770.708510.9995
124399421.0183367.6334478.0210.22450.45920.99990.9861
125393424.0813361.5021491.65340.18360.76650.99940.9742
126378428.7753356.8997507.240.10230.81420.99850.9635
127371404.9654326.5013491.87070.22180.72850.98720.8603
128364416.6337328.1665515.64630.14870.81680.97990.8811
129384446.3605345.4528560.18040.14140.92190.95150.9381
130377458.4363346.829585.5870.10470.87440.94630.941
131383468.6999346.4341609.40930.11630.89930.91320.9401
132352447.073318.8699596.8870.10680.79910.88070.8807







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1210.0349-0.004804.041600
1220.0436-0.02240.013695.127749.58467.0416
1230.0561-0.03310.0201210.3061103.158510.1567
1240.0691-0.05230.0281484.804198.569914.0915
1250.0813-0.07330.0372966.0456352.06518.7634
1260.0934-0.11840.05072578.1271723.075326.8901
1270.1095-0.08390.05551153.6504784.586128.0105
1280.1212-0.12630.06432770.3081032.801332.1372
1290.1301-0.13970.07273888.82981350.137836.7442
1300.1415-0.17760.08326631.87031878.311143.3395
1310.1532-0.18280.09227344.4732375.234948.7364
1320.171-0.21270.10239038.87122930.537954.1344

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
121 & 0.0349 & -0.0048 & 0 & 4.0416 & 0 & 0 \tabularnewline
122 & 0.0436 & -0.0224 & 0.0136 & 95.1277 & 49.5846 & 7.0416 \tabularnewline
123 & 0.0561 & -0.0331 & 0.0201 & 210.3061 & 103.1585 & 10.1567 \tabularnewline
124 & 0.0691 & -0.0523 & 0.0281 & 484.804 & 198.5699 & 14.0915 \tabularnewline
125 & 0.0813 & -0.0733 & 0.0372 & 966.0456 & 352.065 & 18.7634 \tabularnewline
126 & 0.0934 & -0.1184 & 0.0507 & 2578.1271 & 723.0753 & 26.8901 \tabularnewline
127 & 0.1095 & -0.0839 & 0.0555 & 1153.6504 & 784.5861 & 28.0105 \tabularnewline
128 & 0.1212 & -0.1263 & 0.0643 & 2770.308 & 1032.8013 & 32.1372 \tabularnewline
129 & 0.1301 & -0.1397 & 0.0727 & 3888.8298 & 1350.1378 & 36.7442 \tabularnewline
130 & 0.1415 & -0.1776 & 0.0832 & 6631.8703 & 1878.3111 & 43.3395 \tabularnewline
131 & 0.1532 & -0.1828 & 0.0922 & 7344.473 & 2375.2349 & 48.7364 \tabularnewline
132 & 0.171 & -0.2127 & 0.1023 & 9038.8712 & 2930.5379 & 54.1344 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=195130&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]121[/C][C]0.0349[/C][C]-0.0048[/C][C]0[/C][C]4.0416[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]122[/C][C]0.0436[/C][C]-0.0224[/C][C]0.0136[/C][C]95.1277[/C][C]49.5846[/C][C]7.0416[/C][/ROW]
[ROW][C]123[/C][C]0.0561[/C][C]-0.0331[/C][C]0.0201[/C][C]210.3061[/C][C]103.1585[/C][C]10.1567[/C][/ROW]
[ROW][C]124[/C][C]0.0691[/C][C]-0.0523[/C][C]0.0281[/C][C]484.804[/C][C]198.5699[/C][C]14.0915[/C][/ROW]
[ROW][C]125[/C][C]0.0813[/C][C]-0.0733[/C][C]0.0372[/C][C]966.0456[/C][C]352.065[/C][C]18.7634[/C][/ROW]
[ROW][C]126[/C][C]0.0934[/C][C]-0.1184[/C][C]0.0507[/C][C]2578.1271[/C][C]723.0753[/C][C]26.8901[/C][/ROW]
[ROW][C]127[/C][C]0.1095[/C][C]-0.0839[/C][C]0.0555[/C][C]1153.6504[/C][C]784.5861[/C][C]28.0105[/C][/ROW]
[ROW][C]128[/C][C]0.1212[/C][C]-0.1263[/C][C]0.0643[/C][C]2770.308[/C][C]1032.8013[/C][C]32.1372[/C][/ROW]
[ROW][C]129[/C][C]0.1301[/C][C]-0.1397[/C][C]0.0727[/C][C]3888.8298[/C][C]1350.1378[/C][C]36.7442[/C][/ROW]
[ROW][C]130[/C][C]0.1415[/C][C]-0.1776[/C][C]0.0832[/C][C]6631.8703[/C][C]1878.3111[/C][C]43.3395[/C][/ROW]
[ROW][C]131[/C][C]0.1532[/C][C]-0.1828[/C][C]0.0922[/C][C]7344.473[/C][C]2375.2349[/C][C]48.7364[/C][/ROW]
[ROW][C]132[/C][C]0.171[/C][C]-0.2127[/C][C]0.1023[/C][C]9038.8712[/C][C]2930.5379[/C][C]54.1344[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=195130&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=195130&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
1210.0349-0.004804.041600
1220.0436-0.02240.013695.127749.58467.0416
1230.0561-0.03310.0201210.3061103.158510.1567
1240.0691-0.05230.0281484.804198.569914.0915
1250.0813-0.07330.0372966.0456352.06518.7634
1260.0934-0.11840.05072578.1271723.075326.8901
1270.1095-0.08390.05551153.6504784.586128.0105
1280.1212-0.12630.06432770.3081032.801332.1372
1290.1301-0.13970.07273888.82981350.137836.7442
1300.1415-0.17760.08326631.87031878.311143.3395
1310.1532-0.18280.09227344.4732375.234948.7364
1320.171-0.21270.10239038.87122930.537954.1344



Parameters (Session):
par1 = FALSE ; par2 = 0.5 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 0 ; par7 = 0 ; par8 = 0 ; par9 = 0 ;
Parameters (R input):
par1 = 12 ; par2 = 0.5 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 2 ; 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,par1))
(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.mape1 <- array(0, dim=fx)
perf.se <- array(0, dim=fx)
perf.mse <- array(0, dim=fx)
perf.mse1 <- 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.se[i] = (x[nx+i] - forecast$pred[i])^2
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[1] = abs(perf.pe[1])
perf.mse[1] = abs(perf.se[1])
for (i in 2:fx) {
perf.mape[i] = perf.mape[i-1] + abs(perf.pe[i])
perf.mape1[i] = perf.mape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
}
perf.rmse = sqrt(perf.mse1)
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:par1] <- 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.mape1[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse1[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')