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, 07 Dec 2017 13:00:26 +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/07/t15126532557qzql34cytpfrza.htm/, Retrieved Wed, 15 May 2024 20:48:01 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=308710, Retrieved Wed, 15 May 2024 20:48:01 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact83
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA FORECAST] [2017-12-07 12:00:26] [33956d13de8d8b5d5d1b78ead3554acb] [Current]
Feedback Forum

Post a new message
Dataseries X:
53.1
64.1
75.3
66
73.6
73.2
53.5
60.6
73
72.4
75.8
79.6
77.8
75.7
88.5
72.9
80.8
86.6
63.8
69.2
76.5
77.1
75.3
69.5
64.3
66.7
77.3
75.3
73.4
78
61
58.4
73.4
82.3
72.2
76
64.3
70.8
74
71.4
70.1
77.6
61.2
52.1
74.4
73.1
70.9
80.7
62.9
69.3
82.3
76.2
70.8
87.3
62
66.9
84.4
82.6
77.7
87
76
76.3
88.8
81.2
74.5
98.1
63.3
67.7
85.8
78.6
87.2
106.4
75
80.4
94.8
77
91
96.7
69.2
69.5
93.7
98.5
93.3
100.4
87.4
89
106.1
92.5
96.6
113.3
87.6
89.2
115.6
133.2
111.1
113.1
102
109.3
111.1
116.8
107.5
120.5
95.5
87.9
118.6
116.3
98.8
102.9
80.4
87
97.4
87.2
110.6
101.1
69.1
77.4
95
93.2
96.3
93.9
78.5
90
109.2
94.3
93.1
114.5
78.5
88.3
114.8
112.2
106.9
119.7
97.1
106.3
131.7
106.7
124
117.2
87.8
91.9
125.1
115.4
117.7
124.3
104.8
109.6
139.5
105.3
112.4
128.9
91.6
98.7
117.8
117.4
110.5
103.1
95.8
98.2
117.2
108.5
113.2
120.2
102.8
89.4
119.8
126.9
114.4
117.4
109.4
111.1
121
116.6
119.5
121.2
101
92.7
125.5
123.4
110.3
118.8
97.1
107.6
131
117.9
111
131.4
101.8
93.9
138.5
131.1
124.9
126.6
102.7
121.6
132.8
123
116
135
93.7
98.4
129.8
121.9
124.8
126.9
102
117.7
144.8
113.3
129.3
135.7
94.3
106




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time4 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 time4 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=308710&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]4 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=308710&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=308710&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 time4 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])
18893.9-------
189138.5-------
190131.1-------
191124.9-------
192126.6-------
193102.7-------
194121.6-------
195132.8-------
196123-------
197116-------
198135-------
19993.7-------
20098.4000000000001-------
201129.8126.8213112.0996143.26070.36120.99960.08190.9996
202121.9126.8823111.5971144.02650.28450.36940.31480.9994
203124.8121.4463105.5559139.45810.35760.48030.35350.9939
204126.9126.9535109.433146.95940.49790.58360.51380.9974
205102107.81391.8925126.17430.26750.02080.70740.8425
206117.7115.87498.0645136.54330.43130.90580.29360.9512
207144.8132.4194111.4464156.880.16060.88090.48780.9968
208113.3119.032199.2424142.30520.31460.0150.36910.9589
209129.3123.2246102.0639148.25520.31710.78150.71420.974
210135.7134.6831110.9748162.85620.47180.6460.49120.9942
21194.399.957181.315122.36120.31039e-040.70790.5542
212106102.218682.6429125.87280.3770.74410.62420.6242

