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 computationTue, 06 Dec 2011 15:26:47 -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/2011/Dec/06/t13232032852tox527f6ebwkxi.htm/, Retrieved Sun, 28 Apr 2024 20:08:07 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=151905, Retrieved Sun, 28 Apr 2024 20:08:07 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact137
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Standard Deviation-Mean Plot] [stand dev mean plot] [2011-12-06 09:20:11] [bcad5ea7a7be31884500e96b7abaff18]
- RMP   [ARIMA Backward Selection] [ARIMA B S] [2011-12-06 09:46:03] [bcad5ea7a7be31884500e96b7abaff18]
- R P     [ARIMA Backward Selection] [] [2011-12-06 19:38:29] [74be16979710d4c4e7c6647856088456]
- RMP         [ARIMA Forecasting] [] [2011-12-06 20:26:47] [2adf2d2c11e011c12275478b9efd18e5] [Current]
Feedback Forum

Post a new message
Dataseries X:
2851
2672
2755
2721
2946
3036
2282
2212
2922
4301
5764
7132
2541
2475
3031
3266
3776
3230
3028
1759
3595
4474
6838
8357
3113
3006
4047
3523
3937
3986
3260
1573
3528
5211
7614
9254
5375
3088
3718
4514
4520
4539
3663
1643
4739
5428
8314
10651
3633
4292
4154
4121
4647
4753
3965
1723
5048
6922
9858
11331
4016
3957
4510
4276
4968
4677
3523
1821
5222
6873
10803
13916
2639
2899
3370
3740
2927
3986
4217
1738
5221
6424
9842
13076
3934
3162
4286
4676
5010
4874
4633
1659
5951
6981
9851
12670




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151905&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' @ jenkins.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[84])
7213916-------
732639-------
742899-------
753370-------
763740-------
772927-------
783986-------
794217-------
801738-------
815221-------
826424-------
839842-------
8413076-------
8539342887.78992184.57823953.78120.027200.67630
8631623029.36522262.09744216.91250.41340.06770.58520
8742863571.58412588.59085168.40180.19030.69240.59770
8846763864.54752768.06465680.53240.19060.32460.55350
8950103264.93382384.11584678.41230.00780.02520.68030
9048744110.57112916.62656119.01170.22810.190.54840
9146334001.09172848.28275929.8360.26040.18750.41320
9216591762.09911373.13282324.68570.359700.53350
9359515240.3033598.39728157.70690.31650.99190.50520
9469816471.72994310.210410517.71750.40260.59960.50927e-04
95985110078.99216248.246418214.42840.47810.77230.52280.2351
961267013488.36297928.361326509.85070.4510.7080.52470.5247

