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, 22 Dec 2017 14:13:28 +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/22/t15139484528825zxl71r05p11.htm/, Retrieved Wed, 15 May 2024 08:15:31 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=310781, Retrieved Wed, 15 May 2024 08:15:31 +0000
QR Codes:

Original text written by user:Stap 6 voorbeeld 2 (Time Series)
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact107
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [voorbeeld 2 (ARIM...] [2017-12-22 13:13:28] [84a8d6985c1bda8999f49f22468687ba] [Current]
Feedback Forum

Post a new message
Dataseries X:
55.5
63
77.2
71.1
90.1
91.5
76.1
87.8
81
77.2
73.8
68.9
68.4
65.2
78.7
77
97.6
88.1
98.7
93.4
68
87.9
75.8
66.3
68.4
71.3
77.4
87.1
88.5
85.9
92.7
88.5
80.2
81.8
70.4
82.2
72.8
69
83
92.4
92.3
100.5
106.9
99.5
85.9
92.6
77.4
84.1
75.3
73.8
100.1
90.7
96.5
111.8
97.4
100.8
93.7
82
86
84.3
73.1
75.4
97.9
97.5
106
112.8
99.5
100.8
102.9
88.8
91.3
88.3
77.4
80.5
96.7
93.8
105
117.1
111.1
105.8
95.7
97.1
91
90.9
83.5
82.3
101.7
108.3
114
118.2
103.4
106.8
95.4
101.8
95.6
94.8
94
82.4
95.8
106.7
114.1
103.9
117.4
105.9
101.7
98.7
91.3
102.3
80.5
86.7
102.6
107.3
108
124.3
117.1
103.9
104.7
95.9
94.2
102.7
70.3
90.2
107.3
104.6
102.7
124.5
117.8
104.2
99.9
91.5
95.7
91.4
86.2
91.5
115.5
113.9
131.9
121.2
105.2
107.5
113.8
100.5
104.8
103.8
93.1
106.2
117.5
109.9
123.6
131.7
111
122
110.9
108
103.6
107.3
94.4
85.2
113.2
111.7
124.3
124
133.4
112.6
115.8
112.3
103.6
111.4
95.1
93.4
117.3
121.5
123.1
139.3
125.8
108.6
121
111.6
99.7
116.7
90.3
90.4
117.3
121.6
114.6
133.3
127.4
115
112.6
108.3
107.6
109
89
102.5
124.5
124.2
130.8
138.7
127.6
130.9
136.9
125.2
131.3
124.1
103.2
118.1
136.5
117.8
145.1
158.8
136.9
132.7




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310781&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])
188115-------
189112.6-------
190108.3-------
191107.6-------
192109-------
19389-------
194102.5-------
195124.5-------
196124.2-------
197130.8-------
198138.7-------
199127.6-------
200130.9-------
201136.9118.9137104.5248134.23030.01070.06250.79040.0625
202125.2112.974298.916127.96620.0559e-040.72940.0096
203131.3110.588996.6811125.4310.00310.02680.65350.0037
204124.1117.327102.5874133.05560.19930.04080.85030.0454
205103.293.604780.38107.83610.093200.7370
206118.1101.790287.9009116.69770.0160.42650.46281e-04
207136.5126.2342110.5776142.9270.1140.83020.58070.2919
208117.8127.6797111.8168144.59440.12610.15340.65660.3545
209145.1128.3101112.3102145.37510.02690.88630.38740.3831
210158.8140.967124.0713158.94080.02590.32610.59760.8638
211136.9131.7692115.362149.26690.28270.00120.67980.5388
212132.7128.1152111.8636145.46870.30230.16050.37660.3766

