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 computationMon, 19 Dec 2016 12:02:40 +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/19/t1482145497ziah0hi5vvti2nz.htm/, Retrieved Tue, 21 May 2024 06:38:03 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=301292, Retrieved Tue, 21 May 2024 06:38:03 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact104
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2016-12-19 11:02:40] [cefbb908b49c27a772f794ee9c78d9df] [Current]
Feedback Forum

Post a new message
Dataseries X:
5396.86
4963.38
5445.73
5038.03
5412.13
4965.15
5706.96
5176.7
5426.78
5083.14
5852.19
5144.63
5454.9
4958.98
5538.78
5044.74
5252.57
4945.69
6064.6
5335.02
5830.26
5391.33
6111.81
5472.44
5869.92
5423.01
6173.75
5592.14
5896.64
5505.83
6383.46
5761.51
5960.74
5772.04
6743.55
5878.49
6385.87
5900.06
7065.42
6147.75
6487.65
6119.33
7087.73
6422.35
6573.97
6301.82
7366.24
6444.26
6619.34
6528.77
7530.53




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

\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
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301292&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] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=301292&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301292&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







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[39])
276173.75-------
285592.14-------
295896.64-------
305505.83-------
316383.46-------
325761.51-------
335960.74-------
345772.04-------
356743.55-------
365878.49-------
376385.87-------
385900.06-------
397065.42-------
406147.756291.58045963.28036637.95460.2079010
416487.656636.37646207.03217095.41880.26270.98150.99920.0335
426119.336236.98545783.8446725.62880.31850.15730.99834e-04
437087.737172.93576564.11827838.22070.40090.9990.990.6243
446422.356521.11835929.43857171.84010.3830.04390.98890.0506
456573.976709.13126040.0067452.38360.36080.77530.97580.1737
466301.826521.9475834.34247290.58890.28730.44720.97210.0829
477366.247600.85166747.32228562.35150.31620.9960.95970.8625
486444.266635.45035853.78317521.49510.33620.0530.9530.1708
496619.347202.59786313.15968217.34580.130.92850.94270.6045
506528.776657.01845800.61767639.85780.39910.52990.93440.2077
517530.537970.92736905.57549200.63550.24140.98920.92550.9255

