Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationTue, 23 Dec 2008 11:12:02 -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/23/t12300559718wxlizh912hls1j.htm/, Retrieved Sun, 19 May 2024 11:12:07 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=36369, Retrieved Sun, 19 May 2024 11:12:07 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordspaper steven
Estimated Impact168
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
F     [ARIMA Forecasting] [] [2008-12-14 10:32:04] [83a083893f2e187274dbe133edd1fe98]
-   PD    [ARIMA Forecasting] [] [2008-12-23 18:12:02] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
104.3
119.8
116.8
118.2
107.4
110.8
94.8
96.5
113.4
109.8
118.7
117.2
110.3
111.6
128.1
121.3
107.3
120.5
98.5
97.7
113.2
114.6
118.3
123.9
113.6
117.5
130.1
124.7
114.2
127.3
105.9
101.5
120.2
117.1
131.1
130
120.6
123.1
135.3
134.1
123.7
134.6
108.3
110.4
127.8
126.6
131.4
141.1
127
127.3
143.6
149.4
126.6
136.5
116
118
131.4
140.7
144.9
143.9
127.1




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36369&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 time1 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[49])
37120.6-------
38123.100000000000-------
39135.3-------
40134.1-------
41123.7-------
42134.6-------
43108.3-------
44110.4-------
45127.8-------
46126.6-------
47131.4-------
48141.1-------
49127-------
50127.3129.2119121.7861137.13890.31820.70780.93460.7078
51143.6143.4011134.6437152.78910.48340.99960.95460.9997
52149.4141.3943132.6201150.81120.04780.32310.93550.9986
53126.6130.3943122.1953139.20260.199200.93180.775
54136.5142.0502133.0253151.75320.13110.99910.93380.9988
55116114.0528106.8896121.74770.3100.92865e-04
56118116.2639108.8884124.19270.33390.5260.92640.004
57131.4134.6666125.9468144.05510.24760.99970.92410.9453
58140.7133.3479124.6577142.70910.06190.65830.92110.9081
59144.9138.3986129.2844148.22450.09730.32310.91860.9885
60143.9148.6317138.711159.33840.19320.75270.9161
61127.1133.6696124.78143.26090.08970.01830.91360.9136

