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

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact58
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2017-12-14 12:18:46] [d2d54f927b4b6a5dbf001a3c29aa1f74] [Current]
Feedback Forum

Post a new message
Dataseries X:
122.2
136.1
145.5
116.7
137.1
125.5
112.4
106.3
145.7
151.5
144.6
116.4
137.7
138.8
149.5
125
133.4
134.4
124.8
110.6
142.4
149.6
134.6
103.3
136.5
137.1
140.7
131.4
126.2
125.3
126.6
107.7
144.5
154.2
131.4
105.7
136.2
133.3
130
129.3
113.1
117.7
116.3
97.3
140.6
141.2
120.8
106.2
121.5
122.6
137.2
118.9
107.2
127.4
111.8
100
138.3
128
121.2
105.9
112.5
123.1
129
115.5
105.7
122.3
106.4
101.1
131.6
119.5
127
106.9
115.9
122.7
137.2
108.5
115.2
129.4
112.3
104.3
140
139.9
134.9
105.1
127
135.5
143.9
115.8
117.5
129.3
117.9
108.1
131.7
143.7
126.2
96.9
125.8
129.6
124.9
136.8
107.5
114.3
110.3
85.5
116.8
115.1
95.2
83.4
95.4
96.3
100.5
90.9
80.6
94.8
93.9
75.9
101.6
103.3
91.8
83.5
92
101.2
109.1
99.8
90.8
110.6
97.8
81.9
114.4
108.8
103.1
90.4
94.4
100.5
115.1
93.9
102.5
97.1
91.2
82.3
107.1
99.2
94.8
81.1
92.5
97.7
98.5
81.2
86.2
92
86.3
74.8
90
101.1
87.8
66.3
88.6
90
92
85.1
85.9
88.5
92.3
68
93.6
97.7
85.1
69.9
96.1
97
95.9
91.3
83.5
91.4
96.8
71
106.9
102.7
84.9
75.8
93.6
100.7
100.5
95.9
85.7
104.1
93.5
81.5
102.1
98.2
88.4
77.8
90.1
101
98.6
91.5
86.4
98.9
85.2
77.3
93
86.8
91.3
74.9
93.9
95
103.1
81.4
93.1
97.2
86.4
75.5




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309481&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])
18881.5-------
189102.1-------
19098.2-------
19188.4-------
19277.8-------
19390.1-------
194101-------
19598.6-------
19691.5-------
19786.4-------
19898.9-------
19985.2-------
20077.3-------
2019399.786987.826111.74780.1330.99990.35230.9999
20286.895.741683.515107.96820.07590.66980.34680.9984
20391.387.845174.9186100.77160.30020.5630.46650.9451
20474.973.320658.072788.56850.41960.01040.28240.3045
20593.988.232572.5587103.90630.23920.95230.40770.9142
2069597.019480.4336113.60520.40570.64380.3190.9901
207103.196.21578.4536113.97640.22370.55330.39620.9816
20881.488.292569.9725106.61240.23040.05660.36570.8802
20993.183.771164.6029102.93930.17010.59580.3940.7459
21097.294.354374.3654114.34310.39010.54890.32790.9528
21186.485.958765.3578106.55970.48330.14240.52880.795
21275.573.334751.990294.67920.42120.11510.35790.3579

