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 computationThu, 10 Dec 2009 02:29:07 -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/2009/Dec/10/t1260437639iillkxabvarok38.htm/, Retrieved Fri, 29 Mar 2024 16:02:24 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=65242, Retrieved Fri, 29 Mar 2024 16:02:24 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact195
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA forecast] [2009-12-10 09:29:07] [bef26de542bed2eafc60fe4615b06e47] [Current]
-   PD    [ARIMA Forecasting] [] [2010-12-16 15:49:16] [f47feae0308dca73181bb669fbad1c56]
Feedback Forum

Post a new message
Dataseries X:
121.6
118.8
114.0
111.5
97.2
102.5
113.4
109.8
104.9
126.1
80.0
96.8
117.2
112.3
117.3
111.1
102.2
104.3
122.9
107.6
121.3
131.5
89.0
104.4
128.9
135.9
133.3
121.3
120.5
120.4
137.9
126.1
133.2
151.1
105.0
119.0
140.4
156.6
137.1
122.7
125.8
139.3
134.9
149.2
132.3
149.0
117.2
119.6
152.0
149.4
127.3
114.1
102.1
107.7
104.4
102.1
96.0
109.3
90.0
83.9




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

\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 & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65242&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]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65242&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65242&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'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[48])
36119-------
37140.4-------
38156.6-------
39137.1-------
40122.7-------
41125.8-------
42139.3-------
43134.9-------
44149.2-------
45132.3-------
46149-------
47117.2-------
48119.6-------
49152146.3857132.6028160.16870.21230.99990.80270.9999
50149.4157.8421143.3749172.30920.12640.78570.56681
51127.3137.4475119.5453155.34970.13330.09530.51520.9747
52114.1120.9737101.9624139.98490.23930.25710.42940.5563
53102.1125.7407104.6189146.86250.01410.860.49780.7156
54107.7145.7078123.3559168.05974e-040.99990.71290.989
55104.4132.2533108.3101156.19650.01130.97780.41420.8499
56102.1156.3433131.181181.5056010.7110.9979
5796133.2435106.7517159.73520.00290.98940.52780.8436
58109.3143.987116.3301171.64380.0070.99970.36120.958
5990121.907693.0833150.73190.0150.80440.62560.5623
6083.9118.535588.6078148.46330.01170.96920.47220.4722

