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, 24 Dec 2009 11:21:27 -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/24/t1261678942e49k2omebw4c0cx.htm/, Retrieved Mon, 06 May 2024 15:20:30 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=70690, Retrieved Mon, 06 May 2024 15:20:30 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact116
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [Paper - Arima For...] [2008-12-14 14:14:00] [7a664918911e34206ce9d0436dd7c1c8]
-   P   [ARIMA Forecasting] [ARIMA forecasting...] [2008-12-15 14:52:51] [12d343c4448a5f9e527bb31caeac580b]
-  MPD    [ARIMA Forecasting] [univariate arima ...] [2009-12-15 20:49:36] [ba905ddf7cdf9ecb063c35348c4dab2e]
-   PD        [ARIMA Forecasting] [arima] [2009-12-24 18:21:27] [244731fa3e7e6c85774b8c0902c58f85] [Current]
Feedback Forum

Post a new message
Dataseries X:
2058.00
2160.00
2260.00
2498.00
2695.00
2799.00
2947.00
2930.00
2318.00
2540.00
2570.00
2669.00
2450.00
2842.00
3440.00
2678.00
2981.00
2260.00
2844.00
2546.00
2456.00
2295.00
2379.00
2479.00
2057.00
2280.00
2351.00
2276.00
2548.00
2311.00
2201.00
2725.00
2408.00
2139.00
1898.00
2537.00
2069.00
2063.00
2526.00
2440.00
2191.00
2797.00
2074.00
2628.00
2287.00
2146.00
2430.00
2141.00
1827.00
2082.00
1788.00
1743.00
2245.00
1963.00
1828.00
2527.00
2114.00
2424.00




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70690&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[46])
342139-------
351898-------
362537-------
372069-------
382063-------
392526-------
402440-------
412191-------
422797-------
432074-------
442628-------
452287-------
462146-------
4724302350.18151958.36783065.56370.41340.71210.89230.7121
4821412256.26581889.17512913.26980.36550.30210.20120.6289
4918272259.00451864.78943008.09770.12920.62120.69050.6163
5020822296.90811850.63593243.35620.32810.83480.68590.6227
5117882277.79821822.10073278.29330.16860.64940.31340.6019
5217432287.6821805.99793418.03990.17250.80690.39580.597
5322452296.24281790.56533563.78640.46840.80390.56460.5919
5419632295.94921773.81013675.22180.31810.52890.23820.5844
5518282302.49021760.54663825.29380.27070.66890.61570.5798
5625272307.15671747.59963975.85270.39810.71320.35310.5751
5721142310.86131735.26774130.27990.4160.40790.51030.5705
5824242315.91411724.14554304.69390.45760.57890.56650.5665

