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 computationSat, 16 Dec 2017 11:45:41 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2017/Dec/16/t1513421189d3a9ze8tczctv62.htm/, Retrieved Wed, 15 May 2024 21:58:16 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=309844, Retrieved Wed, 15 May 2024 21:58:16 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact101
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA Forecasting] [2017-12-16 10:45:41] [71733e7e3fc4cdee2971288e32d35d04] [Current]
Feedback Forum

Post a new message
Dataseries X:
57.7
60.1
66.5
63.4
71.4
68.5
61.6
68.3
69.3
76.1
73.3
69.7
67.4
63.7
73
67.5
74.4
72.9
71.7
75.6
72.5
80
75.4
71
70.6
67.5
74.1
73.2
74
73
74
73
76
81.7
73.5
77
73.6
70.4
74.7
76.8
72.7
76
77.5
73.6
78.5
84.3
74.4
78.5
72.7
71.3
84.4
79.1
76.2
84.9
77.1
78.7
84.7
83.7
82.5
85.2
76
72.2
83.2
80.2
81.1
86
76
83.9
87.9
85
88.1
87.4
79.5
75.2
87.3
79.5
87.6
89.1
83
88.3
88.9
93.9
91.7
87.2
87.8
81
93.7
87.5
91.4
93.8
89.5
93.3
92.8
104.1
99.9
93.4
99
93.2
95.7
102.6
98.8
98
101.5
94.9
104.7
108.4
97
102.3
90.8
89.6
99.9
99.2
94
103
99.8
94.9
102
103.2
98
101.1
88.2
90.3
105.5
99.4
94.3
105.9
98
99
103.9
104.3
105.7
105.5
97.4
95.4
110.5
102.8
110
104.3
96.5
105.6
111.3
108.5
109.1
107.7
102.3
102.4
110.8
101.7
108.9
111.5
104
109.9
106.8
118.4
111.8
105
104.9
96.5
106.3
105.6
109.3
105.1
111.5
103.1
106.5
114.4
104.7
105.5
100.5
96.4
105.1
108.4
105.7
109
107.2
101.6
112.7
115.9
105
110.4
100.9
98.5
111.3
109.6
103.4
115.7
110.4
105.2
113.2
117.4
112.3
113.9
102.2
106.9
118
113.8
114.9
118.8
106.3
114.2
117.3
114.7
117
116.6
106.5
105.7
121
107.8
119.7
121
108.8
115




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time2 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309844&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]2 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=309844&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309844&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 Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R ServerBig Analytics Cloud Computing Center







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[200])
188105.2-------
189113.2-------
190117.4-------
191112.3-------
192113.9-------
193102.2-------
194106.9-------
195118-------
196113.8-------
197114.9-------
198118.8-------
199106.3-------
200114.2-------
201117.3117.1956111.4498122.94150.48580.84660.91360.8466
202114.7117.9336112.1878123.67930.1350.58560.57220.8986
203117116.908111.0029122.8130.48780.76820.93690.8156
204116.6115.9655109.0759122.8550.42840.38430.72160.6923
205106.5108.148101.1983115.09760.3210.00860.95330.0439
206105.7108.5213101.3409115.70160.22060.70940.6710.0606
207121118.0351110.3979125.67230.22340.99920.50360.8375
208107.8114.4385106.665122.21190.04710.0490.56390.524
209119.7116.2924108.2827124.3020.20220.98120.63330.6957
210121118.8804110.5737127.18720.30850.42330.50760.8653
211108.8113.269104.7893121.74880.15080.0370.94640.4148
212115115.7632107.0612124.46510.43180.94160.63760.6376

