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, 29 Nov 2017 14:07:54 +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/Nov/29/t151196090559nwe3w6g74wpt2.htm/, Retrieved Sat, 18 May 2024 14:22:19 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=308313, Retrieved Sat, 18 May 2024 14:22:19 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsSection C - Manufacturing
Estimated Impact99
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA Forecasting] [2017-11-29 13:07:54] [e32c8f3a6c40fa6b5d041988204898ea] [Current]
Feedback Forum

Post a new message
Dataseries X:
58.4
64.8
73.8
65
73
71.1
58.2
64
75
74.9
75
68.3
72.5
72.4
79.6
70.7
76.4
79.7
64.2
67.9
74.1
78.5
73.4
65.4
69.9
69.6
76.8
75.6
74
76
68.1
65.5
76.9
81.7
73.6
68.7
73.3
71.5
78.3
76.5
71.8
77.6
70
64
81.3
82.5
73.1
78.1
70.7
74.9
88
81.3
75.7
89.8
74.6
74.9
90
88.1
84.9
87.7
80.5
79
89.9
86.3
81.1
92.4
71.8
76.1
92.5
87
89.5
88.7
83.8
84.9
99
84.6
92.7
97.6
78
81.9
96.5
99.9
96.2
90.5
91.4
89.7
102.7
91.5
96.2
104.5
90.3
90.3
100.4
111.3
101.3
94.4
100.4
102
104.3
108.8
101.3
108.9
98.5
88.8
111.8
109.6
92.5
94.5
80.8
83.7
94.2
86.2
89
94.7
81.9
80.2
96.5
95.6
91.9
89.9
86.3
94
108
96.3
94.6
111.7
92
91.9
109.2
106.8
105.8
103.6
97.6
102.8
124.8
103.9
112.2
108.5
92.4
101.1
114.9
106.4
104
101.6
99.4
102.3
121.3
99.3
102.9
111.4
98.5
98.5
108.5
112.1
105.3
95.2
98.2
96.6
109.6
108
106.7
111.5
104.5
94.3
109.6
116.4
106.5
100.5
101.7
104.1
112.3
111.2
108.2
115.1
102.3
93.6
120.6
118.4
106.6
105.3
101.5
100.1
119.5
111.2
103.7
117.8
101.7
97.4
120
117
110.6
105.3
100.9
108.1
119.3
113
108.6
123.3
101.4
103.5
119.4
113.1
112
115.8




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=308313&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[192])
180105.3-------
181101.5-------
182100.1-------
183119.5-------
184111.2-------
185103.7-------
186117.8-------
187101.7-------
18897.4-------
189120-------
190117-------
191110.6-------
192105.3-------
193100.9102.893194.8208111.80430.33060.29830.62040.2983
194108.1105.605997.0363115.09990.30330.83440.87220.5252
195119.3119.6979109.2076131.42080.47350.97380.51320.992
196113110.237998.9108123.15770.33760.08460.4420.7731
197108.6110.285598.7104123.52830.40150.34390.83510.7697
198123.3118.4318105.085133.86520.26820.89410.5320.9523
199101.4101.73989.8064115.62560.48090.00120.50220.3076
200103.599.884187.9296113.8430.30580.41570.63640.2235
201119.4119.2492103.7979137.54440.49360.95420.46790.9325
202113.1119.5817103.4784138.78770.25420.50740.60390.9275
203112111.967496.6981130.22330.49860.45160.55840.763
204115.8107.716492.6078125.88150.19150.3220.60280.6028