\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[46]) \tabularnewline
34 & 2139 & - & - & - & - & - & - & - \tabularnewline
35 & 1898 & - & - & - & - & - & - & - \tabularnewline
36 & 2537 & - & - & - & - & - & - & - \tabularnewline
37 & 2069 & - & - & - & - & - & - & - \tabularnewline
38 & 2063 & - & - & - & - & - & - & - \tabularnewline
39 & 2526 & - & - & - & - & - & - & - \tabularnewline
40 & 2440 & - & - & - & - & - & - & - \tabularnewline
41 & 2191 & - & - & - & - & - & - & - \tabularnewline
42 & 2797 & - & - & - & - & - & - & - \tabularnewline
43 & 2074 & - & - & - & - & - & - & - \tabularnewline
44 & 2628 & - & - & - & - & - & - & - \tabularnewline
45 & 2287 & - & - & - & - & - & - & - \tabularnewline
46 & 2146 & - & - & - & - & - & - & - \tabularnewline
47 & 2430 & 2350.1815 & 1958.3678 & 3065.5637 & 0.4134 & 0.7121 & 0.8923 & 0.7121 \tabularnewline
48 & 2141 & 2256.2658 & 1889.1751 & 2913.2698 & 0.3655 & 0.3021 & 0.2012 & 0.6289 \tabularnewline
49 & 1827 & 2259.0045 & 1864.7894 & 3008.0977 & 0.1292 & 0.6212 & 0.6905 & 0.6163 \tabularnewline
50 & 2082 & 2296.9081 & 1850.6359 & 3243.3562 & 0.3281 & 0.8348 & 0.6859 & 0.6227 \tabularnewline
51 & 1788 & 2277.7982 & 1822.1007 & 3278.2933 & 0.1686 & 0.6494 & 0.3134 & 0.6019 \tabularnewline
52 & 1743 & 2287.682 & 1805.9979 & 3418.0399 & 0.1725 & 0.8069 & 0.3958 & 0.597 \tabularnewline
53 & 2245 & 2296.2428 & 1790.5653 & 3563.7864 & 0.4684 & 0.8039 & 0.5646 & 0.5919 \tabularnewline
54 & 1963 & 2295.9492 & 1773.8101 & 3675.2218 & 0.3181 & 0.5289 & 0.2382 & 0.5844 \tabularnewline
55 & 1828 & 2302.4902 & 1760.5466 & 3825.2938 & 0.2707 & 0.6689 & 0.6157 & 0.5798 \tabularnewline
56 & 2527 & 2307.1567 & 1747.5996 & 3975.8527 & 0.3981 & 0.7132 & 0.3531 & 0.5751 \tabularnewline
57 & 2114 & 2310.8613 & 1735.2677 & 4130.2799 & 0.416 & 0.4079 & 0.5103 & 0.5705 \tabularnewline
58 & 2424 & 2315.9141 & 1724.1455 & 4304.6939 & 0.4576 & 0.5789 & 0.5665 & 0.5665 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70690&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[46])[/C][/ROW]
[ROW][C]34[/C][C]2139[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]1898[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]2537[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]2069[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]2063[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]2526[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]2440[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]2191[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]2797[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]2074[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]2628[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]2287[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]2146[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]2430[/C][C]2350.1815[/C][C]1958.3678[/C][C]3065.5637[/C][C]0.4134[/C][C]0.7121[/C][C]0.8923[/C][C]0.7121[/C][/ROW]
[ROW][C]48[/C][C]2141[/C][C]2256.2658[/C][C]1889.1751[/C][C]2913.2698[/C][C]0.3655[/C][C]0.3021[/C][C]0.2012[/C][C]0.6289[/C][/ROW]
[ROW][C]49[/C][C]1827[/C][C]2259.0045[/C][C]1864.7894[/C][C]3008.0977[/C][C]0.1292[/C][C]0.6212[/C][C]0.6905[/C][C]0.6163[/C][/ROW]
[ROW][C]50[/C][C]2082[/C][C]2296.9081[/C][C]1850.6359[/C][C]3243.3562[/C][C]0.3281[/C][C]0.8348[/C][C]0.6859[/C][C]0.6227[/C][/ROW]
[ROW][C]51[/C][C]1788[/C][C]2277.7982[/C][C]1822.1007[/C][C]3278.2933[/C][C]0.1686[/C][C]0.6494[/C][C]0.3134[/C][C]0.6019[/C][/ROW]
[ROW][C]52[/C][C]1743[/C][C]2287.682[/C][C]1805.9979[/C][C]3418.0399[/C][C]0.1725[/C][C]0.8069[/C][C]0.3958[/C][C]0.597[/C][/ROW]
[ROW][C]53[/C][C]2245[/C][C]2296.2428[/C][C]1790.5653[/C][C]3563.7864[/C][C]0.4684[/C][C]0.8039[/C][C]0.5646[/C][C]0.5919[/C][/ROW]
[ROW][C]54[/C][C]1963[/C][C]2295.9492[/C][C]1773.8101[/C][C]3675.2218[/C][C]0.3181[/C][C]0.5289[/C][C]0.2382[/C][C]0.5844[/C][/ROW]
[ROW][C]55[/C][C]1828[/C][C]2302.4902[/C][C]1760.5466[/C][C]3825.2938[/C][C]0.2707[/C][C]0.6689[/C][C]0.6157[/C][C]0.5798[/C][/ROW]
[ROW][C]56[/C][C]2527[/C][C]2307.1567[/C][C]1747.5996[/C][C]3975.8527[/C][C]0.3981[/C][C]0.7132[/C][C]0.3531[/C][C]0.5751[/C][/ROW]
[ROW][C]57[/C][C]2114[/C][C]2310.8613[/C][C]1735.2677[/C][C]4130.2799[/C][C]0.416[/C][C]0.4079[/C][C]0.5103[/C][C]0.5705[/C][/ROW]
[ROW][C]58[/C][C]2424[/C][C]2315.9141[/C][C]1724.1455[/C][C]4304.6939[/C][C]0.4576[/C][C]0.5789[/C][C]0.5665[/C][C]0.5665[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70690&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70690&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[46])
342139-------
351898-------
362537-------
372069-------
382063-------
392526-------
402440-------
412191-------
422797-------
432074-------
442628-------
452287-------
462146-------
4724302350.18151958.36783065.56370.41340.71210.89230.7121
4821412256.26581889.17512913.26980.36550.30210.20120.6289
4918272259.00451864.78943008.09770.12920.62120.69050.6163
5020822296.90811850.63593243.35620.32810.83480.68590.6227
5117882277.79821822.10073278.29330.16860.64940.31340.6019
5217432287.6821805.99793418.03990.17250.80690.39580.597
5322452296.24281790.56533563.78640.46840.80390.56460.5919
5419632295.94921773.81013675.22180.31810.52890.23820.5844
5518282302.49021760.54663825.29380.27070.66890.61570.5798
5625272307.15671747.59963975.85270.39810.71320.35310.5751
5721142310.86131735.26774130.27990.4160.40790.51030.5705
5824242315.91411724.14554304.69390.45760.57890.56650.5665







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
470.15530.0340.00286370.9865530.915523.0416
480.1486-0.05110.004313286.19681107.183133.2744
490.1692-0.19120.0159186627.869915552.3225124.709
500.2102-0.09360.007846185.48493848.790462.0386
510.2241-0.2150.0179239902.305919991.8588141.3926
520.2521-0.23810.0198296678.472524723.206157.2361
530.2816-0.02230.00192625.8284218.81914.7925
540.3065-0.1450.0121110855.17979237.931696.1142
550.3374-0.20610.0172225140.950518761.7459136.9735
560.3690.09530.007948331.09654027.591463.4633
570.4017-0.08520.007138754.35843229.529956.829
580.43810.04670.003911682.5712973.547631.2017

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
47 & 0.1553 & 0.034 & 0.0028 & 6370.9865 & 530.9155 & 23.0416 \tabularnewline
48 & 0.1486 & -0.0511 & 0.0043 & 13286.1968 & 1107.1831 & 33.2744 \tabularnewline
49 & 0.1692 & -0.1912 & 0.0159 & 186627.8699 & 15552.3225 & 124.709 \tabularnewline
50 & 0.2102 & -0.0936 & 0.0078 & 46185.4849 & 3848.7904 & 62.0386 \tabularnewline
51 & 0.2241 & -0.215 & 0.0179 & 239902.3059 & 19991.8588 & 141.3926 \tabularnewline
52 & 0.2521 & -0.2381 & 0.0198 & 296678.4725 & 24723.206 & 157.2361 \tabularnewline
53 & 0.2816 & -0.0223 & 0.0019 & 2625.8284 & 218.819 & 14.7925 \tabularnewline
54 & 0.3065 & -0.145 & 0.0121 & 110855.1797 & 9237.9316 & 96.1142 \tabularnewline
55 & 0.3374 & -0.2061 & 0.0172 & 225140.9505 & 18761.7459 & 136.9735 \tabularnewline
56 & 0.369 & 0.0953 & 0.0079 & 48331.0965 & 4027.5914 & 63.4633 \tabularnewline
57 & 0.4017 & -0.0852 & 0.0071 & 38754.3584 & 3229.5299 & 56.829 \tabularnewline
58 & 0.4381 & 0.0467 & 0.0039 & 11682.5712 & 973.5476 & 31.2017 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70690&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]47[/C][C]0.1553[/C][C]0.034[/C][C]0.0028[/C][C]6370.9865[/C][C]530.9155[/C][C]23.0416[/C][/ROW]
[ROW][C]48[/C][C]0.1486[/C][C]-0.0511[/C][C]0.0043[/C][C]13286.1968[/C][C]1107.1831[/C][C]33.2744[/C][/ROW]
[ROW][C]49[/C][C]0.1692[/C][C]-0.1912[/C][C]0.0159[/C][C]186627.8699[/C][C]15552.3225[/C][C]124.709[/C][/ROW]
[ROW][C]50[/C][C]0.2102[/C][C]-0.0936[/C][C]0.0078[/C][C]46185.4849[/C][C]3848.7904[/C][C]62.0386[/C][/ROW]
[ROW][C]51[/C][C]0.2241[/C][C]-0.215[/C][C]0.0179[/C][C]239902.3059[/C][C]19991.8588[/C][C]141.3926[/C][/ROW]
[ROW][C]52[/C][C]0.2521[/C][C]-0.2381[/C][C]0.0198[/C][C]296678.4725[/C][C]24723.206[/C][C]157.2361[/C][/ROW]
[ROW][C]53[/C][C]0.2816[/C][C]-0.0223[/C][C]0.0019[/C][C]2625.8284[/C][C]218.819[/C][C]14.7925[/C][/ROW]
[ROW][C]54[/C][C]0.3065[/C][C]-0.145[/C][C]0.0121[/C][C]110855.1797[/C][C]9237.9316[/C][C]96.1142[/C][/ROW]
[ROW][C]55[/C][C]0.3374[/C][C]-0.2061[/C][C]0.0172[/C][C]225140.9505[/C][C]18761.7459[/C][C]136.9735[/C][/ROW]
[ROW][C]56[/C][C]0.369[/C][C]0.0953[/C][C]0.0079[/C][C]48331.0965[/C][C]4027.5914[/C][C]63.4633[/C][/ROW]
[ROW][C]57[/C][C]0.4017[/C][C]-0.0852[/C][C]0.0071[/C][C]38754.3584[/C][C]3229.5299[/C][C]56.829[/C][/ROW]
[ROW][C]58[/C][C]0.4381[/C][C]0.0467[/C][C]0.0039[/C][C]11682.5712[/C][C]973.5476[/C][C]31.2017[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70690&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70690&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
470.15530.0340.00286370.9865530.915523.0416
480.1486-0.05110.004313286.19681107.183133.2744
490.1692-0.19120.0159186627.869915552.3225124.709
500.2102-0.09360.007846185.48493848.790462.0386
510.2241-0.2150.0179239902.305919991.8588141.3926
520.2521-0.23810.0198296678.472524723.206157.2361
530.2816-0.02230.00192625.8284218.81914.7925
540.3065-0.1450.0121110855.17979237.931696.1142
550.3374-0.20610.0172225140.950518761.7459136.9735
560.3690.09530.007948331.09654027.591463.4633
570.4017-0.08520.007138754.35843229.529956.829
580.43810.04670.003911682.5712973.547631.2017



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