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 computationMon, 18 Dec 2017 18:38:00 +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/18/t1513624380ahhze93m8ka5lx0.htm/, Retrieved Tue, 14 May 2024 20:23:14 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=310226, Retrieved Tue, 14 May 2024 20:23:14 +0000
QR Codes:

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

Post a new message
Dataseries X:
112.7
122
134.7
109.8
130.8
118.7
104.4
87.8
134.2
143.9
140.4
111
126.3
124.4
136.1
118.4
127.4
127.9
115
90.2
131
143.3
131.5
98.5
124.9
122.4
128.8
125.9
120.2
120
116
89.2
135.9
148.7
128.1
100.9
125.5
119.8
120.7
125
109
114.2
105.6
80.1
131.1
136.6
119.7
102.4
114.5
112.9
131.8
118.7
107.1
127
104.6
85.9
134
127.6
121.5
104.5
107.3
111.9
120.7
116.9
106.1
122.3
97.8
82.7
128.2
119
127.4
106
108.7
113.5
131.4
111.3
119
130.7
104.5
88.9
135.4
140.6
138.8
107.4
120.8
124.1
139.2
119.9
121
133.7
115.2
96.7
131
147.6
132.9
97.4
123.6
124.9
118.6
127.6
110.2
115.4
106.6
75.5
116.7
118
98.7
81.5
87
86.8
96.8
92.7
82.1
94.1
89.7
67.5
102
103.2
95.6
83
87.2
94
107.7
103.3
94.8
112.7
96.8
75.9
116.7
111.4
108.6
90.9
92.6
95.7
116.7
95.4
105.1
99.7
89.8
74
108
102.1
100.2
83.2
87.9
93.3
98.5
84.5
89.3
94.2
83.5
67.5
89.4
102.4
92
65.9
85.3
87
91.8
88.5
89.1
89.8
88.9
64
93.2
100.1
89.3
68.1
94.3
93.3
98.1
96.8
87.8
95.6
95.7
64.4
108.1
109.6
90.9
75.6
93.5
98.1
104.5
102.7
89.6
108.8
95.4
70.1
104.6
105.5
96.8
79.4
92.3
96.8
103
99.5
91
103.4
82
70.1
98.1
95.7
98
77.3
89.8
91.6
106.5
87.5
99.5
104.4
84.5
68.3




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310226&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])
18870.1-------
189104.6-------
190105.5-------
19196.8000000000001-------
19279.4-------
19392.3-------
19496.8000000000001-------
195103-------
19699.5-------
19791-------
198103.4-------
19982-------
20070.1-------
20198.1100.91591.2845111.79080.30610.25331
20295.799.438289.8593110.26890.24940.59570.13631
2039895.816886.202106.74770.34770.50840.431
20477.376.02367.600385.7370.398300.24780.884
20589.887.64277.422399.5240.36090.9560.22110.9981
20691.692.322980.9276105.69880.45780.64420.25590.9994
207106.598.155385.1613113.60250.14480.79720.26940.9998
20887.592.958980.4223107.91520.23720.0380.19570.9986
20999.588.208875.9737102.88620.06580.53770.35470.9922
210104.496.7282.5694113.88290.19020.37540.22280.9988
21184.583.25471.074798.02560.43430.00250.56610.9595
21268.367.014657.303578.76890.41510.00180.30350.3035

