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, 04 Dec 2009 07:34:06 -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/04/t1259937350r54hcea2bv1z04z.htm/, Retrieved Sat, 27 Apr 2024 19:49:57 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=63618, Retrieved Sat, 27 Apr 2024 19:49: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)
-     [Univariate Data Series] [] [2009-11-05 08:15:26] [74be16979710d4c4e7c6647856088456]
-   PD  [Univariate Data Series] [] [2009-11-11 08:16:12] [74be16979710d4c4e7c6647856088456]
- RMP       [ARIMA Forecasting] [] [2009-12-04 14:34:06] [2b679e8ec54382eeb0ec0b6bb527570a] [Current]
-   P         [ARIMA Forecasting] [] [2009-12-06 15:38:09] [5d885a68c2332cc44f6191ec94766bfa]
Feedback Forum

Post a new message
Dataseries X:
100.03
100.25
99.6
100.16
100.49
99.72
100.14
98.48
100.38
101.45
98.42
98.6
100.06
98.62
100.84
100.02
97.95
98.32
98.27
97.22
99.28
100.38
99.02
100.32
99.81
100.6
101.19
100.47
101.77
102.32
102.39
101.16
100.63
101.48
101.44
100.09
100.7
100.78
99.81
98.45
98.49
97.48
97.91
96.94
98.53
96.82
95.76
95.27
97.32
96.68
97.87
97.42
97.94
99.52
100.99
99.92
101.97
101.58
99.54
100.83




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=63618&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=63618&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=63618&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[48])
36100.09-------
37100.7-------
38100.78-------
3999.81-------
4098.45-------
4198.49-------
4297.48-------
4397.91-------
4496.94-------
4598.53-------
4696.82-------
4795.76-------
4895.27-------
4997.3299.716596.9234102.50960.04630.99910.2450.9991
5096.6899.214796.4215102.00780.03760.90820.1360.9972
5197.87100.931998.1388103.72510.01580.99860.78441
5297.42100.817998.0248103.6110.00860.98070.95171
5397.94100.195997.4028102.9890.05670.97430.88440.9997
5499.52100.747897.9547103.54090.19450.97560.98910.9999
55100.99100.734997.9418103.5280.4290.8030.97630.9999
5699.9299.373996.5808102.1670.35080.12840.95620.998
57101.97100.481197.688103.27420.14810.65310.91450.9999
58101.58102.478799.6856105.27180.26410.639411
5999.54100.985498.1923103.77850.15520.33820.99991
60100.83101.455498.6623104.24850.33040.910511

