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, 21 Dec 2017 20:03:19 +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/21/t1513883029qd03vhszm9q6xg3.htm/, Retrieved Tue, 14 May 2024 15:13:10 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=310693, Retrieved Tue, 14 May 2024 15:13:10 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact51
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Arima forecasting] [2017-12-21 19:03:19] [fe26a21ad13d52067ed58ad527d4fbe1] [Current]
Feedback Forum

Post a new message
Dataseries X:
56.5
69.4
81
68
69.1
66.3
46.4
71.6
75.8
78.7
73.2
53.3
60.3
71.4
73.1
73.4
66.4
69.9
53.9
72.7
77.3
78.6
73.4
63.7
73.8
81.5
93.7
92.9
79.4
81.8
69.3
82.9
90.1
95
83.3
64.6
64.7
85.5
88.5
84.8
81.2
74.3
68.1
82.3
91.6
95.2
76.5
64
62.2
70
93.3
91.1
73.9
90.9
70.7
85.5
91.3
88.3
79.8
68.5
64.8
72.5
84.1
89.1
82.9
100.1
63.8
87.6
96.5
121.3
121.8
111.5
81.9
85.7
106.8
94.7
104.8
110.5
82
102.7
103.8
111.1
100.4
92.5
88.9
97.3
116.2
105.9
107.1
115.4
90.9
123.6
103.5
111
106.9
83.5
113.8
104.2
126.9
125.8
112.9
119.9
105.1
123.4
113.3
114.4
93
73.9
64.9
83.5
90.5
92.1
85.8
99.1
76.7
92.5
106.8
108.5
95.3
67.2
59.4
74.3
111.2
112.4
102.6
127.5
88.4
118.5
112.9
111.1
111
70.6
84.9
102.4
115.6
105.3
118
111.5
72.8
118.7
112.9
107.4
105.2
85.7
88.2
78.8
111.5
99.4
108.7
112.4
79.1
94.7
99.3
111.6
96.1
67.2
66.8
78.9
87.8
97
103.5
103
85
91.7
96.6
105.8
87.5
74
80.7
82.2
92.8
97.1
90.4
90.3
78.1
84.5
95.8
101.4
82.1
72
99
86.6
114.9
101.2
104
119.4
106.2
106.8
113.4
110.8
97.9
83.4
85
89
117.9
112.5
100.3
111.5
66.3
120.4
131.3
118.6
120
100.1
83
99.2
123.7
104
113.9
122.2
98.7
114.8




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310693&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])
188106.8-------
189113.4-------
190110.8-------
19197.9-------
19283.4-------
19385-------
19489-------
195117.9-------
196112.5-------
197100.3-------
198111.5-------
19966.3-------
200120.4-------
201131.3114.840894.2108139.98840.09980.33240.54470.3324
202118.6116.834693.5535145.90930.45260.16470.65790.405
203120103.577281.9861130.85430.1190.14020.65830.1134
204100.182.928865.0749105.6810.06957e-040.48386e-04
2058386.27667.1813110.79780.39670.13460.54060.0032
20699.294.180172.7988121.84110.3610.78590.64320.0316
207123.7114.027787.5168148.56940.29160.79990.4130.3588
208104110.031983.8691144.35630.36530.21760.4440.2769
209113.9106.567580.6837140.75480.33710.55850.64030.2139
210122.2113.888785.6622151.41590.33210.49980.54960.3669
21198.786.547164.6805115.8060.20780.00850.91250.0117
212114.8110.690582.2061149.04490.41680.730.30990.3099