\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[48]) \tabularnewline
36 & 119 & - & - & - & - & - & - & - \tabularnewline
37 & 140.4 & - & - & - & - & - & - & - \tabularnewline
38 & 156.6 & - & - & - & - & - & - & - \tabularnewline
39 & 137.1 & - & - & - & - & - & - & - \tabularnewline
40 & 122.7 & - & - & - & - & - & - & - \tabularnewline
41 & 125.8 & - & - & - & - & - & - & - \tabularnewline
42 & 139.3 & - & - & - & - & - & - & - \tabularnewline
43 & 134.9 & - & - & - & - & - & - & - \tabularnewline
44 & 149.2 & - & - & - & - & - & - & - \tabularnewline
45 & 132.3 & - & - & - & - & - & - & - \tabularnewline
46 & 149 & - & - & - & - & - & - & - \tabularnewline
47 & 117.2 & - & - & - & - & - & - & - \tabularnewline
48 & 119.6 & - & - & - & - & - & - & - \tabularnewline
49 & 152 & 146.3857 & 132.6028 & 160.1687 & 0.2123 & 0.9999 & 0.8027 & 0.9999 \tabularnewline
50 & 149.4 & 157.8421 & 143.3749 & 172.3092 & 0.1264 & 0.7857 & 0.5668 & 1 \tabularnewline
51 & 127.3 & 137.4475 & 119.5453 & 155.3497 & 0.1333 & 0.0953 & 0.5152 & 0.9747 \tabularnewline
52 & 114.1 & 120.9737 & 101.9624 & 139.9849 & 0.2393 & 0.2571 & 0.4294 & 0.5563 \tabularnewline
53 & 102.1 & 125.7407 & 104.6189 & 146.8625 & 0.0141 & 0.86 & 0.4978 & 0.7156 \tabularnewline
54 & 107.7 & 145.7078 & 123.3559 & 168.0597 & 4e-04 & 0.9999 & 0.7129 & 0.989 \tabularnewline
55 & 104.4 & 132.2533 & 108.3101 & 156.1965 & 0.0113 & 0.9778 & 0.4142 & 0.8499 \tabularnewline
56 & 102.1 & 156.3433 & 131.181 & 181.5056 & 0 & 1 & 0.711 & 0.9979 \tabularnewline
57 & 96 & 133.2435 & 106.7517 & 159.7352 & 0.0029 & 0.9894 & 0.5278 & 0.8436 \tabularnewline
58 & 109.3 & 143.987 & 116.3301 & 171.6438 & 0.007 & 0.9997 & 0.3612 & 0.958 \tabularnewline
59 & 90 & 121.9076 & 93.0833 & 150.7319 & 0.015 & 0.8044 & 0.6256 & 0.5623 \tabularnewline
60 & 83.9 & 118.5355 & 88.6078 & 148.4633 & 0.0117 & 0.9692 & 0.4722 & 0.4722 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65242&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[48])[/C][/ROW]
[ROW][C]36[/C][C]119[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]140.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]156.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]137.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]122.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]125.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]139.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]134.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]149.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]132.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]149[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]117.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]119.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]152[/C][C]146.3857[/C][C]132.6028[/C][C]160.1687[/C][C]0.2123[/C][C]0.9999[/C][C]0.8027[/C][C]0.9999[/C][/ROW]
[ROW][C]50[/C][C]149.4[/C][C]157.8421[/C][C]143.3749[/C][C]172.3092[/C][C]0.1264[/C][C]0.7857[/C][C]0.5668[/C][C]1[/C][/ROW]
[ROW][C]51[/C][C]127.3[/C][C]137.4475[/C][C]119.5453[/C][C]155.3497[/C][C]0.1333[/C][C]0.0953[/C][C]0.5152[/C][C]0.9747[/C][/ROW]
[ROW][C]52[/C][C]114.1[/C][C]120.9737[/C][C]101.9624[/C][C]139.9849[/C][C]0.2393[/C][C]0.2571[/C][C]0.4294[/C][C]0.5563[/C][/ROW]
[ROW][C]53[/C][C]102.1[/C][C]125.7407[/C][C]104.6189[/C][C]146.8625[/C][C]0.0141[/C][C]0.86[/C][C]0.4978[/C][C]0.7156[/C][/ROW]
[ROW][C]54[/C][C]107.7[/C][C]145.7078[/C][C]123.3559[/C][C]168.0597[/C][C]4e-04[/C][C]0.9999[/C][C]0.7129[/C][C]0.989[/C][/ROW]
[ROW][C]55[/C][C]104.4[/C][C]132.2533[/C][C]108.3101[/C][C]156.1965[/C][C]0.0113[/C][C]0.9778[/C][C]0.4142[/C][C]0.8499[/C][/ROW]
[ROW][C]56[/C][C]102.1[/C][C]156.3433[/C][C]131.181[/C][C]181.5056[/C][C]0[/C][C]1[/C][C]0.711[/C][C]0.9979[/C][/ROW]
[ROW][C]57[/C][C]96[/C][C]133.2435[/C][C]106.7517[/C][C]159.7352[/C][C]0.0029[/C][C]0.9894[/C][C]0.5278[/C][C]0.8436[/C][/ROW]
[ROW][C]58[/C][C]109.3[/C][C]143.987[/C][C]116.3301[/C][C]171.6438[/C][C]0.007[/C][C]0.9997[/C][C]0.3612[/C][C]0.958[/C][/ROW]
[ROW][C]59[/C][C]90[/C][C]121.9076[/C][C]93.0833[/C][C]150.7319[/C][C]0.015[/C][C]0.8044[/C][C]0.6256[/C][C]0.5623[/C][/ROW]
[ROW][C]60[/C][C]83.9[/C][C]118.5355[/C][C]88.6078[/C][C]148.4633[/C][C]0.0117[/C][C]0.9692[/C][C]0.4722[/C][C]0.4722[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65242&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65242&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[48])
36119-------
37140.4-------
38156.6-------
39137.1-------
40122.7-------
41125.8-------
42139.3-------
43134.9-------
44149.2-------
45132.3-------
46149-------
47117.2-------
48119.6-------
49152146.3857132.6028160.16870.21230.99990.80270.9999
50149.4157.8421143.3749172.30920.12640.78570.56681
51127.3137.4475119.5453155.34970.13330.09530.51520.9747
52114.1120.9737101.9624139.98490.23930.25710.42940.5563
53102.1125.7407104.6189146.86250.01410.860.49780.7156
54107.7145.7078123.3559168.05974e-040.99990.71290.989
55104.4132.2533108.3101156.19650.01130.97780.41420.8499
56102.1156.3433131.181181.5056010.7110.9979
5796133.2435106.7517159.73520.00290.98940.52780.8436
58109.3143.987116.3301171.64380.0070.99970.36120.958
5990121.907693.0833150.73190.0150.80440.62560.5623
6083.9118.535588.6078148.46330.01170.96920.47220.4722







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0480.0384031.5200
500.0468-0.05350.045971.268451.39427.169
510.0665-0.07380.0552102.971568.58678.2817
520.0802-0.05680.055647.247463.25197.9531
530.0857-0.1880.0821558.8832162.378112.7428
540.0783-0.26080.11191444.5899376.080119.3928
550.0924-0.21060.126775.8065433.183920.8131
560.0821-0.34690.15362942.3351746.827827.3281
570.1014-0.27950.16761387.0752817.966428.6001
580.098-0.24090.17491203.188856.488529.2658
590.1206-0.26170.18281018.0941871.179929.5158
600.1288-0.29220.19191199.62898.5529.9758

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.048 & 0.0384 & 0 & 31.52 & 0 & 0 \tabularnewline
50 & 0.0468 & -0.0535 & 0.0459 & 71.2684 & 51.3942 & 7.169 \tabularnewline
51 & 0.0665 & -0.0738 & 0.0552 & 102.9715 & 68.5867 & 8.2817 \tabularnewline
52 & 0.0802 & -0.0568 & 0.0556 & 47.2474 & 63.2519 & 7.9531 \tabularnewline
53 & 0.0857 & -0.188 & 0.0821 & 558.8832 & 162.3781 & 12.7428 \tabularnewline
54 & 0.0783 & -0.2608 & 0.1119 & 1444.5899 & 376.0801 & 19.3928 \tabularnewline
55 & 0.0924 & -0.2106 & 0.126 & 775.8065 & 433.1839 & 20.8131 \tabularnewline
56 & 0.0821 & -0.3469 & 0.1536 & 2942.3351 & 746.8278 & 27.3281 \tabularnewline
57 & 0.1014 & -0.2795 & 0.1676 & 1387.0752 & 817.9664 & 28.6001 \tabularnewline
58 & 0.098 & -0.2409 & 0.1749 & 1203.188 & 856.4885 & 29.2658 \tabularnewline
59 & 0.1206 & -0.2617 & 0.1828 & 1018.0941 & 871.1799 & 29.5158 \tabularnewline
60 & 0.1288 & -0.2922 & 0.1919 & 1199.62 & 898.55 & 29.9758 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65242&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]49[/C][C]0.048[/C][C]0.0384[/C][C]0[/C][C]31.52[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0468[/C][C]-0.0535[/C][C]0.0459[/C][C]71.2684[/C][C]51.3942[/C][C]7.169[/C][/ROW]
[ROW][C]51[/C][C]0.0665[/C][C]-0.0738[/C][C]0.0552[/C][C]102.9715[/C][C]68.5867[/C][C]8.2817[/C][/ROW]
[ROW][C]52[/C][C]0.0802[/C][C]-0.0568[/C][C]0.0556[/C][C]47.2474[/C][C]63.2519[/C][C]7.9531[/C][/ROW]
[ROW][C]53[/C][C]0.0857[/C][C]-0.188[/C][C]0.0821[/C][C]558.8832[/C][C]162.3781[/C][C]12.7428[/C][/ROW]
[ROW][C]54[/C][C]0.0783[/C][C]-0.2608[/C][C]0.1119[/C][C]1444.5899[/C][C]376.0801[/C][C]19.3928[/C][/ROW]
[ROW][C]55[/C][C]0.0924[/C][C]-0.2106[/C][C]0.126[/C][C]775.8065[/C][C]433.1839[/C][C]20.8131[/C][/ROW]
[ROW][C]56[/C][C]0.0821[/C][C]-0.3469[/C][C]0.1536[/C][C]2942.3351[/C][C]746.8278[/C][C]27.3281[/C][/ROW]
[ROW][C]57[/C][C]0.1014[/C][C]-0.2795[/C][C]0.1676[/C][C]1387.0752[/C][C]817.9664[/C][C]28.6001[/C][/ROW]
[ROW][C]58[/C][C]0.098[/C][C]-0.2409[/C][C]0.1749[/C][C]1203.188[/C][C]856.4885[/C][C]29.2658[/C][/ROW]
[ROW][C]59[/C][C]0.1206[/C][C]-0.2617[/C][C]0.1828[/C][C]1018.0941[/C][C]871.1799[/C][C]29.5158[/C][/ROW]
[ROW][C]60[/C][C]0.1288[/C][C]-0.2922[/C][C]0.1919[/C][C]1199.62[/C][C]898.55[/C][C]29.9758[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65242&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65242&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
490.0480.0384031.5200
500.0468-0.05350.045971.268451.39427.169
510.0665-0.07380.0552102.971568.58678.2817
520.0802-0.05680.055647.247463.25197.9531
530.0857-0.1880.0821558.8832162.378112.7428
540.0783-0.26080.11191444.5899376.080119.3928
550.0924-0.21060.126775.8065433.183920.8131
560.0821-0.34690.15362942.3351746.827827.3281
570.1014-0.27950.16761387.0752817.966428.6001
580.098-0.24090.17491203.188856.488529.2658
590.1206-0.26170.18281018.0941871.179929.5158
600.1288-0.29220.19191199.62898.5529.9758



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