\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 & 100.09 & - & - & - & - & - & - & - \tabularnewline
37 & 100.7 & - & - & - & - & - & - & - \tabularnewline
38 & 100.78 & - & - & - & - & - & - & - \tabularnewline
39 & 99.81 & - & - & - & - & - & - & - \tabularnewline
40 & 98.45 & - & - & - & - & - & - & - \tabularnewline
41 & 98.49 & - & - & - & - & - & - & - \tabularnewline
42 & 97.48 & - & - & - & - & - & - & - \tabularnewline
43 & 97.91 & - & - & - & - & - & - & - \tabularnewline
44 & 96.94 & - & - & - & - & - & - & - \tabularnewline
45 & 98.53 & - & - & - & - & - & - & - \tabularnewline
46 & 96.82 & - & - & - & - & - & - & - \tabularnewline
47 & 95.76 & - & - & - & - & - & - & - \tabularnewline
48 & 95.27 & - & - & - & - & - & - & - \tabularnewline
49 & 97.32 & 99.7165 & 96.9234 & 102.5096 & 0.0463 & 0.9991 & 0.245 & 0.9991 \tabularnewline
50 & 96.68 & 99.2147 & 96.4215 & 102.0078 & 0.0376 & 0.9082 & 0.136 & 0.9972 \tabularnewline
51 & 97.87 & 100.9319 & 98.1388 & 103.7251 & 0.0158 & 0.9986 & 0.7844 & 1 \tabularnewline
52 & 97.42 & 100.8179 & 98.0248 & 103.611 & 0.0086 & 0.9807 & 0.9517 & 1 \tabularnewline
53 & 97.94 & 100.1959 & 97.4028 & 102.989 & 0.0567 & 0.9743 & 0.8844 & 0.9997 \tabularnewline
54 & 99.52 & 100.7478 & 97.9547 & 103.5409 & 0.1945 & 0.9756 & 0.9891 & 0.9999 \tabularnewline
55 & 100.99 & 100.7349 & 97.9418 & 103.528 & 0.429 & 0.803 & 0.9763 & 0.9999 \tabularnewline
56 & 99.92 & 99.3739 & 96.5808 & 102.167 & 0.3508 & 0.1284 & 0.9562 & 0.998 \tabularnewline
57 & 101.97 & 100.4811 & 97.688 & 103.2742 & 0.1481 & 0.6531 & 0.9145 & 0.9999 \tabularnewline
58 & 101.58 & 102.4787 & 99.6856 & 105.2718 & 0.2641 & 0.6394 & 1 & 1 \tabularnewline
59 & 99.54 & 100.9854 & 98.1923 & 103.7785 & 0.1552 & 0.3382 & 0.9999 & 1 \tabularnewline
60 & 100.83 & 101.4554 & 98.6623 & 104.2485 & 0.3304 & 0.9105 & 1 & 1 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=63618&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]100.09[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]100.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]100.78[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]99.81[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]98.45[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]98.49[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]97.48[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]97.91[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]96.94[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]98.53[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]96.82[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]95.76[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]95.27[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]97.32[/C][C]99.7165[/C][C]96.9234[/C][C]102.5096[/C][C]0.0463[/C][C]0.9991[/C][C]0.245[/C][C]0.9991[/C][/ROW]
[ROW][C]50[/C][C]96.68[/C][C]99.2147[/C][C]96.4215[/C][C]102.0078[/C][C]0.0376[/C][C]0.9082[/C][C]0.136[/C][C]0.9972[/C][/ROW]
[ROW][C]51[/C][C]97.87[/C][C]100.9319[/C][C]98.1388[/C][C]103.7251[/C][C]0.0158[/C][C]0.9986[/C][C]0.7844[/C][C]1[/C][/ROW]
[ROW][C]52[/C][C]97.42[/C][C]100.8179[/C][C]98.0248[/C][C]103.611[/C][C]0.0086[/C][C]0.9807[/C][C]0.9517[/C][C]1[/C][/ROW]
[ROW][C]53[/C][C]97.94[/C][C]100.1959[/C][C]97.4028[/C][C]102.989[/C][C]0.0567[/C][C]0.9743[/C][C]0.8844[/C][C]0.9997[/C][/ROW]
[ROW][C]54[/C][C]99.52[/C][C]100.7478[/C][C]97.9547[/C][C]103.5409[/C][C]0.1945[/C][C]0.9756[/C][C]0.9891[/C][C]0.9999[/C][/ROW]
[ROW][C]55[/C][C]100.99[/C][C]100.7349[/C][C]97.9418[/C][C]103.528[/C][C]0.429[/C][C]0.803[/C][C]0.9763[/C][C]0.9999[/C][/ROW]
[ROW][C]56[/C][C]99.92[/C][C]99.3739[/C][C]96.5808[/C][C]102.167[/C][C]0.3508[/C][C]0.1284[/C][C]0.9562[/C][C]0.998[/C][/ROW]
[ROW][C]57[/C][C]101.97[/C][C]100.4811[/C][C]97.688[/C][C]103.2742[/C][C]0.1481[/C][C]0.6531[/C][C]0.9145[/C][C]0.9999[/C][/ROW]
[ROW][C]58[/C][C]101.58[/C][C]102.4787[/C][C]99.6856[/C][C]105.2718[/C][C]0.2641[/C][C]0.6394[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]59[/C][C]99.54[/C][C]100.9854[/C][C]98.1923[/C][C]103.7785[/C][C]0.1552[/C][C]0.3382[/C][C]0.9999[/C][C]1[/C][/ROW]
[ROW][C]60[/C][C]100.83[/C][C]101.4554[/C][C]98.6623[/C][C]104.2485[/C][C]0.3304[/C][C]0.9105[/C][C]1[/C][C]1[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=63618&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=63618&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])
36100.09-------
37100.7-------
38100.78-------
3999.81-------
4098.45-------
4198.49-------
4297.48-------
4397.91-------
4496.94-------
4598.53-------
4696.82-------
4795.76-------
4895.27-------
4997.3299.716596.9234102.50960.04630.99910.2450.9991
5096.6899.214796.4215102.00780.03760.90820.1360.9972
5197.87100.931998.1388103.72510.01580.99860.78441
5297.42100.817998.0248103.6110.00860.98070.95171
5397.94100.195997.4028102.9890.05670.97430.88440.9997
5499.52100.747897.9547103.54090.19450.97560.98910.9999
55100.99100.734997.9418103.5280.4290.8030.97630.9999
5699.9299.373996.5808102.1670.35080.12840.95620.998
57101.97100.481197.688103.27420.14810.65310.91450.9999
58101.58102.478799.6856105.27180.26410.639411
5999.54100.985498.1923103.77850.15520.33820.99991
60100.83101.455498.6623104.24850.33040.910511







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0143-0.0240.0025.74320.47860.6918
500.0144-0.02550.00216.42450.53540.7317
510.0141-0.03030.00259.37550.78130.8839
520.0141-0.03370.002811.54580.96220.9809
530.0142-0.02250.00195.08920.42410.6512
540.0141-0.01220.0011.50760.12560.3544
550.01410.00252e-040.06510.00540.0737
560.01430.00555e-040.29820.02480.1576
570.01420.01480.00122.21670.18470.4298
580.0139-0.00887e-040.80770.06730.2594
590.0141-0.01430.00122.08910.17410.4172
600.014-0.00625e-040.39110.03260.1805

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0143 & -0.024 & 0.002 & 5.7432 & 0.4786 & 0.6918 \tabularnewline
50 & 0.0144 & -0.0255 & 0.0021 & 6.4245 & 0.5354 & 0.7317 \tabularnewline
51 & 0.0141 & -0.0303 & 0.0025 & 9.3755 & 0.7813 & 0.8839 \tabularnewline
52 & 0.0141 & -0.0337 & 0.0028 & 11.5458 & 0.9622 & 0.9809 \tabularnewline
53 & 0.0142 & -0.0225 & 0.0019 & 5.0892 & 0.4241 & 0.6512 \tabularnewline
54 & 0.0141 & -0.0122 & 0.001 & 1.5076 & 0.1256 & 0.3544 \tabularnewline
55 & 0.0141 & 0.0025 & 2e-04 & 0.0651 & 0.0054 & 0.0737 \tabularnewline
56 & 0.0143 & 0.0055 & 5e-04 & 0.2982 & 0.0248 & 0.1576 \tabularnewline
57 & 0.0142 & 0.0148 & 0.0012 & 2.2167 & 0.1847 & 0.4298 \tabularnewline
58 & 0.0139 & -0.0088 & 7e-04 & 0.8077 & 0.0673 & 0.2594 \tabularnewline
59 & 0.0141 & -0.0143 & 0.0012 & 2.0891 & 0.1741 & 0.4172 \tabularnewline
60 & 0.014 & -0.0062 & 5e-04 & 0.3911 & 0.0326 & 0.1805 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=63618&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.0143[/C][C]-0.024[/C][C]0.002[/C][C]5.7432[/C][C]0.4786[/C][C]0.6918[/C][/ROW]
[ROW][C]50[/C][C]0.0144[/C][C]-0.0255[/C][C]0.0021[/C][C]6.4245[/C][C]0.5354[/C][C]0.7317[/C][/ROW]
[ROW][C]51[/C][C]0.0141[/C][C]-0.0303[/C][C]0.0025[/C][C]9.3755[/C][C]0.7813[/C][C]0.8839[/C][/ROW]
[ROW][C]52[/C][C]0.0141[/C][C]-0.0337[/C][C]0.0028[/C][C]11.5458[/C][C]0.9622[/C][C]0.9809[/C][/ROW]
[ROW][C]53[/C][C]0.0142[/C][C]-0.0225[/C][C]0.0019[/C][C]5.0892[/C][C]0.4241[/C][C]0.6512[/C][/ROW]
[ROW][C]54[/C][C]0.0141[/C][C]-0.0122[/C][C]0.001[/C][C]1.5076[/C][C]0.1256[/C][C]0.3544[/C][/ROW]
[ROW][C]55[/C][C]0.0141[/C][C]0.0025[/C][C]2e-04[/C][C]0.0651[/C][C]0.0054[/C][C]0.0737[/C][/ROW]
[ROW][C]56[/C][C]0.0143[/C][C]0.0055[/C][C]5e-04[/C][C]0.2982[/C][C]0.0248[/C][C]0.1576[/C][/ROW]
[ROW][C]57[/C][C]0.0142[/C][C]0.0148[/C][C]0.0012[/C][C]2.2167[/C][C]0.1847[/C][C]0.4298[/C][/ROW]
[ROW][C]58[/C][C]0.0139[/C][C]-0.0088[/C][C]7e-04[/C][C]0.8077[/C][C]0.0673[/C][C]0.2594[/C][/ROW]
[ROW][C]59[/C][C]0.0141[/C][C]-0.0143[/C][C]0.0012[/C][C]2.0891[/C][C]0.1741[/C][C]0.4172[/C][/ROW]
[ROW][C]60[/C][C]0.014[/C][C]-0.0062[/C][C]5e-04[/C][C]0.3911[/C][C]0.0326[/C][C]0.1805[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=63618&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=63618&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.0143-0.0240.0025.74320.47860.6918
500.0144-0.02550.00216.42450.53540.7317
510.0141-0.03030.00259.37550.78130.8839
520.0141-0.03370.002811.54580.96220.9809
530.0142-0.02250.00195.08920.42410.6512
540.0141-0.01220.0011.50760.12560.3544
550.01410.00252e-040.06510.00540.0737
560.01430.00555e-040.29820.02480.1576
570.01420.01480.00122.21670.18470.4298
580.0139-0.00887e-040.80770.06730.2594
590.0141-0.01430.00122.08910.17410.4172
600.014-0.00625e-040.39110.03260.1805



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