\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[49]) \tabularnewline
37 & 120.6 & - & - & - & - & - & - & - \tabularnewline
38 & 123.100000000000 & - & - & - & - & - & - & - \tabularnewline
39 & 135.3 & - & - & - & - & - & - & - \tabularnewline
40 & 134.1 & - & - & - & - & - & - & - \tabularnewline
41 & 123.7 & - & - & - & - & - & - & - \tabularnewline
42 & 134.6 & - & - & - & - & - & - & - \tabularnewline
43 & 108.3 & - & - & - & - & - & - & - \tabularnewline
44 & 110.4 & - & - & - & - & - & - & - \tabularnewline
45 & 127.8 & - & - & - & - & - & - & - \tabularnewline
46 & 126.6 & - & - & - & - & - & - & - \tabularnewline
47 & 131.4 & - & - & - & - & - & - & - \tabularnewline
48 & 141.1 & - & - & - & - & - & - & - \tabularnewline
49 & 127 & - & - & - & - & - & - & - \tabularnewline
50 & 127.3 & 129.2119 & 121.7861 & 137.1389 & 0.3182 & 0.7078 & 0.9346 & 0.7078 \tabularnewline
51 & 143.6 & 143.4011 & 134.6437 & 152.7891 & 0.4834 & 0.9996 & 0.9546 & 0.9997 \tabularnewline
52 & 149.4 & 141.3943 & 132.6201 & 150.8112 & 0.0478 & 0.3231 & 0.9355 & 0.9986 \tabularnewline
53 & 126.6 & 130.3943 & 122.1953 & 139.2026 & 0.1992 & 0 & 0.9318 & 0.775 \tabularnewline
54 & 136.5 & 142.0502 & 133.0253 & 151.7532 & 0.1311 & 0.9991 & 0.9338 & 0.9988 \tabularnewline
55 & 116 & 114.0528 & 106.8896 & 121.7477 & 0.31 & 0 & 0.9286 & 5e-04 \tabularnewline
56 & 118 & 116.2639 & 108.8884 & 124.1927 & 0.3339 & 0.526 & 0.9264 & 0.004 \tabularnewline
57 & 131.4 & 134.6666 & 125.9468 & 144.0551 & 0.2476 & 0.9997 & 0.9241 & 0.9453 \tabularnewline
58 & 140.7 & 133.3479 & 124.6577 & 142.7091 & 0.0619 & 0.6583 & 0.9211 & 0.9081 \tabularnewline
59 & 144.9 & 138.3986 & 129.2844 & 148.2245 & 0.0973 & 0.3231 & 0.9186 & 0.9885 \tabularnewline
60 & 143.9 & 148.6317 & 138.711 & 159.3384 & 0.1932 & 0.7527 & 0.916 & 1 \tabularnewline
61 & 127.1 & 133.6696 & 124.78 & 143.2609 & 0.0897 & 0.0183 & 0.9136 & 0.9136 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36369&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[49])[/C][/ROW]
[ROW][C]37[/C][C]120.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]123.100000000000[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]135.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]134.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]123.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]134.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]108.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]110.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]127.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]126.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]131.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]141.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]127[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]127.3[/C][C]129.2119[/C][C]121.7861[/C][C]137.1389[/C][C]0.3182[/C][C]0.7078[/C][C]0.9346[/C][C]0.7078[/C][/ROW]
[ROW][C]51[/C][C]143.6[/C][C]143.4011[/C][C]134.6437[/C][C]152.7891[/C][C]0.4834[/C][C]0.9996[/C][C]0.9546[/C][C]0.9997[/C][/ROW]
[ROW][C]52[/C][C]149.4[/C][C]141.3943[/C][C]132.6201[/C][C]150.8112[/C][C]0.0478[/C][C]0.3231[/C][C]0.9355[/C][C]0.9986[/C][/ROW]
[ROW][C]53[/C][C]126.6[/C][C]130.3943[/C][C]122.1953[/C][C]139.2026[/C][C]0.1992[/C][C]0[/C][C]0.9318[/C][C]0.775[/C][/ROW]
[ROW][C]54[/C][C]136.5[/C][C]142.0502[/C][C]133.0253[/C][C]151.7532[/C][C]0.1311[/C][C]0.9991[/C][C]0.9338[/C][C]0.9988[/C][/ROW]
[ROW][C]55[/C][C]116[/C][C]114.0528[/C][C]106.8896[/C][C]121.7477[/C][C]0.31[/C][C]0[/C][C]0.9286[/C][C]5e-04[/C][/ROW]
[ROW][C]56[/C][C]118[/C][C]116.2639[/C][C]108.8884[/C][C]124.1927[/C][C]0.3339[/C][C]0.526[/C][C]0.9264[/C][C]0.004[/C][/ROW]
[ROW][C]57[/C][C]131.4[/C][C]134.6666[/C][C]125.9468[/C][C]144.0551[/C][C]0.2476[/C][C]0.9997[/C][C]0.9241[/C][C]0.9453[/C][/ROW]
[ROW][C]58[/C][C]140.7[/C][C]133.3479[/C][C]124.6577[/C][C]142.7091[/C][C]0.0619[/C][C]0.6583[/C][C]0.9211[/C][C]0.9081[/C][/ROW]
[ROW][C]59[/C][C]144.9[/C][C]138.3986[/C][C]129.2844[/C][C]148.2245[/C][C]0.0973[/C][C]0.3231[/C][C]0.9186[/C][C]0.9885[/C][/ROW]
[ROW][C]60[/C][C]143.9[/C][C]148.6317[/C][C]138.711[/C][C]159.3384[/C][C]0.1932[/C][C]0.7527[/C][C]0.916[/C][C]1[/C][/ROW]
[ROW][C]61[/C][C]127.1[/C][C]133.6696[/C][C]124.78[/C][C]143.2609[/C][C]0.0897[/C][C]0.0183[/C][C]0.9136[/C][C]0.9136[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36369&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36369&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[49])
37120.6-------
38123.100000000000-------
39135.3-------
40134.1-------
41123.7-------
42134.6-------
43108.3-------
44110.4-------
45127.8-------
46126.6-------
47131.4-------
48141.1-------
49127-------
50127.3129.2119121.7861137.13890.31820.70780.93460.7078
51143.6143.4011134.6437152.78910.48340.99960.95460.9997
52149.4141.3943132.6201150.81120.04780.32310.93550.9986
53126.6130.3943122.1953139.20260.199200.93180.775
54136.5142.0502133.0253151.75320.13110.99910.93380.9988
55116114.0528106.8896121.74770.3100.92865e-04
56118116.2639108.8884124.19270.33390.5260.92640.004
57131.4134.6666125.9468144.05510.24760.99970.92410.9453
58140.7133.3479124.6577142.70910.06190.65830.92110.9081
59144.9138.3986129.2844148.22450.09730.32310.91860.9885
60143.9148.6317138.711159.33840.19320.75270.9161
61127.1133.6696124.78143.26090.08970.01830.91360.9136







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.0313-0.01480.00123.65540.30460.5519
510.03340.00141e-040.03960.00330.0574
520.0340.05660.004764.09135.34092.311
530.0345-0.02910.002414.39691.19971.0953
540.0349-0.03910.003330.80482.56711.6022
550.03440.01710.00143.79140.3160.5621
560.03480.01490.00123.01390.25120.5012
570.0356-0.02430.00210.67060.88920.943
580.03580.05510.004654.05374.50452.1224
590.03620.0470.003942.26873.52241.8768
600.0368-0.03180.002722.38871.86571.3659
610.0366-0.04910.004143.16023.59671.8965

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0313 & -0.0148 & 0.0012 & 3.6554 & 0.3046 & 0.5519 \tabularnewline
51 & 0.0334 & 0.0014 & 1e-04 & 0.0396 & 0.0033 & 0.0574 \tabularnewline
52 & 0.034 & 0.0566 & 0.0047 & 64.0913 & 5.3409 & 2.311 \tabularnewline
53 & 0.0345 & -0.0291 & 0.0024 & 14.3969 & 1.1997 & 1.0953 \tabularnewline
54 & 0.0349 & -0.0391 & 0.0033 & 30.8048 & 2.5671 & 1.6022 \tabularnewline
55 & 0.0344 & 0.0171 & 0.0014 & 3.7914 & 0.316 & 0.5621 \tabularnewline
56 & 0.0348 & 0.0149 & 0.0012 & 3.0139 & 0.2512 & 0.5012 \tabularnewline
57 & 0.0356 & -0.0243 & 0.002 & 10.6706 & 0.8892 & 0.943 \tabularnewline
58 & 0.0358 & 0.0551 & 0.0046 & 54.0537 & 4.5045 & 2.1224 \tabularnewline
59 & 0.0362 & 0.047 & 0.0039 & 42.2687 & 3.5224 & 1.8768 \tabularnewline
60 & 0.0368 & -0.0318 & 0.0027 & 22.3887 & 1.8657 & 1.3659 \tabularnewline
61 & 0.0366 & -0.0491 & 0.0041 & 43.1602 & 3.5967 & 1.8965 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36369&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]50[/C][C]0.0313[/C][C]-0.0148[/C][C]0.0012[/C][C]3.6554[/C][C]0.3046[/C][C]0.5519[/C][/ROW]
[ROW][C]51[/C][C]0.0334[/C][C]0.0014[/C][C]1e-04[/C][C]0.0396[/C][C]0.0033[/C][C]0.0574[/C][/ROW]
[ROW][C]52[/C][C]0.034[/C][C]0.0566[/C][C]0.0047[/C][C]64.0913[/C][C]5.3409[/C][C]2.311[/C][/ROW]
[ROW][C]53[/C][C]0.0345[/C][C]-0.0291[/C][C]0.0024[/C][C]14.3969[/C][C]1.1997[/C][C]1.0953[/C][/ROW]
[ROW][C]54[/C][C]0.0349[/C][C]-0.0391[/C][C]0.0033[/C][C]30.8048[/C][C]2.5671[/C][C]1.6022[/C][/ROW]
[ROW][C]55[/C][C]0.0344[/C][C]0.0171[/C][C]0.0014[/C][C]3.7914[/C][C]0.316[/C][C]0.5621[/C][/ROW]
[ROW][C]56[/C][C]0.0348[/C][C]0.0149[/C][C]0.0012[/C][C]3.0139[/C][C]0.2512[/C][C]0.5012[/C][/ROW]
[ROW][C]57[/C][C]0.0356[/C][C]-0.0243[/C][C]0.002[/C][C]10.6706[/C][C]0.8892[/C][C]0.943[/C][/ROW]
[ROW][C]58[/C][C]0.0358[/C][C]0.0551[/C][C]0.0046[/C][C]54.0537[/C][C]4.5045[/C][C]2.1224[/C][/ROW]
[ROW][C]59[/C][C]0.0362[/C][C]0.047[/C][C]0.0039[/C][C]42.2687[/C][C]3.5224[/C][C]1.8768[/C][/ROW]
[ROW][C]60[/C][C]0.0368[/C][C]-0.0318[/C][C]0.0027[/C][C]22.3887[/C][C]1.8657[/C][C]1.3659[/C][/ROW]
[ROW][C]61[/C][C]0.0366[/C][C]-0.0491[/C][C]0.0041[/C][C]43.1602[/C][C]3.5967[/C][C]1.8965[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36369&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36369&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
500.0313-0.01480.00123.65540.30460.5519
510.03340.00141e-040.03960.00330.0574
520.0340.05660.004764.09135.34092.311
530.0345-0.02910.002414.39691.19971.0953
540.0349-0.03910.003330.80482.56711.6022
550.03440.01710.00143.79140.3160.5621
560.03480.01490.00123.01390.25120.5012
570.0356-0.02430.00210.67060.88920.943
580.03580.05510.004654.05374.50452.1224
590.03620.0470.003942.26873.52241.8768
600.0368-0.03180.002722.38871.86571.3659
610.0366-0.04910.004143.16023.59671.8965



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