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 computationMon, 21 Dec 2009 14:25:49 -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/21/t12614307832hzho8heub8w35d.htm/, Retrieved Sun, 05 May 2024 14:04:57 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=70395, Retrieved Sun, 05 May 2024 14:04:57 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact149
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Bivariate Data Series] [Bivariate dataset] [2008-01-05 23:51:08] [74be16979710d4c4e7c6647856088456]
F RMPD  [Univariate Explorative Data Analysis] [Colombia Coffee] [2008-01-07 14:21:11] [74be16979710d4c4e7c6647856088456]
F RMPD    [Univariate Data Series] [] [2009-10-14 08:30:28] [74be16979710d4c4e7c6647856088456]
- RMPD        [ARIMA Forecasting] [Paper] [2009-12-21 21:25:49] [e339dd08bcbfc073ac7494f09a949034] [Current]
-   PD          [ARIMA Forecasting] [paper] [2009-12-28 10:41:35] [af8eb90b4bf1bcfcc4325c143dbee260]
- R PD          [ARIMA Forecasting] [Paper - Arima For...] [2009-12-28 22:43:50] [aba88da643e3763d32ff92bd8f92a385]
Feedback Forum

Post a new message
Dataseries X:
25.6
23.7
22
21.3
20.7
20.4
20.3
20.4
19.8
19.5
23.1
23.5
23.5
22.9
21.9
21.5
20.5
20.2
19.4
19.2
18.8
18.8
22.6
23.3
23
21.4
19.9
18.8
18.6
18.4
18.6
19.9
19.2
18.4
21.1
20.5
19.1
18.1
17
17.1
17.4
16.8
15.3
14.3
13.4
15.3
22.1
23.7
22.2
19.5
16.6
17.3
19.8
21.2
21.5
20.6
19.1
19.6
23.5
24




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70395&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'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])
3620.5-------
3719.1-------
3818.1-------
3917-------
4017.1-------
4117.4-------
4216.8-------
4315.3-------
4414.3-------
4513.4-------
4615.3-------
4722.1-------
4823.7-------
4922.221.766820.539122.99450.24460.00110.001
5019.517.763815.259520.26810.08713e-040.39620
5116.614.185110.650817.71930.09020.00160.05930
5217.313.46139.430117.49250.0310.06350.03840
5319.815.240711.069919.41150.01610.16660.15510
5421.217.097312.894721.29990.02780.10370.55510.001
5521.517.540813.275921.80580.03440.04630.84840.0023
5620.616.94812.440421.45570.05620.02390.87520.0017
5719.114.38659.386919.38610.03230.00740.65051e-04
5819.613.5858.043519.12650.01670.02550.27212e-04
5923.518.358212.445824.27060.04410.34030.10740.0383
602420.071813.977226.16640.10320.13510.12160.1216

