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 computationWed, 24 Jan 2018 09:43:26 +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/2018/Jan/24/t1516783427e83cd4oaxwmhn3v.htm/, Retrieved Sun, 05 May 2024 22:15:17 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=311817, Retrieved Sun, 05 May 2024 22:15:17 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact34
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2018-01-24 08:43:26] [ca54f96be429c1094bce3fe23777b2f9] [Current]
Feedback Forum

Post a new message
Dataseries X:
62.4
67.4
76.1
67.4
74.5
72.6
60.5
66.1
76.5
76.8
77
71
74.8
73.7
80.5
71.8
76.9
79.9
65.9
69.5
75.1
79.6
75.2
68
72.8
71.5
78.5
76.8
75.3
76.7
69.7
67.8
77.5
82.5
75.3
70.9
76
73.7
79.7
77.8
73.3
78.3
71.9
67
82
83.7
74.8
80
74.3
76.8
89
81.9
76.8
88.9
75.8
75.5
89.1
88
85.9
89.3
82.9
81.2
90.5
86.4
81.8
91.3
73.4
76.6
91
87
89.7
90.7
86.5
86.6
98.8
84.4
91.4
95.7
78.5
81.7
94.3
98.5
95.4
91.7
92.8
90.5
102.2
91.8
95
102
88.9
89.6
97.9
108.6
100.8
95.1
101
100.9
102.5
105.4
98.4
105.3
96.5
88.1
107.9
107
92.5
95.7
85.2
85.5
94.7
86.2
88.8
93.4
83.4
82.9
96.7
96.2
92.8
92.8
90
95.4
108.3
96.3
95
109
92
92.3
107
105.5
105.4
103.9
99.2
102.2
121.5
102.3
110
105.9
91.9
100
111.7
104.9
103.3
101.8
100.8
104.2
116.5
97.9
100.7
107
96.3
96
104.5
107.4
102.4
94.9
98.8
96.8
108.2
103.8
102.3
107.2
102
92.6
105.2
113
105.6
101.6
101.7
102.7
109
105.5
103.3
108.6
98.2
90
112.4
111.9
102.1
102.4
101.7
98.7
114
105.1
98.3
110
96.5
92.2
112
111.4
107.5
103.4
103.5
107.4
117.6
110.2
104.3
115.9
98.9
101.9
113.5
109.5
110
114.2
106.9
109.2
124.2
104.7
111.9
119
102.9
106.3




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=311817&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 time4 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])
18892.2-------
189112-------
190111.4-------
191107.5-------
192103.4-------
193103.5-------
194107.4-------
195117.6-------
196110.2-------
197104.3-------
198115.9-------
19998.9-------
200101.9-------
201113.5113.924107.0246120.82330.45210.99970.70770.9997
202109.5115.2132107.8582122.56830.06390.6760.84520.9998
203110111.6983103.9141119.48240.33450.710.85480.9932
204114.2108.8155100.6247117.00620.09880.38840.90250.951
205106.9108.030499.456116.60480.39810.07920.84980.9194
206109.2110.1245101.1806119.06830.41970.76010.72480.9643
207124.2119.211109.9124128.50960.14650.98260.63290.9999
208104.7111.4974101.8571121.13780.08350.00490.6040.9745
209111.9111.4105101.4401121.38080.46170.90640.91890.9692
210119117.3278107.038127.61760.3750.84940.60720.9984
211102.9104.46293.8624115.06170.38640.00360.84810.6822
212106.3105.311694.411116.21230.42950.66770.73020.7302

