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 computationThu, 21 Dec 2017 17:06:05 +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/21/t1513872374n23aii98gjfpw6i.htm/, Retrieved Tue, 14 May 2024 03:30:16 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=310667, Retrieved Tue, 14 May 2024 03:30:16 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact55
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2017-12-21 16:06:05] [37d4e299f63d60aeb1b8f01e350555e9] [Current]
Feedback Forum

Post a new message
Dataseries X:
120.7
134.1
143.6
115.1
135.1
123.6
110.7
104.3
143.7
149.7
143.3
115.3
136.2
137.4
147.6
123.7
131.6
132.7
123
108.2
140.9
149.2
134.5
103.2
136.2
135.6
139.7
131
124.4
123.6
125.1
106.2
144.4
153.7
131.5
105.5
136.3
133.4
129.8
129.1
113
117.1
115.4
96.5
141
141.3
121
106
121.9
122.4
137.4
118.9
106.7
126.5
110.8
99.3
138.7
128.9
121.9
106
113.1
124.2
129.2
116.5
105.7
122
105.1
100.8
131.8
119.9
127.1
107.1
115.8
122.9
137.5
108.9
114.9
129.7
111.8
103.4
140.3
140.7
136.1
106.3
127.7
136.4
145.1
116.5
117.6
129
117.4
107.2
130.9
145.1
127.8
96.6
126
130.1
124.5
137.4
105.6
113.3
108.4
83.5
116.2
115.6
95.6
83.5
95.3
95.8
100.4
90.9
80
93.8
92.3
74.3
101.4
103.7
92.4
83.4
91.6
101.2
109.2
100.3
91
110.9
96.3
80.4
114.5
109.9
104.1
90.7
94.6
100.4
115.9
94.4
102.5
97.3
90
81.1
107.3
100.5
95.4
81.1
92.2
98.4
98.6
81.4
85.5
90.4
83.7
73.3
89.8
101.6
87.5
65.3
87.1
89.9
91.5
84.7
84.1
86.7
89.6
65.7
92.9
97.7
84.4
68.1
95
96.3
94.7
89.7
81.3
89.3
94.2
68.7
105.7
102
84.3
74.9
92.9
100.4
99.4
94.6
84
102.2
91.4
79.8
101
97.5
87.8
77.1
89.6
100.9
97.8
90.5
84.2
96.8
82.9
75.6
91.9
85.4
90.4
74
93.1
94.9
102.9
80.7
91.7
95.5
84.8
74.4




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310667&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])
18879.8-------
189101-------
19097.5-------
19187.8-------
19277.1-------
19389.6-------
194100.9-------
19597.8-------
19690.5-------
19784.2-------
19896.8000000000001-------
19982.9-------
20075.6-------
20191.999.495388.6432111.98130.11660.99990.40660.9999
20285.499.863188.4237113.12510.01630.88040.63650.9998
20390.489.303278.8364101.48250.42990.7350.59560.9863
2047475.13366.25885.47350.4150.00190.35460.4647
20593.190.028378.6235103.4770.32720.99030.52490.9823
20694.995.280382.6655110.2770.48020.61220.23130.9949
207102.997.403984.0443113.39470.25030.62050.48060.9962
20880.788.326976.074103.02580.15460.0260.3860.9552
20991.783.732671.9197.96610.13630.66190.47430.8686
21095.592.147778.5623108.6520.34530.52120.29030.9753
21184.885.922173.1062101.53080.4440.11450.64780.9025
21274.472.878562.081686.0090.41020.03760.34230.3423

