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, 11 Dec 2017 15:13: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/11/t151300177385c2dmab4z5zls0.htm/, Retrieved Wed, 15 May 2024 12:09:55 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=308992, Retrieved Wed, 15 May 2024 12:09:55 +0000
QR Codes:

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

Post a new message
Dataseries X:
80,9
86,5
111,3
96
97,4
135,3
89,2
147,6
173,5
144
133,7
159,9
139,4
125,7
137,4
103,2
106,3
131,4
79,5
129,1
99,6
99,7
93,7
85,7
79,1
74,9
97,7
74,3
80,3
85,3
74,9
78,4
95,8
112,4
106,3
112,3
87,1
83,5
89,3
89,2
88,5
90,3
74,2
81,6
105,5
93,1
94,1
115,7
86,2
85,2
97,9
90,1
84,5
99,5
92,9
76,9
98,6
99
93
127,6
77,2
75,9
99,9
85,3
87,5
113,3
74,8
77,3
105
92,2
98,2
122,8
61,5
64,5
82,8
69,8
75,2
82,4
57,6
62,2
78
81,4
77,3
90,4
84,7
82,5
115,3
90,2
90,8
113,8
96,7
102,6
100
126,2
121,8
128,2
101,5
110,4
107,3
107,7
98,3
130,3
89,1
100,4
121,1
109,3
87,4
101,3
75,6
74,6
91,3
85,1
80,8
100,2
64,5
86,9
104,8
92,9
94,6
118,3
77,9
85
112,5
82,4
82,4
109,9
86,9
93,3
115
118,5
113,5
122,7
102,3
98,2
117,1
81,8
105,5
93,2
78,8
87,2
111,5
109,8
100,7
108,2
83,8
92
121,9
86,1
98,6
120,6
88,2
80,2
94,9
111,8
98,5
104,6
82,1
87,5
98,1
87,8
87
100,5
78,2
71,3
90,9
108,5
88,4
113,4
84,3
84,6
92
86,8
87,8
90,9
82,7
80,2
100,4
105
92,9
118,8
74,3
81,9
96,7
86,3
80,4
100
66,2
73,3
110,9
104,1
100,4
110,7
85,3
96,9
93,9
98,4
90,1
103,2
72,9
85,6
97,4
101,2
99,2
107,6
88,3
94,6
112,2
85,4
87,5
110,8
78,3
89




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=308992&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])
18873.3-------
189110.9-------
190104.1-------
191100.4-------
192110.7-------
19385.3-------
19496.9-------
19593.9-------
19698.4-------
19790.1-------
198103.2-------
19972.9-------
20085.6-------
20197.4101.011482.1289130.28810.40450.84890.2540.8489
202101.2100.990780.857133.39190.49490.5860.42540.8241
20399.295.925176.1983128.29260.42140.37470.39320.7341
204107.6109.506782.3991160.64820.47090.65360.48180.8202
20588.381.751664.3626110.92380.330.04120.40580.398
20694.683.781264.7095117.37170.26390.3960.2220.4577
207112.299.256872.6725153.33080.31950.5670.5770.6897
20885.485.241863.8381126.14130.4970.09820.26420.4932
20987.586.543863.7974131.93660.48350.51970.4390.5163
210110.8100.837970.5921171.02920.39040.64520.47370.6648
21178.376.197956.6428114.32960.4570.03770.56730.3144
2128983.456560.0667133.42250.41390.58010.46650.4665

