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, 08 Dec 2009 10:38:30 -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/08/t1260294423rfvpfxesvgzx0xj.htm/, Retrieved Sun, 28 Apr 2024 09:23:21 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=64756, Retrieved Sun, 28 Apr 2024 09:23:21 +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)
-       [ARIMA Forecasting] [] [2009-12-08 17:38:30] [6e025b5370bdd3143fbe248190b38274] [Current]
-   PD    [ARIMA Forecasting] [] [2009-12-17 16:35:15] [78d53abea600e0825abda35dbfc51d4c]
Feedback Forum

Post a new message
Dataseries X:
15836,8
17570,4
18252,1
16196,7
16643
17729
16446,1
15993,8
16373,5
17842,2
22321,5
22786,7
18274,1
22392,9
23899,3
21343,5
22952,3
21374,4
21164,1
20906,5
17877,4
20664,3
22160
19813,6
17735,4
19640,2
20844,4
19823,1
18594,6
21350,6
18574,1
18924,2
17343,4
19961,2
19932,1
19464,6
16165,4
17574,9
19795,4
19439,5
17170
21072,4
17751,8
17515,5
18040,3
19090,1
17746,5
19202,1
15141,6
16258,1
18586,5
17209,4
17838,7
19123,5
16583,6
15991,2
16704,4
17420,4
17872
17823,2




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=64756&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[48])
3619464.6-------
3716165.4-------
3817574.9-------
3919795.4-------
4019439.5-------
4117170-------
4221072.4-------
4317751.8-------
4417515.5-------
4518040.3-------
4619090.1-------
4717746.5-------
4819202.1-------
4915141.614165.268212212.870816293.86670.184300.03280
5016258.115764.545813436.345418319.38790.35250.68360.08240.0042
5118586.518703.381915448.655322338.22620.47490.90630.2780.394
5217209.416977.601113052.157421537.46660.46030.24460.1450.1695
5317838.715638.46211627.298520382.35840.18170.25820.26340.0705
5419123.519399.774214166.973825647.90410.46550.68780.29990.5247
5516583.615550.791810554.550221749.09470.3720.12930.24320.1241
5615991.216049.949810674.302222788.81380.49320.43830.3350.1796
5716704.416236.210210381.353123723.83720.45120.52560.31840.2188
5817420.416996.186110646.24625201.06340.45960.52780.30850.2991
591787216221.73859798.820124671.70290.35090.39050.36180.2447
6017823.217201.201510176.964226536.84780.44810.4440.33720.3372