\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 & 79.8 & - & - & - & - & - & - & - \tabularnewline
189 & 101 & - & - & - & - & - & - & - \tabularnewline
190 & 97.5 & - & - & - & - & - & - & - \tabularnewline
191 & 87.8 & - & - & - & - & - & - & - \tabularnewline
192 & 77.1 & - & - & - & - & - & - & - \tabularnewline
193 & 89.6 & - & - & - & - & - & - & - \tabularnewline
194 & 100.9 & - & - & - & - & - & - & - \tabularnewline
195 & 97.8 & - & - & - & - & - & - & - \tabularnewline
196 & 90.5 & - & - & - & - & - & - & - \tabularnewline
197 & 84.2 & - & - & - & - & - & - & - \tabularnewline
198 & 96.8000000000001 & - & - & - & - & - & - & - \tabularnewline
199 & 82.9 & - & - & - & - & - & - & - \tabularnewline
200 & 75.6 & - & - & - & - & - & - & - \tabularnewline
201 & 91.9 & 99.4953 & 88.6432 & 111.9813 & 0.1166 & 0.9999 & 0.4066 & 0.9999 \tabularnewline
202 & 85.4 & 99.8631 & 88.4237 & 113.1251 & 0.0163 & 0.8804 & 0.6365 & 0.9998 \tabularnewline
203 & 90.4 & 89.3032 & 78.8364 & 101.4825 & 0.4299 & 0.735 & 0.5956 & 0.9863 \tabularnewline
204 & 74 & 75.133 & 66.258 & 85.4735 & 0.415 & 0.0019 & 0.3546 & 0.4647 \tabularnewline
205 & 93.1 & 90.0283 & 78.6235 & 103.477 & 0.3272 & 0.9903 & 0.5249 & 0.9823 \tabularnewline
206 & 94.9 & 95.2803 & 82.6655 & 110.277 & 0.4802 & 0.6122 & 0.2313 & 0.9949 \tabularnewline
207 & 102.9 & 97.4039 & 84.0443 & 113.3947 & 0.2503 & 0.6205 & 0.4806 & 0.9962 \tabularnewline
208 & 80.7 & 88.3269 & 76.074 & 103.0258 & 0.1546 & 0.026 & 0.386 & 0.9552 \tabularnewline
209 & 91.7 & 83.7326 & 71.91 & 97.9661 & 0.1363 & 0.6619 & 0.4743 & 0.8686 \tabularnewline
210 & 95.5 & 92.1477 & 78.5623 & 108.652 & 0.3453 & 0.5212 & 0.2903 & 0.9753 \tabularnewline
211 & 84.8 & 85.9221 & 73.1062 & 101.5308 & 0.444 & 0.1145 & 0.6478 & 0.9025 \tabularnewline
212 & 74.4 & 72.8785 & 62.0816 & 86.009 & 0.4102 & 0.0376 & 0.3423 & 0.3423 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310667&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]79.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]101[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]97.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]87.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]77.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]89.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]100.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]97.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]90.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]84.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]96.8000000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]82.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]75.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]91.9[/C][C]99.4953[/C][C]88.6432[/C][C]111.9813[/C][C]0.1166[/C][C]0.9999[/C][C]0.4066[/C][C]0.9999[/C][/ROW]
[ROW][C]202[/C][C]85.4[/C][C]99.8631[/C][C]88.4237[/C][C]113.1251[/C][C]0.0163[/C][C]0.8804[/C][C]0.6365[/C][C]0.9998[/C][/ROW]
[ROW][C]203[/C][C]90.4[/C][C]89.3032[/C][C]78.8364[/C][C]101.4825[/C][C]0.4299[/C][C]0.735[/C][C]0.5956[/C][C]0.9863[/C][/ROW]
[ROW][C]204[/C][C]74[/C][C]75.133[/C][C]66.258[/C][C]85.4735[/C][C]0.415[/C][C]0.0019[/C][C]0.3546[/C][C]0.4647[/C][/ROW]
[ROW][C]205[/C][C]93.1[/C][C]90.0283[/C][C]78.6235[/C][C]103.477[/C][C]0.3272[/C][C]0.9903[/C][C]0.5249[/C][C]0.9823[/C][/ROW]
[ROW][C]206[/C][C]94.9[/C][C]95.2803[/C][C]82.6655[/C][C]110.277[/C][C]0.4802[/C][C]0.6122[/C][C]0.2313[/C][C]0.9949[/C][/ROW]
[ROW][C]207[/C][C]102.9[/C][C]97.4039[/C][C]84.0443[/C][C]113.3947[/C][C]0.2503[/C][C]0.6205[/C][C]0.4806[/C][C]0.9962[/C][/ROW]
[ROW][C]208[/C][C]80.7[/C][C]88.3269[/C][C]76.074[/C][C]103.0258[/C][C]0.1546[/C][C]0.026[/C][C]0.386[/C][C]0.9552[/C][/ROW]
[ROW][C]209[/C][C]91.7[/C][C]83.7326[/C][C]71.91[/C][C]97.9661[/C][C]0.1363[/C][C]0.6619[/C][C]0.4743[/C][C]0.8686[/C][/ROW]
[ROW][C]210[/C][C]95.5[/C][C]92.1477[/C][C]78.5623[/C][C]108.652[/C][C]0.3453[/C][C]0.5212[/C][C]0.2903[/C][C]0.9753[/C][/ROW]
[ROW][C]211[/C][C]84.8[/C][C]85.9221[/C][C]73.1062[/C][C]101.5308[/C][C]0.444[/C][C]0.1145[/C][C]0.6478[/C][C]0.9025[/C][/ROW]
[ROW][C]212[/C][C]74.4[/C][C]72.8785[/C][C]62.0816[/C][C]86.009[/C][C]0.4102[/C][C]0.0376[/C][C]0.3423[/C][C]0.3423[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310667&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310667&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])
18879.8-------
189101-------
19097.5-------
19187.8-------
19277.1-------
19389.6-------
194100.9-------
19597.8-------
19690.5-------
19784.2-------
19896.8000000000001-------
19982.9-------
20075.6-------
20191.999.495388.6432111.98130.11660.99990.40660.9999
20285.499.863188.4237113.12510.01630.88040.63650.9998
20390.489.303278.8364101.48250.42990.7350.59560.9863
2047475.13366.25885.47350.4150.00190.35460.4647
20593.190.028378.6235103.4770.32720.99030.52490.9823
20694.995.280382.6655110.2770.48020.61220.23130.9949
207102.997.403984.0443113.39470.25030.62050.48060.9962
20880.788.326976.074103.02580.15460.0260.3860.9552
20991.783.732671.9197.96610.13630.66190.47430.8686
21095.592.147778.5623108.6520.34530.52120.29030.9753
21184.885.922173.1062101.53080.4440.11450.64780.9025
21274.472.878562.081686.0090.41020.03760.34230.3423







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.064-0.08260.08260.079457.68800-0.72710.7271
2020.0678-0.16940.1260.1178209.1812133.434611.5514-1.38461.0559
2030.06960.01210.0880.08261.20389.35749.45290.1050.7389
2040.0702-0.01530.06990.06571.283767.3398.206-0.10850.5813
2050.07620.0330.06250.05939.435555.75837.46710.29410.5239
2060.0803-0.0040.05270.05010.144646.48936.8183-0.03640.4426
2070.08380.05340.05280.050830.206944.16336.64550.52620.4546
2080.0849-0.09450.0580.055758.169245.9146.776-0.73020.489
2090.08670.08690.06130.059663.479847.86586.91850.76280.5194
2100.09140.03510.05860.057211.237644.2036.64850.32090.4996
2110.0927-0.01320.05450.05321.259240.2996.3481-0.10740.4639
2120.09190.02040.05170.05052.314937.13366.09370.14570.4374