\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 & 115 & - & - & - & - & - & - & - \tabularnewline
189 & 112.6 & - & - & - & - & - & - & - \tabularnewline
190 & 108.3 & - & - & - & - & - & - & - \tabularnewline
191 & 107.6 & - & - & - & - & - & - & - \tabularnewline
192 & 109 & - & - & - & - & - & - & - \tabularnewline
193 & 89 & - & - & - & - & - & - & - \tabularnewline
194 & 102.5 & - & - & - & - & - & - & - \tabularnewline
195 & 124.5 & - & - & - & - & - & - & - \tabularnewline
196 & 124.2 & - & - & - & - & - & - & - \tabularnewline
197 & 130.8 & - & - & - & - & - & - & - \tabularnewline
198 & 138.7 & - & - & - & - & - & - & - \tabularnewline
199 & 127.6 & - & - & - & - & - & - & - \tabularnewline
200 & 130.9 & - & - & - & - & - & - & - \tabularnewline
201 & 136.9 & 118.9137 & 104.5248 & 134.2303 & 0.0107 & 0.0625 & 0.7904 & 0.0625 \tabularnewline
202 & 125.2 & 112.9742 & 98.916 & 127.9662 & 0.055 & 9e-04 & 0.7294 & 0.0096 \tabularnewline
203 & 131.3 & 110.5889 & 96.6811 & 125.431 & 0.0031 & 0.0268 & 0.6535 & 0.0037 \tabularnewline
204 & 124.1 & 117.327 & 102.5874 & 133.0556 & 0.1993 & 0.0408 & 0.8503 & 0.0454 \tabularnewline
205 & 103.2 & 93.6047 & 80.38 & 107.8361 & 0.0932 & 0 & 0.737 & 0 \tabularnewline
206 & 118.1 & 101.7902 & 87.9009 & 116.6977 & 0.016 & 0.4265 & 0.4628 & 1e-04 \tabularnewline
207 & 136.5 & 126.2342 & 110.5776 & 142.927 & 0.114 & 0.8302 & 0.5807 & 0.2919 \tabularnewline
208 & 117.8 & 127.6797 & 111.8168 & 144.5944 & 0.1261 & 0.1534 & 0.6566 & 0.3545 \tabularnewline
209 & 145.1 & 128.3101 & 112.3102 & 145.3751 & 0.0269 & 0.8863 & 0.3874 & 0.3831 \tabularnewline
210 & 158.8 & 140.967 & 124.0713 & 158.9408 & 0.0259 & 0.3261 & 0.5976 & 0.8638 \tabularnewline
211 & 136.9 & 131.7692 & 115.362 & 149.2669 & 0.2827 & 0.0012 & 0.6798 & 0.5388 \tabularnewline
212 & 132.7 & 128.1152 & 111.8636 & 145.4687 & 0.3023 & 0.1605 & 0.3766 & 0.3766 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310781&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]115[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]112.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]108.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]107.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]109[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]89[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]102.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]124.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]124.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]130.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]138.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]127.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]130.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]136.9[/C][C]118.9137[/C][C]104.5248[/C][C]134.2303[/C][C]0.0107[/C][C]0.0625[/C][C]0.7904[/C][C]0.0625[/C][/ROW]
[ROW][C]202[/C][C]125.2[/C][C]112.9742[/C][C]98.916[/C][C]127.9662[/C][C]0.055[/C][C]9e-04[/C][C]0.7294[/C][C]0.0096[/C][/ROW]
[ROW][C]203[/C][C]131.3[/C][C]110.5889[/C][C]96.6811[/C][C]125.431[/C][C]0.0031[/C][C]0.0268[/C][C]0.6535[/C][C]0.0037[/C][/ROW]
[ROW][C]204[/C][C]124.1[/C][C]117.327[/C][C]102.5874[/C][C]133.0556[/C][C]0.1993[/C][C]0.0408[/C][C]0.8503[/C][C]0.0454[/C][/ROW]
[ROW][C]205[/C][C]103.2[/C][C]93.6047[/C][C]80.38[/C][C]107.8361[/C][C]0.0932[/C][C]0[/C][C]0.737[/C][C]0[/C][/ROW]
[ROW][C]206[/C][C]118.1[/C][C]101.7902[/C][C]87.9009[/C][C]116.6977[/C][C]0.016[/C][C]0.4265[/C][C]0.4628[/C][C]1e-04[/C][/ROW]
[ROW][C]207[/C][C]136.5[/C][C]126.2342[/C][C]110.5776[/C][C]142.927[/C][C]0.114[/C][C]0.8302[/C][C]0.5807[/C][C]0.2919[/C][/ROW]
[ROW][C]208[/C][C]117.8[/C][C]127.6797[/C][C]111.8168[/C][C]144.5944[/C][C]0.1261[/C][C]0.1534[/C][C]0.6566[/C][C]0.3545[/C][/ROW]
[ROW][C]209[/C][C]145.1[/C][C]128.3101[/C][C]112.3102[/C][C]145.3751[/C][C]0.0269[/C][C]0.8863[/C][C]0.3874[/C][C]0.3831[/C][/ROW]
[ROW][C]210[/C][C]158.8[/C][C]140.967[/C][C]124.0713[/C][C]158.9408[/C][C]0.0259[/C][C]0.3261[/C][C]0.5976[/C][C]0.8638[/C][/ROW]
[ROW][C]211[/C][C]136.9[/C][C]131.7692[/C][C]115.362[/C][C]149.2669[/C][C]0.2827[/C][C]0.0012[/C][C]0.6798[/C][C]0.5388[/C][/ROW]
[ROW][C]212[/C][C]132.7[/C][C]128.1152[/C][C]111.8636[/C][C]145.4687[/C][C]0.3023[/C][C]0.1605[/C][C]0.3766[/C][C]0.3766[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310781&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310781&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])
188115-------
189112.6-------
190108.3-------
191107.6-------
192109-------
19389-------
194102.5-------
195124.5-------
196124.2-------
197130.8-------
198138.7-------
199127.6-------
200130.9-------
201136.9118.9137104.5248134.23030.01070.06250.79040.0625
202125.2112.974298.916127.96620.0559e-040.72940.0096
203131.3110.588996.6811125.4310.00310.02680.65350.0037
204124.1117.327102.5874133.05560.19930.04080.85030.0454
205103.293.604780.38107.83610.093200.7370
206118.1101.790287.9009116.69770.0160.42650.46281e-04
207136.5126.2342110.5776142.9270.1140.83020.58070.2919
208117.8127.6797111.8168144.59440.12610.15340.65660.3545
209145.1128.3101112.3102145.37510.02690.88630.38740.3831
210158.8140.967124.0713158.94080.02590.32610.59760.8638
211136.9131.7692115.362149.26690.28270.00120.67980.5388
212132.7128.1152111.8636145.46870.30230.16050.37660.3766







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.06570.13140.13140.1406323.5059001.19911.1991
2020.06770.09770.11450.1216149.4702236.488115.37820.81511.0071
2030.06850.15770.12890.1382428.9486300.641617.3391.38071.1316
2040.06840.05460.11030.117745.8742236.949715.39320.45150.9616
2050.07760.0930.10690.113692.0694207.973714.42130.63970.8972
2060.07470.13810.11210.1194266.0105217.646514.75281.08730.9289
2070.06750.07520.10680.1135105.3866201.609414.19890.68440.894
2080.0676-0.08390.10390.109497.6078188.609213.7335-0.65860.8646
2090.06790.11570.10520.1109281.8998198.974814.10581.11930.8929
2100.06510.11230.1060.1117318.016210.878914.52171.18890.9225
2110.06780.03750.09970.10526.3247194.101313.9320.34210.8697
2120.06910.03460.09430.099221.0204179.677813.40440.30570.8227