\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[192]) \tabularnewline
180 & 105.3 & - & - & - & - & - & - & - \tabularnewline
181 & 101.5 & - & - & - & - & - & - & - \tabularnewline
182 & 100.1 & - & - & - & - & - & - & - \tabularnewline
183 & 119.5 & - & - & - & - & - & - & - \tabularnewline
184 & 111.2 & - & - & - & - & - & - & - \tabularnewline
185 & 103.7 & - & - & - & - & - & - & - \tabularnewline
186 & 117.8 & - & - & - & - & - & - & - \tabularnewline
187 & 101.7 & - & - & - & - & - & - & - \tabularnewline
188 & 97.4 & - & - & - & - & - & - & - \tabularnewline
189 & 120 & - & - & - & - & - & - & - \tabularnewline
190 & 117 & - & - & - & - & - & - & - \tabularnewline
191 & 110.6 & - & - & - & - & - & - & - \tabularnewline
192 & 105.3 & - & - & - & - & - & - & - \tabularnewline
193 & 100.9 & 102.8931 & 94.8208 & 111.8043 & 0.3306 & 0.2983 & 0.6204 & 0.2983 \tabularnewline
194 & 108.1 & 105.6059 & 97.0363 & 115.0999 & 0.3033 & 0.8344 & 0.8722 & 0.5252 \tabularnewline
195 & 119.3 & 119.6979 & 109.2076 & 131.4208 & 0.4735 & 0.9738 & 0.5132 & 0.992 \tabularnewline
196 & 113 & 110.2379 & 98.9108 & 123.1577 & 0.3376 & 0.0846 & 0.442 & 0.7731 \tabularnewline
197 & 108.6 & 110.2855 & 98.7104 & 123.5283 & 0.4015 & 0.3439 & 0.8351 & 0.7697 \tabularnewline
198 & 123.3 & 118.4318 & 105.085 & 133.8652 & 0.2682 & 0.8941 & 0.532 & 0.9523 \tabularnewline
199 & 101.4 & 101.739 & 89.8064 & 115.6256 & 0.4809 & 0.0012 & 0.5022 & 0.3076 \tabularnewline
200 & 103.5 & 99.8841 & 87.9296 & 113.843 & 0.3058 & 0.4157 & 0.6364 & 0.2235 \tabularnewline
201 & 119.4 & 119.2492 & 103.7979 & 137.5444 & 0.4936 & 0.9542 & 0.4679 & 0.9325 \tabularnewline
202 & 113.1 & 119.5817 & 103.4784 & 138.7877 & 0.2542 & 0.5074 & 0.6039 & 0.9275 \tabularnewline
203 & 112 & 111.9674 & 96.6981 & 130.2233 & 0.4986 & 0.4516 & 0.5584 & 0.763 \tabularnewline
204 & 115.8 & 107.7164 & 92.6078 & 125.8815 & 0.1915 & 0.322 & 0.6028 & 0.6028 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=308313&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[192])[/C][/ROW]
[ROW][C]180[/C][C]105.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]181[/C][C]101.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]182[/C][C]100.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]183[/C][C]119.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]184[/C][C]111.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]185[/C][C]103.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]186[/C][C]117.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]187[/C][C]101.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]188[/C][C]97.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]120[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]117[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]110.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]105.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]100.9[/C][C]102.8931[/C][C]94.8208[/C][C]111.8043[/C][C]0.3306[/C][C]0.2983[/C][C]0.6204[/C][C]0.2983[/C][/ROW]
[ROW][C]194[/C][C]108.1[/C][C]105.6059[/C][C]97.0363[/C][C]115.0999[/C][C]0.3033[/C][C]0.8344[/C][C]0.8722[/C][C]0.5252[/C][/ROW]
[ROW][C]195[/C][C]119.3[/C][C]119.6979[/C][C]109.2076[/C][C]131.4208[/C][C]0.4735[/C][C]0.9738[/C][C]0.5132[/C][C]0.992[/C][/ROW]
[ROW][C]196[/C][C]113[/C][C]110.2379[/C][C]98.9108[/C][C]123.1577[/C][C]0.3376[/C][C]0.0846[/C][C]0.442[/C][C]0.7731[/C][/ROW]
[ROW][C]197[/C][C]108.6[/C][C]110.2855[/C][C]98.7104[/C][C]123.5283[/C][C]0.4015[/C][C]0.3439[/C][C]0.8351[/C][C]0.7697[/C][/ROW]
[ROW][C]198[/C][C]123.3[/C][C]118.4318[/C][C]105.085[/C][C]133.8652[/C][C]0.2682[/C][C]0.8941[/C][C]0.532[/C][C]0.9523[/C][/ROW]
[ROW][C]199[/C][C]101.4[/C][C]101.739[/C][C]89.8064[/C][C]115.6256[/C][C]0.4809[/C][C]0.0012[/C][C]0.5022[/C][C]0.3076[/C][/ROW]
[ROW][C]200[/C][C]103.5[/C][C]99.8841[/C][C]87.9296[/C][C]113.843[/C][C]0.3058[/C][C]0.4157[/C][C]0.6364[/C][C]0.2235[/C][/ROW]
[ROW][C]201[/C][C]119.4[/C][C]119.2492[/C][C]103.7979[/C][C]137.5444[/C][C]0.4936[/C][C]0.9542[/C][C]0.4679[/C][C]0.9325[/C][/ROW]
[ROW][C]202[/C][C]113.1[/C][C]119.5817[/C][C]103.4784[/C][C]138.7877[/C][C]0.2542[/C][C]0.5074[/C][C]0.6039[/C][C]0.9275[/C][/ROW]
[ROW][C]203[/C][C]112[/C][C]111.9674[/C][C]96.6981[/C][C]130.2233[/C][C]0.4986[/C][C]0.4516[/C][C]0.5584[/C][C]0.763[/C][/ROW]
[ROW][C]204[/C][C]115.8[/C][C]107.7164[/C][C]92.6078[/C][C]125.8815[/C][C]0.1915[/C][C]0.322[/C][C]0.6028[/C][C]0.6028[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=308313&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=308313&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[192])
180105.3-------
181101.5-------
182100.1-------
183119.5-------
184111.2-------
185103.7-------
186117.8-------
187101.7-------
18897.4-------
189120-------
190117-------
191110.6-------
192105.3-------
193100.9102.893194.8208111.80430.33060.29830.62040.2983
194108.1105.605997.0363115.09990.30330.83440.87220.5252
195119.3119.6979109.2076131.42080.47350.97380.51320.992
196113110.237998.9108123.15770.33760.08460.4420.7731
197108.6110.285598.7104123.52830.40150.34390.83510.7697
198123.3118.4318105.085133.86520.26820.89410.5320.9523
199101.4101.73989.8064115.62560.48090.00120.50220.3076
200103.599.884187.9296113.8430.30580.41570.63640.2235
201119.4119.2492103.7979137.54440.49360.95420.46790.9325
202113.1119.5817103.4784138.78770.25420.50740.60390.9275
203112111.967496.6981130.22330.49860.45160.55840.763
204115.8107.716492.6078125.88150.19150.3220.60280.6028







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1930.0442-0.01980.01980.01963.972600-0.2310.231
1940.04590.02310.02140.02156.22055.09652.25750.28910.2601
1950.05-0.00330.01540.01540.15833.45051.8575-0.04610.1887
1960.05980.02440.01770.01777.62934.49522.12020.32020.2216
1970.0613-0.01550.01720.01732.8414.16432.0407-0.19540.2164
1980.06650.03950.02090.021123.69977.42022.7240.56430.2743
1990.0696-0.00330.01840.01860.11496.37662.5252-0.03930.2408
2000.07130.03490.02050.020713.07487.21392.68590.41910.2631
2010.07830.00130.01830.01850.02276.41492.53280.01750.2358
2020.0819-0.05730.02220.022342.01229.97463.1583-0.75130.2873
2030.08323e-040.02020.02030.00119.06793.01130.00380.2615
2040.0860.06980.02440.024665.344713.75763.70910.9370.3178

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
193 & 0.0442 & -0.0198 & 0.0198 & 0.0196 & 3.9726 & 0 & 0 & -0.231 & 0.231 \tabularnewline
194 & 0.0459 & 0.0231 & 0.0214 & 0.0215 & 6.2205 & 5.0965 & 2.2575 & 0.2891 & 0.2601 \tabularnewline
195 & 0.05 & -0.0033 & 0.0154 & 0.0154 & 0.1583 & 3.4505 & 1.8575 & -0.0461 & 0.1887 \tabularnewline
196 & 0.0598 & 0.0244 & 0.0177 & 0.0177 & 7.6293 & 4.4952 & 2.1202 & 0.3202 & 0.2216 \tabularnewline
197 & 0.0613 & -0.0155 & 0.0172 & 0.0173 & 2.841 & 4.1643 & 2.0407 & -0.1954 & 0.2164 \tabularnewline
198 & 0.0665 & 0.0395 & 0.0209 & 0.0211 & 23.6997 & 7.4202 & 2.724 & 0.5643 & 0.2743 \tabularnewline
199 & 0.0696 & -0.0033 & 0.0184 & 0.0186 & 0.1149 & 6.3766 & 2.5252 & -0.0393 & 0.2408 \tabularnewline
200 & 0.0713 & 0.0349 & 0.0205 & 0.0207 & 13.0748 & 7.2139 & 2.6859 & 0.4191 & 0.2631 \tabularnewline
201 & 0.0783 & 0.0013 & 0.0183 & 0.0185 & 0.0227 & 6.4149 & 2.5328 & 0.0175 & 0.2358 \tabularnewline
202 & 0.0819 & -0.0573 & 0.0222 & 0.0223 & 42.0122 & 9.9746 & 3.1583 & -0.7513 & 0.2873 \tabularnewline
203 & 0.0832 & 3e-04 & 0.0202 & 0.0203 & 0.0011 & 9.0679 & 3.0113 & 0.0038 & 0.2615 \tabularnewline
204 & 0.086 & 0.0698 & 0.0244 & 0.0246 & 65.3447 & 13.7576 & 3.7091 & 0.937 & 0.3178 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=308313&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]193[/C][C]0.0442[/C][C]-0.0198[/C][C]0.0198[/C][C]0.0196[/C][C]3.9726[/C][C]0[/C][C]0[/C][C]-0.231[/C][C]0.231[/C][/ROW]
[ROW][C]194[/C][C]0.0459[/C][C]0.0231[/C][C]0.0214[/C][C]0.0215[/C][C]6.2205[/C][C]5.0965[/C][C]2.2575[/C][C]0.2891[/C][C]0.2601[/C][/ROW]
[ROW][C]195[/C][C]0.05[/C][C]-0.0033[/C][C]0.0154[/C][C]0.0154[/C][C]0.1583[/C][C]3.4505[/C][C]1.8575[/C][C]-0.0461[/C][C]0.1887[/C][/ROW]
[ROW][C]196[/C][C]0.0598[/C][C]0.0244[/C][C]0.0177[/C][C]0.0177[/C][C]7.6293[/C][C]4.4952[/C][C]2.1202[/C][C]0.3202[/C][C]0.2216[/C][/ROW]
[ROW][C]197[/C][C]0.0613[/C][C]-0.0155[/C][C]0.0172[/C][C]0.0173[/C][C]2.841[/C][C]4.1643[/C][C]2.0407[/C][C]-0.1954[/C][C]0.2164[/C][/ROW]
[ROW][C]198[/C][C]0.0665[/C][C]0.0395[/C][C]0.0209[/C][C]0.0211[/C][C]23.6997[/C][C]7.4202[/C][C]2.724[/C][C]0.5643[/C][C]0.2743[/C][/ROW]
[ROW][C]199[/C][C]0.0696[/C][C]-0.0033[/C][C]0.0184[/C][C]0.0186[/C][C]0.1149[/C][C]6.3766[/C][C]2.5252[/C][C]-0.0393[/C][C]0.2408[/C][/ROW]
[ROW][C]200[/C][C]0.0713[/C][C]0.0349[/C][C]0.0205[/C][C]0.0207[/C][C]13.0748[/C][C]7.2139[/C][C]2.6859[/C][C]0.4191[/C][C]0.2631[/C][/ROW]
[ROW][C]201[/C][C]0.0783[/C][C]0.0013[/C][C]0.0183[/C][C]0.0185[/C][C]0.0227[/C][C]6.4149[/C][C]2.5328[/C][C]0.0175[/C][C]0.2358[/C][/ROW]
[ROW][C]202[/C][C]0.0819[/C][C]-0.0573[/C][C]0.0222[/C][C]0.0223[/C][C]42.0122[/C][C]9.9746[/C][C]3.1583[/C][C]-0.7513[/C][C]0.2873[/C][/ROW]
[ROW][C]203[/C][C]0.0832[/C][C]3e-04[/C][C]0.0202[/C][C]0.0203[/C][C]0.0011[/C][C]9.0679[/C][C]3.0113[/C][C]0.0038[/C][C]0.2615[/C][/ROW]
[ROW][C]204[/C][C]0.086[/C][C]0.0698[/C][C]0.0244[/C][C]0.0246[/C][C]65.3447[/C][C]13.7576[/C][C]3.7091[/C][C]0.937[/C][C]0.3178[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=308313&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=308313&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
1930.0442-0.01980.01980.01963.972600-0.2310.231
1940.04590.02310.02140.02156.22055.09652.25750.28910.2601
1950.05-0.00330.01540.01540.15833.45051.8575-0.04610.1887
1960.05980.02440.01770.01777.62934.49522.12020.32020.2216
1970.0613-0.01550.01720.01732.8414.16432.0407-0.19540.2164
1980.06650.03950.02090.021123.69977.42022.7240.56430.2743
1990.0696-0.00330.01840.01860.11496.37662.5252-0.03930.2408
2000.07130.03490.02050.020713.07487.21392.68590.41910.2631
2010.07830.00130.01830.01850.02276.41492.53280.01750.2358
2020.0819-0.05730.02220.022342.01229.97463.1583-0.75130.2873
2030.08323e-040.02020.02030.00119.06793.01130.00380.2615
2040.0860.06980.02440.024665.344713.75763.70910.9370.3178



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