\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 & 93.9 & - & - & - & - & - & - & - \tabularnewline
189 & 138.5 & - & - & - & - & - & - & - \tabularnewline
190 & 131.1 & - & - & - & - & - & - & - \tabularnewline
191 & 124.9 & - & - & - & - & - & - & - \tabularnewline
192 & 126.6 & - & - & - & - & - & - & - \tabularnewline
193 & 102.7 & - & - & - & - & - & - & - \tabularnewline
194 & 121.6 & - & - & - & - & - & - & - \tabularnewline
195 & 132.8 & - & - & - & - & - & - & - \tabularnewline
196 & 123 & - & - & - & - & - & - & - \tabularnewline
197 & 116 & - & - & - & - & - & - & - \tabularnewline
198 & 135 & - & - & - & - & - & - & - \tabularnewline
199 & 93.7 & - & - & - & - & - & - & - \tabularnewline
200 & 98.4000000000001 & - & - & - & - & - & - & - \tabularnewline
201 & 129.8 & 126.8213 & 112.0996 & 143.2607 & 0.3612 & 0.9996 & 0.0819 & 0.9996 \tabularnewline
202 & 121.9 & 126.8823 & 111.5971 & 144.0265 & 0.2845 & 0.3694 & 0.3148 & 0.9994 \tabularnewline
203 & 124.8 & 121.4463 & 105.5559 & 139.4581 & 0.3576 & 0.4803 & 0.3535 & 0.9939 \tabularnewline
204 & 126.9 & 126.9535 & 109.433 & 146.9594 & 0.4979 & 0.5836 & 0.5138 & 0.9974 \tabularnewline
205 & 102 & 107.813 & 91.8925 & 126.1743 & 0.2675 & 0.0208 & 0.7074 & 0.8425 \tabularnewline
206 & 117.7 & 115.874 & 98.0645 & 136.5433 & 0.4313 & 0.9058 & 0.2936 & 0.9512 \tabularnewline
207 & 144.8 & 132.4194 & 111.4464 & 156.88 & 0.1606 & 0.8809 & 0.4878 & 0.9968 \tabularnewline
208 & 113.3 & 119.0321 & 99.2424 & 142.3052 & 0.3146 & 0.015 & 0.3691 & 0.9589 \tabularnewline
209 & 129.3 & 123.2246 & 102.0639 & 148.2552 & 0.3171 & 0.7815 & 0.7142 & 0.974 \tabularnewline
210 & 135.7 & 134.6831 & 110.9748 & 162.8562 & 0.4718 & 0.646 & 0.4912 & 0.9942 \tabularnewline
211 & 94.3 & 99.9571 & 81.315 & 122.3612 & 0.3103 & 9e-04 & 0.7079 & 0.5542 \tabularnewline
212 & 106 & 102.2186 & 82.6429 & 125.8728 & 0.377 & 0.7441 & 0.6242 & 0.6242 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=308710&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]93.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]138.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]131.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]124.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]126.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]102.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]121.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]132.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]123[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]116[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]135[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]93.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]98.4000000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]129.8[/C][C]126.8213[/C][C]112.0996[/C][C]143.2607[/C][C]0.3612[/C][C]0.9996[/C][C]0.0819[/C][C]0.9996[/C][/ROW]
[ROW][C]202[/C][C]121.9[/C][C]126.8823[/C][C]111.5971[/C][C]144.0265[/C][C]0.2845[/C][C]0.3694[/C][C]0.3148[/C][C]0.9994[/C][/ROW]
[ROW][C]203[/C][C]124.8[/C][C]121.4463[/C][C]105.5559[/C][C]139.4581[/C][C]0.3576[/C][C]0.4803[/C][C]0.3535[/C][C]0.9939[/C][/ROW]
[ROW][C]204[/C][C]126.9[/C][C]126.9535[/C][C]109.433[/C][C]146.9594[/C][C]0.4979[/C][C]0.5836[/C][C]0.5138[/C][C]0.9974[/C][/ROW]
[ROW][C]205[/C][C]102[/C][C]107.813[/C][C]91.8925[/C][C]126.1743[/C][C]0.2675[/C][C]0.0208[/C][C]0.7074[/C][C]0.8425[/C][/ROW]
[ROW][C]206[/C][C]117.7[/C][C]115.874[/C][C]98.0645[/C][C]136.5433[/C][C]0.4313[/C][C]0.9058[/C][C]0.2936[/C][C]0.9512[/C][/ROW]
[ROW][C]207[/C][C]144.8[/C][C]132.4194[/C][C]111.4464[/C][C]156.88[/C][C]0.1606[/C][C]0.8809[/C][C]0.4878[/C][C]0.9968[/C][/ROW]
[ROW][C]208[/C][C]113.3[/C][C]119.0321[/C][C]99.2424[/C][C]142.3052[/C][C]0.3146[/C][C]0.015[/C][C]0.3691[/C][C]0.9589[/C][/ROW]
[ROW][C]209[/C][C]129.3[/C][C]123.2246[/C][C]102.0639[/C][C]148.2552[/C][C]0.3171[/C][C]0.7815[/C][C]0.7142[/C][C]0.974[/C][/ROW]
[ROW][C]210[/C][C]135.7[/C][C]134.6831[/C][C]110.9748[/C][C]162.8562[/C][C]0.4718[/C][C]0.646[/C][C]0.4912[/C][C]0.9942[/C][/ROW]
[ROW][C]211[/C][C]94.3[/C][C]99.9571[/C][C]81.315[/C][C]122.3612[/C][C]0.3103[/C][C]9e-04[/C][C]0.7079[/C][C]0.5542[/C][/ROW]
[ROW][C]212[/C][C]106[/C][C]102.2186[/C][C]82.6429[/C][C]125.8728[/C][C]0.377[/C][C]0.7441[/C][C]0.6242[/C][C]0.6242[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=308710&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=308710&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])
18893.9-------
189138.5-------
190131.1-------
191124.9-------
192126.6-------
193102.7-------
194121.6-------
195132.8-------
196123-------
197116-------
198135-------
19993.7-------
20098.4000000000001-------
201129.8126.8213112.0996143.26070.36120.99960.08190.9996
202121.9126.8823111.5971144.02650.28450.36940.31480.9994
203124.8121.4463105.5559139.45810.35760.48030.35350.9939
204126.9126.9535109.433146.95940.49790.58360.51380.9974
205102107.81391.8925126.17430.26750.02080.70740.8425
206117.7115.87498.0645136.54330.43130.90580.29360.9512
207144.8132.4194111.4464156.880.16060.88090.48780.9968
208113.3119.032199.2424142.30520.31460.0150.36910.9589
209129.3123.2246102.0639148.25520.31710.78150.71420.974
210135.7134.6831110.9748162.85620.47180.6460.49120.9942
21194.399.957181.315122.36120.31039e-040.70790.5542
212106102.218682.6429125.87280.3770.74410.62420.6242







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.06610.02290.02290.02328.8728000.17470.1747
2020.0689-0.04090.03190.031624.82316.84794.1046-0.29210.2334
2030.07570.02690.03020.030211.247414.98113.87050.19660.2211
2040.0804-4e-040.02280.02270.002911.23653.3521-0.00310.1666
2050.0869-0.0570.02960.029333.790715.74743.9683-0.34080.2015
2060.0910.01550.02730.0273.334413.67853.69840.10710.1857
2070.09420.08550.03560.0359153.280133.62165.79840.72590.2629
2080.0998-0.05060.03750.037632.856933.5265.7902-0.33610.2721
2090.10360.0470.03850.038836.9133.9025.82250.35620.2814
2100.10670.00750.03540.03561.034230.61525.53310.05960.2592
2110.1144-0.060.03770.037732.002730.74145.5445-0.33170.2658
2120.11810.03570.03750.037614.299329.37125.41950.22170.2622

