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 computationThu, 10 Dec 2009 05:26:32 -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/10/t1260448517z9w56rzpzvhiw7b.htm/, Retrieved Sat, 27 Apr 2024 03:41:35 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=65315, Retrieved Sat, 27 Apr 2024 03:41:35 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact122
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] [] [2009-12-10 12:26:32] [fd7715938ba69fff5a3edaf7913b7ba1] [Current]
-   PD      [ARIMA Forecasting] [] [2009-12-11 15:10:50] [94b62ad0aa784646217b93aa983cee13]
-   P         [ARIMA Forecasting] [] [2009-12-11 15:14:47] [94b62ad0aa784646217b93aa983cee13]
-   P           [ARIMA Forecasting] [] [2009-12-11 15:30:17] [94b62ad0aa784646217b93aa983cee13]
Feedback Forum

Post a new message
Dataseries X:
96.8
114.1
110.3
103.9
101.6
94.6
95.9
104.7
102.8
98.1
113.9
80.9
95.7
113.2
105.9
108.8
102.3
99
100.7
115.5
100.7
109.9
114.6
85.4
100.5
114.8
116.5
112.9
102
106
105.3
118.8
106.1
109.3
117.2
92.5
104.2
112.5
122.4
113.3
100
110.7
112.8
109.8
117.3
109.1
115.9
96
99.8
116.8
115.7
99.4
94.3
91
93.2
103.1
94.1
91.8
102.7
82.6
89.1




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65315&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' @ 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])
37104.2-------
38112.5-------
39122.4-------
40113.3-------
41100-------
42110.7-------
43112.8-------
44109.8-------
45117.3-------
46109.1-------
47115.9-------
4896-------
4999.8-------
50116.8115.2566105.9707124.54250.37230.99940.71970.9994
51115.7125.1566115.8707134.44250.0230.96110.71971
5299.4116.0566106.7707125.34252e-040.530.71970.9997
5394.3102.756693.4707112.04250.03710.76070.71970.7337
5491113.4566104.1707122.7425010.71970.998
5593.2115.5566106.2707124.8425010.71970.9996
56103.1112.5566103.2707121.84250.02310.71970.9965
5794.1120.0566110.7707129.342500.99980.71971
5891.8111.8566102.5707121.142600.99990.71970.9945
59102.7118.6566109.3707127.94264e-0410.71971
6082.698.756689.4707108.04263e-040.20260.71970.4128
6189.1102.556693.2707111.84260.002310.71970.7197

