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 computationFri, 15 Dec 2017 23:28:42 +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/15/t1513376957sv7ytwthc08usck.htm/, Retrieved Wed, 15 May 2024 11:05:57 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=309825, Retrieved Wed, 15 May 2024 11:05:57 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact41
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2017-12-15 22:28:42] [8329b9b38c877eb1bcf8703660df8d0b] [Current]
Feedback Forum

Post a new message
Dataseries X:
35
36.1
40.1
35.4
37.4
39.9
32
32.6
44.9
36.3
43.7
39.8
42.6
48.6
49.1
46.9
45.7
56.1
38.3
40.6
46.5
51.4
47
44.6
51
51.1
54.9
52.1
48.7
50.5
47.5
44.6
50.3
54.3
50
44.8
57.6
47.2
59.1
53.9
45.7
54.5
52.8
52.9
66
63.7
54.4
74.4
50.1
62.5
77.2
65.6
58.2
72.6
68.6
63.1
76.9
70.6
71.4
90.6
71.9
60.9
72.9
69.2
64.8
70.2
63
62.2
82.8
77.6
71.2
70.6
71.1
74
87.9
68.3
68.1
75.7
62.7
66.2
81.3
84
80
80.8
67.3
61.9
77.2
65.6
68.7
82
81.4
70.9
71.2
71.9
71.6
76.4
75.6
73.2
80.2
74
69.5
82
82.8
64.5
92.6
82
78.4
103.8
66.6
73.3
92.3
73.6
74.9
83.6
83.3
70.9
82.5
81.7
83.1
92.4
86.9
110.1
112.1
81.5
84.3
113.5
100.3
93.2
100.4
94.4
110.2
113
94.6
111
160.1
110.1
102.8
112.4
105.4
130.4
117.2
103.9
92.2
95.8
93.1
93.9
147.6
89.6
83
99.2
118.3
110.9
124.4
115.8
112.7
111.9
108.6
102.5
141.9
137.7
121.3
142.8
143
121.1
130.2
146.3
143.7
139.3
109.3
141.3
152.7
152.2
151.8
180.5
129
126.1
187.9
170
168.4
157.1
133.9
103.1
166.3
148
131.4
136.3
135.8
151.8
172.2
154.4
158
146.2
128
124.7
160.3
148.1
139.7
194
188.7
172.2
184.8
160.5
139.7
219.8
143.9
166.2
182.7
152.7
146.8
177.1
186
189.2




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309825&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 time1 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])
188151.8-------
189172.2-------
190154.4-------
191158-------
192146.2-------
193128-------
194124.7-------
195160.3-------
196148.1-------
197139.7-------
198194-------
199188.7-------
200172.2-------
201184.8171.362126.3293242.51880.35560.49080.49080.4908
202160.5167.8312122.7049240.10180.42120.32270.64220.4528
203139.7169.1241122.2743245.53710.22520.58750.61230.4686
204219.8165.8247118.9989243.13760.08560.74610.69060.4358
205143.9159.7379114.0866235.70470.34140.06060.79360.3739
206166.2165.0234116.3043247.89970.48890.69130.82990.4326
207182.7170.3271118.4744260.48970.3940.53570.58630.4838
208152.7167.705115.8842258.8140.37340.37350.66340.4615
209146.8166.7984114.376260.16550.33730.61640.71530.4549
210177.1186.2567124.6567300.59580.43760.75060.44720.5952
211186182.5542121.5366296.84220.47640.53730.4580.5705
212189.2175.0657116.3558285.34920.40080.4230.52030.5203