\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 & 92.2 & - & - & - & - & - & - & - \tabularnewline
189 & 112 & - & - & - & - & - & - & - \tabularnewline
190 & 111.4 & - & - & - & - & - & - & - \tabularnewline
191 & 107.5 & - & - & - & - & - & - & - \tabularnewline
192 & 103.4 & - & - & - & - & - & - & - \tabularnewline
193 & 103.5 & - & - & - & - & - & - & - \tabularnewline
194 & 107.4 & - & - & - & - & - & - & - \tabularnewline
195 & 117.6 & - & - & - & - & - & - & - \tabularnewline
196 & 110.2 & - & - & - & - & - & - & - \tabularnewline
197 & 104.3 & - & - & - & - & - & - & - \tabularnewline
198 & 115.9 & - & - & - & - & - & - & - \tabularnewline
199 & 98.9 & - & - & - & - & - & - & - \tabularnewline
200 & 101.9 & - & - & - & - & - & - & - \tabularnewline
201 & 113.5 & 113.924 & 107.0246 & 120.8233 & 0.4521 & 0.9997 & 0.7077 & 0.9997 \tabularnewline
202 & 109.5 & 115.2132 & 107.8582 & 122.5683 & 0.0639 & 0.676 & 0.8452 & 0.9998 \tabularnewline
203 & 110 & 111.6983 & 103.9141 & 119.4824 & 0.3345 & 0.71 & 0.8548 & 0.9932 \tabularnewline
204 & 114.2 & 108.8155 & 100.6247 & 117.0062 & 0.0988 & 0.3884 & 0.9025 & 0.951 \tabularnewline
205 & 106.9 & 108.0304 & 99.456 & 116.6048 & 0.3981 & 0.0792 & 0.8498 & 0.9194 \tabularnewline
206 & 109.2 & 110.1245 & 101.1806 & 119.0683 & 0.4197 & 0.7601 & 0.7248 & 0.9643 \tabularnewline
207 & 124.2 & 119.211 & 109.9124 & 128.5096 & 0.1465 & 0.9826 & 0.6329 & 0.9999 \tabularnewline
208 & 104.7 & 111.4974 & 101.8571 & 121.1378 & 0.0835 & 0.0049 & 0.604 & 0.9745 \tabularnewline
209 & 111.9 & 111.4105 & 101.4401 & 121.3808 & 0.4617 & 0.9064 & 0.9189 & 0.9692 \tabularnewline
210 & 119 & 117.3278 & 107.038 & 127.6176 & 0.375 & 0.8494 & 0.6072 & 0.9984 \tabularnewline
211 & 102.9 & 104.462 & 93.8624 & 115.0617 & 0.3864 & 0.0036 & 0.8481 & 0.6822 \tabularnewline
212 & 106.3 & 105.3116 & 94.411 & 116.2123 & 0.4295 & 0.6677 & 0.7302 & 0.7302 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=311817&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]92.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]112[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]111.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]107.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]103.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]103.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]107.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]117.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]110.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]104.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]115.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]98.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]101.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]113.5[/C][C]113.924[/C][C]107.0246[/C][C]120.8233[/C][C]0.4521[/C][C]0.9997[/C][C]0.7077[/C][C]0.9997[/C][/ROW]
[ROW][C]202[/C][C]109.5[/C][C]115.2132[/C][C]107.8582[/C][C]122.5683[/C][C]0.0639[/C][C]0.676[/C][C]0.8452[/C][C]0.9998[/C][/ROW]
[ROW][C]203[/C][C]110[/C][C]111.6983[/C][C]103.9141[/C][C]119.4824[/C][C]0.3345[/C][C]0.71[/C][C]0.8548[/C][C]0.9932[/C][/ROW]
[ROW][C]204[/C][C]114.2[/C][C]108.8155[/C][C]100.6247[/C][C]117.0062[/C][C]0.0988[/C][C]0.3884[/C][C]0.9025[/C][C]0.951[/C][/ROW]
[ROW][C]205[/C][C]106.9[/C][C]108.0304[/C][C]99.456[/C][C]116.6048[/C][C]0.3981[/C][C]0.0792[/C][C]0.8498[/C][C]0.9194[/C][/ROW]
[ROW][C]206[/C][C]109.2[/C][C]110.1245[/C][C]101.1806[/C][C]119.0683[/C][C]0.4197[/C][C]0.7601[/C][C]0.7248[/C][C]0.9643[/C][/ROW]
[ROW][C]207[/C][C]124.2[/C][C]119.211[/C][C]109.9124[/C][C]128.5096[/C][C]0.1465[/C][C]0.9826[/C][C]0.6329[/C][C]0.9999[/C][/ROW]
[ROW][C]208[/C][C]104.7[/C][C]111.4974[/C][C]101.8571[/C][C]121.1378[/C][C]0.0835[/C][C]0.0049[/C][C]0.604[/C][C]0.9745[/C][/ROW]
[ROW][C]209[/C][C]111.9[/C][C]111.4105[/C][C]101.4401[/C][C]121.3808[/C][C]0.4617[/C][C]0.9064[/C][C]0.9189[/C][C]0.9692[/C][/ROW]
[ROW][C]210[/C][C]119[/C][C]117.3278[/C][C]107.038[/C][C]127.6176[/C][C]0.375[/C][C]0.8494[/C][C]0.6072[/C][C]0.9984[/C][/ROW]
[ROW][C]211[/C][C]102.9[/C][C]104.462[/C][C]93.8624[/C][C]115.0617[/C][C]0.3864[/C][C]0.0036[/C][C]0.8481[/C][C]0.6822[/C][/ROW]
[ROW][C]212[/C][C]106.3[/C][C]105.3116[/C][C]94.411[/C][C]116.2123[/C][C]0.4295[/C][C]0.6677[/C][C]0.7302[/C][C]0.7302[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=311817&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=311817&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])
18892.2-------
189112-------
190111.4-------
191107.5-------
192103.4-------
193103.5-------
194107.4-------
195117.6-------
196110.2-------
197104.3-------
198115.9-------
19998.9-------
200101.9-------
201113.5113.924107.0246120.82330.45210.99970.70770.9997
202109.5115.2132107.8582122.56830.06390.6760.84520.9998
203110111.6983103.9141119.48240.33450.710.85480.9932
204114.2108.8155100.6247117.00620.09880.38840.90250.951
205106.9108.030499.456116.60480.39810.07920.84980.9194
206109.2110.1245101.1806119.06830.41970.76010.72480.9643
207124.2119.211109.9124128.50960.14650.98260.63290.9999
208104.7111.4974101.8571121.13780.08350.00490.6040.9745
209111.9111.4105101.4401121.38080.46170.90640.91890.9692
210119117.3278107.038127.61760.3750.84940.60720.9984
211102.9104.46293.8624115.06170.38640.00360.84810.6822
212106.3105.311694.411116.21230.42950.66770.73020.7302







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.0309-0.00370.00370.00370.179700-0.05390.0539
2020.0326-0.05220.0280.027332.641116.41044.051-0.72570.3898
2030.0356-0.01540.02380.02332.884111.90173.4499-0.21570.3318
2040.03840.04710.02960.029528.993116.17454.02180.68390.4198
2050.0405-0.01060.02580.02571.277713.19523.6325-0.14360.3646
2060.0414-0.00850.02290.02290.854611.13843.3374-0.11740.3234
2070.03980.04020.02540.025424.890113.10293.61980.63370.3677
2080.0441-0.06490.03030.030146.20517.24074.1522-0.86340.4297
2090.04570.00440.02740.02730.239715.35173.91810.06220.3888
2100.04470.01410.02610.0262.796114.09613.75450.21240.3712
2110.0518-0.01520.02510.0252.4413.03653.6106-0.19840.3555
2120.05280.00930.02380.02370.976912.03153.46860.12550.3363

