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, 29 Dec 2009 13:55:02 -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/29/t1262120125g32z8bz33xa4vge.htm/, Retrieved Fri, 03 May 2024 14:08:18 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=71196, Retrieved Fri, 03 May 2024 14:08:18 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact151
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [(Partial) Autocorrelation Function] [paper3: pacf d,D=0] [2009-12-26 18:52:50] [0f0e461427f61416e46aeda5f4901bed]
-   P   [(Partial) Autocorrelation Function] [paper4 pacf d0D1] [2009-12-26 18:57:15] [0f0e461427f61416e46aeda5f4901bed]
- RMP     [ARIMA Backward Selection] [paper 12 backward...] [2009-12-26 19:14:52] [0f0e461427f61416e46aeda5f4901bed]
- RMP         [ARIMA Forecasting] [paper forecast] [2009-12-29 20:55:02] [b090d569c0a4c77894e0b029f4429f19] [Current]
Feedback Forum

Post a new message
Dataseries X:
111.6
104.6
91.6
98.3
97.7
106.3
102.3
106.6
108.1
93.8
88.2
108.9
114.2
102.5
94.2
97.4
98.5
106.5
102.9
97.1
103.7
93.4
85.8
108.6
110.2
101.2
101.2
96.9
99.4
118.7
108.0
101.2
119.9
94.8
95.3
118.0
115.9
111.4
108.2
108.8
109.5
124.8
115.3
109.5
124.2
92.9
98.4
120.9
111.7
116.1
109.4
111.7
114.3
133.7
114.3
126.5
131.0
104.0
108.9
128.5
132.4
128.0
116.4
120.9
118.6
133.1
121.1
127.6
135.4
114.9
114.3
128.9
138.9
129.4
115.0
128.0
127.0
128.8
137.9
128.4
135.9
122.2
113.1
136.2
138.0
115.2
111.0
99.2
102.4
112.7
105.5
98.3
116.4
97.4
93.3
117.4




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71196&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 time3 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[84])
72128.9-------
73138.9-------
74129.4-------
75115-------
76128-------
77127-------
78128.8-------
79137.9-------
80128.4-------
81135.9-------
82122.2-------
83113.1-------
84136.2-------
85138141.8158134.21149.42160.16270.92610.77380.9261
86115.2130.564122.9489138.17900.02780.61780.0734
87111123.8217115.766131.87739e-040.9820.98410.0013
8899.2129.7109120.1257139.29600.99990.63680.0923
89102.4128.1912118.5455137.8369010.59560.0518
90112.7139.1172128.8451149.3893010.97550.7111
91105.5136.164125.2061147.1218010.37810.4974
9298.3132.6549121.5378143.7719010.77340.266
93116.4141.646129.9456153.3463010.83210.8192
9497.4122.822110.7047134.939300.85050.54010.0152
9593.3118.9613106.5956131.32700.99970.82360.0031
96117.4140.6145127.7692153.45972e-0410.74970.7497