\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 & 151.8 & - & - & - & - & - & - & - \tabularnewline
189 & 172.2 & - & - & - & - & - & - & - \tabularnewline
190 & 154.4 & - & - & - & - & - & - & - \tabularnewline
191 & 158 & - & - & - & - & - & - & - \tabularnewline
192 & 146.2 & - & - & - & - & - & - & - \tabularnewline
193 & 128 & - & - & - & - & - & - & - \tabularnewline
194 & 124.7 & - & - & - & - & - & - & - \tabularnewline
195 & 160.3 & - & - & - & - & - & - & - \tabularnewline
196 & 148.1 & - & - & - & - & - & - & - \tabularnewline
197 & 139.7 & - & - & - & - & - & - & - \tabularnewline
198 & 194 & - & - & - & - & - & - & - \tabularnewline
199 & 188.7 & - & - & - & - & - & - & - \tabularnewline
200 & 172.2 & - & - & - & - & - & - & - \tabularnewline
201 & 184.8 & 171.362 & 126.3293 & 242.5188 & 0.3556 & 0.4908 & 0.4908 & 0.4908 \tabularnewline
202 & 160.5 & 167.8312 & 122.7049 & 240.1018 & 0.4212 & 0.3227 & 0.6422 & 0.4528 \tabularnewline
203 & 139.7 & 169.1241 & 122.2743 & 245.5371 & 0.2252 & 0.5875 & 0.6123 & 0.4686 \tabularnewline
204 & 219.8 & 165.8247 & 118.9989 & 243.1376 & 0.0856 & 0.7461 & 0.6906 & 0.4358 \tabularnewline
205 & 143.9 & 159.7379 & 114.0866 & 235.7047 & 0.3414 & 0.0606 & 0.7936 & 0.3739 \tabularnewline
206 & 166.2 & 165.0234 & 116.3043 & 247.8997 & 0.4889 & 0.6913 & 0.8299 & 0.4326 \tabularnewline
207 & 182.7 & 170.3271 & 118.4744 & 260.4897 & 0.394 & 0.5357 & 0.5863 & 0.4838 \tabularnewline
208 & 152.7 & 167.705 & 115.8842 & 258.814 & 0.3734 & 0.3735 & 0.6634 & 0.4615 \tabularnewline
209 & 146.8 & 166.7984 & 114.376 & 260.1655 & 0.3373 & 0.6164 & 0.7153 & 0.4549 \tabularnewline
210 & 177.1 & 186.2567 & 124.6567 & 300.5958 & 0.4376 & 0.7506 & 0.4472 & 0.5952 \tabularnewline
211 & 186 & 182.5542 & 121.5366 & 296.8422 & 0.4764 & 0.5373 & 0.458 & 0.5705 \tabularnewline
212 & 189.2 & 175.0657 & 116.3558 & 285.3492 & 0.4008 & 0.423 & 0.5203 & 0.5203 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309825&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]151.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]172.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]154.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]158[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]146.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]128[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]124.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]160.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]148.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]139.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]194[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]188.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]172.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]184.8[/C][C]171.362[/C][C]126.3293[/C][C]242.5188[/C][C]0.3556[/C][C]0.4908[/C][C]0.4908[/C][C]0.4908[/C][/ROW]
[ROW][C]202[/C][C]160.5[/C][C]167.8312[/C][C]122.7049[/C][C]240.1018[/C][C]0.4212[/C][C]0.3227[/C][C]0.6422[/C][C]0.4528[/C][/ROW]
[ROW][C]203[/C][C]139.7[/C][C]169.1241[/C][C]122.2743[/C][C]245.5371[/C][C]0.2252[/C][C]0.5875[/C][C]0.6123[/C][C]0.4686[/C][/ROW]
[ROW][C]204[/C][C]219.8[/C][C]165.8247[/C][C]118.9989[/C][C]243.1376[/C][C]0.0856[/C][C]0.7461[/C][C]0.6906[/C][C]0.4358[/C][/ROW]
[ROW][C]205[/C][C]143.9[/C][C]159.7379[/C][C]114.0866[/C][C]235.7047[/C][C]0.3414[/C][C]0.0606[/C][C]0.7936[/C][C]0.3739[/C][/ROW]
[ROW][C]206[/C][C]166.2[/C][C]165.0234[/C][C]116.3043[/C][C]247.8997[/C][C]0.4889[/C][C]0.6913[/C][C]0.8299[/C][C]0.4326[/C][/ROW]
[ROW][C]207[/C][C]182.7[/C][C]170.3271[/C][C]118.4744[/C][C]260.4897[/C][C]0.394[/C][C]0.5357[/C][C]0.5863[/C][C]0.4838[/C][/ROW]
[ROW][C]208[/C][C]152.7[/C][C]167.705[/C][C]115.8842[/C][C]258.814[/C][C]0.3734[/C][C]0.3735[/C][C]0.6634[/C][C]0.4615[/C][/ROW]
[ROW][C]209[/C][C]146.8[/C][C]166.7984[/C][C]114.376[/C][C]260.1655[/C][C]0.3373[/C][C]0.6164[/C][C]0.7153[/C][C]0.4549[/C][/ROW]
[ROW][C]210[/C][C]177.1[/C][C]186.2567[/C][C]124.6567[/C][C]300.5958[/C][C]0.4376[/C][C]0.7506[/C][C]0.4472[/C][C]0.5952[/C][/ROW]
[ROW][C]211[/C][C]186[/C][C]182.5542[/C][C]121.5366[/C][C]296.8422[/C][C]0.4764[/C][C]0.5373[/C][C]0.458[/C][C]0.5705[/C][/ROW]
[ROW][C]212[/C][C]189.2[/C][C]175.0657[/C][C]116.3558[/C][C]285.3492[/C][C]0.4008[/C][C]0.423[/C][C]0.5203[/C][C]0.5203[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=309825&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309825&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])
188151.8-------
189172.2-------
190154.4-------
191158-------
192146.2-------
193128-------
194124.7-------
195160.3-------
196148.1-------
197139.7-------
198194-------
199188.7-------
200172.2-------
201184.8171.362126.3293242.51880.35560.49080.49080.4908
202160.5167.8312122.7049240.10180.42120.32270.64220.4528
203139.7169.1241122.2743245.53710.22520.58750.61230.4686
204219.8165.8247118.9989243.13760.08560.74610.69060.4358
205143.9159.7379114.0866235.70470.34140.06060.79360.3739
206166.2165.0234116.3043247.89970.48890.69130.82990.4326
207182.7170.3271118.4744260.48970.3940.53570.58630.4838
208152.7167.705115.8842258.8140.37340.37350.66340.4615
209146.8166.7984114.376260.16550.33730.61640.71530.4549
210177.1186.2567124.6567300.59580.43760.75060.44720.5952
211186182.5542121.5366296.84220.47640.53730.4580.5705
212189.2175.0657116.3558285.34920.40080.4230.52030.5203







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.21190.07270.07270.0755180.581000.46450.4645
2020.2197-0.04570.05920.060153.7471117.164110.8242-0.25340.359
2030.2305-0.21060.10970.1036865.7789366.702319.1495-1.01720.5784
2040.23790.24560.14360.14772913.33761003.361231.67591.86590.9003
2050.2426-0.11010.13690.139250.8382852.856629.2037-0.54750.8297
2060.25620.00710.11530.1171.3844710.944526.66350.04070.6982
2070.27010.06770.10850.1103153.0875631.250725.12470.42770.6596
2080.2772-0.09830.10720.1082225.1504580.488124.0933-0.51870.642
2090.2856-0.13620.11040.1104399.9342560.426623.6733-0.69130.6474
2100.3132-0.05170.10460.104483.8449512.768422.6444-0.31650.6144
2110.31940.01850.09670.096611.8738467.232521.61560.11910.5693
2120.32140.07470.09490.095199.7796444.944821.09370.48860.5626

