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, 22 Dec 2016 21:20:51 +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/22/t1482438123k5iu0s77aerb2hr.htm/, Retrieved Sun, 28 Apr 2024 23:53:25 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302681, Retrieved Sun, 28 Apr 2024 23:53:25 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact62
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2016-12-22 20:20:51] [349958aef20b862f8399a5ba04d6f6e3] [Current]
Feedback Forum

Post a new message
Dataseries X:
990
1384
1350
716
2068
1392
734
758
558
1620
3132
1392
918
776
1348
502
1274
1638
912
1250
1614
2840
1150
1652
1526
1412
882
848
820
1226
1212
2110
1178
2548
1568
2088
2178
3016
5514
1358
3604
1962
2036
2246
3434
4316
3032
5296
3850
2098
3992
4860
7336
9614
2988
2756
3540
2710
3730
3508
2640
2788
3502
3700
3250
4866
2836
3498
3468
3924
5738
7028
5608
6030
11976
7774
7906
10940
7626
5930
6286
6788
6932
6660
4910
4182
3550
3184
3872
3226
2504
3648
4448
2954
3842
3982
4864
6796
5844
5656
6118
7068
7696
7016
5820
4904
3860
7222
7738
7142
13804
7964
9716
8462
6884
8072
7320
11700
10792
10930
7112
8196
16818
10524
14878
13696




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302681&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[114])
1027068-------
1037696-------
1047016-------
1055820-------
1064904-------
1073860-------
1087222.00000000001-------
1097738-------
1107142-------
11113804-------
1127964-------
1139716.00000000001-------
1148462-------
11568848891.09425122.466313964.91690.21910.56580.67780.5658
11680728891.09424792.637914587.12540.3890.75510.74060.5587
11773208891.09424503.278215168.75590.31190.60090.83120.5533
118117008891.09424245.146715719.04880.210.6740.87380.549
119107928891.09424012.033216244.21350.30620.2270.910.5455
120109308891.09423799.527516748.66030.30550.31770.66140.5426
12171128891.09423604.364217235.65380.3380.3160.60670.5401
12281968891.09423424.046517707.69060.43860.65380.65130.538
123168188891.09423256.614418166.73030.0470.55840.14960.5361
124105248891.09423100.496418614.3440.3710.0550.57410.5345
125148788891.09422954.409619051.81410.12410.37640.43680.533
126136968891.09422817.290619480.20370.18690.13390.53170.5317