\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[84]) \tabularnewline
72 & 13916 & - & - & - & - & - & - & - \tabularnewline
73 & 2639 & - & - & - & - & - & - & - \tabularnewline
74 & 2899 & - & - & - & - & - & - & - \tabularnewline
75 & 3370 & - & - & - & - & - & - & - \tabularnewline
76 & 3740 & - & - & - & - & - & - & - \tabularnewline
77 & 2927 & - & - & - & - & - & - & - \tabularnewline
78 & 3986 & - & - & - & - & - & - & - \tabularnewline
79 & 4217 & - & - & - & - & - & - & - \tabularnewline
80 & 1738 & - & - & - & - & - & - & - \tabularnewline
81 & 5221 & - & - & - & - & - & - & - \tabularnewline
82 & 6424 & - & - & - & - & - & - & - \tabularnewline
83 & 9842 & - & - & - & - & - & - & - \tabularnewline
84 & 13076 & - & - & - & - & - & - & - \tabularnewline
85 & 3934 & 2887.7899 & 2184.5782 & 3953.7812 & 0.0272 & 0 & 0.6763 & 0 \tabularnewline
86 & 3162 & 3029.3652 & 2262.0974 & 4216.9125 & 0.4134 & 0.0677 & 0.5852 & 0 \tabularnewline
87 & 4286 & 3571.5841 & 2588.5908 & 5168.4018 & 0.1903 & 0.6924 & 0.5977 & 0 \tabularnewline
88 & 4676 & 3864.5475 & 2768.0646 & 5680.5324 & 0.1906 & 0.3246 & 0.5535 & 0 \tabularnewline
89 & 5010 & 3264.9338 & 2384.1158 & 4678.4123 & 0.0078 & 0.0252 & 0.6803 & 0 \tabularnewline
90 & 4874 & 4110.5711 & 2916.6265 & 6119.0117 & 0.2281 & 0.19 & 0.5484 & 0 \tabularnewline
91 & 4633 & 4001.0917 & 2848.2827 & 5929.836 & 0.2604 & 0.1875 & 0.4132 & 0 \tabularnewline
92 & 1659 & 1762.0991 & 1373.1328 & 2324.6857 & 0.3597 & 0 & 0.5335 & 0 \tabularnewline
93 & 5951 & 5240.303 & 3598.3972 & 8157.7069 & 0.3165 & 0.9919 & 0.5052 & 0 \tabularnewline
94 & 6981 & 6471.7299 & 4310.2104 & 10517.7175 & 0.4026 & 0.5996 & 0.5092 & 7e-04 \tabularnewline
95 & 9851 & 10078.9921 & 6248.2464 & 18214.4284 & 0.4781 & 0.7723 & 0.5228 & 0.2351 \tabularnewline
96 & 12670 & 13488.3629 & 7928.3613 & 26509.8507 & 0.451 & 0.708 & 0.5247 & 0.5247 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151905&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[84])[/C][/ROW]
[ROW][C]72[/C][C]13916[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]2639[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]74[/C][C]2899[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]75[/C][C]3370[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]76[/C][C]3740[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]77[/C][C]2927[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]78[/C][C]3986[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]79[/C][C]4217[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]80[/C][C]1738[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]81[/C][C]5221[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]82[/C][C]6424[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]83[/C][C]9842[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]84[/C][C]13076[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]3934[/C][C]2887.7899[/C][C]2184.5782[/C][C]3953.7812[/C][C]0.0272[/C][C]0[/C][C]0.6763[/C][C]0[/C][/ROW]
[ROW][C]86[/C][C]3162[/C][C]3029.3652[/C][C]2262.0974[/C][C]4216.9125[/C][C]0.4134[/C][C]0.0677[/C][C]0.5852[/C][C]0[/C][/ROW]
[ROW][C]87[/C][C]4286[/C][C]3571.5841[/C][C]2588.5908[/C][C]5168.4018[/C][C]0.1903[/C][C]0.6924[/C][C]0.5977[/C][C]0[/C][/ROW]
[ROW][C]88[/C][C]4676[/C][C]3864.5475[/C][C]2768.0646[/C][C]5680.5324[/C][C]0.1906[/C][C]0.3246[/C][C]0.5535[/C][C]0[/C][/ROW]
[ROW][C]89[/C][C]5010[/C][C]3264.9338[/C][C]2384.1158[/C][C]4678.4123[/C][C]0.0078[/C][C]0.0252[/C][C]0.6803[/C][C]0[/C][/ROW]
[ROW][C]90[/C][C]4874[/C][C]4110.5711[/C][C]2916.6265[/C][C]6119.0117[/C][C]0.2281[/C][C]0.19[/C][C]0.5484[/C][C]0[/C][/ROW]
[ROW][C]91[/C][C]4633[/C][C]4001.0917[/C][C]2848.2827[/C][C]5929.836[/C][C]0.2604[/C][C]0.1875[/C][C]0.4132[/C][C]0[/C][/ROW]
[ROW][C]92[/C][C]1659[/C][C]1762.0991[/C][C]1373.1328[/C][C]2324.6857[/C][C]0.3597[/C][C]0[/C][C]0.5335[/C][C]0[/C][/ROW]
[ROW][C]93[/C][C]5951[/C][C]5240.303[/C][C]3598.3972[/C][C]8157.7069[/C][C]0.3165[/C][C]0.9919[/C][C]0.5052[/C][C]0[/C][/ROW]
[ROW][C]94[/C][C]6981[/C][C]6471.7299[/C][C]4310.2104[/C][C]10517.7175[/C][C]0.4026[/C][C]0.5996[/C][C]0.5092[/C][C]7e-04[/C][/ROW]
[ROW][C]95[/C][C]9851[/C][C]10078.9921[/C][C]6248.2464[/C][C]18214.4284[/C][C]0.4781[/C][C]0.7723[/C][C]0.5228[/C][C]0.2351[/C][/ROW]
[ROW][C]96[/C][C]12670[/C][C]13488.3629[/C][C]7928.3613[/C][C]26509.8507[/C][C]0.451[/C][C]0.708[/C][C]0.5247[/C][C]0.5247[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151905&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151905&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[84])
7213916-------
732639-------
742899-------
753370-------
763740-------
772927-------
783986-------
794217-------
801738-------
815221-------
826424-------
839842-------
8413076-------
8539342887.78992184.57823953.78120.027200.67630
8631623029.36522262.09744216.91250.41340.06770.58520
8742863571.58412588.59085168.40180.19030.69240.59770
8846763864.54752768.06465680.53240.19060.32460.55350
8950103264.93382384.11584678.41230.00780.02520.68030
9048744110.57112916.62656119.01170.22810.190.54840
9146334001.09172848.28275929.8360.26040.18750.41320
9216591762.09911373.13282324.68570.359700.53350
9359515240.3033598.39728157.70690.31650.99190.50520
9469816471.72994310.210410517.71750.40260.59960.50927e-04
95985110078.99216248.246418214.42840.47810.77230.52280.2351
961267013488.36297928.361326509.85070.4510.7080.52470.5247







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
850.18830.362301094555.618100
860.20.04380.20317591.9778556073.7979745.7036
870.22810.20.202510390.0519540845.8826735.4222
880.23970.210.204658455.0993570248.1868755.1478
890.22090.53450.27013045256.18021065249.78541032.1094
900.24930.18570.256582823.7611984845.448992.3938
910.24590.15790.242399308.1415901197.2614949.3141
920.1629-0.05850.219110629.4266789876.282888.7498
930.2840.13560.2098505090.272758233.392870.766
940.3190.07870.1967259355.9977708345.6526841.6327
950.4118-0.02260.180951980.3839648676.0827805.4043
960.4925-0.06070.1709669717.7896650429.5583806.4921

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
85 & 0.1883 & 0.3623 & 0 & 1094555.6181 & 0 & 0 \tabularnewline
86 & 0.2 & 0.0438 & 0.203 & 17591.9778 & 556073.7979 & 745.7036 \tabularnewline
87 & 0.2281 & 0.2 & 0.202 & 510390.0519 & 540845.8826 & 735.4222 \tabularnewline
88 & 0.2397 & 0.21 & 0.204 & 658455.0993 & 570248.1868 & 755.1478 \tabularnewline
89 & 0.2209 & 0.5345 & 0.2701 & 3045256.1802 & 1065249.7854 & 1032.1094 \tabularnewline
90 & 0.2493 & 0.1857 & 0.256 & 582823.7611 & 984845.448 & 992.3938 \tabularnewline
91 & 0.2459 & 0.1579 & 0.242 & 399308.1415 & 901197.2614 & 949.3141 \tabularnewline
92 & 0.1629 & -0.0585 & 0.2191 & 10629.4266 & 789876.282 & 888.7498 \tabularnewline
93 & 0.284 & 0.1356 & 0.2098 & 505090.272 & 758233.392 & 870.766 \tabularnewline
94 & 0.319 & 0.0787 & 0.1967 & 259355.9977 & 708345.6526 & 841.6327 \tabularnewline
95 & 0.4118 & -0.0226 & 0.1809 & 51980.3839 & 648676.0827 & 805.4043 \tabularnewline
96 & 0.4925 & -0.0607 & 0.1709 & 669717.7896 & 650429.5583 & 806.4921 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151905&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]85[/C][C]0.1883[/C][C]0.3623[/C][C]0[/C][C]1094555.6181[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]86[/C][C]0.2[/C][C]0.0438[/C][C]0.203[/C][C]17591.9778[/C][C]556073.7979[/C][C]745.7036[/C][/ROW]
[ROW][C]87[/C][C]0.2281[/C][C]0.2[/C][C]0.202[/C][C]510390.0519[/C][C]540845.8826[/C][C]735.4222[/C][/ROW]
[ROW][C]88[/C][C]0.2397[/C][C]0.21[/C][C]0.204[/C][C]658455.0993[/C][C]570248.1868[/C][C]755.1478[/C][/ROW]
[ROW][C]89[/C][C]0.2209[/C][C]0.5345[/C][C]0.2701[/C][C]3045256.1802[/C][C]1065249.7854[/C][C]1032.1094[/C][/ROW]
[ROW][C]90[/C][C]0.2493[/C][C]0.1857[/C][C]0.256[/C][C]582823.7611[/C][C]984845.448[/C][C]992.3938[/C][/ROW]
[ROW][C]91[/C][C]0.2459[/C][C]0.1579[/C][C]0.242[/C][C]399308.1415[/C][C]901197.2614[/C][C]949.3141[/C][/ROW]
[ROW][C]92[/C][C]0.1629[/C][C]-0.0585[/C][C]0.2191[/C][C]10629.4266[/C][C]789876.282[/C][C]888.7498[/C][/ROW]
[ROW][C]93[/C][C]0.284[/C][C]0.1356[/C][C]0.2098[/C][C]505090.272[/C][C]758233.392[/C][C]870.766[/C][/ROW]
[ROW][C]94[/C][C]0.319[/C][C]0.0787[/C][C]0.1967[/C][C]259355.9977[/C][C]708345.6526[/C][C]841.6327[/C][/ROW]
[ROW][C]95[/C][C]0.4118[/C][C]-0.0226[/C][C]0.1809[/C][C]51980.3839[/C][C]648676.0827[/C][C]805.4043[/C][/ROW]
[ROW][C]96[/C][C]0.4925[/C][C]-0.0607[/C][C]0.1709[/C][C]669717.7896[/C][C]650429.5583[/C][C]806.4921[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151905&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151905&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
850.18830.362301094555.618100
860.20.04380.20317591.9778556073.7979745.7036
870.22810.20.202510390.0519540845.8826735.4222
880.23970.210.204658455.0993570248.1868755.1478
890.22090.53450.27013045256.18021065249.78541032.1094
900.24930.18570.256582823.7611984845.448992.3938
910.24590.15790.242399308.1415901197.2614949.3141
920.1629-0.05850.219110629.4266789876.282888.7498
930.2840.13560.2098505090.272758233.392870.766
940.3190.07870.1967259355.9977708345.6526841.6327
950.4118-0.02260.180951980.3839648676.0827805.4043
960.4925-0.06070.1709669717.7896650429.5583806.4921



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