\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.064 & -0.0826 & 0.0826 & 0.0794 & 57.688 & 0 & 0 & -0.7271 & 0.7271 \tabularnewline
202 & 0.0678 & -0.1694 & 0.126 & 0.1178 & 209.1812 & 133.4346 & 11.5514 & -1.3846 & 1.0559 \tabularnewline
203 & 0.0696 & 0.0121 & 0.088 & 0.0826 & 1.203 & 89.3574 & 9.4529 & 0.105 & 0.7389 \tabularnewline
204 & 0.0702 & -0.0153 & 0.0699 & 0.0657 & 1.2837 & 67.339 & 8.206 & -0.1085 & 0.5813 \tabularnewline
205 & 0.0762 & 0.033 & 0.0625 & 0.0593 & 9.4355 & 55.7583 & 7.4671 & 0.2941 & 0.5239 \tabularnewline
206 & 0.0803 & -0.004 & 0.0527 & 0.0501 & 0.1446 & 46.4893 & 6.8183 & -0.0364 & 0.4426 \tabularnewline
207 & 0.0838 & 0.0534 & 0.0528 & 0.0508 & 30.2069 & 44.1633 & 6.6455 & 0.5262 & 0.4546 \tabularnewline
208 & 0.0849 & -0.0945 & 0.058 & 0.0557 & 58.1692 & 45.914 & 6.776 & -0.7302 & 0.489 \tabularnewline
209 & 0.0867 & 0.0869 & 0.0613 & 0.0596 & 63.4798 & 47.8658 & 6.9185 & 0.7628 & 0.5194 \tabularnewline
210 & 0.0914 & 0.0351 & 0.0586 & 0.0572 & 11.2376 & 44.203 & 6.6485 & 0.3209 & 0.4996 \tabularnewline
211 & 0.0927 & -0.0132 & 0.0545 & 0.0532 & 1.2592 & 40.299 & 6.3481 & -0.1074 & 0.4639 \tabularnewline
212 & 0.0919 & 0.0204 & 0.0517 & 0.0505 & 2.3149 & 37.1336 & 6.0937 & 0.1457 & 0.4374 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310667&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.064[/C][C]-0.0826[/C][C]0.0826[/C][C]0.0794[/C][C]57.688[/C][C]0[/C][C]0[/C][C]-0.7271[/C][C]0.7271[/C][/ROW]
[ROW][C]202[/C][C]0.0678[/C][C]-0.1694[/C][C]0.126[/C][C]0.1178[/C][C]209.1812[/C][C]133.4346[/C][C]11.5514[/C][C]-1.3846[/C][C]1.0559[/C][/ROW]
[ROW][C]203[/C][C]0.0696[/C][C]0.0121[/C][C]0.088[/C][C]0.0826[/C][C]1.203[/C][C]89.3574[/C][C]9.4529[/C][C]0.105[/C][C]0.7389[/C][/ROW]
[ROW][C]204[/C][C]0.0702[/C][C]-0.0153[/C][C]0.0699[/C][C]0.0657[/C][C]1.2837[/C][C]67.339[/C][C]8.206[/C][C]-0.1085[/C][C]0.5813[/C][/ROW]
[ROW][C]205[/C][C]0.0762[/C][C]0.033[/C][C]0.0625[/C][C]0.0593[/C][C]9.4355[/C][C]55.7583[/C][C]7.4671[/C][C]0.2941[/C][C]0.5239[/C][/ROW]
[ROW][C]206[/C][C]0.0803[/C][C]-0.004[/C][C]0.0527[/C][C]0.0501[/C][C]0.1446[/C][C]46.4893[/C][C]6.8183[/C][C]-0.0364[/C][C]0.4426[/C][/ROW]
[ROW][C]207[/C][C]0.0838[/C][C]0.0534[/C][C]0.0528[/C][C]0.0508[/C][C]30.2069[/C][C]44.1633[/C][C]6.6455[/C][C]0.5262[/C][C]0.4546[/C][/ROW]
[ROW][C]208[/C][C]0.0849[/C][C]-0.0945[/C][C]0.058[/C][C]0.0557[/C][C]58.1692[/C][C]45.914[/C][C]6.776[/C][C]-0.7302[/C][C]0.489[/C][/ROW]
[ROW][C]209[/C][C]0.0867[/C][C]0.0869[/C][C]0.0613[/C][C]0.0596[/C][C]63.4798[/C][C]47.8658[/C][C]6.9185[/C][C]0.7628[/C][C]0.5194[/C][/ROW]
[ROW][C]210[/C][C]0.0914[/C][C]0.0351[/C][C]0.0586[/C][C]0.0572[/C][C]11.2376[/C][C]44.203[/C][C]6.6485[/C][C]0.3209[/C][C]0.4996[/C][/ROW]
[ROW][C]211[/C][C]0.0927[/C][C]-0.0132[/C][C]0.0545[/C][C]0.0532[/C][C]1.2592[/C][C]40.299[/C][C]6.3481[/C][C]-0.1074[/C][C]0.4639[/C][/ROW]
[ROW][C]212[/C][C]0.0919[/C][C]0.0204[/C][C]0.0517[/C][C]0.0505[/C][C]2.3149[/C][C]37.1336[/C][C]6.0937[/C][C]0.1457[/C][C]0.4374[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310667&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310667&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.064-0.08260.08260.079457.68800-0.72710.7271
2020.0678-0.16940.1260.1178209.1812133.434611.5514-1.38461.0559
2030.06960.01210.0880.08261.20389.35749.45290.1050.7389
2040.0702-0.01530.06990.06571.283767.3398.206-0.10850.5813
2050.07620.0330.06250.05939.435555.75837.46710.29410.5239
2060.0803-0.0040.05270.05010.144646.48936.8183-0.03640.4426
2070.08380.05340.05280.050830.206944.16336.64550.52620.4546
2080.0849-0.09450.0580.055758.169245.9146.776-0.73020.489
2090.08670.08690.06130.059663.479847.86586.91850.76280.5194
2100.09140.03510.05860.057211.237644.2036.64850.32090.4996
2110.0927-0.01320.05450.05321.259240.2996.3481-0.10740.4639
2120.09190.02040.05170.05052.314937.13366.09370.14570.4374



Parameters (Session):
Parameters (R input):
par1 = 12 ; par2 = -0.2 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 0 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
R code (references can be found in the software module):
par10 <- 'FALSE'
par9 <- '1'
par8 <- '0'
par7 <- '1'
par6 <- '0'
par5 <- '12'
par4 <- '1'
par3 <- '1'
par2 <- '-0.2'
par1 <- '12'
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')