\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 & 104.2 & - & - & - & - & - & - & - \tabularnewline
38 & 112.5 & - & - & - & - & - & - & - \tabularnewline
39 & 122.4 & - & - & - & - & - & - & - \tabularnewline
40 & 113.3 & - & - & - & - & - & - & - \tabularnewline
41 & 100 & - & - & - & - & - & - & - \tabularnewline
42 & 110.7 & - & - & - & - & - & - & - \tabularnewline
43 & 112.8 & - & - & - & - & - & - & - \tabularnewline
44 & 109.8 & - & - & - & - & - & - & - \tabularnewline
45 & 117.3 & - & - & - & - & - & - & - \tabularnewline
46 & 109.1 & - & - & - & - & - & - & - \tabularnewline
47 & 115.9 & - & - & - & - & - & - & - \tabularnewline
48 & 96 & - & - & - & - & - & - & - \tabularnewline
49 & 99.8 & - & - & - & - & - & - & - \tabularnewline
50 & 116.8 & 115.2566 & 105.9707 & 124.5425 & 0.3723 & 0.9994 & 0.7197 & 0.9994 \tabularnewline
51 & 115.7 & 125.1566 & 115.8707 & 134.4425 & 0.023 & 0.9611 & 0.7197 & 1 \tabularnewline
52 & 99.4 & 116.0566 & 106.7707 & 125.3425 & 2e-04 & 0.53 & 0.7197 & 0.9997 \tabularnewline
53 & 94.3 & 102.7566 & 93.4707 & 112.0425 & 0.0371 & 0.7607 & 0.7197 & 0.7337 \tabularnewline
54 & 91 & 113.4566 & 104.1707 & 122.7425 & 0 & 1 & 0.7197 & 0.998 \tabularnewline
55 & 93.2 & 115.5566 & 106.2707 & 124.8425 & 0 & 1 & 0.7197 & 0.9996 \tabularnewline
56 & 103.1 & 112.5566 & 103.2707 & 121.8425 & 0.023 & 1 & 0.7197 & 0.9965 \tabularnewline
57 & 94.1 & 120.0566 & 110.7707 & 129.3425 & 0 & 0.9998 & 0.7197 & 1 \tabularnewline
58 & 91.8 & 111.8566 & 102.5707 & 121.1426 & 0 & 0.9999 & 0.7197 & 0.9945 \tabularnewline
59 & 102.7 & 118.6566 & 109.3707 & 127.9426 & 4e-04 & 1 & 0.7197 & 1 \tabularnewline
60 & 82.6 & 98.7566 & 89.4707 & 108.0426 & 3e-04 & 0.2026 & 0.7197 & 0.4128 \tabularnewline
61 & 89.1 & 102.5566 & 93.2707 & 111.8426 & 0.0023 & 1 & 0.7197 & 0.7197 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65315&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]104.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]112.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]122.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]113.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]100[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]110.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]112.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]109.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]117.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]109.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]115.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]96[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]99.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]116.8[/C][C]115.2566[/C][C]105.9707[/C][C]124.5425[/C][C]0.3723[/C][C]0.9994[/C][C]0.7197[/C][C]0.9994[/C][/ROW]
[ROW][C]51[/C][C]115.7[/C][C]125.1566[/C][C]115.8707[/C][C]134.4425[/C][C]0.023[/C][C]0.9611[/C][C]0.7197[/C][C]1[/C][/ROW]
[ROW][C]52[/C][C]99.4[/C][C]116.0566[/C][C]106.7707[/C][C]125.3425[/C][C]2e-04[/C][C]0.53[/C][C]0.7197[/C][C]0.9997[/C][/ROW]
[ROW][C]53[/C][C]94.3[/C][C]102.7566[/C][C]93.4707[/C][C]112.0425[/C][C]0.0371[/C][C]0.7607[/C][C]0.7197[/C][C]0.7337[/C][/ROW]
[ROW][C]54[/C][C]91[/C][C]113.4566[/C][C]104.1707[/C][C]122.7425[/C][C]0[/C][C]1[/C][C]0.7197[/C][C]0.998[/C][/ROW]
[ROW][C]55[/C][C]93.2[/C][C]115.5566[/C][C]106.2707[/C][C]124.8425[/C][C]0[/C][C]1[/C][C]0.7197[/C][C]0.9996[/C][/ROW]
[ROW][C]56[/C][C]103.1[/C][C]112.5566[/C][C]103.2707[/C][C]121.8425[/C][C]0.023[/C][C]1[/C][C]0.7197[/C][C]0.9965[/C][/ROW]
[ROW][C]57[/C][C]94.1[/C][C]120.0566[/C][C]110.7707[/C][C]129.3425[/C][C]0[/C][C]0.9998[/C][C]0.7197[/C][C]1[/C][/ROW]
[ROW][C]58[/C][C]91.8[/C][C]111.8566[/C][C]102.5707[/C][C]121.1426[/C][C]0[/C][C]0.9999[/C][C]0.7197[/C][C]0.9945[/C][/ROW]
[ROW][C]59[/C][C]102.7[/C][C]118.6566[/C][C]109.3707[/C][C]127.9426[/C][C]4e-04[/C][C]1[/C][C]0.7197[/C][C]1[/C][/ROW]
[ROW][C]60[/C][C]82.6[/C][C]98.7566[/C][C]89.4707[/C][C]108.0426[/C][C]3e-04[/C][C]0.2026[/C][C]0.7197[/C][C]0.4128[/C][/ROW]
[ROW][C]61[/C][C]89.1[/C][C]102.5566[/C][C]93.2707[/C][C]111.8426[/C][C]0.0023[/C][C]1[/C][C]0.7197[/C][C]0.7197[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65315&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65315&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])
37104.2-------
38112.5-------
39122.4-------
40113.3-------
41100-------
42110.7-------
43112.8-------
44109.8-------
45117.3-------
46109.1-------
47115.9-------
4896-------
4999.8-------
50116.8115.2566105.9707124.54250.37230.99940.71970.9994
51115.7125.1566115.8707134.44250.0230.96110.71971
5299.4116.0566106.7707125.34252e-040.530.71970.9997
5394.3102.756693.4707112.04250.03710.76070.71970.7337
5491113.4566104.1707122.7425010.71970.998
5593.2115.5566106.2707124.8425010.71970.9996
56103.1112.5566103.2707121.84250.02310.71970.9965
5794.1120.0566110.7707129.342500.99980.71971
5891.8111.8566102.5707121.142600.99990.71970.9945
59102.7118.6566109.3707127.94264e-0410.71971
6082.698.756689.4707108.04263e-040.20260.71970.4128
6189.1102.556693.2707111.84260.002310.71970.7197







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.04110.013402.38200
510.0379-0.07560.044589.427745.90496.7753
520.0408-0.14350.0775277.4431123.084311.0943
530.0461-0.08230.078771.5145110.191810.4972
540.0418-0.19790.1025504.3189.013513.7482
550.041-0.19350.1177499.8186240.814315.5182
560.0421-0.0840.112989.4277219.187714.805
570.0395-0.21620.1258673.7463276.007516.6135
580.0424-0.17930.1317402.2682290.036517.0305
590.0399-0.13450.132254.6138286.494216.9261
600.048-0.16360.1349261.0365284.179916.8576
610.0462-0.13120.1346181.0807275.588316.6009

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0411 & 0.0134 & 0 & 2.382 & 0 & 0 \tabularnewline
51 & 0.0379 & -0.0756 & 0.0445 & 89.4277 & 45.9049 & 6.7753 \tabularnewline
52 & 0.0408 & -0.1435 & 0.0775 & 277.4431 & 123.0843 & 11.0943 \tabularnewline
53 & 0.0461 & -0.0823 & 0.0787 & 71.5145 & 110.1918 & 10.4972 \tabularnewline
54 & 0.0418 & -0.1979 & 0.1025 & 504.3 & 189.0135 & 13.7482 \tabularnewline
55 & 0.041 & -0.1935 & 0.1177 & 499.8186 & 240.8143 & 15.5182 \tabularnewline
56 & 0.0421 & -0.084 & 0.1129 & 89.4277 & 219.1877 & 14.805 \tabularnewline
57 & 0.0395 & -0.2162 & 0.1258 & 673.7463 & 276.0075 & 16.6135 \tabularnewline
58 & 0.0424 & -0.1793 & 0.1317 & 402.2682 & 290.0365 & 17.0305 \tabularnewline
59 & 0.0399 & -0.1345 & 0.132 & 254.6138 & 286.4942 & 16.9261 \tabularnewline
60 & 0.048 & -0.1636 & 0.1349 & 261.0365 & 284.1799 & 16.8576 \tabularnewline
61 & 0.0462 & -0.1312 & 0.1346 & 181.0807 & 275.5883 & 16.6009 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65315&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.0411[/C][C]0.0134[/C][C]0[/C][C]2.382[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]0.0379[/C][C]-0.0756[/C][C]0.0445[/C][C]89.4277[/C][C]45.9049[/C][C]6.7753[/C][/ROW]
[ROW][C]52[/C][C]0.0408[/C][C]-0.1435[/C][C]0.0775[/C][C]277.4431[/C][C]123.0843[/C][C]11.0943[/C][/ROW]
[ROW][C]53[/C][C]0.0461[/C][C]-0.0823[/C][C]0.0787[/C][C]71.5145[/C][C]110.1918[/C][C]10.4972[/C][/ROW]
[ROW][C]54[/C][C]0.0418[/C][C]-0.1979[/C][C]0.1025[/C][C]504.3[/C][C]189.0135[/C][C]13.7482[/C][/ROW]
[ROW][C]55[/C][C]0.041[/C][C]-0.1935[/C][C]0.1177[/C][C]499.8186[/C][C]240.8143[/C][C]15.5182[/C][/ROW]
[ROW][C]56[/C][C]0.0421[/C][C]-0.084[/C][C]0.1129[/C][C]89.4277[/C][C]219.1877[/C][C]14.805[/C][/ROW]
[ROW][C]57[/C][C]0.0395[/C][C]-0.2162[/C][C]0.1258[/C][C]673.7463[/C][C]276.0075[/C][C]16.6135[/C][/ROW]
[ROW][C]58[/C][C]0.0424[/C][C]-0.1793[/C][C]0.1317[/C][C]402.2682[/C][C]290.0365[/C][C]17.0305[/C][/ROW]
[ROW][C]59[/C][C]0.0399[/C][C]-0.1345[/C][C]0.132[/C][C]254.6138[/C][C]286.4942[/C][C]16.9261[/C][/ROW]
[ROW][C]60[/C][C]0.048[/C][C]-0.1636[/C][C]0.1349[/C][C]261.0365[/C][C]284.1799[/C][C]16.8576[/C][/ROW]
[ROW][C]61[/C][C]0.0462[/C][C]-0.1312[/C][C]0.1346[/C][C]181.0807[/C][C]275.5883[/C][C]16.6009[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65315&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65315&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.04110.013402.38200
510.0379-0.07560.044589.427745.90496.7753
520.0408-0.14350.0775277.4431123.084311.0943
530.0461-0.08230.078771.5145110.191810.4972
540.0418-0.19790.1025504.3189.013513.7482
550.041-0.19350.1177499.8186240.814315.5182
560.0421-0.0840.112989.4277219.187714.805
570.0395-0.21620.1258673.7463276.007516.6135
580.0424-0.17930.1317402.2682290.036517.0305
590.0399-0.13450.132254.6138286.494216.9261
600.048-0.16360.1349261.0365284.179916.8576
610.0462-0.13120.1346181.0807275.588316.6009



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