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, 11 Dec 2009 07:53: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/11/t126054337902hsz59s8tldj10.htm/, Retrieved Sun, 28 Apr 2024 21:05:15 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=66281, Retrieved Sun, 28 Apr 2024 21:05:15 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact131
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-07 09:54:52] [b98453cac15ba1066b407e146608df68]
- R PD    [ARIMA Forecasting] [forecast] [2009-12-11 14:53:07] [e7a989b306049c061a54f626f1127c12] [Current]
- R P       [ARIMA Forecasting] [verbetering workshop] [2009-12-12 16:13:58] [757146c69eaf0537be37c7b0c18216d8]
Feedback Forum

Post a new message
Dataseries X:
130.7
117.2
110.8
111.4
108.2
108.8
110.2
109.5
109.5
116
111.2
112.1
114
119.1
114.1
115.1
115.4
110.8
116
119.2
126.5
127.8
131.3
140.3
137.3
143
134.5
139.9
159.3
170.4
175
175.8
180.9
180.3
169.6
172.3
184.8
177.7
184.6
211.4
215.3
215.9
244.7
259.3
289
310.9
321
315.1
333.2
314.1
284.7
273.9
216
196.4
190.9
206.4
196.3
199.5
198.9
214.4




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66281&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 time5 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])
36172.3-------
37184.8-------
38177.7-------
39184.6-------
40211.4-------
41215.3-------
42215.9-------
43244.7-------
44259.3-------
45289-------
46310.9-------
47321-------
48315.1-------
49333.2311.1506293.0684329.23290.00840.334310.3343
50314.1311.1506279.219343.08220.42820.08810.4042
51284.7311.1506269.7708352.53040.10510.444410.4258
52273.9311.1506262.1103360.19090.06830.854810.4373
53216311.1506255.4945366.80684e-040.90520.99960.4447
54196.4311.1506249.5855372.71581e-040.99880.99880.45
55190.9311.1506244.1959378.10532e-040.99960.97410.454
56206.4311.1506239.2091383.09220.00220.99950.92110.4572
57196.3311.1506234.5461387.75510.00160.99630.71460.4598
58199.5311.1506230.1512392.15010.00340.99730.50240.4619
59198.9311.1506225.9827396.31850.00490.99490.41030.4638
60214.4311.1506222.009400.29230.01670.99320.46540.4654