\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.2119 & 0.0727 & 0.0727 & 0.0755 & 180.581 & 0 & 0 & 0.4645 & 0.4645 \tabularnewline
202 & 0.2197 & -0.0457 & 0.0592 & 0.0601 & 53.7471 & 117.1641 & 10.8242 & -0.2534 & 0.359 \tabularnewline
203 & 0.2305 & -0.2106 & 0.1097 & 0.1036 & 865.7789 & 366.7023 & 19.1495 & -1.0172 & 0.5784 \tabularnewline
204 & 0.2379 & 0.2456 & 0.1436 & 0.1477 & 2913.3376 & 1003.3612 & 31.6759 & 1.8659 & 0.9003 \tabularnewline
205 & 0.2426 & -0.1101 & 0.1369 & 0.139 & 250.8382 & 852.8566 & 29.2037 & -0.5475 & 0.8297 \tabularnewline
206 & 0.2562 & 0.0071 & 0.1153 & 0.117 & 1.3844 & 710.9445 & 26.6635 & 0.0407 & 0.6982 \tabularnewline
207 & 0.2701 & 0.0677 & 0.1085 & 0.1103 & 153.0875 & 631.2507 & 25.1247 & 0.4277 & 0.6596 \tabularnewline
208 & 0.2772 & -0.0983 & 0.1072 & 0.1082 & 225.1504 & 580.4881 & 24.0933 & -0.5187 & 0.642 \tabularnewline
209 & 0.2856 & -0.1362 & 0.1104 & 0.1104 & 399.9342 & 560.4266 & 23.6733 & -0.6913 & 0.6474 \tabularnewline
210 & 0.3132 & -0.0517 & 0.1046 & 0.1044 & 83.8449 & 512.7684 & 22.6444 & -0.3165 & 0.6144 \tabularnewline
211 & 0.3194 & 0.0185 & 0.0967 & 0.0966 & 11.8738 & 467.2325 & 21.6156 & 0.1191 & 0.5693 \tabularnewline
212 & 0.3214 & 0.0747 & 0.0949 & 0.095 & 199.7796 & 444.9448 & 21.0937 & 0.4886 & 0.5626 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309825&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.2119[/C][C]0.0727[/C][C]0.0727[/C][C]0.0755[/C][C]180.581[/C][C]0[/C][C]0[/C][C]0.4645[/C][C]0.4645[/C][/ROW]
[ROW][C]202[/C][C]0.2197[/C][C]-0.0457[/C][C]0.0592[/C][C]0.0601[/C][C]53.7471[/C][C]117.1641[/C][C]10.8242[/C][C]-0.2534[/C][C]0.359[/C][/ROW]
[ROW][C]203[/C][C]0.2305[/C][C]-0.2106[/C][C]0.1097[/C][C]0.1036[/C][C]865.7789[/C][C]366.7023[/C][C]19.1495[/C][C]-1.0172[/C][C]0.5784[/C][/ROW]
[ROW][C]204[/C][C]0.2379[/C][C]0.2456[/C][C]0.1436[/C][C]0.1477[/C][C]2913.3376[/C][C]1003.3612[/C][C]31.6759[/C][C]1.8659[/C][C]0.9003[/C][/ROW]
[ROW][C]205[/C][C]0.2426[/C][C]-0.1101[/C][C]0.1369[/C][C]0.139[/C][C]250.8382[/C][C]852.8566[/C][C]29.2037[/C][C]-0.5475[/C][C]0.8297[/C][/ROW]
[ROW][C]206[/C][C]0.2562[/C][C]0.0071[/C][C]0.1153[/C][C]0.117[/C][C]1.3844[/C][C]710.9445[/C][C]26.6635[/C][C]0.0407[/C][C]0.6982[/C][/ROW]
[ROW][C]207[/C][C]0.2701[/C][C]0.0677[/C][C]0.1085[/C][C]0.1103[/C][C]153.0875[/C][C]631.2507[/C][C]25.1247[/C][C]0.4277[/C][C]0.6596[/C][/ROW]
[ROW][C]208[/C][C]0.2772[/C][C]-0.0983[/C][C]0.1072[/C][C]0.1082[/C][C]225.1504[/C][C]580.4881[/C][C]24.0933[/C][C]-0.5187[/C][C]0.642[/C][/ROW]
[ROW][C]209[/C][C]0.2856[/C][C]-0.1362[/C][C]0.1104[/C][C]0.1104[/C][C]399.9342[/C][C]560.4266[/C][C]23.6733[/C][C]-0.6913[/C][C]0.6474[/C][/ROW]
[ROW][C]210[/C][C]0.3132[/C][C]-0.0517[/C][C]0.1046[/C][C]0.1044[/C][C]83.8449[/C][C]512.7684[/C][C]22.6444[/C][C]-0.3165[/C][C]0.6144[/C][/ROW]
[ROW][C]211[/C][C]0.3194[/C][C]0.0185[/C][C]0.0967[/C][C]0.0966[/C][C]11.8738[/C][C]467.2325[/C][C]21.6156[/C][C]0.1191[/C][C]0.5693[/C][/ROW]
[ROW][C]212[/C][C]0.3214[/C][C]0.0747[/C][C]0.0949[/C][C]0.095[/C][C]199.7796[/C][C]444.9448[/C][C]21.0937[/C][C]0.4886[/C][C]0.5626[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=309825&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309825&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.21190.07270.07270.0755180.581000.46450.4645
2020.2197-0.04570.05920.060153.7471117.164110.8242-0.25340.359
2030.2305-0.21060.10970.1036865.7789366.702319.1495-1.01720.5784
2040.23790.24560.14360.14772913.33761003.361231.67591.86590.9003
2050.2426-0.11010.13690.139250.8382852.856629.2037-0.54750.8297
2060.25620.00710.11530.1171.3844710.944526.66350.04070.6982
2070.27010.06770.10850.1103153.0875631.250725.12470.42770.6596
2080.2772-0.09830.10720.1082225.1504580.488124.0933-0.51870.642
2090.2856-0.13620.11040.1104399.9342560.426623.6733-0.69130.6474
2100.3132-0.05170.10460.104483.8449512.768422.6444-0.31650.6144
2110.31940.01850.09670.096611.8738467.232521.61560.11910.5693
2120.32140.07470.09490.095199.7796444.944821.09370.48860.5626



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