\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[39]) \tabularnewline
27 & 6173.75 & - & - & - & - & - & - & - \tabularnewline
28 & 5592.14 & - & - & - & - & - & - & - \tabularnewline
29 & 5896.64 & - & - & - & - & - & - & - \tabularnewline
30 & 5505.83 & - & - & - & - & - & - & - \tabularnewline
31 & 6383.46 & - & - & - & - & - & - & - \tabularnewline
32 & 5761.51 & - & - & - & - & - & - & - \tabularnewline
33 & 5960.74 & - & - & - & - & - & - & - \tabularnewline
34 & 5772.04 & - & - & - & - & - & - & - \tabularnewline
35 & 6743.55 & - & - & - & - & - & - & - \tabularnewline
36 & 5878.49 & - & - & - & - & - & - & - \tabularnewline
37 & 6385.87 & - & - & - & - & - & - & - \tabularnewline
38 & 5900.06 & - & - & - & - & - & - & - \tabularnewline
39 & 7065.42 & - & - & - & - & - & - & - \tabularnewline
40 & 6147.75 & 6291.5804 & 5963.2803 & 6637.9546 & 0.2079 & 0 & 1 & 0 \tabularnewline
41 & 6487.65 & 6636.3764 & 6207.0321 & 7095.4188 & 0.2627 & 0.9815 & 0.9992 & 0.0335 \tabularnewline
42 & 6119.33 & 6236.9854 & 5783.844 & 6725.6288 & 0.3185 & 0.1573 & 0.9983 & 4e-04 \tabularnewline
43 & 7087.73 & 7172.9357 & 6564.1182 & 7838.2207 & 0.4009 & 0.999 & 0.99 & 0.6243 \tabularnewline
44 & 6422.35 & 6521.1183 & 5929.4385 & 7171.8401 & 0.383 & 0.0439 & 0.9889 & 0.0506 \tabularnewline
45 & 6573.97 & 6709.1312 & 6040.006 & 7452.3836 & 0.3608 & 0.7753 & 0.9758 & 0.1737 \tabularnewline
46 & 6301.82 & 6521.947 & 5834.3424 & 7290.5889 & 0.2873 & 0.4472 & 0.9721 & 0.0829 \tabularnewline
47 & 7366.24 & 7600.8516 & 6747.3222 & 8562.3515 & 0.3162 & 0.996 & 0.9597 & 0.8625 \tabularnewline
48 & 6444.26 & 6635.4503 & 5853.7831 & 7521.4951 & 0.3362 & 0.053 & 0.953 & 0.1708 \tabularnewline
49 & 6619.34 & 7202.5978 & 6313.1596 & 8217.3458 & 0.13 & 0.9285 & 0.9427 & 0.6045 \tabularnewline
50 & 6528.77 & 6657.0184 & 5800.6176 & 7639.8578 & 0.3991 & 0.5299 & 0.9344 & 0.2077 \tabularnewline
51 & 7530.53 & 7970.9273 & 6905.5754 & 9200.6355 & 0.2414 & 0.9892 & 0.9255 & 0.9255 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301292&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[39])[/C][/ROW]
[ROW][C]27[/C][C]6173.75[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]28[/C][C]5592.14[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]29[/C][C]5896.64[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]30[/C][C]5505.83[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]31[/C][C]6383.46[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]32[/C][C]5761.51[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]33[/C][C]5960.74[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]34[/C][C]5772.04[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]6743.55[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]5878.49[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]6385.87[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]5900.06[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]7065.42[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]6147.75[/C][C]6291.5804[/C][C]5963.2803[/C][C]6637.9546[/C][C]0.2079[/C][C]0[/C][C]1[/C][C]0[/C][/ROW]
[ROW][C]41[/C][C]6487.65[/C][C]6636.3764[/C][C]6207.0321[/C][C]7095.4188[/C][C]0.2627[/C][C]0.9815[/C][C]0.9992[/C][C]0.0335[/C][/ROW]
[ROW][C]42[/C][C]6119.33[/C][C]6236.9854[/C][C]5783.844[/C][C]6725.6288[/C][C]0.3185[/C][C]0.1573[/C][C]0.9983[/C][C]4e-04[/C][/ROW]
[ROW][C]43[/C][C]7087.73[/C][C]7172.9357[/C][C]6564.1182[/C][C]7838.2207[/C][C]0.4009[/C][C]0.999[/C][C]0.99[/C][C]0.6243[/C][/ROW]
[ROW][C]44[/C][C]6422.35[/C][C]6521.1183[/C][C]5929.4385[/C][C]7171.8401[/C][C]0.383[/C][C]0.0439[/C][C]0.9889[/C][C]0.0506[/C][/ROW]
[ROW][C]45[/C][C]6573.97[/C][C]6709.1312[/C][C]6040.006[/C][C]7452.3836[/C][C]0.3608[/C][C]0.7753[/C][C]0.9758[/C][C]0.1737[/C][/ROW]
[ROW][C]46[/C][C]6301.82[/C][C]6521.947[/C][C]5834.3424[/C][C]7290.5889[/C][C]0.2873[/C][C]0.4472[/C][C]0.9721[/C][C]0.0829[/C][/ROW]
[ROW][C]47[/C][C]7366.24[/C][C]7600.8516[/C][C]6747.3222[/C][C]8562.3515[/C][C]0.3162[/C][C]0.996[/C][C]0.9597[/C][C]0.8625[/C][/ROW]
[ROW][C]48[/C][C]6444.26[/C][C]6635.4503[/C][C]5853.7831[/C][C]7521.4951[/C][C]0.3362[/C][C]0.053[/C][C]0.953[/C][C]0.1708[/C][/ROW]
[ROW][C]49[/C][C]6619.34[/C][C]7202.5978[/C][C]6313.1596[/C][C]8217.3458[/C][C]0.13[/C][C]0.9285[/C][C]0.9427[/C][C]0.6045[/C][/ROW]
[ROW][C]50[/C][C]6528.77[/C][C]6657.0184[/C][C]5800.6176[/C][C]7639.8578[/C][C]0.3991[/C][C]0.5299[/C][C]0.9344[/C][C]0.2077[/C][/ROW]
[ROW][C]51[/C][C]7530.53[/C][C]7970.9273[/C][C]6905.5754[/C][C]9200.6355[/C][C]0.2414[/C][C]0.9892[/C][C]0.9255[/C][C]0.9255[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301292&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301292&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[39])
276173.75-------
285592.14-------
295896.64-------
305505.83-------
316383.46-------
325761.51-------
335960.74-------
345772.04-------
356743.55-------
365878.49-------
376385.87-------
385900.06-------
397065.42-------
406147.756291.58045963.28036637.95460.2079010
416487.656636.37646207.03217095.41880.26270.98150.99920.0335
426119.336236.98545783.8446725.62880.31850.15730.99834e-04
437087.737172.93576564.11827838.22070.40090.9990.990.6243
446422.356521.11835929.43857171.84010.3830.04390.98890.0506
456573.976709.13126040.0067452.38360.36080.77530.97580.1737
466301.826521.9475834.34247290.58890.28730.44720.97210.0829
477366.247600.85166747.32228562.35150.31620.9960.95970.8625
486444.266635.45035853.78317521.49510.33620.0530.9530.1708
496619.347202.59786313.15968217.34580.130.92850.94270.6045
506528.776657.01845800.61767639.85780.39910.52990.93440.2077
517530.537970.92736905.57549200.63550.24140.98920.92550.9255







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
400.0281-0.02340.02340.023120687.18600-0.26280.2628
410.0353-0.02290.02320.022922119.55121403.3685146.2989-0.27180.2673
420.04-0.01920.02180.021613842.804118883.1804137.4161-0.2150.2499
430.0473-0.0120.01940.01927260.017915977.3897126.4017-0.15570.2263
440.0509-0.01540.01860.01849755.186314732.949121.3794-0.18050.2172
450.0565-0.02060.01890.018718268.559915322.2175123.7829-0.2470.2221
460.0601-0.03490.02120.02148455.884220055.5985141.6178-0.40230.2479
470.0645-0.03180.02250.022355042.598824428.9735156.2977-0.42870.2705
480.0681-0.02970.02330.02336553.729725776.1686160.5496-0.34940.2792
490.0719-0.08810.02980.0292340189.708457217.5226239.2018-1.06580.3579
500.0753-0.01960.02890.028316447.651153511.1707231.3248-0.23440.3467
510.0787-0.05850.03130.0307193949.792565214.3891255.3711-0.80480.3848

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
40 & 0.0281 & -0.0234 & 0.0234 & 0.0231 & 20687.186 & 0 & 0 & -0.2628 & 0.2628 \tabularnewline
41 & 0.0353 & -0.0229 & 0.0232 & 0.0229 & 22119.551 & 21403.3685 & 146.2989 & -0.2718 & 0.2673 \tabularnewline
42 & 0.04 & -0.0192 & 0.0218 & 0.0216 & 13842.8041 & 18883.1804 & 137.4161 & -0.215 & 0.2499 \tabularnewline
43 & 0.0473 & -0.012 & 0.0194 & 0.0192 & 7260.0179 & 15977.3897 & 126.4017 & -0.1557 & 0.2263 \tabularnewline
44 & 0.0509 & -0.0154 & 0.0186 & 0.0184 & 9755.1863 & 14732.949 & 121.3794 & -0.1805 & 0.2172 \tabularnewline
45 & 0.0565 & -0.0206 & 0.0189 & 0.0187 & 18268.5599 & 15322.2175 & 123.7829 & -0.247 & 0.2221 \tabularnewline
46 & 0.0601 & -0.0349 & 0.0212 & 0.021 & 48455.8842 & 20055.5985 & 141.6178 & -0.4023 & 0.2479 \tabularnewline
47 & 0.0645 & -0.0318 & 0.0225 & 0.0223 & 55042.5988 & 24428.9735 & 156.2977 & -0.4287 & 0.2705 \tabularnewline
48 & 0.0681 & -0.0297 & 0.0233 & 0.023 & 36553.7297 & 25776.1686 & 160.5496 & -0.3494 & 0.2792 \tabularnewline
49 & 0.0719 & -0.0881 & 0.0298 & 0.0292 & 340189.7084 & 57217.5226 & 239.2018 & -1.0658 & 0.3579 \tabularnewline
50 & 0.0753 & -0.0196 & 0.0289 & 0.0283 & 16447.6511 & 53511.1707 & 231.3248 & -0.2344 & 0.3467 \tabularnewline
51 & 0.0787 & -0.0585 & 0.0313 & 0.0307 & 193949.7925 & 65214.3891 & 255.3711 & -0.8048 & 0.3848 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301292&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]40[/C][C]0.0281[/C][C]-0.0234[/C][C]0.0234[/C][C]0.0231[/C][C]20687.186[/C][C]0[/C][C]0[/C][C]-0.2628[/C][C]0.2628[/C][/ROW]
[ROW][C]41[/C][C]0.0353[/C][C]-0.0229[/C][C]0.0232[/C][C]0.0229[/C][C]22119.551[/C][C]21403.3685[/C][C]146.2989[/C][C]-0.2718[/C][C]0.2673[/C][/ROW]
[ROW][C]42[/C][C]0.04[/C][C]-0.0192[/C][C]0.0218[/C][C]0.0216[/C][C]13842.8041[/C][C]18883.1804[/C][C]137.4161[/C][C]-0.215[/C][C]0.2499[/C][/ROW]
[ROW][C]43[/C][C]0.0473[/C][C]-0.012[/C][C]0.0194[/C][C]0.0192[/C][C]7260.0179[/C][C]15977.3897[/C][C]126.4017[/C][C]-0.1557[/C][C]0.2263[/C][/ROW]
[ROW][C]44[/C][C]0.0509[/C][C]-0.0154[/C][C]0.0186[/C][C]0.0184[/C][C]9755.1863[/C][C]14732.949[/C][C]121.3794[/C][C]-0.1805[/C][C]0.2172[/C][/ROW]
[ROW][C]45[/C][C]0.0565[/C][C]-0.0206[/C][C]0.0189[/C][C]0.0187[/C][C]18268.5599[/C][C]15322.2175[/C][C]123.7829[/C][C]-0.247[/C][C]0.2221[/C][/ROW]
[ROW][C]46[/C][C]0.0601[/C][C]-0.0349[/C][C]0.0212[/C][C]0.021[/C][C]48455.8842[/C][C]20055.5985[/C][C]141.6178[/C][C]-0.4023[/C][C]0.2479[/C][/ROW]
[ROW][C]47[/C][C]0.0645[/C][C]-0.0318[/C][C]0.0225[/C][C]0.0223[/C][C]55042.5988[/C][C]24428.9735[/C][C]156.2977[/C][C]-0.4287[/C][C]0.2705[/C][/ROW]
[ROW][C]48[/C][C]0.0681[/C][C]-0.0297[/C][C]0.0233[/C][C]0.023[/C][C]36553.7297[/C][C]25776.1686[/C][C]160.5496[/C][C]-0.3494[/C][C]0.2792[/C][/ROW]
[ROW][C]49[/C][C]0.0719[/C][C]-0.0881[/C][C]0.0298[/C][C]0.0292[/C][C]340189.7084[/C][C]57217.5226[/C][C]239.2018[/C][C]-1.0658[/C][C]0.3579[/C][/ROW]
[ROW][C]50[/C][C]0.0753[/C][C]-0.0196[/C][C]0.0289[/C][C]0.0283[/C][C]16447.6511[/C][C]53511.1707[/C][C]231.3248[/C][C]-0.2344[/C][C]0.3467[/C][/ROW]
[ROW][C]51[/C][C]0.0787[/C][C]-0.0585[/C][C]0.0313[/C][C]0.0307[/C][C]193949.7925[/C][C]65214.3891[/C][C]255.3711[/C][C]-0.8048[/C][C]0.3848[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301292&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301292&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
400.0281-0.02340.02340.023120687.18600-0.26280.2628
410.0353-0.02290.02320.022922119.55121403.3685146.2989-0.27180.2673
420.04-0.01920.02180.021613842.804118883.1804137.4161-0.2150.2499
430.0473-0.0120.01940.01927260.017915977.3897126.4017-0.15570.2263
440.0509-0.01540.01860.01849755.186314732.949121.3794-0.18050.2172
450.0565-0.02060.01890.018718268.559915322.2175123.7829-0.2470.2221
460.0601-0.03490.02120.02148455.884220055.5985141.6178-0.40230.2479
470.0645-0.03180.02250.022355042.598824428.9735156.2977-0.42870.2705
480.0681-0.02970.02330.02336553.729725776.1686160.5496-0.34940.2792
490.0719-0.08810.02980.0292340189.708457217.5226239.2018-1.06580.3579
500.0753-0.01960.02890.028316447.651153511.1707231.3248-0.23440.3467
510.0787-0.05850.03130.0307193949.792565214.3891255.3711-0.80480.3848



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