\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 & 73.3 & - & - & - & - & - & - & - \tabularnewline
189 & 110.9 & - & - & - & - & - & - & - \tabularnewline
190 & 104.1 & - & - & - & - & - & - & - \tabularnewline
191 & 100.4 & - & - & - & - & - & - & - \tabularnewline
192 & 110.7 & - & - & - & - & - & - & - \tabularnewline
193 & 85.3 & - & - & - & - & - & - & - \tabularnewline
194 & 96.9 & - & - & - & - & - & - & - \tabularnewline
195 & 93.9 & - & - & - & - & - & - & - \tabularnewline
196 & 98.4 & - & - & - & - & - & - & - \tabularnewline
197 & 90.1 & - & - & - & - & - & - & - \tabularnewline
198 & 103.2 & - & - & - & - & - & - & - \tabularnewline
199 & 72.9 & - & - & - & - & - & - & - \tabularnewline
200 & 85.6 & - & - & - & - & - & - & - \tabularnewline
201 & 97.4 & 101.0114 & 82.1289 & 130.2881 & 0.4045 & 0.8489 & 0.254 & 0.8489 \tabularnewline
202 & 101.2 & 100.9907 & 80.857 & 133.3919 & 0.4949 & 0.586 & 0.4254 & 0.8241 \tabularnewline
203 & 99.2 & 95.9251 & 76.1983 & 128.2926 & 0.4214 & 0.3747 & 0.3932 & 0.7341 \tabularnewline
204 & 107.6 & 109.5067 & 82.3991 & 160.6482 & 0.4709 & 0.6536 & 0.4818 & 0.8202 \tabularnewline
205 & 88.3 & 81.7516 & 64.3626 & 110.9238 & 0.33 & 0.0412 & 0.4058 & 0.398 \tabularnewline
206 & 94.6 & 83.7812 & 64.7095 & 117.3717 & 0.2639 & 0.396 & 0.222 & 0.4577 \tabularnewline
207 & 112.2 & 99.2568 & 72.6725 & 153.3308 & 0.3195 & 0.567 & 0.577 & 0.6897 \tabularnewline
208 & 85.4 & 85.2418 & 63.8381 & 126.1413 & 0.497 & 0.0982 & 0.2642 & 0.4932 \tabularnewline
209 & 87.5 & 86.5438 & 63.7974 & 131.9366 & 0.4835 & 0.5197 & 0.439 & 0.5163 \tabularnewline
210 & 110.8 & 100.8379 & 70.5921 & 171.0292 & 0.3904 & 0.6452 & 0.4737 & 0.6648 \tabularnewline
211 & 78.3 & 76.1979 & 56.6428 & 114.3296 & 0.457 & 0.0377 & 0.5673 & 0.3144 \tabularnewline
212 & 89 & 83.4565 & 60.0667 & 133.4225 & 0.4139 & 0.5801 & 0.4665 & 0.4665 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=308992&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]73.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]110.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]104.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]100.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]110.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]85.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]96.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]93.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]98.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]90.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]103.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]72.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]85.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]97.4[/C][C]101.0114[/C][C]82.1289[/C][C]130.2881[/C][C]0.4045[/C][C]0.8489[/C][C]0.254[/C][C]0.8489[/C][/ROW]
[ROW][C]202[/C][C]101.2[/C][C]100.9907[/C][C]80.857[/C][C]133.3919[/C][C]0.4949[/C][C]0.586[/C][C]0.4254[/C][C]0.8241[/C][/ROW]
[ROW][C]203[/C][C]99.2[/C][C]95.9251[/C][C]76.1983[/C][C]128.2926[/C][C]0.4214[/C][C]0.3747[/C][C]0.3932[/C][C]0.7341[/C][/ROW]
[ROW][C]204[/C][C]107.6[/C][C]109.5067[/C][C]82.3991[/C][C]160.6482[/C][C]0.4709[/C][C]0.6536[/C][C]0.4818[/C][C]0.8202[/C][/ROW]
[ROW][C]205[/C][C]88.3[/C][C]81.7516[/C][C]64.3626[/C][C]110.9238[/C][C]0.33[/C][C]0.0412[/C][C]0.4058[/C][C]0.398[/C][/ROW]
[ROW][C]206[/C][C]94.6[/C][C]83.7812[/C][C]64.7095[/C][C]117.3717[/C][C]0.2639[/C][C]0.396[/C][C]0.222[/C][C]0.4577[/C][/ROW]
[ROW][C]207[/C][C]112.2[/C][C]99.2568[/C][C]72.6725[/C][C]153.3308[/C][C]0.3195[/C][C]0.567[/C][C]0.577[/C][C]0.6897[/C][/ROW]
[ROW][C]208[/C][C]85.4[/C][C]85.2418[/C][C]63.8381[/C][C]126.1413[/C][C]0.497[/C][C]0.0982[/C][C]0.2642[/C][C]0.4932[/C][/ROW]
[ROW][C]209[/C][C]87.5[/C][C]86.5438[/C][C]63.7974[/C][C]131.9366[/C][C]0.4835[/C][C]0.5197[/C][C]0.439[/C][C]0.5163[/C][/ROW]
[ROW][C]210[/C][C]110.8[/C][C]100.8379[/C][C]70.5921[/C][C]171.0292[/C][C]0.3904[/C][C]0.6452[/C][C]0.4737[/C][C]0.6648[/C][/ROW]
[ROW][C]211[/C][C]78.3[/C][C]76.1979[/C][C]56.6428[/C][C]114.3296[/C][C]0.457[/C][C]0.0377[/C][C]0.5673[/C][C]0.3144[/C][/ROW]
[ROW][C]212[/C][C]89[/C][C]83.4565[/C][C]60.0667[/C][C]133.4225[/C][C]0.4139[/C][C]0.5801[/C][C]0.4665[/C][C]0.4665[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=308992&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=308992&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])
18873.3-------
189110.9-------
190104.1-------
191100.4-------
192110.7-------
19385.3-------
19496.9-------
19593.9-------
19698.4-------
19790.1-------
198103.2-------
19972.9-------
20085.6-------
20197.4101.011482.1289130.28810.40450.84890.2540.8489
202101.2100.990780.857133.39190.49490.5860.42540.8241
20399.295.925176.1983128.29260.42140.37470.39320.7341
204107.6109.506782.3991160.64820.47090.65360.48180.8202
20588.381.751664.3626110.92380.330.04120.40580.398
20694.683.781264.7095117.37170.26390.3960.2220.4577
207112.299.256872.6725153.33080.31950.5670.5770.6897
20885.485.241863.8381126.14130.4970.09820.26420.4932
20987.586.543863.7974131.93660.48350.51970.4390.5163
210110.8100.837970.5921171.02920.39040.64520.47370.6648
21178.376.197956.6428114.32960.4570.03770.56730.3144
2128983.456560.0667133.42250.41390.58010.46650.4665







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.1479-0.03710.03710.036413.042300-0.260.26
2020.16370.00210.01960.01920.04386.54312.55790.01510.1375
2030.17220.0330.02410.02410.72467.93692.81730.23580.1703
2040.2383-0.01770.02250.02243.63556.86162.6195-0.13730.162
2050.18210.07420.03280.033342.881914.06563.75040.47140.2239
2060.20460.11440.04640.048117.045731.2295.58830.77880.3164
2070.2780.11540.05630.0586167.525150.69997.12040.93180.4043
2080.24480.00190.04950.05150.02544.36556.66070.01140.3552
2090.26760.01090.04520.0470.914439.53766.28790.06880.3234
2100.35510.08990.04960.051799.242745.50816.7460.71720.3627
2110.25530.02680.04760.04954.418941.77276.46320.15130.3435
2120.30550.06230.04880.050730.730840.85266.39160.39910.3482