\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 & 20.5 & - & - & - & - & - & - & - \tabularnewline
37 & 19.1 & - & - & - & - & - & - & - \tabularnewline
38 & 18.1 & - & - & - & - & - & - & - \tabularnewline
39 & 17 & - & - & - & - & - & - & - \tabularnewline
40 & 17.1 & - & - & - & - & - & - & - \tabularnewline
41 & 17.4 & - & - & - & - & - & - & - \tabularnewline
42 & 16.8 & - & - & - & - & - & - & - \tabularnewline
43 & 15.3 & - & - & - & - & - & - & - \tabularnewline
44 & 14.3 & - & - & - & - & - & - & - \tabularnewline
45 & 13.4 & - & - & - & - & - & - & - \tabularnewline
46 & 15.3 & - & - & - & - & - & - & - \tabularnewline
47 & 22.1 & - & - & - & - & - & - & - \tabularnewline
48 & 23.7 & - & - & - & - & - & - & - \tabularnewline
49 & 22.2 & 21.7668 & 20.5391 & 22.9945 & 0.2446 & 0.001 & 1 & 0.001 \tabularnewline
50 & 19.5 & 17.7638 & 15.2595 & 20.2681 & 0.0871 & 3e-04 & 0.3962 & 0 \tabularnewline
51 & 16.6 & 14.1851 & 10.6508 & 17.7193 & 0.0902 & 0.0016 & 0.0593 & 0 \tabularnewline
52 & 17.3 & 13.4613 & 9.4301 & 17.4925 & 0.031 & 0.0635 & 0.0384 & 0 \tabularnewline
53 & 19.8 & 15.2407 & 11.0699 & 19.4115 & 0.0161 & 0.1666 & 0.1551 & 0 \tabularnewline
54 & 21.2 & 17.0973 & 12.8947 & 21.2999 & 0.0278 & 0.1037 & 0.5551 & 0.001 \tabularnewline
55 & 21.5 & 17.5408 & 13.2759 & 21.8058 & 0.0344 & 0.0463 & 0.8484 & 0.0023 \tabularnewline
56 & 20.6 & 16.948 & 12.4404 & 21.4557 & 0.0562 & 0.0239 & 0.8752 & 0.0017 \tabularnewline
57 & 19.1 & 14.3865 & 9.3869 & 19.3861 & 0.0323 & 0.0074 & 0.6505 & 1e-04 \tabularnewline
58 & 19.6 & 13.585 & 8.0435 & 19.1265 & 0.0167 & 0.0255 & 0.2721 & 2e-04 \tabularnewline
59 & 23.5 & 18.3582 & 12.4458 & 24.2706 & 0.0441 & 0.3403 & 0.1074 & 0.0383 \tabularnewline
60 & 24 & 20.0718 & 13.9772 & 26.1664 & 0.1032 & 0.1351 & 0.1216 & 0.1216 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70395&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]20.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]19.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]18.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]17[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]17.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]17.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]16.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]15.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]14.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]13.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]15.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]22.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]23.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]22.2[/C][C]21.7668[/C][C]20.5391[/C][C]22.9945[/C][C]0.2446[/C][C]0.001[/C][C]1[/C][C]0.001[/C][/ROW]
[ROW][C]50[/C][C]19.5[/C][C]17.7638[/C][C]15.2595[/C][C]20.2681[/C][C]0.0871[/C][C]3e-04[/C][C]0.3962[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]16.6[/C][C]14.1851[/C][C]10.6508[/C][C]17.7193[/C][C]0.0902[/C][C]0.0016[/C][C]0.0593[/C][C]0[/C][/ROW]
[ROW][C]52[/C][C]17.3[/C][C]13.4613[/C][C]9.4301[/C][C]17.4925[/C][C]0.031[/C][C]0.0635[/C][C]0.0384[/C][C]0[/C][/ROW]
[ROW][C]53[/C][C]19.8[/C][C]15.2407[/C][C]11.0699[/C][C]19.4115[/C][C]0.0161[/C][C]0.1666[/C][C]0.1551[/C][C]0[/C][/ROW]
[ROW][C]54[/C][C]21.2[/C][C]17.0973[/C][C]12.8947[/C][C]21.2999[/C][C]0.0278[/C][C]0.1037[/C][C]0.5551[/C][C]0.001[/C][/ROW]
[ROW][C]55[/C][C]21.5[/C][C]17.5408[/C][C]13.2759[/C][C]21.8058[/C][C]0.0344[/C][C]0.0463[/C][C]0.8484[/C][C]0.0023[/C][/ROW]
[ROW][C]56[/C][C]20.6[/C][C]16.948[/C][C]12.4404[/C][C]21.4557[/C][C]0.0562[/C][C]0.0239[/C][C]0.8752[/C][C]0.0017[/C][/ROW]
[ROW][C]57[/C][C]19.1[/C][C]14.3865[/C][C]9.3869[/C][C]19.3861[/C][C]0.0323[/C][C]0.0074[/C][C]0.6505[/C][C]1e-04[/C][/ROW]
[ROW][C]58[/C][C]19.6[/C][C]13.585[/C][C]8.0435[/C][C]19.1265[/C][C]0.0167[/C][C]0.0255[/C][C]0.2721[/C][C]2e-04[/C][/ROW]
[ROW][C]59[/C][C]23.5[/C][C]18.3582[/C][C]12.4458[/C][C]24.2706[/C][C]0.0441[/C][C]0.3403[/C][C]0.1074[/C][C]0.0383[/C][/ROW]
[ROW][C]60[/C][C]24[/C][C]20.0718[/C][C]13.9772[/C][C]26.1664[/C][C]0.1032[/C][C]0.1351[/C][C]0.1216[/C][C]0.1216[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70395&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70395&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])
3620.5-------
3719.1-------
3818.1-------
3917-------
4017.1-------
4117.4-------
4216.8-------
4315.3-------
4414.3-------
4513.4-------
4615.3-------
4722.1-------
4823.7-------
4922.221.766820.539122.99450.24460.00110.001
5019.517.763815.259520.26810.08713e-040.39620
5116.614.185110.650817.71930.09020.00160.05930
5217.313.46139.430117.49250.0310.06350.03840
5319.815.240711.069919.41150.01610.16660.15510
5421.217.097312.894721.29990.02780.10370.55510.001
5521.517.540813.275921.80580.03440.04630.84840.0023
5620.616.94812.440421.45570.05620.02390.87520.0017
5719.114.38659.386919.38610.03230.00740.65051e-04
5819.613.5858.043519.12650.01670.02550.27212e-04
5923.518.358212.445824.27060.04410.34030.10740.0383
602420.071813.977226.16640.10320.13510.12160.1216







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.02880.019900.187700
500.07190.09770.05883.01441.6011.2653
510.12710.17020.0965.83193.01131.7353
520.15280.28520.143314.73585.94242.4377
530.13960.29920.174420.78718.91142.9852
540.12540.240.185416.832210.23153.1987
550.12410.22570.191115.675211.00923.318
560.13570.21550.194213.336911.30023.3616
570.17730.32760.20922.217112.51323.5374
580.20810.44280.232436.180514.87993.8574
590.16430.28010.236726.438315.93073.9913
600.15490.19570.233315.430615.8893.9861

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0288 & 0.0199 & 0 & 0.1877 & 0 & 0 \tabularnewline
50 & 0.0719 & 0.0977 & 0.0588 & 3.0144 & 1.601 & 1.2653 \tabularnewline
51 & 0.1271 & 0.1702 & 0.096 & 5.8319 & 3.0113 & 1.7353 \tabularnewline
52 & 0.1528 & 0.2852 & 0.1433 & 14.7358 & 5.9424 & 2.4377 \tabularnewline
53 & 0.1396 & 0.2992 & 0.1744 & 20.7871 & 8.9114 & 2.9852 \tabularnewline
54 & 0.1254 & 0.24 & 0.1854 & 16.8322 & 10.2315 & 3.1987 \tabularnewline
55 & 0.1241 & 0.2257 & 0.1911 & 15.6752 & 11.0092 & 3.318 \tabularnewline
56 & 0.1357 & 0.2155 & 0.1942 & 13.3369 & 11.3002 & 3.3616 \tabularnewline
57 & 0.1773 & 0.3276 & 0.209 & 22.2171 & 12.5132 & 3.5374 \tabularnewline
58 & 0.2081 & 0.4428 & 0.2324 & 36.1805 & 14.8799 & 3.8574 \tabularnewline
59 & 0.1643 & 0.2801 & 0.2367 & 26.4383 & 15.9307 & 3.9913 \tabularnewline
60 & 0.1549 & 0.1957 & 0.2333 & 15.4306 & 15.889 & 3.9861 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70395&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.0288[/C][C]0.0199[/C][C]0[/C][C]0.1877[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0719[/C][C]0.0977[/C][C]0.0588[/C][C]3.0144[/C][C]1.601[/C][C]1.2653[/C][/ROW]
[ROW][C]51[/C][C]0.1271[/C][C]0.1702[/C][C]0.096[/C][C]5.8319[/C][C]3.0113[/C][C]1.7353[/C][/ROW]
[ROW][C]52[/C][C]0.1528[/C][C]0.2852[/C][C]0.1433[/C][C]14.7358[/C][C]5.9424[/C][C]2.4377[/C][/ROW]
[ROW][C]53[/C][C]0.1396[/C][C]0.2992[/C][C]0.1744[/C][C]20.7871[/C][C]8.9114[/C][C]2.9852[/C][/ROW]
[ROW][C]54[/C][C]0.1254[/C][C]0.24[/C][C]0.1854[/C][C]16.8322[/C][C]10.2315[/C][C]3.1987[/C][/ROW]
[ROW][C]55[/C][C]0.1241[/C][C]0.2257[/C][C]0.1911[/C][C]15.6752[/C][C]11.0092[/C][C]3.318[/C][/ROW]
[ROW][C]56[/C][C]0.1357[/C][C]0.2155[/C][C]0.1942[/C][C]13.3369[/C][C]11.3002[/C][C]3.3616[/C][/ROW]
[ROW][C]57[/C][C]0.1773[/C][C]0.3276[/C][C]0.209[/C][C]22.2171[/C][C]12.5132[/C][C]3.5374[/C][/ROW]
[ROW][C]58[/C][C]0.2081[/C][C]0.4428[/C][C]0.2324[/C][C]36.1805[/C][C]14.8799[/C][C]3.8574[/C][/ROW]
[ROW][C]59[/C][C]0.1643[/C][C]0.2801[/C][C]0.2367[/C][C]26.4383[/C][C]15.9307[/C][C]3.9913[/C][/ROW]
[ROW][C]60[/C][C]0.1549[/C][C]0.1957[/C][C]0.2333[/C][C]15.4306[/C][C]15.889[/C][C]3.9861[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70395&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70395&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.02880.019900.187700
500.07190.09770.05883.01441.6011.2653
510.12710.17020.0965.83193.01131.7353
520.15280.28520.143314.73585.94242.4377
530.13960.29920.174420.78718.91142.9852
540.12540.240.185416.832210.23153.1987
550.12410.22570.191115.675211.00923.318
560.13570.21550.194213.336911.30023.3616
570.17730.32760.20922.217112.51323.5374
580.20810.44280.232436.180514.87993.8574
590.16430.28010.236726.438315.93073.9913
600.15490.19570.233315.430615.8893.9861



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