\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.0657 & 0.1314 & 0.1314 & 0.1406 & 323.5059 & 0 & 0 & 1.1991 & 1.1991 \tabularnewline
202 & 0.0677 & 0.0977 & 0.1145 & 0.1216 & 149.4702 & 236.4881 & 15.3782 & 0.8151 & 1.0071 \tabularnewline
203 & 0.0685 & 0.1577 & 0.1289 & 0.1382 & 428.9486 & 300.6416 & 17.339 & 1.3807 & 1.1316 \tabularnewline
204 & 0.0684 & 0.0546 & 0.1103 & 0.1177 & 45.8742 & 236.9497 & 15.3932 & 0.4515 & 0.9616 \tabularnewline
205 & 0.0776 & 0.093 & 0.1069 & 0.1136 & 92.0694 & 207.9737 & 14.4213 & 0.6397 & 0.8972 \tabularnewline
206 & 0.0747 & 0.1381 & 0.1121 & 0.1194 & 266.0105 & 217.6465 & 14.7528 & 1.0873 & 0.9289 \tabularnewline
207 & 0.0675 & 0.0752 & 0.1068 & 0.1135 & 105.3866 & 201.6094 & 14.1989 & 0.6844 & 0.894 \tabularnewline
208 & 0.0676 & -0.0839 & 0.1039 & 0.1094 & 97.6078 & 188.6092 & 13.7335 & -0.6586 & 0.8646 \tabularnewline
209 & 0.0679 & 0.1157 & 0.1052 & 0.1109 & 281.8998 & 198.9748 & 14.1058 & 1.1193 & 0.8929 \tabularnewline
210 & 0.0651 & 0.1123 & 0.106 & 0.1117 & 318.016 & 210.8789 & 14.5217 & 1.1889 & 0.9225 \tabularnewline
211 & 0.0678 & 0.0375 & 0.0997 & 0.105 & 26.3247 & 194.1013 & 13.932 & 0.3421 & 0.8697 \tabularnewline
212 & 0.0691 & 0.0346 & 0.0943 & 0.0992 & 21.0204 & 179.6778 & 13.4044 & 0.3057 & 0.8227 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310781&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.0657[/C][C]0.1314[/C][C]0.1314[/C][C]0.1406[/C][C]323.5059[/C][C]0[/C][C]0[/C][C]1.1991[/C][C]1.1991[/C][/ROW]
[ROW][C]202[/C][C]0.0677[/C][C]0.0977[/C][C]0.1145[/C][C]0.1216[/C][C]149.4702[/C][C]236.4881[/C][C]15.3782[/C][C]0.8151[/C][C]1.0071[/C][/ROW]
[ROW][C]203[/C][C]0.0685[/C][C]0.1577[/C][C]0.1289[/C][C]0.1382[/C][C]428.9486[/C][C]300.6416[/C][C]17.339[/C][C]1.3807[/C][C]1.1316[/C][/ROW]
[ROW][C]204[/C][C]0.0684[/C][C]0.0546[/C][C]0.1103[/C][C]0.1177[/C][C]45.8742[/C][C]236.9497[/C][C]15.3932[/C][C]0.4515[/C][C]0.9616[/C][/ROW]
[ROW][C]205[/C][C]0.0776[/C][C]0.093[/C][C]0.1069[/C][C]0.1136[/C][C]92.0694[/C][C]207.9737[/C][C]14.4213[/C][C]0.6397[/C][C]0.8972[/C][/ROW]
[ROW][C]206[/C][C]0.0747[/C][C]0.1381[/C][C]0.1121[/C][C]0.1194[/C][C]266.0105[/C][C]217.6465[/C][C]14.7528[/C][C]1.0873[/C][C]0.9289[/C][/ROW]
[ROW][C]207[/C][C]0.0675[/C][C]0.0752[/C][C]0.1068[/C][C]0.1135[/C][C]105.3866[/C][C]201.6094[/C][C]14.1989[/C][C]0.6844[/C][C]0.894[/C][/ROW]
[ROW][C]208[/C][C]0.0676[/C][C]-0.0839[/C][C]0.1039[/C][C]0.1094[/C][C]97.6078[/C][C]188.6092[/C][C]13.7335[/C][C]-0.6586[/C][C]0.8646[/C][/ROW]
[ROW][C]209[/C][C]0.0679[/C][C]0.1157[/C][C]0.1052[/C][C]0.1109[/C][C]281.8998[/C][C]198.9748[/C][C]14.1058[/C][C]1.1193[/C][C]0.8929[/C][/ROW]
[ROW][C]210[/C][C]0.0651[/C][C]0.1123[/C][C]0.106[/C][C]0.1117[/C][C]318.016[/C][C]210.8789[/C][C]14.5217[/C][C]1.1889[/C][C]0.9225[/C][/ROW]
[ROW][C]211[/C][C]0.0678[/C][C]0.0375[/C][C]0.0997[/C][C]0.105[/C][C]26.3247[/C][C]194.1013[/C][C]13.932[/C][C]0.3421[/C][C]0.8697[/C][/ROW]
[ROW][C]212[/C][C]0.0691[/C][C]0.0346[/C][C]0.0943[/C][C]0.0992[/C][C]21.0204[/C][C]179.6778[/C][C]13.4044[/C][C]0.3057[/C][C]0.8227[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310781&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310781&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.06570.13140.13140.1406323.5059001.19911.1991
2020.06770.09770.11450.1216149.4702236.488115.37820.81511.0071
2030.06850.15770.12890.1382428.9486300.641617.3391.38071.1316
2040.06840.05460.11030.117745.8742236.949715.39320.45150.9616
2050.07760.0930.10690.113692.0694207.973714.42130.63970.8972
2060.07470.13810.11210.1194266.0105217.646514.75281.08730.9289
2070.06750.07520.10680.1135105.3866201.609414.19890.68440.894
2080.0676-0.08390.10390.109497.6078188.609213.7335-0.65860.8646
2090.06790.11570.10520.1109281.8998198.974814.10581.11930.8929
2100.06510.11230.1060.1117318.016210.878914.52171.18890.9225
2110.06780.03750.09970.10526.3247194.101313.9320.34210.8697
2120.06910.03460.09430.099221.0204179.677813.40440.30570.8227



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