\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.1479 & -0.0371 & 0.0371 & 0.0364 & 13.0423 & 0 & 0 & -0.26 & 0.26 \tabularnewline
202 & 0.1637 & 0.0021 & 0.0196 & 0.0192 & 0.0438 & 6.5431 & 2.5579 & 0.0151 & 0.1375 \tabularnewline
203 & 0.1722 & 0.033 & 0.0241 & 0.024 & 10.7246 & 7.9369 & 2.8173 & 0.2358 & 0.1703 \tabularnewline
204 & 0.2383 & -0.0177 & 0.0225 & 0.0224 & 3.6355 & 6.8616 & 2.6195 & -0.1373 & 0.162 \tabularnewline
205 & 0.1821 & 0.0742 & 0.0328 & 0.0333 & 42.8819 & 14.0656 & 3.7504 & 0.4714 & 0.2239 \tabularnewline
206 & 0.2046 & 0.1144 & 0.0464 & 0.048 & 117.0457 & 31.229 & 5.5883 & 0.7788 & 0.3164 \tabularnewline
207 & 0.278 & 0.1154 & 0.0563 & 0.0586 & 167.5251 & 50.6999 & 7.1204 & 0.9318 & 0.4043 \tabularnewline
208 & 0.2448 & 0.0019 & 0.0495 & 0.0515 & 0.025 & 44.3655 & 6.6607 & 0.0114 & 0.3552 \tabularnewline
209 & 0.2676 & 0.0109 & 0.0452 & 0.047 & 0.9144 & 39.5376 & 6.2879 & 0.0688 & 0.3234 \tabularnewline
210 & 0.3551 & 0.0899 & 0.0496 & 0.0517 & 99.2427 & 45.5081 & 6.746 & 0.7172 & 0.3627 \tabularnewline
211 & 0.2553 & 0.0268 & 0.0476 & 0.0495 & 4.4189 & 41.7727 & 6.4632 & 0.1513 & 0.3435 \tabularnewline
212 & 0.3055 & 0.0623 & 0.0488 & 0.0507 & 30.7308 & 40.8526 & 6.3916 & 0.3991 & 0.3482 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=308992&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.1479[/C][C]-0.0371[/C][C]0.0371[/C][C]0.0364[/C][C]13.0423[/C][C]0[/C][C]0[/C][C]-0.26[/C][C]0.26[/C][/ROW]
[ROW][C]202[/C][C]0.1637[/C][C]0.0021[/C][C]0.0196[/C][C]0.0192[/C][C]0.0438[/C][C]6.5431[/C][C]2.5579[/C][C]0.0151[/C][C]0.1375[/C][/ROW]
[ROW][C]203[/C][C]0.1722[/C][C]0.033[/C][C]0.0241[/C][C]0.024[/C][C]10.7246[/C][C]7.9369[/C][C]2.8173[/C][C]0.2358[/C][C]0.1703[/C][/ROW]
[ROW][C]204[/C][C]0.2383[/C][C]-0.0177[/C][C]0.0225[/C][C]0.0224[/C][C]3.6355[/C][C]6.8616[/C][C]2.6195[/C][C]-0.1373[/C][C]0.162[/C][/ROW]
[ROW][C]205[/C][C]0.1821[/C][C]0.0742[/C][C]0.0328[/C][C]0.0333[/C][C]42.8819[/C][C]14.0656[/C][C]3.7504[/C][C]0.4714[/C][C]0.2239[/C][/ROW]
[ROW][C]206[/C][C]0.2046[/C][C]0.1144[/C][C]0.0464[/C][C]0.048[/C][C]117.0457[/C][C]31.229[/C][C]5.5883[/C][C]0.7788[/C][C]0.3164[/C][/ROW]
[ROW][C]207[/C][C]0.278[/C][C]0.1154[/C][C]0.0563[/C][C]0.0586[/C][C]167.5251[/C][C]50.6999[/C][C]7.1204[/C][C]0.9318[/C][C]0.4043[/C][/ROW]
[ROW][C]208[/C][C]0.2448[/C][C]0.0019[/C][C]0.0495[/C][C]0.0515[/C][C]0.025[/C][C]44.3655[/C][C]6.6607[/C][C]0.0114[/C][C]0.3552[/C][/ROW]
[ROW][C]209[/C][C]0.2676[/C][C]0.0109[/C][C]0.0452[/C][C]0.047[/C][C]0.9144[/C][C]39.5376[/C][C]6.2879[/C][C]0.0688[/C][C]0.3234[/C][/ROW]
[ROW][C]210[/C][C]0.3551[/C][C]0.0899[/C][C]0.0496[/C][C]0.0517[/C][C]99.2427[/C][C]45.5081[/C][C]6.746[/C][C]0.7172[/C][C]0.3627[/C][/ROW]
[ROW][C]211[/C][C]0.2553[/C][C]0.0268[/C][C]0.0476[/C][C]0.0495[/C][C]4.4189[/C][C]41.7727[/C][C]6.4632[/C][C]0.1513[/C][C]0.3435[/C][/ROW]
[ROW][C]212[/C][C]0.3055[/C][C]0.0623[/C][C]0.0488[/C][C]0.0507[/C][C]30.7308[/C][C]40.8526[/C][C]6.3916[/C][C]0.3991[/C][C]0.3482[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=308992&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=308992&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.1479-0.03710.03710.036413.042300-0.260.26
2020.16370.00210.01960.01920.04386.54312.55790.01510.1375
2030.17220.0330.02410.02410.72467.93692.81730.23580.1703
2040.2383-0.01770.02250.02243.63556.86162.6195-0.13730.162
2050.18210.07420.03280.033342.881914.06563.75040.47140.2239
2060.20460.11440.04640.048117.045731.2295.58830.77880.3164
2070.2780.11540.05630.0586167.525150.69997.12040.93180.4043
2080.24480.00190.04950.05150.02544.36556.66070.01140.3552
2090.26760.01090.04520.0470.914439.53766.28790.06880.3234
2100.35510.08990.04960.051799.242745.50816.7460.71720.3627
2110.25530.02680.04760.04954.418941.77276.46320.15130.3435
2120.30550.06230.04880.050730.730840.85266.39160.39910.3482



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