\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 & 19464.6 & - & - & - & - & - & - & - \tabularnewline
37 & 16165.4 & - & - & - & - & - & - & - \tabularnewline
38 & 17574.9 & - & - & - & - & - & - & - \tabularnewline
39 & 19795.4 & - & - & - & - & - & - & - \tabularnewline
40 & 19439.5 & - & - & - & - & - & - & - \tabularnewline
41 & 17170 & - & - & - & - & - & - & - \tabularnewline
42 & 21072.4 & - & - & - & - & - & - & - \tabularnewline
43 & 17751.8 & - & - & - & - & - & - & - \tabularnewline
44 & 17515.5 & - & - & - & - & - & - & - \tabularnewline
45 & 18040.3 & - & - & - & - & - & - & - \tabularnewline
46 & 19090.1 & - & - & - & - & - & - & - \tabularnewline
47 & 17746.5 & - & - & - & - & - & - & - \tabularnewline
48 & 19202.1 & - & - & - & - & - & - & - \tabularnewline
49 & 15141.6 & 14165.2682 & 12212.8708 & 16293.8667 & 0.1843 & 0 & 0.0328 & 0 \tabularnewline
50 & 16258.1 & 15764.5458 & 13436.3454 & 18319.3879 & 0.3525 & 0.6836 & 0.0824 & 0.0042 \tabularnewline
51 & 18586.5 & 18703.3819 & 15448.6553 & 22338.2262 & 0.4749 & 0.9063 & 0.278 & 0.394 \tabularnewline
52 & 17209.4 & 16977.6011 & 13052.1574 & 21537.4666 & 0.4603 & 0.2446 & 0.145 & 0.1695 \tabularnewline
53 & 17838.7 & 15638.462 & 11627.2985 & 20382.3584 & 0.1817 & 0.2582 & 0.2634 & 0.0705 \tabularnewline
54 & 19123.5 & 19399.7742 & 14166.9738 & 25647.9041 & 0.4655 & 0.6878 & 0.2999 & 0.5247 \tabularnewline
55 & 16583.6 & 15550.7918 & 10554.5502 & 21749.0947 & 0.372 & 0.1293 & 0.2432 & 0.1241 \tabularnewline
56 & 15991.2 & 16049.9498 & 10674.3022 & 22788.8138 & 0.4932 & 0.4383 & 0.335 & 0.1796 \tabularnewline
57 & 16704.4 & 16236.2102 & 10381.3531 & 23723.8372 & 0.4512 & 0.5256 & 0.3184 & 0.2188 \tabularnewline
58 & 17420.4 & 16996.1861 & 10646.246 & 25201.0634 & 0.4596 & 0.5278 & 0.3085 & 0.2991 \tabularnewline
59 & 17872 & 16221.7385 & 9798.8201 & 24671.7029 & 0.3509 & 0.3905 & 0.3618 & 0.2447 \tabularnewline
60 & 17823.2 & 17201.2015 & 10176.9642 & 26536.8478 & 0.4481 & 0.444 & 0.3372 & 0.3372 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=64756&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]19464.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]16165.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]17574.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]19795.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]19439.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]17170[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]21072.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]17751.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]17515.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]18040.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]19090.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]17746.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]19202.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]15141.6[/C][C]14165.2682[/C][C]12212.8708[/C][C]16293.8667[/C][C]0.1843[/C][C]0[/C][C]0.0328[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]16258.1[/C][C]15764.5458[/C][C]13436.3454[/C][C]18319.3879[/C][C]0.3525[/C][C]0.6836[/C][C]0.0824[/C][C]0.0042[/C][/ROW]
[ROW][C]51[/C][C]18586.5[/C][C]18703.3819[/C][C]15448.6553[/C][C]22338.2262[/C][C]0.4749[/C][C]0.9063[/C][C]0.278[/C][C]0.394[/C][/ROW]
[ROW][C]52[/C][C]17209.4[/C][C]16977.6011[/C][C]13052.1574[/C][C]21537.4666[/C][C]0.4603[/C][C]0.2446[/C][C]0.145[/C][C]0.1695[/C][/ROW]
[ROW][C]53[/C][C]17838.7[/C][C]15638.462[/C][C]11627.2985[/C][C]20382.3584[/C][C]0.1817[/C][C]0.2582[/C][C]0.2634[/C][C]0.0705[/C][/ROW]
[ROW][C]54[/C][C]19123.5[/C][C]19399.7742[/C][C]14166.9738[/C][C]25647.9041[/C][C]0.4655[/C][C]0.6878[/C][C]0.2999[/C][C]0.5247[/C][/ROW]
[ROW][C]55[/C][C]16583.6[/C][C]15550.7918[/C][C]10554.5502[/C][C]21749.0947[/C][C]0.372[/C][C]0.1293[/C][C]0.2432[/C][C]0.1241[/C][/ROW]
[ROW][C]56[/C][C]15991.2[/C][C]16049.9498[/C][C]10674.3022[/C][C]22788.8138[/C][C]0.4932[/C][C]0.4383[/C][C]0.335[/C][C]0.1796[/C][/ROW]
[ROW][C]57[/C][C]16704.4[/C][C]16236.2102[/C][C]10381.3531[/C][C]23723.8372[/C][C]0.4512[/C][C]0.5256[/C][C]0.3184[/C][C]0.2188[/C][/ROW]
[ROW][C]58[/C][C]17420.4[/C][C]16996.1861[/C][C]10646.246[/C][C]25201.0634[/C][C]0.4596[/C][C]0.5278[/C][C]0.3085[/C][C]0.2991[/C][/ROW]
[ROW][C]59[/C][C]17872[/C][C]16221.7385[/C][C]9798.8201[/C][C]24671.7029[/C][C]0.3509[/C][C]0.3905[/C][C]0.3618[/C][C]0.2447[/C][/ROW]
[ROW][C]60[/C][C]17823.2[/C][C]17201.2015[/C][C]10176.9642[/C][C]26536.8478[/C][C]0.4481[/C][C]0.444[/C][C]0.3372[/C][C]0.3372[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=64756&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=64756&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])
3619464.6-------
3716165.4-------
3817574.9-------
3919795.4-------
4019439.5-------
4117170-------
4221072.4-------
4317751.8-------
4417515.5-------
4518040.3-------
4619090.1-------
4717746.5-------
4819202.1-------
4915141.614165.268212212.870816293.86670.184300.03280
5016258.115764.545813436.345418319.38790.35250.68360.08240.0042
5118586.518703.381915448.655322338.22620.47490.90630.2780.394
5217209.416977.601113052.157421537.46660.46030.24460.1450.1695
5317838.715638.46211627.298520382.35840.18170.25820.26340.0705
5419123.519399.774214166.973825647.90410.46550.68780.29990.5247
5516583.615550.791810554.550221749.09470.3720.12930.24320.1241
5615991.216049.949810674.302222788.81380.49320.43830.3350.1796
5716704.416236.210210381.353123723.83720.45120.52560.31840.2188
5817420.416996.186110646.24625201.06340.45960.52780.30850.2991
591787216221.73859798.820124671.70290.35090.39050.36180.2447
6017823.217201.201510176.964226536.84780.44810.4440.33720.3372







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.07670.06890953223.772200
500.08270.03130.0501243595.7537598409.7629773.5695
510.0992-0.00620.035513661.3864403493.6374635.2115
520.1370.01370.0353730.7244316052.9092562.1858
530.15480.14070.05224841047.33531221051.79441105.0121
540.1643-0.01420.045876327.45551030264.40461015.0194
550.20340.06640.04881066692.86431035468.47021017.5797
560.2142-0.00370.04313451.5345906466.3533952.0853
570.23530.02880.0416219201.7231830103.6166911.1002
580.24630.0250.0399179957.4752765089.0025874.6937
590.26580.10170.04552723363.133943113.9234971.1405
600.27690.03620.0447386882.1955896761.2794946.9748

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0767 & 0.0689 & 0 & 953223.7722 & 0 & 0 \tabularnewline
50 & 0.0827 & 0.0313 & 0.0501 & 243595.7537 & 598409.7629 & 773.5695 \tabularnewline
51 & 0.0992 & -0.0062 & 0.0355 & 13661.3864 & 403493.6374 & 635.2115 \tabularnewline
52 & 0.137 & 0.0137 & 0.03 & 53730.7244 & 316052.9092 & 562.1858 \tabularnewline
53 & 0.1548 & 0.1407 & 0.0522 & 4841047.3353 & 1221051.7944 & 1105.0121 \tabularnewline
54 & 0.1643 & -0.0142 & 0.0458 & 76327.4555 & 1030264.4046 & 1015.0194 \tabularnewline
55 & 0.2034 & 0.0664 & 0.0488 & 1066692.8643 & 1035468.4702 & 1017.5797 \tabularnewline
56 & 0.2142 & -0.0037 & 0.0431 & 3451.5345 & 906466.3533 & 952.0853 \tabularnewline
57 & 0.2353 & 0.0288 & 0.0416 & 219201.7231 & 830103.6166 & 911.1002 \tabularnewline
58 & 0.2463 & 0.025 & 0.0399 & 179957.4752 & 765089.0025 & 874.6937 \tabularnewline
59 & 0.2658 & 0.1017 & 0.0455 & 2723363.133 & 943113.9234 & 971.1405 \tabularnewline
60 & 0.2769 & 0.0362 & 0.0447 & 386882.1955 & 896761.2794 & 946.9748 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=64756&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.0767[/C][C]0.0689[/C][C]0[/C][C]953223.7722[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0827[/C][C]0.0313[/C][C]0.0501[/C][C]243595.7537[/C][C]598409.7629[/C][C]773.5695[/C][/ROW]
[ROW][C]51[/C][C]0.0992[/C][C]-0.0062[/C][C]0.0355[/C][C]13661.3864[/C][C]403493.6374[/C][C]635.2115[/C][/ROW]
[ROW][C]52[/C][C]0.137[/C][C]0.0137[/C][C]0.03[/C][C]53730.7244[/C][C]316052.9092[/C][C]562.1858[/C][/ROW]
[ROW][C]53[/C][C]0.1548[/C][C]0.1407[/C][C]0.0522[/C][C]4841047.3353[/C][C]1221051.7944[/C][C]1105.0121[/C][/ROW]
[ROW][C]54[/C][C]0.1643[/C][C]-0.0142[/C][C]0.0458[/C][C]76327.4555[/C][C]1030264.4046[/C][C]1015.0194[/C][/ROW]
[ROW][C]55[/C][C]0.2034[/C][C]0.0664[/C][C]0.0488[/C][C]1066692.8643[/C][C]1035468.4702[/C][C]1017.5797[/C][/ROW]
[ROW][C]56[/C][C]0.2142[/C][C]-0.0037[/C][C]0.0431[/C][C]3451.5345[/C][C]906466.3533[/C][C]952.0853[/C][/ROW]
[ROW][C]57[/C][C]0.2353[/C][C]0.0288[/C][C]0.0416[/C][C]219201.7231[/C][C]830103.6166[/C][C]911.1002[/C][/ROW]
[ROW][C]58[/C][C]0.2463[/C][C]0.025[/C][C]0.0399[/C][C]179957.4752[/C][C]765089.0025[/C][C]874.6937[/C][/ROW]
[ROW][C]59[/C][C]0.2658[/C][C]0.1017[/C][C]0.0455[/C][C]2723363.133[/C][C]943113.9234[/C][C]971.1405[/C][/ROW]
[ROW][C]60[/C][C]0.2769[/C][C]0.0362[/C][C]0.0447[/C][C]386882.1955[/C][C]896761.2794[/C][C]946.9748[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=64756&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=64756&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.07670.06890953223.772200
500.08270.03130.0501243595.7537598409.7629773.5695
510.0992-0.00620.035513661.3864403493.6374635.2115
520.1370.01370.0353730.7244316052.9092562.1858
530.15480.14070.05224841047.33531221051.79441105.0121
540.1643-0.01420.045876327.45551030264.40461015.0194
550.20340.06640.04881066692.86431035468.47021017.5797
560.2142-0.00370.04313451.5345906466.3533952.0853
570.23530.02880.0416219201.7231830103.6166911.1002
580.24630.0250.0399179957.4752765089.0025874.6937
590.26580.10170.04552723363.133943113.9234971.1405
600.27690.03620.0447386882.1955896761.2794946.9748



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