\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[200]) \tabularnewline
188 & 105.2 & - & - & - & - & - & - & - \tabularnewline
189 & 113.2 & - & - & - & - & - & - & - \tabularnewline
190 & 117.4 & - & - & - & - & - & - & - \tabularnewline
191 & 112.3 & - & - & - & - & - & - & - \tabularnewline
192 & 113.9 & - & - & - & - & - & - & - \tabularnewline
193 & 102.2 & - & - & - & - & - & - & - \tabularnewline
194 & 106.9 & - & - & - & - & - & - & - \tabularnewline
195 & 118 & - & - & - & - & - & - & - \tabularnewline
196 & 113.8 & - & - & - & - & - & - & - \tabularnewline
197 & 114.9 & - & - & - & - & - & - & - \tabularnewline
198 & 118.8 & - & - & - & - & - & - & - \tabularnewline
199 & 106.3 & - & - & - & - & - & - & - \tabularnewline
200 & 114.2 & - & - & - & - & - & - & - \tabularnewline
201 & 117.3 & 117.1956 & 111.4498 & 122.9415 & 0.4858 & 0.8466 & 0.9136 & 0.8466 \tabularnewline
202 & 114.7 & 117.9336 & 112.1878 & 123.6793 & 0.135 & 0.5856 & 0.5722 & 0.8986 \tabularnewline
203 & 117 & 116.908 & 111.0029 & 122.813 & 0.4878 & 0.7682 & 0.9369 & 0.8156 \tabularnewline
204 & 116.6 & 115.9655 & 109.0759 & 122.855 & 0.4284 & 0.3843 & 0.7216 & 0.6923 \tabularnewline
205 & 106.5 & 108.148 & 101.1983 & 115.0976 & 0.321 & 0.0086 & 0.9533 & 0.0439 \tabularnewline
206 & 105.7 & 108.5213 & 101.3409 & 115.7016 & 0.2206 & 0.7094 & 0.671 & 0.0606 \tabularnewline
207 & 121 & 118.0351 & 110.3979 & 125.6723 & 0.2234 & 0.9992 & 0.5036 & 0.8375 \tabularnewline
208 & 107.8 & 114.4385 & 106.665 & 122.2119 & 0.0471 & 0.049 & 0.5639 & 0.524 \tabularnewline
209 & 119.7 & 116.2924 & 108.2827 & 124.302 & 0.2022 & 0.9812 & 0.6333 & 0.6957 \tabularnewline
210 & 121 & 118.8804 & 110.5737 & 127.1872 & 0.3085 & 0.4233 & 0.5076 & 0.8653 \tabularnewline
211 & 108.8 & 113.269 & 104.7893 & 121.7488 & 0.1508 & 0.037 & 0.9464 & 0.4148 \tabularnewline
212 & 115 & 115.7632 & 107.0612 & 124.4651 & 0.4318 & 0.9416 & 0.6376 & 0.6376 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309844&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[200])[/C][/ROW]
[ROW][C]188[/C][C]105.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]113.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]117.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]112.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]113.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]102.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]106.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]118[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]113.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]114.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]118.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]106.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]114.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]117.3[/C][C]117.1956[/C][C]111.4498[/C][C]122.9415[/C][C]0.4858[/C][C]0.8466[/C][C]0.9136[/C][C]0.8466[/C][/ROW]
[ROW][C]202[/C][C]114.7[/C][C]117.9336[/C][C]112.1878[/C][C]123.6793[/C][C]0.135[/C][C]0.5856[/C][C]0.5722[/C][C]0.8986[/C][/ROW]
[ROW][C]203[/C][C]117[/C][C]116.908[/C][C]111.0029[/C][C]122.813[/C][C]0.4878[/C][C]0.7682[/C][C]0.9369[/C][C]0.8156[/C][/ROW]
[ROW][C]204[/C][C]116.6[/C][C]115.9655[/C][C]109.0759[/C][C]122.855[/C][C]0.4284[/C][C]0.3843[/C][C]0.7216[/C][C]0.6923[/C][/ROW]
[ROW][C]205[/C][C]106.5[/C][C]108.148[/C][C]101.1983[/C][C]115.0976[/C][C]0.321[/C][C]0.0086[/C][C]0.9533[/C][C]0.0439[/C][/ROW]
[ROW][C]206[/C][C]105.7[/C][C]108.5213[/C][C]101.3409[/C][C]115.7016[/C][C]0.2206[/C][C]0.7094[/C][C]0.671[/C][C]0.0606[/C][/ROW]
[ROW][C]207[/C][C]121[/C][C]118.0351[/C][C]110.3979[/C][C]125.6723[/C][C]0.2234[/C][C]0.9992[/C][C]0.5036[/C][C]0.8375[/C][/ROW]
[ROW][C]208[/C][C]107.8[/C][C]114.4385[/C][C]106.665[/C][C]122.2119[/C][C]0.0471[/C][C]0.049[/C][C]0.5639[/C][C]0.524[/C][/ROW]
[ROW][C]209[/C][C]119.7[/C][C]116.2924[/C][C]108.2827[/C][C]124.302[/C][C]0.2022[/C][C]0.9812[/C][C]0.6333[/C][C]0.6957[/C][/ROW]
[ROW][C]210[/C][C]121[/C][C]118.8804[/C][C]110.5737[/C][C]127.1872[/C][C]0.3085[/C][C]0.4233[/C][C]0.5076[/C][C]0.8653[/C][/ROW]
[ROW][C]211[/C][C]108.8[/C][C]113.269[/C][C]104.7893[/C][C]121.7488[/C][C]0.1508[/C][C]0.037[/C][C]0.9464[/C][C]0.4148[/C][/ROW]
[ROW][C]212[/C][C]115[/C][C]115.7632[/C][C]107.0612[/C][C]124.4651[/C][C]0.4318[/C][C]0.9416[/C][C]0.6376[/C][C]0.6376[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=309844&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309844&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[200])
188105.2-------
189113.2-------
190117.4-------
191112.3-------
192113.9-------
193102.2-------
194106.9-------
195118-------
196113.8-------
197114.9-------
198118.8-------
199106.3-------
200114.2-------
201117.3117.1956111.4498122.94150.48580.84660.91360.8466
202114.7117.9336112.1878123.67930.1350.58560.57220.8986
203117116.908111.0029122.8130.48780.76820.93690.8156
204116.6115.9655109.0759122.8550.42840.38430.72160.6923
205106.5108.148101.1983115.09760.3210.00860.95330.0439
206105.7108.5213101.3409115.70160.22060.70940.6710.0606
207121118.0351110.3979125.67230.22340.99920.50360.8375
208107.8114.4385106.665122.21190.04710.0490.56390.524
209119.7116.2924108.2827124.3020.20220.98120.63330.6957
210121118.8804110.5737127.18720.30850.42330.50760.8653
211108.8113.269104.7893121.74880.15080.0370.94640.4148
212115115.7632107.0612124.46510.43180.94160.63760.6376







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.0259e-049e-049e-040.0109000.0150.015
2020.0249-0.02820.01450.014310.45595.23342.2877-0.46620.2406
2030.02588e-040.010.00980.00853.49181.86860.01330.1648
2040.03030.00540.00880.00870.40262.71951.64910.09150.1465
2050.0328-0.01550.01020.01012.71572.71871.6489-0.23760.1647
2060.0338-0.02670.01290.01287.95953.59221.8953-0.40670.205
2070.0330.02450.01460.01458.79054.33482.0820.42740.2368
2080.0347-0.06160.02040.020144.06969.30173.0499-0.95710.3268
2090.03510.02850.02130.021111.61189.55833.09170.49130.3451
2100.03570.01750.0210.02084.49269.05183.00860.30560.3412
2110.0382-0.04110.02280.022519.972310.04453.1693-0.64430.3687
2120.0384-0.00660.02140.02120.58249.2563.0424-0.110.3472

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
201 & 0.025 & 9e-04 & 9e-04 & 9e-04 & 0.0109 & 0 & 0 & 0.015 & 0.015 \tabularnewline
202 & 0.0249 & -0.0282 & 0.0145 & 0.0143 & 10.4559 & 5.2334 & 2.2877 & -0.4662 & 0.2406 \tabularnewline
203 & 0.0258 & 8e-04 & 0.01 & 0.0098 & 0.0085 & 3.4918 & 1.8686 & 0.0133 & 0.1648 \tabularnewline
204 & 0.0303 & 0.0054 & 0.0088 & 0.0087 & 0.4026 & 2.7195 & 1.6491 & 0.0915 & 0.1465 \tabularnewline
205 & 0.0328 & -0.0155 & 0.0102 & 0.0101 & 2.7157 & 2.7187 & 1.6489 & -0.2376 & 0.1647 \tabularnewline
206 & 0.0338 & -0.0267 & 0.0129 & 0.0128 & 7.9595 & 3.5922 & 1.8953 & -0.4067 & 0.205 \tabularnewline
207 & 0.033 & 0.0245 & 0.0146 & 0.0145 & 8.7905 & 4.3348 & 2.082 & 0.4274 & 0.2368 \tabularnewline
208 & 0.0347 & -0.0616 & 0.0204 & 0.0201 & 44.0696 & 9.3017 & 3.0499 & -0.9571 & 0.3268 \tabularnewline
209 & 0.0351 & 0.0285 & 0.0213 & 0.0211 & 11.6118 & 9.5583 & 3.0917 & 0.4913 & 0.3451 \tabularnewline
210 & 0.0357 & 0.0175 & 0.021 & 0.0208 & 4.4926 & 9.0518 & 3.0086 & 0.3056 & 0.3412 \tabularnewline
211 & 0.0382 & -0.0411 & 0.0228 & 0.0225 & 19.9723 & 10.0445 & 3.1693 & -0.6443 & 0.3687 \tabularnewline
212 & 0.0384 & -0.0066 & 0.0214 & 0.0212 & 0.5824 & 9.256 & 3.0424 & -0.11 & 0.3472 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309844&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]sMAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][C]ScaledE[/C][C]MASE[/C][/ROW]
[ROW][C]201[/C][C]0.025[/C][C]9e-04[/C][C]9e-04[/C][C]9e-04[/C][C]0.0109[/C][C]0[/C][C]0[/C][C]0.015[/C][C]0.015[/C][/ROW]
[ROW][C]202[/C][C]0.0249[/C][C]-0.0282[/C][C]0.0145[/C][C]0.0143[/C][C]10.4559[/C][C]5.2334[/C][C]2.2877[/C][C]-0.4662[/C][C]0.2406[/C][/ROW]
[ROW][C]203[/C][C]0.0258[/C][C]8e-04[/C][C]0.01[/C][C]0.0098[/C][C]0.0085[/C][C]3.4918[/C][C]1.8686[/C][C]0.0133[/C][C]0.1648[/C][/ROW]
[ROW][C]204[/C][C]0.0303[/C][C]0.0054[/C][C]0.0088[/C][C]0.0087[/C][C]0.4026[/C][C]2.7195[/C][C]1.6491[/C][C]0.0915[/C][C]0.1465[/C][/ROW]
[ROW][C]205[/C][C]0.0328[/C][C]-0.0155[/C][C]0.0102[/C][C]0.0101[/C][C]2.7157[/C][C]2.7187[/C][C]1.6489[/C][C]-0.2376[/C][C]0.1647[/C][/ROW]
[ROW][C]206[/C][C]0.0338[/C][C]-0.0267[/C][C]0.0129[/C][C]0.0128[/C][C]7.9595[/C][C]3.5922[/C][C]1.8953[/C][C]-0.4067[/C][C]0.205[/C][/ROW]
[ROW][C]207[/C][C]0.033[/C][C]0.0245[/C][C]0.0146[/C][C]0.0145[/C][C]8.7905[/C][C]4.3348[/C][C]2.082[/C][C]0.4274[/C][C]0.2368[/C][/ROW]
[ROW][C]208[/C][C]0.0347[/C][C]-0.0616[/C][C]0.0204[/C][C]0.0201[/C][C]44.0696[/C][C]9.3017[/C][C]3.0499[/C][C]-0.9571[/C][C]0.3268[/C][/ROW]
[ROW][C]209[/C][C]0.0351[/C][C]0.0285[/C][C]0.0213[/C][C]0.0211[/C][C]11.6118[/C][C]9.5583[/C][C]3.0917[/C][C]0.4913[/C][C]0.3451[/C][/ROW]
[ROW][C]210[/C][C]0.0357[/C][C]0.0175[/C][C]0.021[/C][C]0.0208[/C][C]4.4926[/C][C]9.0518[/C][C]3.0086[/C][C]0.3056[/C][C]0.3412[/C][/ROW]
[ROW][C]211[/C][C]0.0382[/C][C]-0.0411[/C][C]0.0228[/C][C]0.0225[/C][C]19.9723[/C][C]10.0445[/C][C]3.1693[/C][C]-0.6443[/C][C]0.3687[/C][/ROW]
[ROW][C]212[/C][C]0.0384[/C][C]-0.0066[/C][C]0.0214[/C][C]0.0212[/C][C]0.5824[/C][C]9.256[/C][C]3.0424[/C][C]-0.11[/C][C]0.3472[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=309844&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309844&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.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.0259e-049e-049e-040.0109000.0150.015
2020.0249-0.02820.01450.014310.45595.23342.2877-0.46620.2406
2030.02588e-040.010.00980.00853.49181.86860.01330.1648
2040.03030.00540.00880.00870.40262.71951.64910.09150.1465
2050.0328-0.01550.01020.01012.71572.71871.6489-0.23760.1647
2060.0338-0.02670.01290.01287.95953.59221.8953-0.40670.205
2070.0330.02450.01460.01458.79054.33482.0820.42740.2368
2080.0347-0.06160.02040.020144.06969.30173.0499-0.95710.3268
2090.03510.02850.02130.021111.61189.55833.09170.49130.3451
2100.03570.01750.0210.02084.49269.05183.00860.30560.3412
2110.0382-0.04110.02280.022519.972310.04453.1693-0.64430.3687
2120.0384-0.00660.02140.02120.58249.2563.0424-0.110.3472



Parameters (Session):
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 2 ; par7 = 1 ; 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*2
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.spe <- array(0, dim=fx)
perf.scalederr <- array(0, dim=fx)
perf.mase <- array(0, dim=fx)
perf.mase1 <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.smape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.smape1 <- 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)
perf.scaleddenom <- 0
for (i in 2:fx) {
perf.scaleddenom = perf.scaleddenom + abs(x[nx+i] - x[nx+i-1])
}
perf.scaleddenom = perf.scaleddenom / (fx-1)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.scalederr[i] = (x[nx+i] - forecast$pred[i]) / perf.scaleddenom
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / x[nx+i]
perf.spe[i] = 2*(x[nx+i] - forecast$pred[i]) / (x[nx+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.smape[1] = abs(perf.spe[1])
perf.mape1[1] = perf.mape[1]
perf.smape1[1] = perf.smape[1]
perf.mse[1] = perf.se[1]
perf.mase[1] = abs(perf.scalederr[1])
perf.mase1[1] = perf.mase[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.smape[i] = perf.smape[i-1] + abs(perf.spe[i])
perf.smape1[i] = perf.smape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
perf.mase[i] = perf.mase[i-1] + abs(perf.scalederr[i])
perf.mase1[i] = perf.mase[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',10,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,'sMAPE',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.element(a,'ScaledE',1,header=TRUE)
a<-table.element(a,'MASE',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.smape1[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.element(a,round(perf.scalederr[i],4))
a<-table.element(a,round(perf.mase1[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')