\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 & 81.5 & - & - & - & - & - & - & - \tabularnewline
189 & 102.1 & - & - & - & - & - & - & - \tabularnewline
190 & 98.2 & - & - & - & - & - & - & - \tabularnewline
191 & 88.4 & - & - & - & - & - & - & - \tabularnewline
192 & 77.8 & - & - & - & - & - & - & - \tabularnewline
193 & 90.1 & - & - & - & - & - & - & - \tabularnewline
194 & 101 & - & - & - & - & - & - & - \tabularnewline
195 & 98.6 & - & - & - & - & - & - & - \tabularnewline
196 & 91.5 & - & - & - & - & - & - & - \tabularnewline
197 & 86.4 & - & - & - & - & - & - & - \tabularnewline
198 & 98.9 & - & - & - & - & - & - & - \tabularnewline
199 & 85.2 & - & - & - & - & - & - & - \tabularnewline
200 & 77.3 & - & - & - & - & - & - & - \tabularnewline
201 & 93 & 99.7869 & 87.826 & 111.7478 & 0.133 & 0.9999 & 0.3523 & 0.9999 \tabularnewline
202 & 86.8 & 95.7416 & 83.515 & 107.9682 & 0.0759 & 0.6698 & 0.3468 & 0.9984 \tabularnewline
203 & 91.3 & 87.8451 & 74.9186 & 100.7716 & 0.3002 & 0.563 & 0.4665 & 0.9451 \tabularnewline
204 & 74.9 & 73.3206 & 58.0727 & 88.5685 & 0.4196 & 0.0104 & 0.2824 & 0.3045 \tabularnewline
205 & 93.9 & 88.2325 & 72.5587 & 103.9063 & 0.2392 & 0.9523 & 0.4077 & 0.9142 \tabularnewline
206 & 95 & 97.0194 & 80.4336 & 113.6052 & 0.4057 & 0.6438 & 0.319 & 0.9901 \tabularnewline
207 & 103.1 & 96.215 & 78.4536 & 113.9764 & 0.2237 & 0.5533 & 0.3962 & 0.9816 \tabularnewline
208 & 81.4 & 88.2925 & 69.9725 & 106.6124 & 0.2304 & 0.0566 & 0.3657 & 0.8802 \tabularnewline
209 & 93.1 & 83.7711 & 64.6029 & 102.9393 & 0.1701 & 0.5958 & 0.394 & 0.7459 \tabularnewline
210 & 97.2 & 94.3543 & 74.3654 & 114.3431 & 0.3901 & 0.5489 & 0.3279 & 0.9528 \tabularnewline
211 & 86.4 & 85.9587 & 65.3578 & 106.5597 & 0.4833 & 0.1424 & 0.5288 & 0.795 \tabularnewline
212 & 75.5 & 73.3347 & 51.9902 & 94.6792 & 0.4212 & 0.1151 & 0.3579 & 0.3579 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309481&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]81.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]102.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]98.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]88.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]77.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]90.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]101[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]98.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]91.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]86.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]98.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]85.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]77.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]93[/C][C]99.7869[/C][C]87.826[/C][C]111.7478[/C][C]0.133[/C][C]0.9999[/C][C]0.3523[/C][C]0.9999[/C][/ROW]
[ROW][C]202[/C][C]86.8[/C][C]95.7416[/C][C]83.515[/C][C]107.9682[/C][C]0.0759[/C][C]0.6698[/C][C]0.3468[/C][C]0.9984[/C][/ROW]
[ROW][C]203[/C][C]91.3[/C][C]87.8451[/C][C]74.9186[/C][C]100.7716[/C][C]0.3002[/C][C]0.563[/C][C]0.4665[/C][C]0.9451[/C][/ROW]
[ROW][C]204[/C][C]74.9[/C][C]73.3206[/C][C]58.0727[/C][C]88.5685[/C][C]0.4196[/C][C]0.0104[/C][C]0.2824[/C][C]0.3045[/C][/ROW]
[ROW][C]205[/C][C]93.9[/C][C]88.2325[/C][C]72.5587[/C][C]103.9063[/C][C]0.2392[/C][C]0.9523[/C][C]0.4077[/C][C]0.9142[/C][/ROW]
[ROW][C]206[/C][C]95[/C][C]97.0194[/C][C]80.4336[/C][C]113.6052[/C][C]0.4057[/C][C]0.6438[/C][C]0.319[/C][C]0.9901[/C][/ROW]
[ROW][C]207[/C][C]103.1[/C][C]96.215[/C][C]78.4536[/C][C]113.9764[/C][C]0.2237[/C][C]0.5533[/C][C]0.3962[/C][C]0.9816[/C][/ROW]
[ROW][C]208[/C][C]81.4[/C][C]88.2925[/C][C]69.9725[/C][C]106.6124[/C][C]0.2304[/C][C]0.0566[/C][C]0.3657[/C][C]0.8802[/C][/ROW]
[ROW][C]209[/C][C]93.1[/C][C]83.7711[/C][C]64.6029[/C][C]102.9393[/C][C]0.1701[/C][C]0.5958[/C][C]0.394[/C][C]0.7459[/C][/ROW]
[ROW][C]210[/C][C]97.2[/C][C]94.3543[/C][C]74.3654[/C][C]114.3431[/C][C]0.3901[/C][C]0.5489[/C][C]0.3279[/C][C]0.9528[/C][/ROW]
[ROW][C]211[/C][C]86.4[/C][C]85.9587[/C][C]65.3578[/C][C]106.5597[/C][C]0.4833[/C][C]0.1424[/C][C]0.5288[/C][C]0.795[/C][/ROW]
[ROW][C]212[/C][C]75.5[/C][C]73.3347[/C][C]51.9902[/C][C]94.6792[/C][C]0.4212[/C][C]0.1151[/C][C]0.3579[/C][C]0.3579[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=309481&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309481&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])
18881.5-------
189102.1-------
19098.2-------
19188.4-------
19277.8-------
19390.1-------
194101-------
19598.6-------
19691.5-------
19786.4-------
19898.9-------
19985.2-------
20077.3-------
2019399.786987.826111.74780.1330.99990.35230.9999
20286.895.741683.515107.96820.07590.66980.34680.9984
20391.387.845174.9186100.77160.30020.5630.46650.9451
20474.973.320658.072788.56850.41960.01040.28240.3045
20593.988.232572.5587103.90630.23920.95230.40770.9142
2069597.019480.4336113.60520.40570.64380.3190.9901
207103.196.21578.4536113.97640.22370.55330.39620.9816
20881.488.292569.9725106.61240.23040.05660.36570.8802
20993.183.771164.6029102.93930.17010.59580.3940.7459
21097.294.354374.3654114.34310.39010.54890.32790.9528
21186.485.958765.3578106.55970.48330.14240.52880.795
21275.573.334751.990294.67920.42120.11510.35790.3579







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.0612-0.0730.0730.070446.062200-0.6520.652
2020.0652-0.1030.0880.084279.95263.00717.9377-0.8590.7555
2030.07510.03780.07130.06911.936345.98356.78110.33190.6143
2040.10610.02110.05870.05712.494635.11135.92550.15170.4987
2050.09060.06040.05910.058132.121134.51325.87480.54450.5078
2060.0872-0.02130.05280.05194.077929.44075.4259-0.1940.4555
2070.09420.06680.05480.054447.403732.00685.65750.66140.4849
2080.1059-0.08470.05850.057747.506133.94425.8262-0.66220.5071
2090.11670.10020.06310.06387.028739.84256.31210.89620.5503
2100.10810.02930.05970.05978.098336.66816.05540.27340.5226
2110.12230.00510.05480.05470.194733.35235.77510.04240.479
2120.14850.02870.05260.05264.688430.96375.56450.2080.4564

