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, 21 Dec 2018 20:45:43 +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/2018/Dec/21/t15454232133sjq95q6oqmnmnk.htm/, Retrieved Sat, 04 May 2024 11:36:30 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=316205, Retrieved Sat, 04 May 2024 11:36:30 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact83
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Forecast bouwverg...] [2018-12-21 19:45:43] [8607e318ea7bb53061252e65c5c0fa8a] [Current]
Feedback Forum

Post a new message
Dataseries X:
2570
2669
2450
2842
3440
2678
2981
2260
2844
2546
2456
2295
2379
2471
2057
2280
2351
2276
2548
2311
2201
2725
2408
2139
1898
2539
2070
2063
2565
2443
2196
2799
2076
2628
2292
2155
2476
2138
1854
2081
1795
1756
2237
1960
1829
2524
2077
2366
2185
2098
1836
1863
2044
2136
2931
3263
3328
3570
2313
1623
1316
1507
1419
1660
1790
1733
2086
1814
2241
1943
1773
2143
2087
1805
1913
2296
2500
2210
2526
2249
2024
2091
2045
1882
1831
1964
1763
1688
2149
1823
2094
2145
1791
1996
2097
1796
1963
2042
1746
2210
2968
3126
3708
3015
1569
1518
1393
1615
1777
1648
1463
1779




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time3 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 time3 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=316205&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]3 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=316205&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=316205&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 time3 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[100])
881688-------
892149-------
901823-------
912094-------
922145-------
931791-------
941996-------
952097-------
961796-------
971963-------
982042-------
991746-------
1002210-------
10129682259.91711644.65962875.17450.0120.56320.63810.5632
10231262153.85291404.54192903.16380.00550.01660.80660.4416
10337082357.64011472.93153242.34870.00140.04440.72040.6282
10430152293.66731296.21293291.12170.07820.00270.61490.5653
10515692254.57841154.96013354.19670.11090.08760.79570.5317
10615182392.89951200.02883585.77030.07530.91210.74280.6181
10713932183.1085903.72343462.49360.11310.84590.55250.4836
10816152096.1977735.80023456.59520.24410.84450.66730.4349
10917772073.2688636.46033510.07730.34310.73410.55980.426
11016482112.9764603.97423621.97860.27290.66870.53670.4499
11114631952.3311374.43473530.22740.27170.64730.60110.3745
11217792094.6642450.75843738.56990.35330.77430.44530.4453