\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 & 172.3 & - & - & - & - & - & - & - \tabularnewline
37 & 184.8 & - & - & - & - & - & - & - \tabularnewline
38 & 177.7 & - & - & - & - & - & - & - \tabularnewline
39 & 184.6 & - & - & - & - & - & - & - \tabularnewline
40 & 211.4 & - & - & - & - & - & - & - \tabularnewline
41 & 215.3 & - & - & - & - & - & - & - \tabularnewline
42 & 215.9 & - & - & - & - & - & - & - \tabularnewline
43 & 244.7 & - & - & - & - & - & - & - \tabularnewline
44 & 259.3 & - & - & - & - & - & - & - \tabularnewline
45 & 289 & - & - & - & - & - & - & - \tabularnewline
46 & 310.9 & - & - & - & - & - & - & - \tabularnewline
47 & 321 & - & - & - & - & - & - & - \tabularnewline
48 & 315.1 & - & - & - & - & - & - & - \tabularnewline
49 & 333.2 & 311.1506 & 293.0684 & 329.2329 & 0.0084 & 0.3343 & 1 & 0.3343 \tabularnewline
50 & 314.1 & 311.1506 & 279.219 & 343.0822 & 0.4282 & 0.088 & 1 & 0.4042 \tabularnewline
51 & 284.7 & 311.1506 & 269.7708 & 352.5304 & 0.1051 & 0.4444 & 1 & 0.4258 \tabularnewline
52 & 273.9 & 311.1506 & 262.1103 & 360.1909 & 0.0683 & 0.8548 & 1 & 0.4373 \tabularnewline
53 & 216 & 311.1506 & 255.4945 & 366.8068 & 4e-04 & 0.9052 & 0.9996 & 0.4447 \tabularnewline
54 & 196.4 & 311.1506 & 249.5855 & 372.7158 & 1e-04 & 0.9988 & 0.9988 & 0.45 \tabularnewline
55 & 190.9 & 311.1506 & 244.1959 & 378.1053 & 2e-04 & 0.9996 & 0.9741 & 0.454 \tabularnewline
56 & 206.4 & 311.1506 & 239.2091 & 383.0922 & 0.0022 & 0.9995 & 0.9211 & 0.4572 \tabularnewline
57 & 196.3 & 311.1506 & 234.5461 & 387.7551 & 0.0016 & 0.9963 & 0.7146 & 0.4598 \tabularnewline
58 & 199.5 & 311.1506 & 230.1512 & 392.1501 & 0.0034 & 0.9973 & 0.5024 & 0.4619 \tabularnewline
59 & 198.9 & 311.1506 & 225.9827 & 396.3185 & 0.0049 & 0.9949 & 0.4103 & 0.4638 \tabularnewline
60 & 214.4 & 311.1506 & 222.009 & 400.2923 & 0.0167 & 0.9932 & 0.4654 & 0.4654 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66281&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]172.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]184.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]177.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]184.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]211.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]215.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]215.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]244.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]259.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]289[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]310.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]321[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]315.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]333.2[/C][C]311.1506[/C][C]293.0684[/C][C]329.2329[/C][C]0.0084[/C][C]0.3343[/C][C]1[/C][C]0.3343[/C][/ROW]
[ROW][C]50[/C][C]314.1[/C][C]311.1506[/C][C]279.219[/C][C]343.0822[/C][C]0.4282[/C][C]0.088[/C][C]1[/C][C]0.4042[/C][/ROW]
[ROW][C]51[/C][C]284.7[/C][C]311.1506[/C][C]269.7708[/C][C]352.5304[/C][C]0.1051[/C][C]0.4444[/C][C]1[/C][C]0.4258[/C][/ROW]
[ROW][C]52[/C][C]273.9[/C][C]311.1506[/C][C]262.1103[/C][C]360.1909[/C][C]0.0683[/C][C]0.8548[/C][C]1[/C][C]0.4373[/C][/ROW]
[ROW][C]53[/C][C]216[/C][C]311.1506[/C][C]255.4945[/C][C]366.8068[/C][C]4e-04[/C][C]0.9052[/C][C]0.9996[/C][C]0.4447[/C][/ROW]
[ROW][C]54[/C][C]196.4[/C][C]311.1506[/C][C]249.5855[/C][C]372.7158[/C][C]1e-04[/C][C]0.9988[/C][C]0.9988[/C][C]0.45[/C][/ROW]
[ROW][C]55[/C][C]190.9[/C][C]311.1506[/C][C]244.1959[/C][C]378.1053[/C][C]2e-04[/C][C]0.9996[/C][C]0.9741[/C][C]0.454[/C][/ROW]
[ROW][C]56[/C][C]206.4[/C][C]311.1506[/C][C]239.2091[/C][C]383.0922[/C][C]0.0022[/C][C]0.9995[/C][C]0.9211[/C][C]0.4572[/C][/ROW]
[ROW][C]57[/C][C]196.3[/C][C]311.1506[/C][C]234.5461[/C][C]387.7551[/C][C]0.0016[/C][C]0.9963[/C][C]0.7146[/C][C]0.4598[/C][/ROW]
[ROW][C]58[/C][C]199.5[/C][C]311.1506[/C][C]230.1512[/C][C]392.1501[/C][C]0.0034[/C][C]0.9973[/C][C]0.5024[/C][C]0.4619[/C][/ROW]
[ROW][C]59[/C][C]198.9[/C][C]311.1506[/C][C]225.9827[/C][C]396.3185[/C][C]0.0049[/C][C]0.9949[/C][C]0.4103[/C][C]0.4638[/C][/ROW]
[ROW][C]60[/C][C]214.4[/C][C]311.1506[/C][C]222.009[/C][C]400.2923[/C][C]0.0167[/C][C]0.9932[/C][C]0.4654[/C][C]0.4654[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66281&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66281&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])
36172.3-------
37184.8-------
38177.7-------
39184.6-------
40211.4-------
41215.3-------
42215.9-------
43244.7-------
44259.3-------
45289-------
46310.9-------
47321-------
48315.1-------
49333.2311.1506293.0684329.23290.00840.334310.3343
50314.1311.1506279.219343.08220.42820.08810.4042
51284.7311.1506269.7708352.53040.10510.444410.4258
52273.9311.1506262.1103360.19090.06830.854810.4373
53216311.1506255.4945366.80684e-040.90520.99960.4447
54196.4311.1506249.5855372.71581e-040.99880.99880.45
55190.9311.1506244.1959378.10532e-040.99960.97410.454
56206.4311.1506239.2091383.09220.00220.99950.92110.4572
57196.3311.1506234.5461387.75510.00160.99630.71460.4598
58199.5311.1506230.1512392.15010.00340.99730.50240.4619
59198.9311.1506225.9827396.31850.00490.99490.41030.4638
60214.4311.1506222.009400.29230.01670.99320.46540.4654







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.02970.07090486.174900
500.05240.00950.04028.6988247.436915.7301
510.0679-0.0850.0551699.6356398.169819.9542
520.0804-0.11970.07131387.6091645.529625.4073
530.0913-0.30580.11829053.64152327.15248.2406
540.101-0.36880.159913167.7064133.91164.2955
550.1098-0.38650.192314460.21285609.096974.8939
560.118-0.33670.210310972.69356279.546579.2436
570.1256-0.36910.22813190.66617047.448783.9491
580.1328-0.35880.241112465.86217589.2987.1165
590.1397-0.36080.25212600.20288044.827689.693
600.1462-0.31090.25699360.68358154.482290.3022

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0297 & 0.0709 & 0 & 486.1749 & 0 & 0 \tabularnewline
50 & 0.0524 & 0.0095 & 0.0402 & 8.6988 & 247.4369 & 15.7301 \tabularnewline
51 & 0.0679 & -0.085 & 0.0551 & 699.6356 & 398.1698 & 19.9542 \tabularnewline
52 & 0.0804 & -0.1197 & 0.0713 & 1387.6091 & 645.5296 & 25.4073 \tabularnewline
53 & 0.0913 & -0.3058 & 0.1182 & 9053.6415 & 2327.152 & 48.2406 \tabularnewline
54 & 0.101 & -0.3688 & 0.1599 & 13167.706 & 4133.911 & 64.2955 \tabularnewline
55 & 0.1098 & -0.3865 & 0.1923 & 14460.2128 & 5609.0969 & 74.8939 \tabularnewline
56 & 0.118 & -0.3367 & 0.2103 & 10972.6935 & 6279.5465 & 79.2436 \tabularnewline
57 & 0.1256 & -0.3691 & 0.228 & 13190.6661 & 7047.4487 & 83.9491 \tabularnewline
58 & 0.1328 & -0.3588 & 0.2411 & 12465.8621 & 7589.29 & 87.1165 \tabularnewline
59 & 0.1397 & -0.3608 & 0.252 & 12600.2028 & 8044.8276 & 89.693 \tabularnewline
60 & 0.1462 & -0.3109 & 0.2569 & 9360.6835 & 8154.4822 & 90.3022 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66281&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.0297[/C][C]0.0709[/C][C]0[/C][C]486.1749[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0524[/C][C]0.0095[/C][C]0.0402[/C][C]8.6988[/C][C]247.4369[/C][C]15.7301[/C][/ROW]
[ROW][C]51[/C][C]0.0679[/C][C]-0.085[/C][C]0.0551[/C][C]699.6356[/C][C]398.1698[/C][C]19.9542[/C][/ROW]
[ROW][C]52[/C][C]0.0804[/C][C]-0.1197[/C][C]0.0713[/C][C]1387.6091[/C][C]645.5296[/C][C]25.4073[/C][/ROW]
[ROW][C]53[/C][C]0.0913[/C][C]-0.3058[/C][C]0.1182[/C][C]9053.6415[/C][C]2327.152[/C][C]48.2406[/C][/ROW]
[ROW][C]54[/C][C]0.101[/C][C]-0.3688[/C][C]0.1599[/C][C]13167.706[/C][C]4133.911[/C][C]64.2955[/C][/ROW]
[ROW][C]55[/C][C]0.1098[/C][C]-0.3865[/C][C]0.1923[/C][C]14460.2128[/C][C]5609.0969[/C][C]74.8939[/C][/ROW]
[ROW][C]56[/C][C]0.118[/C][C]-0.3367[/C][C]0.2103[/C][C]10972.6935[/C][C]6279.5465[/C][C]79.2436[/C][/ROW]
[ROW][C]57[/C][C]0.1256[/C][C]-0.3691[/C][C]0.228[/C][C]13190.6661[/C][C]7047.4487[/C][C]83.9491[/C][/ROW]
[ROW][C]58[/C][C]0.1328[/C][C]-0.3588[/C][C]0.2411[/C][C]12465.8621[/C][C]7589.29[/C][C]87.1165[/C][/ROW]
[ROW][C]59[/C][C]0.1397[/C][C]-0.3608[/C][C]0.252[/C][C]12600.2028[/C][C]8044.8276[/C][C]89.693[/C][/ROW]
[ROW][C]60[/C][C]0.1462[/C][C]-0.3109[/C][C]0.2569[/C][C]9360.6835[/C][C]8154.4822[/C][C]90.3022[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66281&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66281&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.02970.07090486.174900
500.05240.00950.04028.6988247.436915.7301
510.0679-0.0850.0551699.6356398.169819.9542
520.0804-0.11970.07131387.6091645.529625.4073
530.0913-0.30580.11829053.64152327.15248.2406
540.101-0.36880.159913167.7064133.91164.2955
550.1098-0.38650.192314460.21285609.096974.8939
560.118-0.33670.210310972.69356279.546579.2436
570.1256-0.36910.22813190.66617047.448783.9491
580.1328-0.35880.241112465.86217589.2987.1165
590.1397-0.36080.25212600.20288044.827689.693
600.1462-0.31090.25699360.68358154.482290.3022



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