\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[84]) \tabularnewline
72 & 128.9 & - & - & - & - & - & - & - \tabularnewline
73 & 138.9 & - & - & - & - & - & - & - \tabularnewline
74 & 129.4 & - & - & - & - & - & - & - \tabularnewline
75 & 115 & - & - & - & - & - & - & - \tabularnewline
76 & 128 & - & - & - & - & - & - & - \tabularnewline
77 & 127 & - & - & - & - & - & - & - \tabularnewline
78 & 128.8 & - & - & - & - & - & - & - \tabularnewline
79 & 137.9 & - & - & - & - & - & - & - \tabularnewline
80 & 128.4 & - & - & - & - & - & - & - \tabularnewline
81 & 135.9 & - & - & - & - & - & - & - \tabularnewline
82 & 122.2 & - & - & - & - & - & - & - \tabularnewline
83 & 113.1 & - & - & - & - & - & - & - \tabularnewline
84 & 136.2 & - & - & - & - & - & - & - \tabularnewline
85 & 138 & 141.8158 & 134.21 & 149.4216 & 0.1627 & 0.9261 & 0.7738 & 0.9261 \tabularnewline
86 & 115.2 & 130.564 & 122.9489 & 138.179 & 0 & 0.0278 & 0.6178 & 0.0734 \tabularnewline
87 & 111 & 123.8217 & 115.766 & 131.8773 & 9e-04 & 0.982 & 0.9841 & 0.0013 \tabularnewline
88 & 99.2 & 129.7109 & 120.1257 & 139.296 & 0 & 0.9999 & 0.6368 & 0.0923 \tabularnewline
89 & 102.4 & 128.1912 & 118.5455 & 137.8369 & 0 & 1 & 0.5956 & 0.0518 \tabularnewline
90 & 112.7 & 139.1172 & 128.8451 & 149.3893 & 0 & 1 & 0.9755 & 0.7111 \tabularnewline
91 & 105.5 & 136.164 & 125.2061 & 147.1218 & 0 & 1 & 0.3781 & 0.4974 \tabularnewline
92 & 98.3 & 132.6549 & 121.5378 & 143.7719 & 0 & 1 & 0.7734 & 0.266 \tabularnewline
93 & 116.4 & 141.646 & 129.9456 & 153.3463 & 0 & 1 & 0.8321 & 0.8192 \tabularnewline
94 & 97.4 & 122.822 & 110.7047 & 134.9393 & 0 & 0.8505 & 0.5401 & 0.0152 \tabularnewline
95 & 93.3 & 118.9613 & 106.5956 & 131.327 & 0 & 0.9997 & 0.8236 & 0.0031 \tabularnewline
96 & 117.4 & 140.6145 & 127.7692 & 153.4597 & 2e-04 & 1 & 0.7497 & 0.7497 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71196&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[84])[/C][/ROW]
[ROW][C]72[/C][C]128.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]138.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]74[/C][C]129.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]75[/C][C]115[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]76[/C][C]128[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]77[/C][C]127[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]78[/C][C]128.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]79[/C][C]137.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]80[/C][C]128.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]81[/C][C]135.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]82[/C][C]122.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]83[/C][C]113.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]84[/C][C]136.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]138[/C][C]141.8158[/C][C]134.21[/C][C]149.4216[/C][C]0.1627[/C][C]0.9261[/C][C]0.7738[/C][C]0.9261[/C][/ROW]
[ROW][C]86[/C][C]115.2[/C][C]130.564[/C][C]122.9489[/C][C]138.179[/C][C]0[/C][C]0.0278[/C][C]0.6178[/C][C]0.0734[/C][/ROW]
[ROW][C]87[/C][C]111[/C][C]123.8217[/C][C]115.766[/C][C]131.8773[/C][C]9e-04[/C][C]0.982[/C][C]0.9841[/C][C]0.0013[/C][/ROW]
[ROW][C]88[/C][C]99.2[/C][C]129.7109[/C][C]120.1257[/C][C]139.296[/C][C]0[/C][C]0.9999[/C][C]0.6368[/C][C]0.0923[/C][/ROW]
[ROW][C]89[/C][C]102.4[/C][C]128.1912[/C][C]118.5455[/C][C]137.8369[/C][C]0[/C][C]1[/C][C]0.5956[/C][C]0.0518[/C][/ROW]
[ROW][C]90[/C][C]112.7[/C][C]139.1172[/C][C]128.8451[/C][C]149.3893[/C][C]0[/C][C]1[/C][C]0.9755[/C][C]0.7111[/C][/ROW]
[ROW][C]91[/C][C]105.5[/C][C]136.164[/C][C]125.2061[/C][C]147.1218[/C][C]0[/C][C]1[/C][C]0.3781[/C][C]0.4974[/C][/ROW]
[ROW][C]92[/C][C]98.3[/C][C]132.6549[/C][C]121.5378[/C][C]143.7719[/C][C]0[/C][C]1[/C][C]0.7734[/C][C]0.266[/C][/ROW]
[ROW][C]93[/C][C]116.4[/C][C]141.646[/C][C]129.9456[/C][C]153.3463[/C][C]0[/C][C]1[/C][C]0.8321[/C][C]0.8192[/C][/ROW]
[ROW][C]94[/C][C]97.4[/C][C]122.822[/C][C]110.7047[/C][C]134.9393[/C][C]0[/C][C]0.8505[/C][C]0.5401[/C][C]0.0152[/C][/ROW]
[ROW][C]95[/C][C]93.3[/C][C]118.9613[/C][C]106.5956[/C][C]131.327[/C][C]0[/C][C]0.9997[/C][C]0.8236[/C][C]0.0031[/C][/ROW]
[ROW][C]96[/C][C]117.4[/C][C]140.6145[/C][C]127.7692[/C][C]153.4597[/C][C]2e-04[/C][C]1[/C][C]0.7497[/C][C]0.7497[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71196&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71196&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[84])
72128.9-------
73138.9-------
74129.4-------
75115-------
76128-------
77127-------
78128.8-------
79137.9-------
80128.4-------
81135.9-------
82122.2-------
83113.1-------
84136.2-------
85138141.8158134.21149.42160.16270.92610.77380.9261
86115.2130.564122.9489138.17900.02780.61780.0734
87111123.8217115.766131.87739e-040.9820.98410.0013
8899.2129.7109120.1257139.29600.99990.63680.0923
89102.4128.1912118.5455137.8369010.59560.0518
90112.7139.1172128.8451149.3893010.97550.7111
91105.5136.164125.2061147.1218010.37810.4974
9298.3132.6549121.5378143.7719010.77340.266
93116.4141.646129.9456153.3463010.83210.8192
9497.4122.822110.7047134.939300.85050.54010.0152
9593.3118.9613106.5956131.32700.99970.82360.0031
96117.4140.6145127.7692153.45972e-0410.74970.7497







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
850.0274-0.0269014.560500
860.0298-0.11770.0723236.0517125.306111.194
870.0332-0.10350.0827164.3948138.335711.7616
880.0377-0.23520.1208930.913336.4818.3434
890.0384-0.20120.1369665.1851402.22120.0554
900.0377-0.18990.1457697.8683451.495621.2484
910.0411-0.22520.1571940.2781521.321722.8325
920.0428-0.2590.16981180.2564603.688524.5701
930.0421-0.17820.1708637.3581607.429624.6461
940.0503-0.2070.1744646.2786611.314524.7248
950.053-0.21570.1781658.503615.604324.8114
960.0466-0.16510.1771538.9122609.213324.6822

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
85 & 0.0274 & -0.0269 & 0 & 14.5605 & 0 & 0 \tabularnewline
86 & 0.0298 & -0.1177 & 0.0723 & 236.0517 & 125.3061 & 11.194 \tabularnewline
87 & 0.0332 & -0.1035 & 0.0827 & 164.3948 & 138.3357 & 11.7616 \tabularnewline
88 & 0.0377 & -0.2352 & 0.1208 & 930.913 & 336.48 & 18.3434 \tabularnewline
89 & 0.0384 & -0.2012 & 0.1369 & 665.1851 & 402.221 & 20.0554 \tabularnewline
90 & 0.0377 & -0.1899 & 0.1457 & 697.8683 & 451.4956 & 21.2484 \tabularnewline
91 & 0.0411 & -0.2252 & 0.1571 & 940.2781 & 521.3217 & 22.8325 \tabularnewline
92 & 0.0428 & -0.259 & 0.1698 & 1180.2564 & 603.6885 & 24.5701 \tabularnewline
93 & 0.0421 & -0.1782 & 0.1708 & 637.3581 & 607.4296 & 24.6461 \tabularnewline
94 & 0.0503 & -0.207 & 0.1744 & 646.2786 & 611.3145 & 24.7248 \tabularnewline
95 & 0.053 & -0.2157 & 0.1781 & 658.503 & 615.6043 & 24.8114 \tabularnewline
96 & 0.0466 & -0.1651 & 0.1771 & 538.9122 & 609.2133 & 24.6822 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71196&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]85[/C][C]0.0274[/C][C]-0.0269[/C][C]0[/C][C]14.5605[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]86[/C][C]0.0298[/C][C]-0.1177[/C][C]0.0723[/C][C]236.0517[/C][C]125.3061[/C][C]11.194[/C][/ROW]
[ROW][C]87[/C][C]0.0332[/C][C]-0.1035[/C][C]0.0827[/C][C]164.3948[/C][C]138.3357[/C][C]11.7616[/C][/ROW]
[ROW][C]88[/C][C]0.0377[/C][C]-0.2352[/C][C]0.1208[/C][C]930.913[/C][C]336.48[/C][C]18.3434[/C][/ROW]
[ROW][C]89[/C][C]0.0384[/C][C]-0.2012[/C][C]0.1369[/C][C]665.1851[/C][C]402.221[/C][C]20.0554[/C][/ROW]
[ROW][C]90[/C][C]0.0377[/C][C]-0.1899[/C][C]0.1457[/C][C]697.8683[/C][C]451.4956[/C][C]21.2484[/C][/ROW]
[ROW][C]91[/C][C]0.0411[/C][C]-0.2252[/C][C]0.1571[/C][C]940.2781[/C][C]521.3217[/C][C]22.8325[/C][/ROW]
[ROW][C]92[/C][C]0.0428[/C][C]-0.259[/C][C]0.1698[/C][C]1180.2564[/C][C]603.6885[/C][C]24.5701[/C][/ROW]
[ROW][C]93[/C][C]0.0421[/C][C]-0.1782[/C][C]0.1708[/C][C]637.3581[/C][C]607.4296[/C][C]24.6461[/C][/ROW]
[ROW][C]94[/C][C]0.0503[/C][C]-0.207[/C][C]0.1744[/C][C]646.2786[/C][C]611.3145[/C][C]24.7248[/C][/ROW]
[ROW][C]95[/C][C]0.053[/C][C]-0.2157[/C][C]0.1781[/C][C]658.503[/C][C]615.6043[/C][C]24.8114[/C][/ROW]
[ROW][C]96[/C][C]0.0466[/C][C]-0.1651[/C][C]0.1771[/C][C]538.9122[/C][C]609.2133[/C][C]24.6822[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71196&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71196&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
850.0274-0.0269014.560500
860.0298-0.11770.0723236.0517125.306111.194
870.0332-0.10350.0827164.3948138.335711.7616
880.0377-0.23520.1208930.913336.4818.3434
890.0384-0.20120.1369665.1851402.22120.0554
900.0377-0.18990.1457697.8683451.495621.2484
910.0411-0.22520.1571940.2781521.321722.8325
920.0428-0.2590.16981180.2564603.688524.5701
930.0421-0.17820.1708637.3581607.429624.6461
940.0503-0.2070.1744646.2786611.314524.7248
950.053-0.21570.1781658.503615.604324.8114
960.0466-0.16510.1771538.9122609.213324.6822



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