\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 & 106.8 & - & - & - & - & - & - & - \tabularnewline
189 & 113.4 & - & - & - & - & - & - & - \tabularnewline
190 & 110.8 & - & - & - & - & - & - & - \tabularnewline
191 & 97.9 & - & - & - & - & - & - & - \tabularnewline
192 & 83.4 & - & - & - & - & - & - & - \tabularnewline
193 & 85 & - & - & - & - & - & - & - \tabularnewline
194 & 89 & - & - & - & - & - & - & - \tabularnewline
195 & 117.9 & - & - & - & - & - & - & - \tabularnewline
196 & 112.5 & - & - & - & - & - & - & - \tabularnewline
197 & 100.3 & - & - & - & - & - & - & - \tabularnewline
198 & 111.5 & - & - & - & - & - & - & - \tabularnewline
199 & 66.3 & - & - & - & - & - & - & - \tabularnewline
200 & 120.4 & - & - & - & - & - & - & - \tabularnewline
201 & 131.3 & 114.8408 & 94.2108 & 139.9884 & 0.0998 & 0.3324 & 0.5447 & 0.3324 \tabularnewline
202 & 118.6 & 116.8346 & 93.5535 & 145.9093 & 0.4526 & 0.1647 & 0.6579 & 0.405 \tabularnewline
203 & 120 & 103.5772 & 81.9861 & 130.8543 & 0.119 & 0.1402 & 0.6583 & 0.1134 \tabularnewline
204 & 100.1 & 82.9288 & 65.0749 & 105.681 & 0.0695 & 7e-04 & 0.4838 & 6e-04 \tabularnewline
205 & 83 & 86.276 & 67.1813 & 110.7978 & 0.3967 & 0.1346 & 0.5406 & 0.0032 \tabularnewline
206 & 99.2 & 94.1801 & 72.7988 & 121.8411 & 0.361 & 0.7859 & 0.6432 & 0.0316 \tabularnewline
207 & 123.7 & 114.0277 & 87.5168 & 148.5694 & 0.2916 & 0.7999 & 0.413 & 0.3588 \tabularnewline
208 & 104 & 110.0319 & 83.8691 & 144.3563 & 0.3653 & 0.2176 & 0.444 & 0.2769 \tabularnewline
209 & 113.9 & 106.5675 & 80.6837 & 140.7548 & 0.3371 & 0.5585 & 0.6403 & 0.2139 \tabularnewline
210 & 122.2 & 113.8887 & 85.6622 & 151.4159 & 0.3321 & 0.4998 & 0.5496 & 0.3669 \tabularnewline
211 & 98.7 & 86.5471 & 64.6805 & 115.806 & 0.2078 & 0.0085 & 0.9125 & 0.0117 \tabularnewline
212 & 114.8 & 110.6905 & 82.2061 & 149.0449 & 0.4168 & 0.73 & 0.3099 & 0.3099 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310693&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]106.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]113.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]110.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]97.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]83.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]85[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]89[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]117.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]112.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]100.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]111.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]66.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]120.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]131.3[/C][C]114.8408[/C][C]94.2108[/C][C]139.9884[/C][C]0.0998[/C][C]0.3324[/C][C]0.5447[/C][C]0.3324[/C][/ROW]
[ROW][C]202[/C][C]118.6[/C][C]116.8346[/C][C]93.5535[/C][C]145.9093[/C][C]0.4526[/C][C]0.1647[/C][C]0.6579[/C][C]0.405[/C][/ROW]
[ROW][C]203[/C][C]120[/C][C]103.5772[/C][C]81.9861[/C][C]130.8543[/C][C]0.119[/C][C]0.1402[/C][C]0.6583[/C][C]0.1134[/C][/ROW]
[ROW][C]204[/C][C]100.1[/C][C]82.9288[/C][C]65.0749[/C][C]105.681[/C][C]0.0695[/C][C]7e-04[/C][C]0.4838[/C][C]6e-04[/C][/ROW]
[ROW][C]205[/C][C]83[/C][C]86.276[/C][C]67.1813[/C][C]110.7978[/C][C]0.3967[/C][C]0.1346[/C][C]0.5406[/C][C]0.0032[/C][/ROW]
[ROW][C]206[/C][C]99.2[/C][C]94.1801[/C][C]72.7988[/C][C]121.8411[/C][C]0.361[/C][C]0.7859[/C][C]0.6432[/C][C]0.0316[/C][/ROW]
[ROW][C]207[/C][C]123.7[/C][C]114.0277[/C][C]87.5168[/C][C]148.5694[/C][C]0.2916[/C][C]0.7999[/C][C]0.413[/C][C]0.3588[/C][/ROW]
[ROW][C]208[/C][C]104[/C][C]110.0319[/C][C]83.8691[/C][C]144.3563[/C][C]0.3653[/C][C]0.2176[/C][C]0.444[/C][C]0.2769[/C][/ROW]
[ROW][C]209[/C][C]113.9[/C][C]106.5675[/C][C]80.6837[/C][C]140.7548[/C][C]0.3371[/C][C]0.5585[/C][C]0.6403[/C][C]0.2139[/C][/ROW]
[ROW][C]210[/C][C]122.2[/C][C]113.8887[/C][C]85.6622[/C][C]151.4159[/C][C]0.3321[/C][C]0.4998[/C][C]0.5496[/C][C]0.3669[/C][/ROW]
[ROW][C]211[/C][C]98.7[/C][C]86.5471[/C][C]64.6805[/C][C]115.806[/C][C]0.2078[/C][C]0.0085[/C][C]0.9125[/C][C]0.0117[/C][/ROW]
[ROW][C]212[/C][C]114.8[/C][C]110.6905[/C][C]82.2061[/C][C]149.0449[/C][C]0.4168[/C][C]0.73[/C][C]0.3099[/C][C]0.3099[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310693&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310693&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])
188106.8-------
189113.4-------
190110.8-------
19197.9-------
19283.4-------
19385-------
19489-------
195117.9-------
196112.5-------
197100.3-------
198111.5-------
19966.3-------
200120.4-------
201131.3114.840894.2108139.98840.09980.33240.54470.3324
202118.6116.834693.5535145.90930.45260.16470.65790.405
203120103.577281.9861130.85430.1190.14020.65830.1134
204100.182.928865.0749105.6810.06957e-040.48386e-04
2058386.27667.1813110.79780.39670.13460.54060.0032
20699.294.180172.7988121.84110.3610.78590.64320.0316
207123.7114.027787.5168148.56940.29160.79990.4130.3588
208104110.031983.8691144.35630.36530.21760.4440.2769
209113.9106.567580.6837140.75480.33710.55850.64030.2139
210122.2113.888785.6622151.41590.33210.49980.54960.3669
21198.786.547164.6805115.8060.20780.00850.91250.0117
212114.8110.690582.2061149.04490.41680.730.30990.3099







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.11170.12540.12540.1337270.9038001.06941.0694
2020.1270.01490.07010.07443.1166137.010211.70510.11470.5921
2030.13440.13690.09240.0985269.7083181.242913.46261.0670.7504
2040.140.17150.11220.1208294.8513209.64514.47911.11570.8417
2050.145-0.03950.09760.104410.7321169.862413.0331-0.21290.7159
2060.14980.05060.08980.095725.1995145.751912.07280.32620.651
2070.15460.07820.08810.093693.5531138.294911.75990.62840.6478
2080.1592-0.0580.08440.08936.3843125.556111.2052-0.39190.6158
2090.16370.06440.08210.086553.7662117.579510.84340.47640.6003
2100.16810.0680.08070.084969.0785112.729410.61740.540.5943
2110.17250.12310.08460.0891147.6941115.90810.76610.78960.612
2120.17680.03580.08050.084716.8876107.656310.37580.2670.5833