\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.0612 & -0.073 & 0.073 & 0.0704 & 46.0622 & 0 & 0 & -0.652 & 0.652 \tabularnewline
202 & 0.0652 & -0.103 & 0.088 & 0.0842 & 79.952 & 63.0071 & 7.9377 & -0.859 & 0.7555 \tabularnewline
203 & 0.0751 & 0.0378 & 0.0713 & 0.069 & 11.9363 & 45.9835 & 6.7811 & 0.3319 & 0.6143 \tabularnewline
204 & 0.1061 & 0.0211 & 0.0587 & 0.0571 & 2.4946 & 35.1113 & 5.9255 & 0.1517 & 0.4987 \tabularnewline
205 & 0.0906 & 0.0604 & 0.0591 & 0.0581 & 32.1211 & 34.5132 & 5.8748 & 0.5445 & 0.5078 \tabularnewline
206 & 0.0872 & -0.0213 & 0.0528 & 0.0519 & 4.0779 & 29.4407 & 5.4259 & -0.194 & 0.4555 \tabularnewline
207 & 0.0942 & 0.0668 & 0.0548 & 0.0544 & 47.4037 & 32.0068 & 5.6575 & 0.6614 & 0.4849 \tabularnewline
208 & 0.1059 & -0.0847 & 0.0585 & 0.0577 & 47.5061 & 33.9442 & 5.8262 & -0.6622 & 0.5071 \tabularnewline
209 & 0.1167 & 0.1002 & 0.0631 & 0.063 & 87.0287 & 39.8425 & 6.3121 & 0.8962 & 0.5503 \tabularnewline
210 & 0.1081 & 0.0293 & 0.0597 & 0.0597 & 8.0983 & 36.6681 & 6.0554 & 0.2734 & 0.5226 \tabularnewline
211 & 0.1223 & 0.0051 & 0.0548 & 0.0547 & 0.1947 & 33.3523 & 5.7751 & 0.0424 & 0.479 \tabularnewline
212 & 0.1485 & 0.0287 & 0.0526 & 0.0526 & 4.6884 & 30.9637 & 5.5645 & 0.208 & 0.4564 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309481&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.0612[/C][C]-0.073[/C][C]0.073[/C][C]0.0704[/C][C]46.0622[/C][C]0[/C][C]0[/C][C]-0.652[/C][C]0.652[/C][/ROW]
[ROW][C]202[/C][C]0.0652[/C][C]-0.103[/C][C]0.088[/C][C]0.0842[/C][C]79.952[/C][C]63.0071[/C][C]7.9377[/C][C]-0.859[/C][C]0.7555[/C][/ROW]
[ROW][C]203[/C][C]0.0751[/C][C]0.0378[/C][C]0.0713[/C][C]0.069[/C][C]11.9363[/C][C]45.9835[/C][C]6.7811[/C][C]0.3319[/C][C]0.6143[/C][/ROW]
[ROW][C]204[/C][C]0.1061[/C][C]0.0211[/C][C]0.0587[/C][C]0.0571[/C][C]2.4946[/C][C]35.1113[/C][C]5.9255[/C][C]0.1517[/C][C]0.4987[/C][/ROW]
[ROW][C]205[/C][C]0.0906[/C][C]0.0604[/C][C]0.0591[/C][C]0.0581[/C][C]32.1211[/C][C]34.5132[/C][C]5.8748[/C][C]0.5445[/C][C]0.5078[/C][/ROW]
[ROW][C]206[/C][C]0.0872[/C][C]-0.0213[/C][C]0.0528[/C][C]0.0519[/C][C]4.0779[/C][C]29.4407[/C][C]5.4259[/C][C]-0.194[/C][C]0.4555[/C][/ROW]
[ROW][C]207[/C][C]0.0942[/C][C]0.0668[/C][C]0.0548[/C][C]0.0544[/C][C]47.4037[/C][C]32.0068[/C][C]5.6575[/C][C]0.6614[/C][C]0.4849[/C][/ROW]
[ROW][C]208[/C][C]0.1059[/C][C]-0.0847[/C][C]0.0585[/C][C]0.0577[/C][C]47.5061[/C][C]33.9442[/C][C]5.8262[/C][C]-0.6622[/C][C]0.5071[/C][/ROW]
[ROW][C]209[/C][C]0.1167[/C][C]0.1002[/C][C]0.0631[/C][C]0.063[/C][C]87.0287[/C][C]39.8425[/C][C]6.3121[/C][C]0.8962[/C][C]0.5503[/C][/ROW]
[ROW][C]210[/C][C]0.1081[/C][C]0.0293[/C][C]0.0597[/C][C]0.0597[/C][C]8.0983[/C][C]36.6681[/C][C]6.0554[/C][C]0.2734[/C][C]0.5226[/C][/ROW]
[ROW][C]211[/C][C]0.1223[/C][C]0.0051[/C][C]0.0548[/C][C]0.0547[/C][C]0.1947[/C][C]33.3523[/C][C]5.7751[/C][C]0.0424[/C][C]0.479[/C][/ROW]
[ROW][C]212[/C][C]0.1485[/C][C]0.0287[/C][C]0.0526[/C][C]0.0526[/C][C]4.6884[/C][C]30.9637[/C][C]5.5645[/C][C]0.208[/C][C]0.4564[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=309481&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309481&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.0612-0.0730.0730.070446.062200-0.6520.652
2020.0652-0.1030.0880.084279.95263.00717.9377-0.8590.7555
2030.07510.03780.07130.06911.936345.98356.78110.33190.6143
2040.10610.02110.05870.05712.494635.11135.92550.15170.4987
2050.09060.06040.05910.058132.121134.51325.87480.54450.5078
2060.0872-0.02130.05280.05194.077929.44075.4259-0.1940.4555
2070.09420.06680.05480.054447.403732.00685.65750.66140.4849
2080.1059-0.08470.05850.057747.506133.94425.8262-0.66220.5071
2090.11670.10020.06310.06387.028739.84256.31210.89620.5503
2100.10810.02930.05970.05978.098336.66816.05540.27340.5226
2110.12230.00510.05480.05470.194733.35235.77510.04240.479
2120.14850.02870.05260.05264.688430.96375.56450.2080.4564



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