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 computationFri, 23 Dec 2016 14:02:31 +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/2016/Dec/23/t14824982989wtqudocps7n3fl.htm/, Retrieved Tue, 07 May 2024 14:47:46 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302925, Retrieved Tue, 07 May 2024 14:47:46 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact69
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [(Partial) Autocorrelation Function] [ACF1] [2016-12-22 17:08:50] [267314984f6394bb93cd815224aa34ba]
- RM      [ARIMA Forecasting] [ARIMAF1] [2016-12-23 13:02:31] [636d0f72197ac5e1dae4a755427db02a] [Current]
Feedback Forum

Post a new message
Dataseries X:
2601.76
2819.1
2368.84
2683.5
2649.22
2760.3
2326
2819.3
2957.02
3460.5
2873.16
3252.48
3628.52
3899.22
3049.36
3751.58
4639.42
4991.02
4076.28
4782.4
5173.8
5177.94
4048.46
4828.98
4727.62
5366.84
4597.38
4838.16
4268.2
4769.34
4223.34
4396.38
4911.6
5368.4
4665
5081.46
















































































































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
R Framework error message
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.

\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
R Framework error message & 
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.
\tabularnewline \hline \end{tabular} %Source: https://freestatistics.org/blog/index.php?pk=302925&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] [ROW]R Framework error message[/C][C]
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.
[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=302925&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302925&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
R Framework error message
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.







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[24])
123252.48-------
133628.52-------
143899.22-------
153049.36-------
163751.58-------
174639.42-------
184991.02-------
194076.28-------
204782.4-------
215173.8-------
225177.94-------
234048.46-------
244828.98-------
254727.625205.024315.51456094.52550.14640.79630.99970.7963
265366.845475.724217.76936733.67070.43260.87810.9930.8432
274597.384625.86013085.19156166.52880.48550.17290.97750.398
284838.165328.083549.06917107.09090.29470.78960.95880.7088
294268.26215.91964226.9258204.91430.02750.91270.93990.9141
304769.346567.51954388.6858746.3540.05290.98070.92190.9411
314223.345652.77973299.36958006.18990.11690.76910.90540.7537
324396.386358.89963842.99838874.8010.06310.95190.89030.8833
334911.66750.29954081.78329418.81590.08840.95810.87660.9209
345368.46754.43973941.57659567.3030.16710.90040.8640.9101
3546655624.95992674.80418575.11580.26180.56770.85250.7015
365081.466405.47983324.14259486.81710.19980.86590.8420.842