\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[100]) \tabularnewline
88 & 1688 & - & - & - & - & - & - & - \tabularnewline
89 & 2149 & - & - & - & - & - & - & - \tabularnewline
90 & 1823 & - & - & - & - & - & - & - \tabularnewline
91 & 2094 & - & - & - & - & - & - & - \tabularnewline
92 & 2145 & - & - & - & - & - & - & - \tabularnewline
93 & 1791 & - & - & - & - & - & - & - \tabularnewline
94 & 1996 & - & - & - & - & - & - & - \tabularnewline
95 & 2097 & - & - & - & - & - & - & - \tabularnewline
96 & 1796 & - & - & - & - & - & - & - \tabularnewline
97 & 1963 & - & - & - & - & - & - & - \tabularnewline
98 & 2042 & - & - & - & - & - & - & - \tabularnewline
99 & 1746 & - & - & - & - & - & - & - \tabularnewline
100 & 2210 & - & - & - & - & - & - & - \tabularnewline
101 & 2968 & 2259.9171 & 1644.6596 & 2875.1745 & 0.012 & 0.5632 & 0.6381 & 0.5632 \tabularnewline
102 & 3126 & 2153.8529 & 1404.5419 & 2903.1638 & 0.0055 & 0.0166 & 0.8066 & 0.4416 \tabularnewline
103 & 3708 & 2357.6401 & 1472.9315 & 3242.3487 & 0.0014 & 0.0444 & 0.7204 & 0.6282 \tabularnewline
104 & 3015 & 2293.6673 & 1296.2129 & 3291.1217 & 0.0782 & 0.0027 & 0.6149 & 0.5653 \tabularnewline
105 & 1569 & 2254.5784 & 1154.9601 & 3354.1967 & 0.1109 & 0.0876 & 0.7957 & 0.5317 \tabularnewline
106 & 1518 & 2392.8995 & 1200.0288 & 3585.7703 & 0.0753 & 0.9121 & 0.7428 & 0.6181 \tabularnewline
107 & 1393 & 2183.1085 & 903.7234 & 3462.4936 & 0.1131 & 0.8459 & 0.5525 & 0.4836 \tabularnewline
108 & 1615 & 2096.1977 & 735.8002 & 3456.5952 & 0.2441 & 0.8445 & 0.6673 & 0.4349 \tabularnewline
109 & 1777 & 2073.2688 & 636.4603 & 3510.0773 & 0.3431 & 0.7341 & 0.5598 & 0.426 \tabularnewline
110 & 1648 & 2112.9764 & 603.9742 & 3621.9786 & 0.2729 & 0.6687 & 0.5367 & 0.4499 \tabularnewline
111 & 1463 & 1952.3311 & 374.4347 & 3530.2274 & 0.2717 & 0.6473 & 0.6011 & 0.3745 \tabularnewline
112 & 1779 & 2094.6642 & 450.7584 & 3738.5699 & 0.3533 & 0.7743 & 0.4453 & 0.4453 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=316205&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[100])[/C][/ROW]
[ROW][C]88[/C][C]1688[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]2149[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]1823[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]2094[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]2145[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]1791[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]1996[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]2097[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]1796[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]1963[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]2042[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]1746[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]2210[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]2968[/C][C]2259.9171[/C][C]1644.6596[/C][C]2875.1745[/C][C]0.012[/C][C]0.5632[/C][C]0.6381[/C][C]0.5632[/C][/ROW]
[ROW][C]102[/C][C]3126[/C][C]2153.8529[/C][C]1404.5419[/C][C]2903.1638[/C][C]0.0055[/C][C]0.0166[/C][C]0.8066[/C][C]0.4416[/C][/ROW]
[ROW][C]103[/C][C]3708[/C][C]2357.6401[/C][C]1472.9315[/C][C]3242.3487[/C][C]0.0014[/C][C]0.0444[/C][C]0.7204[/C][C]0.6282[/C][/ROW]
[ROW][C]104[/C][C]3015[/C][C]2293.6673[/C][C]1296.2129[/C][C]3291.1217[/C][C]0.0782[/C][C]0.0027[/C][C]0.6149[/C][C]0.5653[/C][/ROW]
[ROW][C]105[/C][C]1569[/C][C]2254.5784[/C][C]1154.9601[/C][C]3354.1967[/C][C]0.1109[/C][C]0.0876[/C][C]0.7957[/C][C]0.5317[/C][/ROW]
[ROW][C]106[/C][C]1518[/C][C]2392.8995[/C][C]1200.0288[/C][C]3585.7703[/C][C]0.0753[/C][C]0.9121[/C][C]0.7428[/C][C]0.6181[/C][/ROW]
[ROW][C]107[/C][C]1393[/C][C]2183.1085[/C][C]903.7234[/C][C]3462.4936[/C][C]0.1131[/C][C]0.8459[/C][C]0.5525[/C][C]0.4836[/C][/ROW]
[ROW][C]108[/C][C]1615[/C][C]2096.1977[/C][C]735.8002[/C][C]3456.5952[/C][C]0.2441[/C][C]0.8445[/C][C]0.6673[/C][C]0.4349[/C][/ROW]
[ROW][C]109[/C][C]1777[/C][C]2073.2688[/C][C]636.4603[/C][C]3510.0773[/C][C]0.3431[/C][C]0.7341[/C][C]0.5598[/C][C]0.426[/C][/ROW]
[ROW][C]110[/C][C]1648[/C][C]2112.9764[/C][C]603.9742[/C][C]3621.9786[/C][C]0.2729[/C][C]0.6687[/C][C]0.5367[/C][C]0.4499[/C][/ROW]
[ROW][C]111[/C][C]1463[/C][C]1952.3311[/C][C]374.4347[/C][C]3530.2274[/C][C]0.2717[/C][C]0.6473[/C][C]0.6011[/C][C]0.3745[/C][/ROW]
[ROW][C]112[/C][C]1779[/C][C]2094.6642[/C][C]450.7584[/C][C]3738.5699[/C][C]0.3533[/C][C]0.7743[/C][C]0.4453[/C][C]0.4453[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=316205&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=316205&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[100])
881688-------
892149-------
901823-------
912094-------
922145-------
931791-------
941996-------
952097-------
961796-------
971963-------
982042-------
991746-------
1002210-------
10129682259.91711644.65962875.17450.0120.56320.63810.5632
10231262153.85291404.54192903.16380.00550.01660.80660.4416
10337082357.64011472.93153242.34870.00140.04440.72040.6282
10430152293.66731296.21293291.12170.07820.00270.61490.5653
10515692254.57841154.96013354.19670.11090.08760.79570.5317
10615182392.89951200.02883585.77030.07530.91210.74280.6181
10713932183.1085903.72343462.49360.11310.84590.55250.4836
10816152096.1977735.80023456.59520.24410.84450.66730.4349
10917772073.2688636.46033510.07730.34310.73410.55980.426
11016482112.9764603.97423621.97860.27290.66870.53670.4499
11114631952.3311374.43473530.22740.27170.64730.60110.3745
11217792094.6642450.75843738.56990.35330.77430.44530.4453







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1010.13890.23860.23860.2709501381.4381001.91421.9142
1020.17750.3110.27480.3196945070.0612723225.7496850.42682.62812.2711
1030.19150.36420.30460.36151823471.79111089974.43011044.01843.65052.7309
1040.22190.23920.28820.339520320.9322947561.0556973.42751.952.5357
1050.2488-0.4370.3180.3429470017.7533852052.3952923.0668-1.85342.3992
1060.2543-0.57640.3610.3604765449.2178837618.5323915.215-2.36522.3936
1070.299-0.56720.39050.372624271.435807140.3755898.4099-2.1362.3568
1080.3311-0.2980.37890.3579231551.2497735191.7348857.4332-1.30092.2248
1090.3536-0.16670.35540.335387775.1898663256.5631814.4057-0.80092.0666
1100.3644-0.28210.3480.3265216203.0723618551.214786.4803-1.2571.9856
1110.4124-0.33450.34680.3228239444.8939584087.0031764.2558-1.32281.9254
1120.4004-0.17740.33270.309599643.8735543716.7423737.3715-0.85341.836

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
101 & 0.1389 & 0.2386 & 0.2386 & 0.2709 & 501381.4381 & 0 & 0 & 1.9142 & 1.9142 \tabularnewline
102 & 0.1775 & 0.311 & 0.2748 & 0.3196 & 945070.0612 & 723225.7496 & 850.4268 & 2.6281 & 2.2711 \tabularnewline
103 & 0.1915 & 0.3642 & 0.3046 & 0.3615 & 1823471.7911 & 1089974.4301 & 1044.0184 & 3.6505 & 2.7309 \tabularnewline
104 & 0.2219 & 0.2392 & 0.2882 & 0.339 & 520320.9322 & 947561.0556 & 973.4275 & 1.95 & 2.5357 \tabularnewline
105 & 0.2488 & -0.437 & 0.318 & 0.3429 & 470017.7533 & 852052.3952 & 923.0668 & -1.8534 & 2.3992 \tabularnewline
106 & 0.2543 & -0.5764 & 0.361 & 0.3604 & 765449.2178 & 837618.5323 & 915.215 & -2.3652 & 2.3936 \tabularnewline
107 & 0.299 & -0.5672 & 0.3905 & 0.372 & 624271.435 & 807140.3755 & 898.4099 & -2.136 & 2.3568 \tabularnewline
108 & 0.3311 & -0.298 & 0.3789 & 0.3579 & 231551.2497 & 735191.7348 & 857.4332 & -1.3009 & 2.2248 \tabularnewline
109 & 0.3536 & -0.1667 & 0.3554 & 0.3353 & 87775.1898 & 663256.5631 & 814.4057 & -0.8009 & 2.0666 \tabularnewline
110 & 0.3644 & -0.2821 & 0.348 & 0.3265 & 216203.0723 & 618551.214 & 786.4803 & -1.257 & 1.9856 \tabularnewline
111 & 0.4124 & -0.3345 & 0.3468 & 0.3228 & 239444.8939 & 584087.0031 & 764.2558 & -1.3228 & 1.9254 \tabularnewline
112 & 0.4004 & -0.1774 & 0.3327 & 0.3095 & 99643.8735 & 543716.7423 & 737.3715 & -0.8534 & 1.836 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=316205&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]101[/C][C]0.1389[/C][C]0.2386[/C][C]0.2386[/C][C]0.2709[/C][C]501381.4381[/C][C]0[/C][C]0[/C][C]1.9142[/C][C]1.9142[/C][/ROW]
[ROW][C]102[/C][C]0.1775[/C][C]0.311[/C][C]0.2748[/C][C]0.3196[/C][C]945070.0612[/C][C]723225.7496[/C][C]850.4268[/C][C]2.6281[/C][C]2.2711[/C][/ROW]
[ROW][C]103[/C][C]0.1915[/C][C]0.3642[/C][C]0.3046[/C][C]0.3615[/C][C]1823471.7911[/C][C]1089974.4301[/C][C]1044.0184[/C][C]3.6505[/C][C]2.7309[/C][/ROW]
[ROW][C]104[/C][C]0.2219[/C][C]0.2392[/C][C]0.2882[/C][C]0.339[/C][C]520320.9322[/C][C]947561.0556[/C][C]973.4275[/C][C]1.95[/C][C]2.5357[/C][/ROW]
[ROW][C]105[/C][C]0.2488[/C][C]-0.437[/C][C]0.318[/C][C]0.3429[/C][C]470017.7533[/C][C]852052.3952[/C][C]923.0668[/C][C]-1.8534[/C][C]2.3992[/C][/ROW]
[ROW][C]106[/C][C]0.2543[/C][C]-0.5764[/C][C]0.361[/C][C]0.3604[/C][C]765449.2178[/C][C]837618.5323[/C][C]915.215[/C][C]-2.3652[/C][C]2.3936[/C][/ROW]
[ROW][C]107[/C][C]0.299[/C][C]-0.5672[/C][C]0.3905[/C][C]0.372[/C][C]624271.435[/C][C]807140.3755[/C][C]898.4099[/C][C]-2.136[/C][C]2.3568[/C][/ROW]
[ROW][C]108[/C][C]0.3311[/C][C]-0.298[/C][C]0.3789[/C][C]0.3579[/C][C]231551.2497[/C][C]735191.7348[/C][C]857.4332[/C][C]-1.3009[/C][C]2.2248[/C][/ROW]
[ROW][C]109[/C][C]0.3536[/C][C]-0.1667[/C][C]0.3554[/C][C]0.3353[/C][C]87775.1898[/C][C]663256.5631[/C][C]814.4057[/C][C]-0.8009[/C][C]2.0666[/C][/ROW]
[ROW][C]110[/C][C]0.3644[/C][C]-0.2821[/C][C]0.348[/C][C]0.3265[/C][C]216203.0723[/C][C]618551.214[/C][C]786.4803[/C][C]-1.257[/C][C]1.9856[/C][/ROW]
[ROW][C]111[/C][C]0.4124[/C][C]-0.3345[/C][C]0.3468[/C][C]0.3228[/C][C]239444.8939[/C][C]584087.0031[/C][C]764.2558[/C][C]-1.3228[/C][C]1.9254[/C][/ROW]
[ROW][C]112[/C][C]0.4004[/C][C]-0.1774[/C][C]0.3327[/C][C]0.3095[/C][C]99643.8735[/C][C]543716.7423[/C][C]737.3715[/C][C]-0.8534[/C][C]1.836[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=316205&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=316205&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
1010.13890.23860.23860.2709501381.4381001.91421.9142
1020.17750.3110.27480.3196945070.0612723225.7496850.42682.62812.2711
1030.19150.36420.30460.36151823471.79111089974.43011044.01843.65052.7309
1040.22190.23920.28820.339520320.9322947561.0556973.42751.952.5357
1050.2488-0.4370.3180.3429470017.7533852052.3952923.0668-1.85342.3992
1060.2543-0.57640.3610.3604765449.2178837618.5323915.215-2.36522.3936
1070.299-0.56720.39050.372624271.435807140.3755898.4099-2.1362.3568
1080.3311-0.2980.37890.3579231551.2497735191.7348857.4332-1.30092.2248
1090.3536-0.16670.35540.335387775.1898663256.5631814.4057-0.80092.0666
1100.3644-0.28210.3480.3265216203.0723618551.214786.4803-1.2571.9856
1110.4124-0.33450.34680.3228239444.8939584087.0031764.2558-1.32281.9254
1120.4004-0.17740.33270.309599643.8735543716.7423737.3715-0.85341.836



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