\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 & 70.1 & - & - & - & - & - & - & - \tabularnewline
189 & 104.6 & - & - & - & - & - & - & - \tabularnewline
190 & 105.5 & - & - & - & - & - & - & - \tabularnewline
191 & 96.8000000000001 & - & - & - & - & - & - & - \tabularnewline
192 & 79.4 & - & - & - & - & - & - & - \tabularnewline
193 & 92.3 & - & - & - & - & - & - & - \tabularnewline
194 & 96.8000000000001 & - & - & - & - & - & - & - \tabularnewline
195 & 103 & - & - & - & - & - & - & - \tabularnewline
196 & 99.5 & - & - & - & - & - & - & - \tabularnewline
197 & 91 & - & - & - & - & - & - & - \tabularnewline
198 & 103.4 & - & - & - & - & - & - & - \tabularnewline
199 & 82 & - & - & - & - & - & - & - \tabularnewline
200 & 70.1 & - & - & - & - & - & - & - \tabularnewline
201 & 98.1 & 100.915 & 91.2845 & 111.7908 & 0.306 & 1 & 0.2533 & 1 \tabularnewline
202 & 95.7 & 99.4382 & 89.8593 & 110.2689 & 0.2494 & 0.5957 & 0.1363 & 1 \tabularnewline
203 & 98 & 95.8168 & 86.202 & 106.7477 & 0.3477 & 0.5084 & 0.43 & 1 \tabularnewline
204 & 77.3 & 76.023 & 67.6003 & 85.737 & 0.3983 & 0 & 0.2478 & 0.884 \tabularnewline
205 & 89.8 & 87.642 & 77.4223 & 99.524 & 0.3609 & 0.956 & 0.2211 & 0.9981 \tabularnewline
206 & 91.6 & 92.3229 & 80.9276 & 105.6988 & 0.4578 & 0.6442 & 0.2559 & 0.9994 \tabularnewline
207 & 106.5 & 98.1553 & 85.1613 & 113.6025 & 0.1448 & 0.7972 & 0.2694 & 0.9998 \tabularnewline
208 & 87.5 & 92.9589 & 80.4223 & 107.9152 & 0.2372 & 0.038 & 0.1957 & 0.9986 \tabularnewline
209 & 99.5 & 88.2088 & 75.9737 & 102.8862 & 0.0658 & 0.5377 & 0.3547 & 0.9922 \tabularnewline
210 & 104.4 & 96.72 & 82.5694 & 113.8829 & 0.1902 & 0.3754 & 0.2228 & 0.9988 \tabularnewline
211 & 84.5 & 83.254 & 71.0747 & 98.0256 & 0.4343 & 0.0025 & 0.5661 & 0.9595 \tabularnewline
212 & 68.3 & 67.0146 & 57.3035 & 78.7689 & 0.4151 & 0.0018 & 0.3035 & 0.3035 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310226&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]70.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]104.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]105.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]96.8000000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]79.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]92.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]96.8000000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]103[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]99.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]91[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]103.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]82[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]70.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]98.1[/C][C]100.915[/C][C]91.2845[/C][C]111.7908[/C][C]0.306[/C][C]1[/C][C]0.2533[/C][C]1[/C][/ROW]
[ROW][C]202[/C][C]95.7[/C][C]99.4382[/C][C]89.8593[/C][C]110.2689[/C][C]0.2494[/C][C]0.5957[/C][C]0.1363[/C][C]1[/C][/ROW]
[ROW][C]203[/C][C]98[/C][C]95.8168[/C][C]86.202[/C][C]106.7477[/C][C]0.3477[/C][C]0.5084[/C][C]0.43[/C][C]1[/C][/ROW]
[ROW][C]204[/C][C]77.3[/C][C]76.023[/C][C]67.6003[/C][C]85.737[/C][C]0.3983[/C][C]0[/C][C]0.2478[/C][C]0.884[/C][/ROW]
[ROW][C]205[/C][C]89.8[/C][C]87.642[/C][C]77.4223[/C][C]99.524[/C][C]0.3609[/C][C]0.956[/C][C]0.2211[/C][C]0.9981[/C][/ROW]
[ROW][C]206[/C][C]91.6[/C][C]92.3229[/C][C]80.9276[/C][C]105.6988[/C][C]0.4578[/C][C]0.6442[/C][C]0.2559[/C][C]0.9994[/C][/ROW]
[ROW][C]207[/C][C]106.5[/C][C]98.1553[/C][C]85.1613[/C][C]113.6025[/C][C]0.1448[/C][C]0.7972[/C][C]0.2694[/C][C]0.9998[/C][/ROW]
[ROW][C]208[/C][C]87.5[/C][C]92.9589[/C][C]80.4223[/C][C]107.9152[/C][C]0.2372[/C][C]0.038[/C][C]0.1957[/C][C]0.9986[/C][/ROW]
[ROW][C]209[/C][C]99.5[/C][C]88.2088[/C][C]75.9737[/C][C]102.8862[/C][C]0.0658[/C][C]0.5377[/C][C]0.3547[/C][C]0.9922[/C][/ROW]
[ROW][C]210[/C][C]104.4[/C][C]96.72[/C][C]82.5694[/C][C]113.8829[/C][C]0.1902[/C][C]0.3754[/C][C]0.2228[/C][C]0.9988[/C][/ROW]
[ROW][C]211[/C][C]84.5[/C][C]83.254[/C][C]71.0747[/C][C]98.0256[/C][C]0.4343[/C][C]0.0025[/C][C]0.5661[/C][C]0.9595[/C][/ROW]
[ROW][C]212[/C][C]68.3[/C][C]67.0146[/C][C]57.3035[/C][C]78.7689[/C][C]0.4151[/C][C]0.0018[/C][C]0.3035[/C][C]0.3035[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310226&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310226&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])
18870.1-------
189104.6-------
190105.5-------
19196.8000000000001-------
19279.4-------
19392.3-------
19496.8000000000001-------
195103-------
19699.5-------
19791-------
198103.4-------
19982-------
20070.1-------
20198.1100.91591.2845111.79080.30610.25331
20295.799.438289.8593110.26890.24940.59570.13631
2039895.816886.202106.74770.34770.50840.431
20477.376.02367.600385.7370.398300.24780.884
20589.887.64277.422399.5240.36090.9560.22110.9981
20691.692.322980.9276105.69880.45780.64420.25590.9994
207106.598.155385.1613113.60250.14480.79720.26940.9998
20887.592.958980.4223107.91520.23720.0380.19570.9986
20999.588.208875.9737102.88620.06580.53770.35470.9922
210104.496.7282.5694113.88290.19020.37540.22280.9988
21184.583.25471.074798.02560.43430.00250.56610.9595
21268.367.014657.303578.76890.41510.00180.30350.3035







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.055-0.02870.02870.02837.92400-0.24460.2446
2020.0556-0.03910.03390.033313.97410.9493.3089-0.32480.2847
2030.05820.02230.030.02974.76628.88812.98130.18970.253
2040.06520.01650.02660.02641.63067.07372.65960.1110.2175
2050.06920.0240.02610.0264.65696.59032.56720.18750.2115
2060.0739-0.00790.02310.0230.52255.5792.362-0.06280.1867
2070.08030.07840.0310.031469.634814.72993.8380.72510.2636
2080.0821-0.06240.03490.03529.799316.61354.076-0.47430.29
2090.08490.11350.04360.0445127.491628.93335.3790.98110.3668
2100.09050.07360.04660.047758.981731.93825.65140.66730.3968
2110.09050.01470.04370.04471.552529.17585.40150.10830.3706
2120.08950.01880.04170.04251.652326.88225.18480.11170.349