\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[24]) \tabularnewline
12 & 3252.48 & - & - & - & - & - & - & - \tabularnewline
13 & 3628.52 & - & - & - & - & - & - & - \tabularnewline
14 & 3899.22 & - & - & - & - & - & - & - \tabularnewline
15 & 3049.36 & - & - & - & - & - & - & - \tabularnewline
16 & 3751.58 & - & - & - & - & - & - & - \tabularnewline
17 & 4639.42 & - & - & - & - & - & - & - \tabularnewline
18 & 4991.02 & - & - & - & - & - & - & - \tabularnewline
19 & 4076.28 & - & - & - & - & - & - & - \tabularnewline
20 & 4782.4 & - & - & - & - & - & - & - \tabularnewline
21 & 5173.8 & - & - & - & - & - & - & - \tabularnewline
22 & 5177.94 & - & - & - & - & - & - & - \tabularnewline
23 & 4048.46 & - & - & - & - & - & - & - \tabularnewline
24 & 4828.98 & - & - & - & - & - & - & - \tabularnewline
25 & 4727.62 & 5205.02 & 4315.5145 & 6094.5255 & 0.1464 & 0.7963 & 0.9997 & 0.7963 \tabularnewline
26 & 5366.84 & 5475.72 & 4217.7693 & 6733.6707 & 0.4326 & 0.8781 & 0.993 & 0.8432 \tabularnewline
27 & 4597.38 & 4625.8601 & 3085.1915 & 6166.5288 & 0.4855 & 0.1729 & 0.9775 & 0.398 \tabularnewline
28 & 4838.16 & 5328.08 & 3549.0691 & 7107.0909 & 0.2947 & 0.7896 & 0.9588 & 0.7088 \tabularnewline
29 & 4268.2 & 6215.9196 & 4226.925 & 8204.9143 & 0.0275 & 0.9127 & 0.9399 & 0.9141 \tabularnewline
30 & 4769.34 & 6567.5195 & 4388.685 & 8746.354 & 0.0529 & 0.9807 & 0.9219 & 0.9411 \tabularnewline
31 & 4223.34 & 5652.7797 & 3299.3695 & 8006.1899 & 0.1169 & 0.7691 & 0.9054 & 0.7537 \tabularnewline
32 & 4396.38 & 6358.8996 & 3842.9983 & 8874.801 & 0.0631 & 0.9519 & 0.8903 & 0.8833 \tabularnewline
33 & 4911.6 & 6750.2995 & 4081.7832 & 9418.8159 & 0.0884 & 0.9581 & 0.8766 & 0.9209 \tabularnewline
34 & 5368.4 & 6754.4397 & 3941.5765 & 9567.303 & 0.1671 & 0.9004 & 0.864 & 0.9101 \tabularnewline
35 & 4665 & 5624.9599 & 2674.8041 & 8575.1158 & 0.2618 & 0.5677 & 0.8525 & 0.7015 \tabularnewline
36 & 5081.46 & 6405.4798 & 3324.1425 & 9486.8171 & 0.1998 & 0.8659 & 0.842 & 0.842 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302925&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[24])[/C][/ROW]
[ROW][C]12[/C][C]3252.48[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]13[/C][C]3628.52[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]14[/C][C]3899.22[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]15[/C][C]3049.36[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]16[/C][C]3751.58[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]17[/C][C]4639.42[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]18[/C][C]4991.02[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]19[/C][C]4076.28[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]20[/C][C]4782.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]21[/C][C]5173.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]22[/C][C]5177.94[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]23[/C][C]4048.46[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]24[/C][C]4828.98[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]25[/C][C]4727.62[/C][C]5205.02[/C][C]4315.5145[/C][C]6094.5255[/C][C]0.1464[/C][C]0.7963[/C][C]0.9997[/C][C]0.7963[/C][/ROW]
[ROW][C]26[/C][C]5366.84[/C][C]5475.72[/C][C]4217.7693[/C][C]6733.6707[/C][C]0.4326[/C][C]0.8781[/C][C]0.993[/C][C]0.8432[/C][/ROW]
[ROW][C]27[/C][C]4597.38[/C][C]4625.8601[/C][C]3085.1915[/C][C]6166.5288[/C][C]0.4855[/C][C]0.1729[/C][C]0.9775[/C][C]0.398[/C][/ROW]
[ROW][C]28[/C][C]4838.16[/C][C]5328.08[/C][C]3549.0691[/C][C]7107.0909[/C][C]0.2947[/C][C]0.7896[/C][C]0.9588[/C][C]0.7088[/C][/ROW]
[ROW][C]29[/C][C]4268.2[/C][C]6215.9196[/C][C]4226.925[/C][C]8204.9143[/C][C]0.0275[/C][C]0.9127[/C][C]0.9399[/C][C]0.9141[/C][/ROW]
[ROW][C]30[/C][C]4769.34[/C][C]6567.5195[/C][C]4388.685[/C][C]8746.354[/C][C]0.0529[/C][C]0.9807[/C][C]0.9219[/C][C]0.9411[/C][/ROW]
[ROW][C]31[/C][C]4223.34[/C][C]5652.7797[/C][C]3299.3695[/C][C]8006.1899[/C][C]0.1169[/C][C]0.7691[/C][C]0.9054[/C][C]0.7537[/C][/ROW]
[ROW][C]32[/C][C]4396.38[/C][C]6358.8996[/C][C]3842.9983[/C][C]8874.801[/C][C]0.0631[/C][C]0.9519[/C][C]0.8903[/C][C]0.8833[/C][/ROW]
[ROW][C]33[/C][C]4911.6[/C][C]6750.2995[/C][C]4081.7832[/C][C]9418.8159[/C][C]0.0884[/C][C]0.9581[/C][C]0.8766[/C][C]0.9209[/C][/ROW]
[ROW][C]34[/C][C]5368.4[/C][C]6754.4397[/C][C]3941.5765[/C][C]9567.303[/C][C]0.1671[/C][C]0.9004[/C][C]0.864[/C][C]0.9101[/C][/ROW]
[ROW][C]35[/C][C]4665[/C][C]5624.9599[/C][C]2674.8041[/C][C]8575.1158[/C][C]0.2618[/C][C]0.5677[/C][C]0.8525[/C][C]0.7015[/C][/ROW]
[ROW][C]36[/C][C]5081.46[/C][C]6405.4798[/C][C]3324.1425[/C][C]9486.8171[/C][C]0.1998[/C][C]0.8659[/C][C]0.842[/C][C]0.842[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302925&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302925&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[24])
123252.48-------
133628.52-------
143899.22-------
153049.36-------
163751.58-------
174639.42-------
184991.02-------
194076.28-------
204782.4-------
215173.8-------
225177.94-------
234048.46-------
244828.98-------
254727.625205.024315.51456094.52550.14640.79630.99970.7963
265366.845475.724217.76936733.67070.43260.87810.9930.8432
274597.384625.86013085.19156166.52880.48550.17290.97750.398
284838.165328.083549.06917107.09090.29470.78960.95880.7088
294268.26215.91964226.9258204.91430.02750.91270.93990.9141
304769.346567.51954388.6858746.3540.05290.98070.92190.9411
314223.345652.77973299.36958006.18990.11690.76910.90540.7537
324396.386358.89963842.99838874.8010.06310.95190.89030.8833
334911.66750.29954081.78329418.81590.08840.95810.87660.9209
345368.46754.43973941.57659567.3030.16710.90040.8640.9101
3546655624.95992674.80418575.11580.26180.56770.85250.7015
365081.466405.47983324.14259486.81710.19980.86590.8420.842







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
250.0872-0.1010.1010.0961227910.7600-0.94940.9494
260.1172-0.02030.06060.058111854.8498119882.8049346.241-0.21650.5829
270.1699-0.00620.04250.0408811.118280192.2427283.1823-0.05660.4075
280.1704-0.10130.05720.0547240021.5904120149.5796346.626-0.97430.5492
290.1633-0.45630.1370.11813793611.7124854842.0062924.5767-3.87331.214
300.1693-0.3770.1770.15133233449.59791251276.60481118.6048-3.57591.6077
310.2124-0.33850.20010.1712043297.89461364422.50331168.085-2.84261.7841
320.2019-0.44640.23090.19523851483.29521675305.10231294.3358-3.90272.0489
330.2017-0.37440.24680.20863380815.95721864806.30841365.5791-3.65652.2275
340.2125-0.25820.24790.21061921106.12351870436.28991367.6389-2.75632.2804
350.2676-0.20580.24410.2084921523.08871784171.45351335.7288-1.9092.2466
360.2454-0.26060.24550.21031753028.3841781576.19771334.757-2.6332.2788

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
25 & 0.0872 & -0.101 & 0.101 & 0.0961 & 227910.76 & 0 & 0 & -0.9494 & 0.9494 \tabularnewline
26 & 0.1172 & -0.0203 & 0.0606 & 0.0581 & 11854.8498 & 119882.8049 & 346.241 & -0.2165 & 0.5829 \tabularnewline
27 & 0.1699 & -0.0062 & 0.0425 & 0.0408 & 811.1182 & 80192.2427 & 283.1823 & -0.0566 & 0.4075 \tabularnewline
28 & 0.1704 & -0.1013 & 0.0572 & 0.0547 & 240021.5904 & 120149.5796 & 346.626 & -0.9743 & 0.5492 \tabularnewline
29 & 0.1633 & -0.4563 & 0.137 & 0.1181 & 3793611.7124 & 854842.0062 & 924.5767 & -3.8733 & 1.214 \tabularnewline
30 & 0.1693 & -0.377 & 0.177 & 0.1513 & 3233449.5979 & 1251276.6048 & 1118.6048 & -3.5759 & 1.6077 \tabularnewline
31 & 0.2124 & -0.3385 & 0.2001 & 0.171 & 2043297.8946 & 1364422.5033 & 1168.085 & -2.8426 & 1.7841 \tabularnewline
32 & 0.2019 & -0.4464 & 0.2309 & 0.1952 & 3851483.2952 & 1675305.1023 & 1294.3358 & -3.9027 & 2.0489 \tabularnewline
33 & 0.2017 & -0.3744 & 0.2468 & 0.2086 & 3380815.9572 & 1864806.3084 & 1365.5791 & -3.6565 & 2.2275 \tabularnewline
34 & 0.2125 & -0.2582 & 0.2479 & 0.2106 & 1921106.1235 & 1870436.2899 & 1367.6389 & -2.7563 & 2.2804 \tabularnewline
35 & 0.2676 & -0.2058 & 0.2441 & 0.2084 & 921523.0887 & 1784171.4535 & 1335.7288 & -1.909 & 2.2466 \tabularnewline
36 & 0.2454 & -0.2606 & 0.2455 & 0.2103 & 1753028.384 & 1781576.1977 & 1334.757 & -2.633 & 2.2788 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302925&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]25[/C][C]0.0872[/C][C]-0.101[/C][C]0.101[/C][C]0.0961[/C][C]227910.76[/C][C]0[/C][C]0[/C][C]-0.9494[/C][C]0.9494[/C][/ROW]
[ROW][C]26[/C][C]0.1172[/C][C]-0.0203[/C][C]0.0606[/C][C]0.0581[/C][C]11854.8498[/C][C]119882.8049[/C][C]346.241[/C][C]-0.2165[/C][C]0.5829[/C][/ROW]
[ROW][C]27[/C][C]0.1699[/C][C]-0.0062[/C][C]0.0425[/C][C]0.0408[/C][C]811.1182[/C][C]80192.2427[/C][C]283.1823[/C][C]-0.0566[/C][C]0.4075[/C][/ROW]
[ROW][C]28[/C][C]0.1704[/C][C]-0.1013[/C][C]0.0572[/C][C]0.0547[/C][C]240021.5904[/C][C]120149.5796[/C][C]346.626[/C][C]-0.9743[/C][C]0.5492[/C][/ROW]
[ROW][C]29[/C][C]0.1633[/C][C]-0.4563[/C][C]0.137[/C][C]0.1181[/C][C]3793611.7124[/C][C]854842.0062[/C][C]924.5767[/C][C]-3.8733[/C][C]1.214[/C][/ROW]
[ROW][C]30[/C][C]0.1693[/C][C]-0.377[/C][C]0.177[/C][C]0.1513[/C][C]3233449.5979[/C][C]1251276.6048[/C][C]1118.6048[/C][C]-3.5759[/C][C]1.6077[/C][/ROW]
[ROW][C]31[/C][C]0.2124[/C][C]-0.3385[/C][C]0.2001[/C][C]0.171[/C][C]2043297.8946[/C][C]1364422.5033[/C][C]1168.085[/C][C]-2.8426[/C][C]1.7841[/C][/ROW]
[ROW][C]32[/C][C]0.2019[/C][C]-0.4464[/C][C]0.2309[/C][C]0.1952[/C][C]3851483.2952[/C][C]1675305.1023[/C][C]1294.3358[/C][C]-3.9027[/C][C]2.0489[/C][/ROW]
[ROW][C]33[/C][C]0.2017[/C][C]-0.3744[/C][C]0.2468[/C][C]0.2086[/C][C]3380815.9572[/C][C]1864806.3084[/C][C]1365.5791[/C][C]-3.6565[/C][C]2.2275[/C][/ROW]
[ROW][C]34[/C][C]0.2125[/C][C]-0.2582[/C][C]0.2479[/C][C]0.2106[/C][C]1921106.1235[/C][C]1870436.2899[/C][C]1367.6389[/C][C]-2.7563[/C][C]2.2804[/C][/ROW]
[ROW][C]35[/C][C]0.2676[/C][C]-0.2058[/C][C]0.2441[/C][C]0.2084[/C][C]921523.0887[/C][C]1784171.4535[/C][C]1335.7288[/C][C]-1.909[/C][C]2.2466[/C][/ROW]
[ROW][C]36[/C][C]0.2454[/C][C]-0.2606[/C][C]0.2455[/C][C]0.2103[/C][C]1753028.384[/C][C]1781576.1977[/C][C]1334.757[/C][C]-2.633[/C][C]2.2788[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302925&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302925&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
250.0872-0.1010.1010.0961227910.7600-0.94940.9494
260.1172-0.02030.06060.058111854.8498119882.8049346.241-0.21650.5829
270.1699-0.00620.04250.0408811.118280192.2427283.1823-0.05660.4075
280.1704-0.10130.05720.0547240021.5904120149.5796346.626-0.97430.5492
290.1633-0.45630.1370.11813793611.7124854842.0062924.5767-3.87331.214
300.1693-0.3770.1770.15133233449.59791251276.60481118.6048-3.57591.6077
310.2124-0.33850.20010.1712043297.89461364422.50331168.085-2.84261.7841
320.2019-0.44640.23090.19523851483.29521675305.10231294.3358-3.90272.0489
330.2017-0.37440.24680.20863380815.95721864806.30841365.5791-3.65652.2275
340.2125-0.25820.24790.21061921106.12351870436.28991367.6389-2.75632.2804
350.2676-0.20580.24410.2084921523.08871784171.45351335.7288-1.9092.2466
360.2454-0.26060.24550.21031753028.3841781576.19771334.757-2.6332.2788



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