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, 07 Dec 2017 20:23:33 +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/07/t1512675666zhbhz5kgyagnlhv.htm/, Retrieved Wed, 15 May 2024 11:20:42 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=308750, Retrieved Wed, 15 May 2024 11:20:42 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact103
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2017-12-07 19:23:33] [467f8ec0164a59d5b0902e2bf4d37c85] [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=308750&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=308750&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=308750&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.997.735487.1995109.83640.17230.99980.29850.9998
20285.491.700281.7042103.20030.14150.48640.16150.997
20390.485.125175.278696.55820.18290.48120.32330.9488
2047472.444262.705984.05490.39640.00120.2160.2971
20593.185.561673.4522100.14720.15550.93990.29370.9097
20694.997.804882.7451116.27620.3790.69120.37130.9908
207102.992.990477.7032112.03260.15390.42210.31030.9633
20880.787.380572.8498105.53160.23530.04690.36810.8983
20991.781.137867.183598.71860.11950.51950.36640.7315
21095.593.389976.206115.43960.42560.55970.38090.9431
21184.881.822366.7715101.13320.38120.08250.45640.7362
21274.473.935260.084691.79930.47970.11660.42750.4275

\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 & 97.7354 & 87.1995 & 109.8364 & 0.1723 & 0.9998 & 0.2985 & 0.9998 \tabularnewline
202 & 85.4 & 91.7002 & 81.7042 & 103.2003 & 0.1415 & 0.4864 & 0.1615 & 0.997 \tabularnewline
203 & 90.4 & 85.1251 & 75.2786 & 96.5582 & 0.1829 & 0.4812 & 0.3233 & 0.9488 \tabularnewline
204 & 74 & 72.4442 & 62.7059 & 84.0549 & 0.3964 & 0.0012 & 0.216 & 0.2971 \tabularnewline
205 & 93.1 & 85.5616 & 73.4522 & 100.1472 & 0.1555 & 0.9399 & 0.2937 & 0.9097 \tabularnewline
206 & 94.9 & 97.8048 & 82.7451 & 116.2762 & 0.379 & 0.6912 & 0.3713 & 0.9908 \tabularnewline
207 & 102.9 & 92.9904 & 77.7032 & 112.0326 & 0.1539 & 0.4221 & 0.3103 & 0.9633 \tabularnewline
208 & 80.7 & 87.3805 & 72.8498 & 105.5316 & 0.2353 & 0.0469 & 0.3681 & 0.8983 \tabularnewline
209 & 91.7 & 81.1378 & 67.1835 & 98.7186 & 0.1195 & 0.5195 & 0.3664 & 0.7315 \tabularnewline
210 & 95.5 & 93.3899 & 76.206 & 115.4396 & 0.4256 & 0.5597 & 0.3809 & 0.9431 \tabularnewline
211 & 84.8 & 81.8223 & 66.7715 & 101.1332 & 0.3812 & 0.0825 & 0.4564 & 0.7362 \tabularnewline
212 & 74.4 & 73.9352 & 60.0846 & 91.7993 & 0.4797 & 0.1166 & 0.4275 & 0.4275 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=308750&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]97.7354[/C][C]87.1995[/C][C]109.8364[/C][C]0.1723[/C][C]0.9998[/C][C]0.2985[/C][C]0.9998[/C][/ROW]
[ROW][C]202[/C][C]85.4[/C][C]91.7002[/C][C]81.7042[/C][C]103.2003[/C][C]0.1415[/C][C]0.4864[/C][C]0.1615[/C][C]0.997[/C][/ROW]
[ROW][C]203[/C][C]90.4[/C][C]85.1251[/C][C]75.2786[/C][C]96.5582[/C][C]0.1829[/C][C]0.4812[/C][C]0.3233[/C][C]0.9488[/C][/ROW]
[ROW][C]204[/C][C]74[/C][C]72.4442[/C][C]62.7059[/C][C]84.0549[/C][C]0.3964[/C][C]0.0012[/C][C]0.216[/C][C]0.2971[/C][/ROW]
[ROW][C]205[/C][C]93.1[/C][C]85.5616[/C][C]73.4522[/C][C]100.1472[/C][C]0.1555[/C][C]0.9399[/C][C]0.2937[/C][C]0.9097[/C][/ROW]
[ROW][C]206[/C][C]94.9[/C][C]97.8048[/C][C]82.7451[/C][C]116.2762[/C][C]0.379[/C][C]0.6912[/C][C]0.3713[/C][C]0.9908[/C][/ROW]
[ROW][C]207[/C][C]102.9[/C][C]92.9904[/C][C]77.7032[/C][C]112.0326[/C][C]0.1539[/C][C]0.4221[/C][C]0.3103[/C][C]0.9633[/C][/ROW]
[ROW][C]208[/C][C]80.7[/C][C]87.3805[/C][C]72.8498[/C][C]105.5316[/C][C]0.2353[/C][C]0.0469[/C][C]0.3681[/C][C]0.8983[/C][/ROW]
[ROW][C]209[/C][C]91.7[/C][C]81.1378[/C][C]67.1835[/C][C]98.7186[/C][C]0.1195[/C][C]0.5195[/C][C]0.3664[/C][C]0.7315[/C][/ROW]
[ROW][C]210[/C][C]95.5[/C][C]93.3899[/C][C]76.206[/C][C]115.4396[/C][C]0.4256[/C][C]0.5597[/C][C]0.3809[/C][C]0.9431[/C][/ROW]
[ROW][C]211[/C][C]84.8[/C][C]81.8223[/C][C]66.7715[/C][C]101.1332[/C][C]0.3812[/C][C]0.0825[/C][C]0.4564[/C][C]0.7362[/C][/ROW]
[ROW][C]212[/C][C]74.4[/C][C]73.9352[/C][C]60.0846[/C][C]91.7993[/C][C]0.4797[/C][C]0.1166[/C][C]0.4275[/C][C]0.4275[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=308750&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=308750&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.997.735487.1995109.83640.17230.99980.29850.9998
20285.491.700281.7042103.20030.14150.48640.16150.997
20390.485.125175.278696.55820.18290.48120.32330.9488
2047472.444262.705984.05490.39640.00120.2160.2971
20593.185.561673.4522100.14720.15550.93990.29370.9097
20694.997.804882.7451116.27620.3790.69120.37130.9908
207102.992.990477.7032112.03260.15390.42210.31030.9633
20880.787.380572.8498105.53160.23530.04690.36810.8983
20991.781.137867.183598.71860.11950.51950.36640.7315
21095.593.389976.206115.43960.42560.55970.38090.9431
21184.881.822366.7715101.13320.38120.08250.45640.7362
21274.473.935260.084691.79930.47970.11660.42750.4275







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.0632-0.06350.06350.061534.05200-0.55870.5587
2020.064-0.07380.06860.066339.692936.87246.0723-0.60320.5809
2030.06850.05840.06520.064327.824633.85655.81860.5050.5556
2040.08180.0210.05420.05352.420425.99755.09880.14890.4539
2050.0870.0810.05950.059756.828232.16365.67130.72170.5075
2060.0964-0.03060.05470.05488.43828.20945.3112-0.27810.4693
2070.10450.09630.06060.061498.199338.20796.18130.94870.5377
2080.106-0.08280.06340.063744.629439.01066.2458-0.63960.5505
2090.11060.11520.06920.0702111.559747.07166.86091.01120.6017
2100.12050.02210.06450.06544.452742.80976.54290.2020.5617
2110.12040.03510.06180.06278.866739.7246.30270.28510.5366
2120.12330.00620.05720.0580.21636.43176.03590.04450.4955

\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.0632 & -0.0635 & 0.0635 & 0.0615 & 34.052 & 0 & 0 & -0.5587 & 0.5587 \tabularnewline
202 & 0.064 & -0.0738 & 0.0686 & 0.0663 & 39.6929 & 36.8724 & 6.0723 & -0.6032 & 0.5809 \tabularnewline
203 & 0.0685 & 0.0584 & 0.0652 & 0.0643 & 27.8246 & 33.8565 & 5.8186 & 0.505 & 0.5556 \tabularnewline
204 & 0.0818 & 0.021 & 0.0542 & 0.0535 & 2.4204 & 25.9975 & 5.0988 & 0.1489 & 0.4539 \tabularnewline
205 & 0.087 & 0.081 & 0.0595 & 0.0597 & 56.8282 & 32.1636 & 5.6713 & 0.7217 & 0.5075 \tabularnewline
206 & 0.0964 & -0.0306 & 0.0547 & 0.0548 & 8.438 & 28.2094 & 5.3112 & -0.2781 & 0.4693 \tabularnewline
207 & 0.1045 & 0.0963 & 0.0606 & 0.0614 & 98.1993 & 38.2079 & 6.1813 & 0.9487 & 0.5377 \tabularnewline
208 & 0.106 & -0.0828 & 0.0634 & 0.0637 & 44.6294 & 39.0106 & 6.2458 & -0.6396 & 0.5505 \tabularnewline
209 & 0.1106 & 0.1152 & 0.0692 & 0.0702 & 111.5597 & 47.0716 & 6.8609 & 1.0112 & 0.6017 \tabularnewline
210 & 0.1205 & 0.0221 & 0.0645 & 0.0654 & 4.4527 & 42.8097 & 6.5429 & 0.202 & 0.5617 \tabularnewline
211 & 0.1204 & 0.0351 & 0.0618 & 0.0627 & 8.8667 & 39.724 & 6.3027 & 0.2851 & 0.5366 \tabularnewline
212 & 0.1233 & 0.0062 & 0.0572 & 0.058 & 0.216 & 36.4317 & 6.0359 & 0.0445 & 0.4955 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=308750&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.0632[/C][C]-0.0635[/C][C]0.0635[/C][C]0.0615[/C][C]34.052[/C][C]0[/C][C]0[/C][C]-0.5587[/C][C]0.5587[/C][/ROW]
[ROW][C]202[/C][C]0.064[/C][C]-0.0738[/C][C]0.0686[/C][C]0.0663[/C][C]39.6929[/C][C]36.8724[/C][C]6.0723[/C][C]-0.6032[/C][C]0.5809[/C][/ROW]
[ROW][C]203[/C][C]0.0685[/C][C]0.0584[/C][C]0.0652[/C][C]0.0643[/C][C]27.8246[/C][C]33.8565[/C][C]5.8186[/C][C]0.505[/C][C]0.5556[/C][/ROW]
[ROW][C]204[/C][C]0.0818[/C][C]0.021[/C][C]0.0542[/C][C]0.0535[/C][C]2.4204[/C][C]25.9975[/C][C]5.0988[/C][C]0.1489[/C][C]0.4539[/C][/ROW]
[ROW][C]205[/C][C]0.087[/C][C]0.081[/C][C]0.0595[/C][C]0.0597[/C][C]56.8282[/C][C]32.1636[/C][C]5.6713[/C][C]0.7217[/C][C]0.5075[/C][/ROW]
[ROW][C]206[/C][C]0.0964[/C][C]-0.0306[/C][C]0.0547[/C][C]0.0548[/C][C]8.438[/C][C]28.2094[/C][C]5.3112[/C][C]-0.2781[/C][C]0.4693[/C][/ROW]
[ROW][C]207[/C][C]0.1045[/C][C]0.0963[/C][C]0.0606[/C][C]0.0614[/C][C]98.1993[/C][C]38.2079[/C][C]6.1813[/C][C]0.9487[/C][C]0.5377[/C][/ROW]
[ROW][C]208[/C][C]0.106[/C][C]-0.0828[/C][C]0.0634[/C][C]0.0637[/C][C]44.6294[/C][C]39.0106[/C][C]6.2458[/C][C]-0.6396[/C][C]0.5505[/C][/ROW]
[ROW][C]209[/C][C]0.1106[/C][C]0.1152[/C][C]0.0692[/C][C]0.0702[/C][C]111.5597[/C][C]47.0716[/C][C]6.8609[/C][C]1.0112[/C][C]0.6017[/C][/ROW]
[ROW][C]210[/C][C]0.1205[/C][C]0.0221[/C][C]0.0645[/C][C]0.0654[/C][C]4.4527[/C][C]42.8097[/C][C]6.5429[/C][C]0.202[/C][C]0.5617[/C][/ROW]
[ROW][C]211[/C][C]0.1204[/C][C]0.0351[/C][C]0.0618[/C][C]0.0627[/C][C]8.8667[/C][C]39.724[/C][C]6.3027[/C][C]0.2851[/C][C]0.5366[/C][/ROW]
[ROW][C]212[/C][C]0.1233[/C][C]0.0062[/C][C]0.0572[/C][C]0.058[/C][C]0.216[/C][C]36.4317[/C][C]6.0359[/C][C]0.0445[/C][C]0.4955[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=308750&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=308750&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.0632-0.06350.06350.061534.05200-0.55870.5587
2020.064-0.07380.06860.066339.692936.87246.0723-0.60320.5809
2030.06850.05840.06520.064327.824633.85655.81860.5050.5556
2040.08180.0210.05420.05352.420425.99755.09880.14890.4539
2050.0870.0810.05950.059756.828232.16365.67130.72170.5075
2060.0964-0.03060.05470.05488.43828.20945.3112-0.27810.4693
2070.10450.09630.06060.061498.199338.20796.18130.94870.5377
2080.106-0.08280.06340.063744.629439.01066.2458-0.63960.5505
2090.11060.11520.06920.0702111.559747.07166.86091.01120.6017
2100.12050.02210.06450.06544.452742.80976.54290.2020.5617
2110.12040.03510.06180.06278.866739.7246.30270.28510.5366
2120.12330.00620.05720.0580.21636.43176.03590.04450.4955



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