Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationWed, 30 Dec 2009 15:22:39 -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/30/t1262211815dtvri0v6h0380va.htm/, Retrieved Sun, 28 Apr 2024 19:55:37 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=71381, Retrieved Sun, 28 Apr 2024 19:55:37 +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)
-     [Central Tendency] [Central tendency:...] [2008-12-12 12:54:43] [73d6180dc45497329efd1b6934a84aba]
- RMP   [ARIMA Backward Selection] [ARIMA goudprijs] [2008-12-14 20:12:57] [73d6180dc45497329efd1b6934a84aba]
- RMPD    [ARIMA Forecasting] [ARIMA forecast: O...] [2008-12-14 22:42:36] [73d6180dc45497329efd1b6934a84aba]
-   PD      [ARIMA Forecasting] [arima forecast ol...] [2008-12-16 16:27:50] [73d6180dc45497329efd1b6934a84aba]
-   P         [ARIMA Forecasting] [Lambda -0,2 ARIMA...] [2008-12-19 21:26:09] [73d6180dc45497329efd1b6934a84aba]
- R  D          [ARIMA Forecasting] [ARIMA Forecast olie] [2008-12-22 13:09:43] [7458e879e85b911182071700fff19fbd]
- RMPD              [ARIMA Forecasting] [] [2009-12-30 22:22:39] [d41d8cd98f00b204e9800998ecf8427e] [Current]
-   PD                [ARIMA Forecasting] [] [2009-12-31 10:35:36] [74be16979710d4c4e7c6647856088456]
-   PD                [ARIMA Forecasting] [] [2009-12-31 10:39:14] [74be16979710d4c4e7c6647856088456]
Feedback Forum

Post a new message
Dataseries X:
40,22
44,23
45,85
53,38
53,26
51,8
55,3
57,81
63,96
63,77
59,15
56,12
57,42
63,52
61,71
63,01
68,18
72,03
69,75
74,41
74,33
64,24
60,03
59,44
62,5
55,04
58,34
61,92
67,65
67,68
70,3
75,26
71,44
76,36
81,71
92,6
90,6
92,23
94,09
102,79
109,65
124,05
132,69
135,81
116,07
101,42
75,73
55,48
43,8
45,29
44,01
47,48
51,07
57,84
69,04
65,61
72,87
68,41
73,25
77,43




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71381&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])
3692.6-------
3790.6-------
3892.23-------
3994.09-------
40102.79-------
41109.65-------
42124.05-------
43132.69-------
44135.81-------
45116.07-------
46101.42-------
4775.73-------
4855.48-------
4943.855.4847.529665.7940.01320.500.5
5045.2955.4844.757870.99460.0990.9300.5
5144.0155.4842.80275.44680.13010.84141e-040.5
5247.4855.4841.257279.5580.25750.82481e-040.5
5351.0755.4839.968883.48570.37880.71221e-040.5
5457.8455.4838.858487.31070.44220.60700.5
5569.0455.4837.880391.0820.22770.448300.5
5665.6155.4837.004894.83210.30690.249700.5
5772.8755.4836.211698.58450.21450.32250.00290.5
5868.4155.4835.4862102.35720.29440.23360.02740.5
5973.2555.4834.8175106.16450.2460.30850.21680.5
6077.4355.4834.1972110.01870.21510.26150.50.5