\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.1117 & 0.1254 & 0.1254 & 0.1337 & 270.9038 & 0 & 0 & 1.0694 & 1.0694 \tabularnewline
202 & 0.127 & 0.0149 & 0.0701 & 0.0744 & 3.1166 & 137.0102 & 11.7051 & 0.1147 & 0.5921 \tabularnewline
203 & 0.1344 & 0.1369 & 0.0924 & 0.0985 & 269.7083 & 181.2429 & 13.4626 & 1.067 & 0.7504 \tabularnewline
204 & 0.14 & 0.1715 & 0.1122 & 0.1208 & 294.8513 & 209.645 & 14.4791 & 1.1157 & 0.8417 \tabularnewline
205 & 0.145 & -0.0395 & 0.0976 & 0.1044 & 10.7321 & 169.8624 & 13.0331 & -0.2129 & 0.7159 \tabularnewline
206 & 0.1498 & 0.0506 & 0.0898 & 0.0957 & 25.1995 & 145.7519 & 12.0728 & 0.3262 & 0.651 \tabularnewline
207 & 0.1546 & 0.0782 & 0.0881 & 0.0936 & 93.5531 & 138.2949 & 11.7599 & 0.6284 & 0.6478 \tabularnewline
208 & 0.1592 & -0.058 & 0.0844 & 0.089 & 36.3843 & 125.5561 & 11.2052 & -0.3919 & 0.6158 \tabularnewline
209 & 0.1637 & 0.0644 & 0.0821 & 0.0865 & 53.7662 & 117.5795 & 10.8434 & 0.4764 & 0.6003 \tabularnewline
210 & 0.1681 & 0.068 & 0.0807 & 0.0849 & 69.0785 & 112.7294 & 10.6174 & 0.54 & 0.5943 \tabularnewline
211 & 0.1725 & 0.1231 & 0.0846 & 0.0891 & 147.6941 & 115.908 & 10.7661 & 0.7896 & 0.612 \tabularnewline
212 & 0.1768 & 0.0358 & 0.0805 & 0.0847 & 16.8876 & 107.6563 & 10.3758 & 0.267 & 0.5833 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310693&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.1117[/C][C]0.1254[/C][C]0.1254[/C][C]0.1337[/C][C]270.9038[/C][C]0[/C][C]0[/C][C]1.0694[/C][C]1.0694[/C][/ROW]
[ROW][C]202[/C][C]0.127[/C][C]0.0149[/C][C]0.0701[/C][C]0.0744[/C][C]3.1166[/C][C]137.0102[/C][C]11.7051[/C][C]0.1147[/C][C]0.5921[/C][/ROW]
[ROW][C]203[/C][C]0.1344[/C][C]0.1369[/C][C]0.0924[/C][C]0.0985[/C][C]269.7083[/C][C]181.2429[/C][C]13.4626[/C][C]1.067[/C][C]0.7504[/C][/ROW]
[ROW][C]204[/C][C]0.14[/C][C]0.1715[/C][C]0.1122[/C][C]0.1208[/C][C]294.8513[/C][C]209.645[/C][C]14.4791[/C][C]1.1157[/C][C]0.8417[/C][/ROW]
[ROW][C]205[/C][C]0.145[/C][C]-0.0395[/C][C]0.0976[/C][C]0.1044[/C][C]10.7321[/C][C]169.8624[/C][C]13.0331[/C][C]-0.2129[/C][C]0.7159[/C][/ROW]
[ROW][C]206[/C][C]0.1498[/C][C]0.0506[/C][C]0.0898[/C][C]0.0957[/C][C]25.1995[/C][C]145.7519[/C][C]12.0728[/C][C]0.3262[/C][C]0.651[/C][/ROW]
[ROW][C]207[/C][C]0.1546[/C][C]0.0782[/C][C]0.0881[/C][C]0.0936[/C][C]93.5531[/C][C]138.2949[/C][C]11.7599[/C][C]0.6284[/C][C]0.6478[/C][/ROW]
[ROW][C]208[/C][C]0.1592[/C][C]-0.058[/C][C]0.0844[/C][C]0.089[/C][C]36.3843[/C][C]125.5561[/C][C]11.2052[/C][C]-0.3919[/C][C]0.6158[/C][/ROW]
[ROW][C]209[/C][C]0.1637[/C][C]0.0644[/C][C]0.0821[/C][C]0.0865[/C][C]53.7662[/C][C]117.5795[/C][C]10.8434[/C][C]0.4764[/C][C]0.6003[/C][/ROW]
[ROW][C]210[/C][C]0.1681[/C][C]0.068[/C][C]0.0807[/C][C]0.0849[/C][C]69.0785[/C][C]112.7294[/C][C]10.6174[/C][C]0.54[/C][C]0.5943[/C][/ROW]
[ROW][C]211[/C][C]0.1725[/C][C]0.1231[/C][C]0.0846[/C][C]0.0891[/C][C]147.6941[/C][C]115.908[/C][C]10.7661[/C][C]0.7896[/C][C]0.612[/C][/ROW]
[ROW][C]212[/C][C]0.1768[/C][C]0.0358[/C][C]0.0805[/C][C]0.0847[/C][C]16.8876[/C][C]107.6563[/C][C]10.3758[/C][C]0.267[/C][C]0.5833[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310693&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310693&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.11170.12540.12540.1337270.9038001.06941.0694
2020.1270.01490.07010.07443.1166137.010211.70510.11470.5921
2030.13440.13690.09240.0985269.7083181.242913.46261.0670.7504
2040.140.17150.11220.1208294.8513209.64514.47911.11570.8417
2050.145-0.03950.09760.104410.7321169.862413.0331-0.21290.7159
2060.14980.05060.08980.095725.1995145.751912.07280.32620.651
2070.15460.07820.08810.093693.5531138.294911.75990.62840.6478
2080.1592-0.0580.08440.08936.3843125.556111.2052-0.39190.6158
2090.16370.06440.08210.086553.7662117.579510.84340.47640.6003
2100.16810.0680.08070.084969.0785112.729410.61740.540.5943
2110.17250.12310.08460.0891147.6941115.90810.76610.78960.612
2120.17680.03580.08050.084716.8876107.656310.37580.2670.5833



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