\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.055 & -0.0287 & 0.0287 & 0.0283 & 7.924 & 0 & 0 & -0.2446 & 0.2446 \tabularnewline
202 & 0.0556 & -0.0391 & 0.0339 & 0.0333 & 13.974 & 10.949 & 3.3089 & -0.3248 & 0.2847 \tabularnewline
203 & 0.0582 & 0.0223 & 0.03 & 0.0297 & 4.7662 & 8.8881 & 2.9813 & 0.1897 & 0.253 \tabularnewline
204 & 0.0652 & 0.0165 & 0.0266 & 0.0264 & 1.6306 & 7.0737 & 2.6596 & 0.111 & 0.2175 \tabularnewline
205 & 0.0692 & 0.024 & 0.0261 & 0.026 & 4.6569 & 6.5903 & 2.5672 & 0.1875 & 0.2115 \tabularnewline
206 & 0.0739 & -0.0079 & 0.0231 & 0.023 & 0.5225 & 5.579 & 2.362 & -0.0628 & 0.1867 \tabularnewline
207 & 0.0803 & 0.0784 & 0.031 & 0.0314 & 69.6348 & 14.7299 & 3.838 & 0.7251 & 0.2636 \tabularnewline
208 & 0.0821 & -0.0624 & 0.0349 & 0.035 & 29.7993 & 16.6135 & 4.076 & -0.4743 & 0.29 \tabularnewline
209 & 0.0849 & 0.1135 & 0.0436 & 0.0445 & 127.4916 & 28.9333 & 5.379 & 0.9811 & 0.3668 \tabularnewline
210 & 0.0905 & 0.0736 & 0.0466 & 0.0477 & 58.9817 & 31.9382 & 5.6514 & 0.6673 & 0.3968 \tabularnewline
211 & 0.0905 & 0.0147 & 0.0437 & 0.0447 & 1.5525 & 29.1758 & 5.4015 & 0.1083 & 0.3706 \tabularnewline
212 & 0.0895 & 0.0188 & 0.0417 & 0.0425 & 1.6523 & 26.8822 & 5.1848 & 0.1117 & 0.349 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310226&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.055[/C][C]-0.0287[/C][C]0.0287[/C][C]0.0283[/C][C]7.924[/C][C]0[/C][C]0[/C][C]-0.2446[/C][C]0.2446[/C][/ROW]
[ROW][C]202[/C][C]0.0556[/C][C]-0.0391[/C][C]0.0339[/C][C]0.0333[/C][C]13.974[/C][C]10.949[/C][C]3.3089[/C][C]-0.3248[/C][C]0.2847[/C][/ROW]
[ROW][C]203[/C][C]0.0582[/C][C]0.0223[/C][C]0.03[/C][C]0.0297[/C][C]4.7662[/C][C]8.8881[/C][C]2.9813[/C][C]0.1897[/C][C]0.253[/C][/ROW]
[ROW][C]204[/C][C]0.0652[/C][C]0.0165[/C][C]0.0266[/C][C]0.0264[/C][C]1.6306[/C][C]7.0737[/C][C]2.6596[/C][C]0.111[/C][C]0.2175[/C][/ROW]
[ROW][C]205[/C][C]0.0692[/C][C]0.024[/C][C]0.0261[/C][C]0.026[/C][C]4.6569[/C][C]6.5903[/C][C]2.5672[/C][C]0.1875[/C][C]0.2115[/C][/ROW]
[ROW][C]206[/C][C]0.0739[/C][C]-0.0079[/C][C]0.0231[/C][C]0.023[/C][C]0.5225[/C][C]5.579[/C][C]2.362[/C][C]-0.0628[/C][C]0.1867[/C][/ROW]
[ROW][C]207[/C][C]0.0803[/C][C]0.0784[/C][C]0.031[/C][C]0.0314[/C][C]69.6348[/C][C]14.7299[/C][C]3.838[/C][C]0.7251[/C][C]0.2636[/C][/ROW]
[ROW][C]208[/C][C]0.0821[/C][C]-0.0624[/C][C]0.0349[/C][C]0.035[/C][C]29.7993[/C][C]16.6135[/C][C]4.076[/C][C]-0.4743[/C][C]0.29[/C][/ROW]
[ROW][C]209[/C][C]0.0849[/C][C]0.1135[/C][C]0.0436[/C][C]0.0445[/C][C]127.4916[/C][C]28.9333[/C][C]5.379[/C][C]0.9811[/C][C]0.3668[/C][/ROW]
[ROW][C]210[/C][C]0.0905[/C][C]0.0736[/C][C]0.0466[/C][C]0.0477[/C][C]58.9817[/C][C]31.9382[/C][C]5.6514[/C][C]0.6673[/C][C]0.3968[/C][/ROW]
[ROW][C]211[/C][C]0.0905[/C][C]0.0147[/C][C]0.0437[/C][C]0.0447[/C][C]1.5525[/C][C]29.1758[/C][C]5.4015[/C][C]0.1083[/C][C]0.3706[/C][/ROW]
[ROW][C]212[/C][C]0.0895[/C][C]0.0188[/C][C]0.0417[/C][C]0.0425[/C][C]1.6523[/C][C]26.8822[/C][C]5.1848[/C][C]0.1117[/C][C]0.349[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310226&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310226&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.055-0.02870.02870.02837.92400-0.24460.2446
2020.0556-0.03910.03390.033313.97410.9493.3089-0.32480.2847
2030.05820.02230.030.02974.76628.88812.98130.18970.253
2040.06520.01650.02660.02641.63067.07372.65960.1110.2175
2050.06920.0240.02610.0264.65696.59032.56720.18750.2115
2060.0739-0.00790.02310.0230.52255.5792.362-0.06280.1867
2070.08030.07840.0310.031469.634814.72993.8380.72510.2636
2080.0821-0.06240.03490.03529.799316.61354.076-0.47430.29
2090.08490.11350.04360.0445127.491628.93335.3790.98110.3668
2100.09050.07360.04660.047758.981731.93825.65140.66730.3968
2110.09050.01470.04370.04471.552529.17585.40150.10830.3706
2120.08950.01880.04170.04251.652326.88225.18480.11170.349



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