\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[114]) \tabularnewline
102 & 7068 & - & - & - & - & - & - & - \tabularnewline
103 & 7696 & - & - & - & - & - & - & - \tabularnewline
104 & 7016 & - & - & - & - & - & - & - \tabularnewline
105 & 5820 & - & - & - & - & - & - & - \tabularnewline
106 & 4904 & - & - & - & - & - & - & - \tabularnewline
107 & 3860 & - & - & - & - & - & - & - \tabularnewline
108 & 7222.00000000001 & - & - & - & - & - & - & - \tabularnewline
109 & 7738 & - & - & - & - & - & - & - \tabularnewline
110 & 7142 & - & - & - & - & - & - & - \tabularnewline
111 & 13804 & - & - & - & - & - & - & - \tabularnewline
112 & 7964 & - & - & - & - & - & - & - \tabularnewline
113 & 9716.00000000001 & - & - & - & - & - & - & - \tabularnewline
114 & 8462 & - & - & - & - & - & - & - \tabularnewline
115 & 6884 & 8891.0942 & 5122.4663 & 13964.9169 & 0.2191 & 0.5658 & 0.6778 & 0.5658 \tabularnewline
116 & 8072 & 8891.0942 & 4792.6379 & 14587.1254 & 0.389 & 0.7551 & 0.7406 & 0.5587 \tabularnewline
117 & 7320 & 8891.0942 & 4503.2782 & 15168.7559 & 0.3119 & 0.6009 & 0.8312 & 0.5533 \tabularnewline
118 & 11700 & 8891.0942 & 4245.1467 & 15719.0488 & 0.21 & 0.674 & 0.8738 & 0.549 \tabularnewline
119 & 10792 & 8891.0942 & 4012.0332 & 16244.2135 & 0.3062 & 0.227 & 0.91 & 0.5455 \tabularnewline
120 & 10930 & 8891.0942 & 3799.5275 & 16748.6603 & 0.3055 & 0.3177 & 0.6614 & 0.5426 \tabularnewline
121 & 7112 & 8891.0942 & 3604.3642 & 17235.6538 & 0.338 & 0.316 & 0.6067 & 0.5401 \tabularnewline
122 & 8196 & 8891.0942 & 3424.0465 & 17707.6906 & 0.4386 & 0.6538 & 0.6513 & 0.538 \tabularnewline
123 & 16818 & 8891.0942 & 3256.6144 & 18166.7303 & 0.047 & 0.5584 & 0.1496 & 0.5361 \tabularnewline
124 & 10524 & 8891.0942 & 3100.4964 & 18614.344 & 0.371 & 0.055 & 0.5741 & 0.5345 \tabularnewline
125 & 14878 & 8891.0942 & 2954.4096 & 19051.8141 & 0.1241 & 0.3764 & 0.4368 & 0.533 \tabularnewline
126 & 13696 & 8891.0942 & 2817.2906 & 19480.2037 & 0.1869 & 0.1339 & 0.5317 & 0.5317 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302681&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[114])[/C][/ROW]
[ROW][C]102[/C][C]7068[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]7696[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]7016[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]5820[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]4904[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]3860[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]7222.00000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]7738[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]7142[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]13804[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]7964[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]9716.00000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]8462[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]6884[/C][C]8891.0942[/C][C]5122.4663[/C][C]13964.9169[/C][C]0.2191[/C][C]0.5658[/C][C]0.6778[/C][C]0.5658[/C][/ROW]
[ROW][C]116[/C][C]8072[/C][C]8891.0942[/C][C]4792.6379[/C][C]14587.1254[/C][C]0.389[/C][C]0.7551[/C][C]0.7406[/C][C]0.5587[/C][/ROW]
[ROW][C]117[/C][C]7320[/C][C]8891.0942[/C][C]4503.2782[/C][C]15168.7559[/C][C]0.3119[/C][C]0.6009[/C][C]0.8312[/C][C]0.5533[/C][/ROW]
[ROW][C]118[/C][C]11700[/C][C]8891.0942[/C][C]4245.1467[/C][C]15719.0488[/C][C]0.21[/C][C]0.674[/C][C]0.8738[/C][C]0.549[/C][/ROW]
[ROW][C]119[/C][C]10792[/C][C]8891.0942[/C][C]4012.0332[/C][C]16244.2135[/C][C]0.3062[/C][C]0.227[/C][C]0.91[/C][C]0.5455[/C][/ROW]
[ROW][C]120[/C][C]10930[/C][C]8891.0942[/C][C]3799.5275[/C][C]16748.6603[/C][C]0.3055[/C][C]0.3177[/C][C]0.6614[/C][C]0.5426[/C][/ROW]
[ROW][C]121[/C][C]7112[/C][C]8891.0942[/C][C]3604.3642[/C][C]17235.6538[/C][C]0.338[/C][C]0.316[/C][C]0.6067[/C][C]0.5401[/C][/ROW]
[ROW][C]122[/C][C]8196[/C][C]8891.0942[/C][C]3424.0465[/C][C]17707.6906[/C][C]0.4386[/C][C]0.6538[/C][C]0.6513[/C][C]0.538[/C][/ROW]
[ROW][C]123[/C][C]16818[/C][C]8891.0942[/C][C]3256.6144[/C][C]18166.7303[/C][C]0.047[/C][C]0.5584[/C][C]0.1496[/C][C]0.5361[/C][/ROW]
[ROW][C]124[/C][C]10524[/C][C]8891.0942[/C][C]3100.4964[/C][C]18614.344[/C][C]0.371[/C][C]0.055[/C][C]0.5741[/C][C]0.5345[/C][/ROW]
[ROW][C]125[/C][C]14878[/C][C]8891.0942[/C][C]2954.4096[/C][C]19051.8141[/C][C]0.1241[/C][C]0.3764[/C][C]0.4368[/C][C]0.533[/C][/ROW]
[ROW][C]126[/C][C]13696[/C][C]8891.0942[/C][C]2817.2906[/C][C]19480.2037[/C][C]0.1869[/C][C]0.1339[/C][C]0.5317[/C][C]0.5317[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302681&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302681&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[114])
1027068-------
1037696-------
1047016-------
1055820-------
1064904-------
1073860-------
1087222.00000000001-------
1097738-------
1107142-------
11113804-------
1127964-------
1139716.00000000001-------
1148462-------
11568848891.09425122.466313964.91690.21910.56580.67780.5658
11680728891.09424792.637914587.12540.3890.75510.74060.5587
11773208891.09424503.278215168.75590.31190.60090.83120.5533
118117008891.09424245.146715719.04880.210.6740.87380.549
119107928891.09424012.033216244.21350.30620.2270.910.5455
120109308891.09423799.527516748.66030.30550.31770.66140.5426
12171128891.09423604.364217235.65380.3380.3160.60670.5401
12281968891.09423424.046517707.69060.43860.65380.65130.538
123168188891.09423256.614418166.73030.0470.55840.14960.5361
124105248891.09423100.496418614.3440.3710.0550.57410.5345
125148788891.09422954.409619051.81410.12410.37640.43680.533
126136968891.09422817.290619480.20370.18690.13390.53170.5317







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1150.2912-0.29160.29160.25454028427.217100-0.67480.6748
1160.3269-0.10150.19650.1755670915.3452349671.2811532.8638-0.27540.4751
1170.3602-0.21460.20260.18162468337.05532389226.53911545.7123-0.52820.4928
1180.39180.24010.21190.20447889951.66813764407.82141940.20820.94430.6057
1190.42190.17610.20480.20223613442.77583734214.81221932.41170.63910.6123
1200.45090.18650.20170.20284157136.77043804701.80531950.56450.68550.6245
1210.4788-0.25020.20870.20563165176.25173713341.01191927.0031-0.59810.6207
1220.5059-0.08480.19320.19483155.97783309567.88271819.2218-0.23370.5724
1230.53230.47130.22410.237462835835.2099923597.58563150.17422.66490.8049
1240.5580.15520.21720.23052666381.27899197875.95493032.80.5490.7793
1250.58310.40240.2340.255435843040.791411620163.66733408.83612.01270.8914
1260.60760.35080.24380.269523087119.532812575743.32283546.22951.61530.9517

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
115 & 0.2912 & -0.2916 & 0.2916 & 0.2545 & 4028427.2171 & 0 & 0 & -0.6748 & 0.6748 \tabularnewline
116 & 0.3269 & -0.1015 & 0.1965 & 0.1755 & 670915.345 & 2349671.281 & 1532.8638 & -0.2754 & 0.4751 \tabularnewline
117 & 0.3602 & -0.2146 & 0.2026 & 0.1816 & 2468337.0553 & 2389226.5391 & 1545.7123 & -0.5282 & 0.4928 \tabularnewline
118 & 0.3918 & 0.2401 & 0.2119 & 0.2044 & 7889951.6681 & 3764407.8214 & 1940.2082 & 0.9443 & 0.6057 \tabularnewline
119 & 0.4219 & 0.1761 & 0.2048 & 0.2022 & 3613442.7758 & 3734214.8122 & 1932.4117 & 0.6391 & 0.6123 \tabularnewline
120 & 0.4509 & 0.1865 & 0.2017 & 0.2028 & 4157136.7704 & 3804701.8053 & 1950.5645 & 0.6855 & 0.6245 \tabularnewline
121 & 0.4788 & -0.2502 & 0.2087 & 0.2056 & 3165176.2517 & 3713341.0119 & 1927.0031 & -0.5981 & 0.6207 \tabularnewline
122 & 0.5059 & -0.0848 & 0.1932 & 0.19 & 483155.9778 & 3309567.8827 & 1819.2218 & -0.2337 & 0.5724 \tabularnewline
123 & 0.5323 & 0.4713 & 0.2241 & 0.2374 & 62835835.209 & 9923597.5856 & 3150.1742 & 2.6649 & 0.8049 \tabularnewline
124 & 0.558 & 0.1552 & 0.2172 & 0.2305 & 2666381.2789 & 9197875.9549 & 3032.8 & 0.549 & 0.7793 \tabularnewline
125 & 0.5831 & 0.4024 & 0.234 & 0.2554 & 35843040.7914 & 11620163.6673 & 3408.8361 & 2.0127 & 0.8914 \tabularnewline
126 & 0.6076 & 0.3508 & 0.2438 & 0.2695 & 23087119.5328 & 12575743.3228 & 3546.2295 & 1.6153 & 0.9517 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302681&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]115[/C][C]0.2912[/C][C]-0.2916[/C][C]0.2916[/C][C]0.2545[/C][C]4028427.2171[/C][C]0[/C][C]0[/C][C]-0.6748[/C][C]0.6748[/C][/ROW]
[ROW][C]116[/C][C]0.3269[/C][C]-0.1015[/C][C]0.1965[/C][C]0.1755[/C][C]670915.345[/C][C]2349671.281[/C][C]1532.8638[/C][C]-0.2754[/C][C]0.4751[/C][/ROW]
[ROW][C]117[/C][C]0.3602[/C][C]-0.2146[/C][C]0.2026[/C][C]0.1816[/C][C]2468337.0553[/C][C]2389226.5391[/C][C]1545.7123[/C][C]-0.5282[/C][C]0.4928[/C][/ROW]
[ROW][C]118[/C][C]0.3918[/C][C]0.2401[/C][C]0.2119[/C][C]0.2044[/C][C]7889951.6681[/C][C]3764407.8214[/C][C]1940.2082[/C][C]0.9443[/C][C]0.6057[/C][/ROW]
[ROW][C]119[/C][C]0.4219[/C][C]0.1761[/C][C]0.2048[/C][C]0.2022[/C][C]3613442.7758[/C][C]3734214.8122[/C][C]1932.4117[/C][C]0.6391[/C][C]0.6123[/C][/ROW]
[ROW][C]120[/C][C]0.4509[/C][C]0.1865[/C][C]0.2017[/C][C]0.2028[/C][C]4157136.7704[/C][C]3804701.8053[/C][C]1950.5645[/C][C]0.6855[/C][C]0.6245[/C][/ROW]
[ROW][C]121[/C][C]0.4788[/C][C]-0.2502[/C][C]0.2087[/C][C]0.2056[/C][C]3165176.2517[/C][C]3713341.0119[/C][C]1927.0031[/C][C]-0.5981[/C][C]0.6207[/C][/ROW]
[ROW][C]122[/C][C]0.5059[/C][C]-0.0848[/C][C]0.1932[/C][C]0.19[/C][C]483155.9778[/C][C]3309567.8827[/C][C]1819.2218[/C][C]-0.2337[/C][C]0.5724[/C][/ROW]
[ROW][C]123[/C][C]0.5323[/C][C]0.4713[/C][C]0.2241[/C][C]0.2374[/C][C]62835835.209[/C][C]9923597.5856[/C][C]3150.1742[/C][C]2.6649[/C][C]0.8049[/C][/ROW]
[ROW][C]124[/C][C]0.558[/C][C]0.1552[/C][C]0.2172[/C][C]0.2305[/C][C]2666381.2789[/C][C]9197875.9549[/C][C]3032.8[/C][C]0.549[/C][C]0.7793[/C][/ROW]
[ROW][C]125[/C][C]0.5831[/C][C]0.4024[/C][C]0.234[/C][C]0.2554[/C][C]35843040.7914[/C][C]11620163.6673[/C][C]3408.8361[/C][C]2.0127[/C][C]0.8914[/C][/ROW]
[ROW][C]126[/C][C]0.6076[/C][C]0.3508[/C][C]0.2438[/C][C]0.2695[/C][C]23087119.5328[/C][C]12575743.3228[/C][C]3546.2295[/C][C]1.6153[/C][C]0.9517[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302681&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302681&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
1150.2912-0.29160.29160.25454028427.217100-0.67480.6748
1160.3269-0.10150.19650.1755670915.3452349671.2811532.8638-0.27540.4751
1170.3602-0.21460.20260.18162468337.05532389226.53911545.7123-0.52820.4928
1180.39180.24010.21190.20447889951.66813764407.82141940.20820.94430.6057
1190.42190.17610.20480.20223613442.77583734214.81221932.41170.63910.6123
1200.45090.18650.20170.20284157136.77043804701.80531950.56450.68550.6245
1210.4788-0.25020.20870.20563165176.25173713341.01191927.0031-0.59810.6207
1220.5059-0.08480.19320.19483155.97783309567.88271819.2218-0.23370.5724
1230.53230.47130.22410.237462835835.2099923597.58563150.17422.66490.8049
1240.5580.15520.21720.23052666381.27899197875.95493032.80.5490.7793
1250.58310.40240.2340.255435843040.791411620163.66733408.83612.01270.8914
1260.60760.35080.24380.269523087119.532812575743.32283546.22951.61530.9517



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