\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.0309 & -0.0037 & 0.0037 & 0.0037 & 0.1797 & 0 & 0 & -0.0539 & 0.0539 \tabularnewline
202 & 0.0326 & -0.0522 & 0.028 & 0.0273 & 32.6411 & 16.4104 & 4.051 & -0.7257 & 0.3898 \tabularnewline
203 & 0.0356 & -0.0154 & 0.0238 & 0.0233 & 2.8841 & 11.9017 & 3.4499 & -0.2157 & 0.3318 \tabularnewline
204 & 0.0384 & 0.0471 & 0.0296 & 0.0295 & 28.9931 & 16.1745 & 4.0218 & 0.6839 & 0.4198 \tabularnewline
205 & 0.0405 & -0.0106 & 0.0258 & 0.0257 & 1.2777 & 13.1952 & 3.6325 & -0.1436 & 0.3646 \tabularnewline
206 & 0.0414 & -0.0085 & 0.0229 & 0.0229 & 0.8546 & 11.1384 & 3.3374 & -0.1174 & 0.3234 \tabularnewline
207 & 0.0398 & 0.0402 & 0.0254 & 0.0254 & 24.8901 & 13.1029 & 3.6198 & 0.6337 & 0.3677 \tabularnewline
208 & 0.0441 & -0.0649 & 0.0303 & 0.0301 & 46.205 & 17.2407 & 4.1522 & -0.8634 & 0.4297 \tabularnewline
209 & 0.0457 & 0.0044 & 0.0274 & 0.0273 & 0.2397 & 15.3517 & 3.9181 & 0.0622 & 0.3888 \tabularnewline
210 & 0.0447 & 0.0141 & 0.0261 & 0.026 & 2.7961 & 14.0961 & 3.7545 & 0.2124 & 0.3712 \tabularnewline
211 & 0.0518 & -0.0152 & 0.0251 & 0.025 & 2.44 & 13.0365 & 3.6106 & -0.1984 & 0.3555 \tabularnewline
212 & 0.0528 & 0.0093 & 0.0238 & 0.0237 & 0.9769 & 12.0315 & 3.4686 & 0.1255 & 0.3363 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=311817&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.0309[/C][C]-0.0037[/C][C]0.0037[/C][C]0.0037[/C][C]0.1797[/C][C]0[/C][C]0[/C][C]-0.0539[/C][C]0.0539[/C][/ROW]
[ROW][C]202[/C][C]0.0326[/C][C]-0.0522[/C][C]0.028[/C][C]0.0273[/C][C]32.6411[/C][C]16.4104[/C][C]4.051[/C][C]-0.7257[/C][C]0.3898[/C][/ROW]
[ROW][C]203[/C][C]0.0356[/C][C]-0.0154[/C][C]0.0238[/C][C]0.0233[/C][C]2.8841[/C][C]11.9017[/C][C]3.4499[/C][C]-0.2157[/C][C]0.3318[/C][/ROW]
[ROW][C]204[/C][C]0.0384[/C][C]0.0471[/C][C]0.0296[/C][C]0.0295[/C][C]28.9931[/C][C]16.1745[/C][C]4.0218[/C][C]0.6839[/C][C]0.4198[/C][/ROW]
[ROW][C]205[/C][C]0.0405[/C][C]-0.0106[/C][C]0.0258[/C][C]0.0257[/C][C]1.2777[/C][C]13.1952[/C][C]3.6325[/C][C]-0.1436[/C][C]0.3646[/C][/ROW]
[ROW][C]206[/C][C]0.0414[/C][C]-0.0085[/C][C]0.0229[/C][C]0.0229[/C][C]0.8546[/C][C]11.1384[/C][C]3.3374[/C][C]-0.1174[/C][C]0.3234[/C][/ROW]
[ROW][C]207[/C][C]0.0398[/C][C]0.0402[/C][C]0.0254[/C][C]0.0254[/C][C]24.8901[/C][C]13.1029[/C][C]3.6198[/C][C]0.6337[/C][C]0.3677[/C][/ROW]
[ROW][C]208[/C][C]0.0441[/C][C]-0.0649[/C][C]0.0303[/C][C]0.0301[/C][C]46.205[/C][C]17.2407[/C][C]4.1522[/C][C]-0.8634[/C][C]0.4297[/C][/ROW]
[ROW][C]209[/C][C]0.0457[/C][C]0.0044[/C][C]0.0274[/C][C]0.0273[/C][C]0.2397[/C][C]15.3517[/C][C]3.9181[/C][C]0.0622[/C][C]0.3888[/C][/ROW]
[ROW][C]210[/C][C]0.0447[/C][C]0.0141[/C][C]0.0261[/C][C]0.026[/C][C]2.7961[/C][C]14.0961[/C][C]3.7545[/C][C]0.2124[/C][C]0.3712[/C][/ROW]
[ROW][C]211[/C][C]0.0518[/C][C]-0.0152[/C][C]0.0251[/C][C]0.025[/C][C]2.44[/C][C]13.0365[/C][C]3.6106[/C][C]-0.1984[/C][C]0.3555[/C][/ROW]
[ROW][C]212[/C][C]0.0528[/C][C]0.0093[/C][C]0.0238[/C][C]0.0237[/C][C]0.9769[/C][C]12.0315[/C][C]3.4686[/C][C]0.1255[/C][C]0.3363[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=311817&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=311817&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.0309-0.00370.00370.00370.179700-0.05390.0539
2020.0326-0.05220.0280.027332.641116.41044.051-0.72570.3898
2030.0356-0.01540.02380.02332.884111.90173.4499-0.21570.3318
2040.03840.04710.02960.029528.993116.17454.02180.68390.4198
2050.0405-0.01060.02580.02571.277713.19523.6325-0.14360.3646
2060.0414-0.00850.02290.02290.854611.13843.3374-0.11740.3234
2070.03980.04020.02540.025424.890113.10293.61980.63370.3677
2080.0441-0.06490.03030.030146.20517.24074.1522-0.86340.4297
2090.04570.00440.02740.02730.239715.35173.91810.06220.3888
2100.04470.01410.02610.0262.796114.09613.75450.21240.3712
2110.0518-0.01520.02510.0252.4413.03653.6106-0.19840.3555
2120.05280.00930.02380.02370.976912.03153.46860.12550.3363



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