\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.0661 & 0.0229 & 0.0229 & 0.0232 & 8.8728 & 0 & 0 & 0.1747 & 0.1747 \tabularnewline
202 & 0.0689 & -0.0409 & 0.0319 & 0.0316 & 24.823 & 16.8479 & 4.1046 & -0.2921 & 0.2334 \tabularnewline
203 & 0.0757 & 0.0269 & 0.0302 & 0.0302 & 11.2474 & 14.9811 & 3.8705 & 0.1966 & 0.2211 \tabularnewline
204 & 0.0804 & -4e-04 & 0.0228 & 0.0227 & 0.0029 & 11.2365 & 3.3521 & -0.0031 & 0.1666 \tabularnewline
205 & 0.0869 & -0.057 & 0.0296 & 0.0293 & 33.7907 & 15.7474 & 3.9683 & -0.3408 & 0.2015 \tabularnewline
206 & 0.091 & 0.0155 & 0.0273 & 0.027 & 3.3344 & 13.6785 & 3.6984 & 0.1071 & 0.1857 \tabularnewline
207 & 0.0942 & 0.0855 & 0.0356 & 0.0359 & 153.2801 & 33.6216 & 5.7984 & 0.7259 & 0.2629 \tabularnewline
208 & 0.0998 & -0.0506 & 0.0375 & 0.0376 & 32.8569 & 33.526 & 5.7902 & -0.3361 & 0.2721 \tabularnewline
209 & 0.1036 & 0.047 & 0.0385 & 0.0388 & 36.91 & 33.902 & 5.8225 & 0.3562 & 0.2814 \tabularnewline
210 & 0.1067 & 0.0075 & 0.0354 & 0.0356 & 1.0342 & 30.6152 & 5.5331 & 0.0596 & 0.2592 \tabularnewline
211 & 0.1144 & -0.06 & 0.0377 & 0.0377 & 32.0027 & 30.7414 & 5.5445 & -0.3317 & 0.2658 \tabularnewline
212 & 0.1181 & 0.0357 & 0.0375 & 0.0376 & 14.2993 & 29.3712 & 5.4195 & 0.2217 & 0.2622 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=308710&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.0661[/C][C]0.0229[/C][C]0.0229[/C][C]0.0232[/C][C]8.8728[/C][C]0[/C][C]0[/C][C]0.1747[/C][C]0.1747[/C][/ROW]
[ROW][C]202[/C][C]0.0689[/C][C]-0.0409[/C][C]0.0319[/C][C]0.0316[/C][C]24.823[/C][C]16.8479[/C][C]4.1046[/C][C]-0.2921[/C][C]0.2334[/C][/ROW]
[ROW][C]203[/C][C]0.0757[/C][C]0.0269[/C][C]0.0302[/C][C]0.0302[/C][C]11.2474[/C][C]14.9811[/C][C]3.8705[/C][C]0.1966[/C][C]0.2211[/C][/ROW]
[ROW][C]204[/C][C]0.0804[/C][C]-4e-04[/C][C]0.0228[/C][C]0.0227[/C][C]0.0029[/C][C]11.2365[/C][C]3.3521[/C][C]-0.0031[/C][C]0.1666[/C][/ROW]
[ROW][C]205[/C][C]0.0869[/C][C]-0.057[/C][C]0.0296[/C][C]0.0293[/C][C]33.7907[/C][C]15.7474[/C][C]3.9683[/C][C]-0.3408[/C][C]0.2015[/C][/ROW]
[ROW][C]206[/C][C]0.091[/C][C]0.0155[/C][C]0.0273[/C][C]0.027[/C][C]3.3344[/C][C]13.6785[/C][C]3.6984[/C][C]0.1071[/C][C]0.1857[/C][/ROW]
[ROW][C]207[/C][C]0.0942[/C][C]0.0855[/C][C]0.0356[/C][C]0.0359[/C][C]153.2801[/C][C]33.6216[/C][C]5.7984[/C][C]0.7259[/C][C]0.2629[/C][/ROW]
[ROW][C]208[/C][C]0.0998[/C][C]-0.0506[/C][C]0.0375[/C][C]0.0376[/C][C]32.8569[/C][C]33.526[/C][C]5.7902[/C][C]-0.3361[/C][C]0.2721[/C][/ROW]
[ROW][C]209[/C][C]0.1036[/C][C]0.047[/C][C]0.0385[/C][C]0.0388[/C][C]36.91[/C][C]33.902[/C][C]5.8225[/C][C]0.3562[/C][C]0.2814[/C][/ROW]
[ROW][C]210[/C][C]0.1067[/C][C]0.0075[/C][C]0.0354[/C][C]0.0356[/C][C]1.0342[/C][C]30.6152[/C][C]5.5331[/C][C]0.0596[/C][C]0.2592[/C][/ROW]
[ROW][C]211[/C][C]0.1144[/C][C]-0.06[/C][C]0.0377[/C][C]0.0377[/C][C]32.0027[/C][C]30.7414[/C][C]5.5445[/C][C]-0.3317[/C][C]0.2658[/C][/ROW]
[ROW][C]212[/C][C]0.1181[/C][C]0.0357[/C][C]0.0375[/C][C]0.0376[/C][C]14.2993[/C][C]29.3712[/C][C]5.4195[/C][C]0.2217[/C][C]0.2622[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=308710&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=308710&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.06610.02290.02290.02328.8728000.17470.1747
2020.0689-0.04090.03190.031624.82316.84794.1046-0.29210.2334
2030.07570.02690.03020.030211.247414.98113.87050.19660.2211
2040.0804-4e-040.02280.02270.002911.23653.3521-0.00310.1666
2050.0869-0.0570.02960.029333.790715.74743.9683-0.34080.2015
2060.0910.01550.02730.0273.334413.67853.69840.10710.1857
2070.09420.08550.03560.0359153.280133.62165.79840.72590.2629
2080.0998-0.05060.03750.037632.856933.5265.7902-0.33610.2721
2090.10360.0470.03850.038836.9133.9025.82250.35620.2814
2100.10670.00750.03540.03561.034230.61525.53310.05960.2592
2110.1144-0.060.03770.037732.002730.74145.5445-0.33170.2658
2120.11810.03570.03750.037614.299329.37125.41950.22170.2622



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