\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 & 92.6 & - & - & - & - & - & - & - \tabularnewline
37 & 90.6 & - & - & - & - & - & - & - \tabularnewline
38 & 92.23 & - & - & - & - & - & - & - \tabularnewline
39 & 94.09 & - & - & - & - & - & - & - \tabularnewline
40 & 102.79 & - & - & - & - & - & - & - \tabularnewline
41 & 109.65 & - & - & - & - & - & - & - \tabularnewline
42 & 124.05 & - & - & - & - & - & - & - \tabularnewline
43 & 132.69 & - & - & - & - & - & - & - \tabularnewline
44 & 135.81 & - & - & - & - & - & - & - \tabularnewline
45 & 116.07 & - & - & - & - & - & - & - \tabularnewline
46 & 101.42 & - & - & - & - & - & - & - \tabularnewline
47 & 75.73 & - & - & - & - & - & - & - \tabularnewline
48 & 55.48 & - & - & - & - & - & - & - \tabularnewline
49 & 43.8 & 55.48 & 47.5296 & 65.794 & 0.0132 & 0.5 & 0 & 0.5 \tabularnewline
50 & 45.29 & 55.48 & 44.7578 & 70.9946 & 0.099 & 0.93 & 0 & 0.5 \tabularnewline
51 & 44.01 & 55.48 & 42.802 & 75.4468 & 0.1301 & 0.8414 & 1e-04 & 0.5 \tabularnewline
52 & 47.48 & 55.48 & 41.2572 & 79.558 & 0.2575 & 0.8248 & 1e-04 & 0.5 \tabularnewline
53 & 51.07 & 55.48 & 39.9688 & 83.4857 & 0.3788 & 0.7122 & 1e-04 & 0.5 \tabularnewline
54 & 57.84 & 55.48 & 38.8584 & 87.3107 & 0.4422 & 0.607 & 0 & 0.5 \tabularnewline
55 & 69.04 & 55.48 & 37.8803 & 91.082 & 0.2277 & 0.4483 & 0 & 0.5 \tabularnewline
56 & 65.61 & 55.48 & 37.0048 & 94.8321 & 0.3069 & 0.2497 & 0 & 0.5 \tabularnewline
57 & 72.87 & 55.48 & 36.2116 & 98.5845 & 0.2145 & 0.3225 & 0.0029 & 0.5 \tabularnewline
58 & 68.41 & 55.48 & 35.4862 & 102.3572 & 0.2944 & 0.2336 & 0.0274 & 0.5 \tabularnewline
59 & 73.25 & 55.48 & 34.8175 & 106.1645 & 0.246 & 0.3085 & 0.2168 & 0.5 \tabularnewline
60 & 77.43 & 55.48 & 34.1972 & 110.0187 & 0.2151 & 0.2615 & 0.5 & 0.5 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71381&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]92.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]90.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]92.23[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]94.09[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]102.79[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]109.65[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]124.05[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]132.69[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]135.81[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]116.07[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]101.42[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]75.73[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]55.48[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]43.8[/C][C]55.48[/C][C]47.5296[/C][C]65.794[/C][C]0.0132[/C][C]0.5[/C][C]0[/C][C]0.5[/C][/ROW]
[ROW][C]50[/C][C]45.29[/C][C]55.48[/C][C]44.7578[/C][C]70.9946[/C][C]0.099[/C][C]0.93[/C][C]0[/C][C]0.5[/C][/ROW]
[ROW][C]51[/C][C]44.01[/C][C]55.48[/C][C]42.802[/C][C]75.4468[/C][C]0.1301[/C][C]0.8414[/C][C]1e-04[/C][C]0.5[/C][/ROW]
[ROW][C]52[/C][C]47.48[/C][C]55.48[/C][C]41.2572[/C][C]79.558[/C][C]0.2575[/C][C]0.8248[/C][C]1e-04[/C][C]0.5[/C][/ROW]
[ROW][C]53[/C][C]51.07[/C][C]55.48[/C][C]39.9688[/C][C]83.4857[/C][C]0.3788[/C][C]0.7122[/C][C]1e-04[/C][C]0.5[/C][/ROW]
[ROW][C]54[/C][C]57.84[/C][C]55.48[/C][C]38.8584[/C][C]87.3107[/C][C]0.4422[/C][C]0.607[/C][C]0[/C][C]0.5[/C][/ROW]
[ROW][C]55[/C][C]69.04[/C][C]55.48[/C][C]37.8803[/C][C]91.082[/C][C]0.2277[/C][C]0.4483[/C][C]0[/C][C]0.5[/C][/ROW]
[ROW][C]56[/C][C]65.61[/C][C]55.48[/C][C]37.0048[/C][C]94.8321[/C][C]0.3069[/C][C]0.2497[/C][C]0[/C][C]0.5[/C][/ROW]
[ROW][C]57[/C][C]72.87[/C][C]55.48[/C][C]36.2116[/C][C]98.5845[/C][C]0.2145[/C][C]0.3225[/C][C]0.0029[/C][C]0.5[/C][/ROW]
[ROW][C]58[/C][C]68.41[/C][C]55.48[/C][C]35.4862[/C][C]102.3572[/C][C]0.2944[/C][C]0.2336[/C][C]0.0274[/C][C]0.5[/C][/ROW]
[ROW][C]59[/C][C]73.25[/C][C]55.48[/C][C]34.8175[/C][C]106.1645[/C][C]0.246[/C][C]0.3085[/C][C]0.2168[/C][C]0.5[/C][/ROW]
[ROW][C]60[/C][C]77.43[/C][C]55.48[/C][C]34.1972[/C][C]110.0187[/C][C]0.2151[/C][C]0.2615[/C][C]0.5[/C][C]0.5[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71381&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71381&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])
3692.6-------
3790.6-------
3892.23-------
3994.09-------
40102.79-------
41109.65-------
42124.05-------
43132.69-------
44135.81-------
45116.07-------
46101.42-------
4775.73-------
4855.48-------
4943.855.4847.529665.7940.01320.500.5
5045.2955.4844.757870.99460.0990.9300.5
5144.0155.4842.80275.44680.13010.84141e-040.5
5247.4855.4841.257279.5580.25750.82481e-040.5
5351.0755.4839.968883.48570.37880.71221e-040.5
5457.8455.4838.858487.31070.44220.60700.5
5569.0455.4837.880391.0820.22770.448300.5
5665.6155.4837.004894.83210.30690.249700.5
5772.8755.4836.211698.58450.21450.32250.00290.5
5868.4155.4835.4862102.35720.29440.23360.02740.5
5973.2555.4834.8175106.16450.2460.30850.21680.5
6077.4355.4834.1972110.01870.21510.26150.50.5







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0948-0.21050136.422400
500.1427-0.18370.1971103.8361120.129210.9603
510.1836-0.20670.2003131.5609123.939811.1328
520.2214-0.14420.186364108.954810.4381
530.2575-0.07950.164919.448191.05359.5422
540.29270.04250.14455.569676.80628.7639
550.32740.24440.1588183.873692.10159.597
560.36190.18260.1618102.616993.4169.6652
570.39640.31340.1786302.4121116.637710.7999
580.43110.23310.1841167.1849121.692511.0314
590.46610.32030.1965315.7729139.336111.8041
600.50150.39560.213481.8025167.87512.9567

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0948 & -0.2105 & 0 & 136.4224 & 0 & 0 \tabularnewline
50 & 0.1427 & -0.1837 & 0.1971 & 103.8361 & 120.1292 & 10.9603 \tabularnewline
51 & 0.1836 & -0.2067 & 0.2003 & 131.5609 & 123.9398 & 11.1328 \tabularnewline
52 & 0.2214 & -0.1442 & 0.1863 & 64 & 108.9548 & 10.4381 \tabularnewline
53 & 0.2575 & -0.0795 & 0.1649 & 19.4481 & 91.0535 & 9.5422 \tabularnewline
54 & 0.2927 & 0.0425 & 0.1445 & 5.5696 & 76.8062 & 8.7639 \tabularnewline
55 & 0.3274 & 0.2444 & 0.1588 & 183.8736 & 92.1015 & 9.597 \tabularnewline
56 & 0.3619 & 0.1826 & 0.1618 & 102.6169 & 93.416 & 9.6652 \tabularnewline
57 & 0.3964 & 0.3134 & 0.1786 & 302.4121 & 116.6377 & 10.7999 \tabularnewline
58 & 0.4311 & 0.2331 & 0.1841 & 167.1849 & 121.6925 & 11.0314 \tabularnewline
59 & 0.4661 & 0.3203 & 0.1965 & 315.7729 & 139.3361 & 11.8041 \tabularnewline
60 & 0.5015 & 0.3956 & 0.213 & 481.8025 & 167.875 & 12.9567 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71381&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.0948[/C][C]-0.2105[/C][C]0[/C][C]136.4224[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.1427[/C][C]-0.1837[/C][C]0.1971[/C][C]103.8361[/C][C]120.1292[/C][C]10.9603[/C][/ROW]
[ROW][C]51[/C][C]0.1836[/C][C]-0.2067[/C][C]0.2003[/C][C]131.5609[/C][C]123.9398[/C][C]11.1328[/C][/ROW]
[ROW][C]52[/C][C]0.2214[/C][C]-0.1442[/C][C]0.1863[/C][C]64[/C][C]108.9548[/C][C]10.4381[/C][/ROW]
[ROW][C]53[/C][C]0.2575[/C][C]-0.0795[/C][C]0.1649[/C][C]19.4481[/C][C]91.0535[/C][C]9.5422[/C][/ROW]
[ROW][C]54[/C][C]0.2927[/C][C]0.0425[/C][C]0.1445[/C][C]5.5696[/C][C]76.8062[/C][C]8.7639[/C][/ROW]
[ROW][C]55[/C][C]0.3274[/C][C]0.2444[/C][C]0.1588[/C][C]183.8736[/C][C]92.1015[/C][C]9.597[/C][/ROW]
[ROW][C]56[/C][C]0.3619[/C][C]0.1826[/C][C]0.1618[/C][C]102.6169[/C][C]93.416[/C][C]9.6652[/C][/ROW]
[ROW][C]57[/C][C]0.3964[/C][C]0.3134[/C][C]0.1786[/C][C]302.4121[/C][C]116.6377[/C][C]10.7999[/C][/ROW]
[ROW][C]58[/C][C]0.4311[/C][C]0.2331[/C][C]0.1841[/C][C]167.1849[/C][C]121.6925[/C][C]11.0314[/C][/ROW]
[ROW][C]59[/C][C]0.4661[/C][C]0.3203[/C][C]0.1965[/C][C]315.7729[/C][C]139.3361[/C][C]11.8041[/C][/ROW]
[ROW][C]60[/C][C]0.5015[/C][C]0.3956[/C][C]0.213[/C][C]481.8025[/C][C]167.875[/C][C]12.9567[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71381&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71381&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.0948-0.21050136.422400
500.1427-0.18370.1971103.8361120.129210.9603
510.1836-0.20670.2003131.5609123.939811.1328
520.2214-0.14420.186364108.954810.4381
530.2575-0.07950.164919.448191.05359.5422
540.29270.04250.14455.569676.80628.7639
550.32740.24440.1588183.873692.10159.597
560.36190.18260.1618102.616993.4169.6652
570.39640.31340.1786302.4121116.637710.7999
580.43110.23310.1841167.1849121.692511.0314
590.46610.32030.1965315.7729139.336111.8041
600.50150.39560.213481.8025167.87512.9567



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