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 computationTue, 05 Sep 2017 11:28:01 +0200
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2017/Sep/05/t15046037598eo04gfa9vm0ujw.htm/, Retrieved Fri, 17 May 2024 00:27:45 +0200
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=, Retrieved Fri, 17 May 2024 00:27:45 +0200
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact0
Dataseries X:
6396
6509
7018
6791
6300
6737
6399
6758
6601
6891
6789
5967
6995
6771
7360
7162
7025
7188
6801
7395
7203
7534
7267
6741
7185
7295
7660
7344
7439
7264
7192
7368
7246
7625
7153
6875
7413
6981
7651
7148
7072
6943
7022
6925
6904
7666
7112
6907
7880
7261
7478
7742
7499
7563
7812
7582
7362
7779
7681
7795
8049
7541
7869
7855
7582
7723
8195
7729
7856
7984
7401
8162
8223
7743
8249
8137
7650
7689
7901
7951
7956
7908
7887
8198
8358
7837
8169
8040
8112
8348
8548
8498
8167
8331
8070
7936
8553
8108
8341
8260
8113
8042
8467
8333
8243
8517
8120
8012
8801
8115
8161
8271
8108
7992
8239
8419
8781
8992
7966
8626
7935
8166
8411
8693
8861




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=&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[113])
1018113-------
1028042.00000000001-------
1038467.00000000001-------
1048333.00000000001-------
1058243.00000000001-------
1068517.00000000001-------
1078120-------
1088012-------
1098801.00000000001-------
1108115-------
1118161-------
1128271.00000000001-------
1138108.00000000001-------
11479928146.57077696.9578598.68060.25140.56640.67480.5664
11582398492.14728013.97928973.0240.15110.97930.54080.9413
11684198383.63747880.91858889.39060.44550.71240.57780.8573
11787818251.4217725.59528780.62110.02490.26740.51240.7024
11889928468.29897918.12829022.06950.03190.13420.43160.8989
11979668136.21167566.38868710.05630.28050.00170.52210.5384
12086268096.82047506.19818691.7860.04060.66680.610.4853
12179358749.30218133.41259369.5610.0050.65160.43510.9786
12281668149.06817517.99018785.07580.47920.74530.54180.5504
12384118292.55337641.20148949.06640.36180.64720.65270.7092
12486938322.38647652.20628998.01220.14120.39860.55930.733
12588618171.37427484.42568864.15280.02550.070.57110.5711

\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[113]) \tabularnewline
101 & 8113 & - & - & - & - & - & - & - \tabularnewline
102 & 8042.00000000001 & - & - & - & - & - & - & - \tabularnewline
103 & 8467.00000000001 & - & - & - & - & - & - & - \tabularnewline
104 & 8333.00000000001 & - & - & - & - & - & - & - \tabularnewline
105 & 8243.00000000001 & - & - & - & - & - & - & - \tabularnewline
106 & 8517.00000000001 & - & - & - & - & - & - & - \tabularnewline
107 & 8120 & - & - & - & - & - & - & - \tabularnewline
108 & 8012 & - & - & - & - & - & - & - \tabularnewline
109 & 8801.00000000001 & - & - & - & - & - & - & - \tabularnewline
110 & 8115 & - & - & - & - & - & - & - \tabularnewline
111 & 8161 & - & - & - & - & - & - & - \tabularnewline
112 & 8271.00000000001 & - & - & - & - & - & - & - \tabularnewline
113 & 8108.00000000001 & - & - & - & - & - & - & - \tabularnewline
114 & 7992 & 8146.5707 & 7696.957 & 8598.6806 & 0.2514 & 0.5664 & 0.6748 & 0.5664 \tabularnewline
115 & 8239 & 8492.1472 & 8013.9792 & 8973.024 & 0.1511 & 0.9793 & 0.5408 & 0.9413 \tabularnewline
116 & 8419 & 8383.6374 & 7880.9185 & 8889.3906 & 0.4455 & 0.7124 & 0.5778 & 0.8573 \tabularnewline
117 & 8781 & 8251.421 & 7725.5952 & 8780.6211 & 0.0249 & 0.2674 & 0.5124 & 0.7024 \tabularnewline
118 & 8992 & 8468.2989 & 7918.1282 & 9022.0695 & 0.0319 & 0.1342 & 0.4316 & 0.8989 \tabularnewline
119 & 7966 & 8136.2116 & 7566.3886 & 8710.0563 & 0.2805 & 0.0017 & 0.5221 & 0.5384 \tabularnewline
120 & 8626 & 8096.8204 & 7506.1981 & 8691.786 & 0.0406 & 0.6668 & 0.61 & 0.4853 \tabularnewline
121 & 7935 & 8749.3021 & 8133.4125 & 9369.561 & 0.005 & 0.6516 & 0.4351 & 0.9786 \tabularnewline
122 & 8166 & 8149.0681 & 7517.9901 & 8785.0758 & 0.4792 & 0.7453 & 0.5418 & 0.5504 \tabularnewline
123 & 8411 & 8292.5533 & 7641.2014 & 8949.0664 & 0.3618 & 0.6472 & 0.6527 & 0.7092 \tabularnewline
124 & 8693 & 8322.3864 & 7652.2062 & 8998.0122 & 0.1412 & 0.3986 & 0.5593 & 0.733 \tabularnewline
125 & 8861 & 8171.3742 & 7484.4256 & 8864.1528 & 0.0255 & 0.07 & 0.5711 & 0.5711 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=&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[113])[/C][/ROW]
[ROW][C]101[/C][C]8113[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]8042.00000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]8467.00000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]8333.00000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]8243.00000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]8517.00000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]8120[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]8012[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]8801.00000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]8115[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]8161[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]8271.00000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]8108.00000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]7992[/C][C]8146.5707[/C][C]7696.957[/C][C]8598.6806[/C][C]0.2514[/C][C]0.5664[/C][C]0.6748[/C][C]0.5664[/C][/ROW]
[ROW][C]115[/C][C]8239[/C][C]8492.1472[/C][C]8013.9792[/C][C]8973.024[/C][C]0.1511[/C][C]0.9793[/C][C]0.5408[/C][C]0.9413[/C][/ROW]
[ROW][C]116[/C][C]8419[/C][C]8383.6374[/C][C]7880.9185[/C][C]8889.3906[/C][C]0.4455[/C][C]0.7124[/C][C]0.5778[/C][C]0.8573[/C][/ROW]
[ROW][C]117[/C][C]8781[/C][C]8251.421[/C][C]7725.5952[/C][C]8780.6211[/C][C]0.0249[/C][C]0.2674[/C][C]0.5124[/C][C]0.7024[/C][/ROW]
[ROW][C]118[/C][C]8992[/C][C]8468.2989[/C][C]7918.1282[/C][C]9022.0695[/C][C]0.0319[/C][C]0.1342[/C][C]0.4316[/C][C]0.8989[/C][/ROW]
[ROW][C]119[/C][C]7966[/C][C]8136.2116[/C][C]7566.3886[/C][C]8710.0563[/C][C]0.2805[/C][C]0.0017[/C][C]0.5221[/C][C]0.5384[/C][/ROW]
[ROW][C]120[/C][C]8626[/C][C]8096.8204[/C][C]7506.1981[/C][C]8691.786[/C][C]0.0406[/C][C]0.6668[/C][C]0.61[/C][C]0.4853[/C][/ROW]
[ROW][C]121[/C][C]7935[/C][C]8749.3021[/C][C]8133.4125[/C][C]9369.561[/C][C]0.005[/C][C]0.6516[/C][C]0.4351[/C][C]0.9786[/C][/ROW]
[ROW][C]122[/C][C]8166[/C][C]8149.0681[/C][C]7517.9901[/C][C]8785.0758[/C][C]0.4792[/C][C]0.7453[/C][C]0.5418[/C][C]0.5504[/C][/ROW]
[ROW][C]123[/C][C]8411[/C][C]8292.5533[/C][C]7641.2014[/C][C]8949.0664[/C][C]0.3618[/C][C]0.6472[/C][C]0.6527[/C][C]0.7092[/C][/ROW]
[ROW][C]124[/C][C]8693[/C][C]8322.3864[/C][C]7652.2062[/C][C]8998.0122[/C][C]0.1412[/C][C]0.3986[/C][C]0.5593[/C][C]0.733[/C][/ROW]
[ROW][C]125[/C][C]8861[/C][C]8171.3742[/C][C]7484.4256[/C][C]8864.1528[/C][C]0.0255[/C][C]0.07[/C][C]0.5711[/C][C]0.5711[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=&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[113])
1018113-------
1028042.00000000001-------
1038467.00000000001-------
1048333.00000000001-------
1058243.00000000001-------
1068517.00000000001-------
1078120-------
1088012-------
1098801.00000000001-------
1108115-------
1118161-------
1128271.00000000001-------
1138108.00000000001-------
11479928146.57077696.9578598.68060.25140.56640.67480.5664
11582398492.14728013.97928973.0240.15110.97930.54080.9413
11684198383.63747880.91858889.39060.44550.71240.57780.8573
11787818251.4217725.59528780.62110.02490.26740.51240.7024
11889928468.29897918.12829022.06950.03190.13420.43160.8989
11979668136.21167566.38868710.05630.28050.00170.52210.5384
12086268096.82047506.19818691.7860.04060.66680.610.4853
12179358749.30218133.41259369.5610.0050.65160.43510.9786
12281668149.06817517.99018785.07580.47920.74530.54180.5504
12384118292.55337641.20148949.06640.36180.64720.65270.7092
12486938322.38647652.20628998.01220.14120.39860.55930.733
12588618171.37427484.42568864.15280.02550.070.57110.5711







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1140.0283-0.01930.01930.019223892.089300-0.39510.3951
1150.0289-0.03070.0250.024764083.481243987.7852209.7327-0.64710.5211
1160.03080.00420.01810.01791250.511929742.0274172.45880.09040.3776
1170.03270.06030.02860.029280453.965392420.0119304.00661.35380.6216
1180.03340.05820.03460.0352274262.8748128788.5845358.87131.33880.765
1190.036-0.02140.03240.032828971.9882112152.4851334.8918-0.43510.7101
1200.03750.06130.03650.0372280031.022136135.1332368.96491.35280.8019
1210.0362-0.10260.04480.0447663087.9239202004.232449.4488-2.08160.9618
1220.03980.00210.040.04286.6877179591.1716423.7820.04330.8598
1230.04040.01410.03740.037414029.6243163035.0168403.77590.30280.8041
1240.04140.04260.03790.038137354.4775160700.4223400.87460.94740.8171
1250.04330.07780.04120.0416475583.731186940.6981432.36641.76290.8959

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
114 & 0.0283 & -0.0193 & 0.0193 & 0.0192 & 23892.0893 & 0 & 0 & -0.3951 & 0.3951 \tabularnewline
115 & 0.0289 & -0.0307 & 0.025 & 0.0247 & 64083.4812 & 43987.7852 & 209.7327 & -0.6471 & 0.5211 \tabularnewline
116 & 0.0308 & 0.0042 & 0.0181 & 0.0179 & 1250.5119 & 29742.0274 & 172.4588 & 0.0904 & 0.3776 \tabularnewline
117 & 0.0327 & 0.0603 & 0.0286 & 0.029 & 280453.9653 & 92420.0119 & 304.0066 & 1.3538 & 0.6216 \tabularnewline
118 & 0.0334 & 0.0582 & 0.0346 & 0.0352 & 274262.8748 & 128788.5845 & 358.8713 & 1.3388 & 0.765 \tabularnewline
119 & 0.036 & -0.0214 & 0.0324 & 0.0328 & 28971.9882 & 112152.4851 & 334.8918 & -0.4351 & 0.7101 \tabularnewline
120 & 0.0375 & 0.0613 & 0.0365 & 0.0372 & 280031.022 & 136135.1332 & 368.9649 & 1.3528 & 0.8019 \tabularnewline
121 & 0.0362 & -0.1026 & 0.0448 & 0.0447 & 663087.9239 & 202004.232 & 449.4488 & -2.0816 & 0.9618 \tabularnewline
122 & 0.0398 & 0.0021 & 0.04 & 0.04 & 286.6877 & 179591.1716 & 423.782 & 0.0433 & 0.8598 \tabularnewline
123 & 0.0404 & 0.0141 & 0.0374 & 0.0374 & 14029.6243 & 163035.0168 & 403.7759 & 0.3028 & 0.8041 \tabularnewline
124 & 0.0414 & 0.0426 & 0.0379 & 0.038 & 137354.4775 & 160700.4223 & 400.8746 & 0.9474 & 0.8171 \tabularnewline
125 & 0.0433 & 0.0778 & 0.0412 & 0.0416 & 475583.731 & 186940.6981 & 432.3664 & 1.7629 & 0.8959 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=&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]114[/C][C]0.0283[/C][C]-0.0193[/C][C]0.0193[/C][C]0.0192[/C][C]23892.0893[/C][C]0[/C][C]0[/C][C]-0.3951[/C][C]0.3951[/C][/ROW]
[ROW][C]115[/C][C]0.0289[/C][C]-0.0307[/C][C]0.025[/C][C]0.0247[/C][C]64083.4812[/C][C]43987.7852[/C][C]209.7327[/C][C]-0.6471[/C][C]0.5211[/C][/ROW]
[ROW][C]116[/C][C]0.0308[/C][C]0.0042[/C][C]0.0181[/C][C]0.0179[/C][C]1250.5119[/C][C]29742.0274[/C][C]172.4588[/C][C]0.0904[/C][C]0.3776[/C][/ROW]
[ROW][C]117[/C][C]0.0327[/C][C]0.0603[/C][C]0.0286[/C][C]0.029[/C][C]280453.9653[/C][C]92420.0119[/C][C]304.0066[/C][C]1.3538[/C][C]0.6216[/C][/ROW]
[ROW][C]118[/C][C]0.0334[/C][C]0.0582[/C][C]0.0346[/C][C]0.0352[/C][C]274262.8748[/C][C]128788.5845[/C][C]358.8713[/C][C]1.3388[/C][C]0.765[/C][/ROW]
[ROW][C]119[/C][C]0.036[/C][C]-0.0214[/C][C]0.0324[/C][C]0.0328[/C][C]28971.9882[/C][C]112152.4851[/C][C]334.8918[/C][C]-0.4351[/C][C]0.7101[/C][/ROW]
[ROW][C]120[/C][C]0.0375[/C][C]0.0613[/C][C]0.0365[/C][C]0.0372[/C][C]280031.022[/C][C]136135.1332[/C][C]368.9649[/C][C]1.3528[/C][C]0.8019[/C][/ROW]
[ROW][C]121[/C][C]0.0362[/C][C]-0.1026[/C][C]0.0448[/C][C]0.0447[/C][C]663087.9239[/C][C]202004.232[/C][C]449.4488[/C][C]-2.0816[/C][C]0.9618[/C][/ROW]
[ROW][C]122[/C][C]0.0398[/C][C]0.0021[/C][C]0.04[/C][C]0.04[/C][C]286.6877[/C][C]179591.1716[/C][C]423.782[/C][C]0.0433[/C][C]0.8598[/C][/ROW]
[ROW][C]123[/C][C]0.0404[/C][C]0.0141[/C][C]0.0374[/C][C]0.0374[/C][C]14029.6243[/C][C]163035.0168[/C][C]403.7759[/C][C]0.3028[/C][C]0.8041[/C][/ROW]
[ROW][C]124[/C][C]0.0414[/C][C]0.0426[/C][C]0.0379[/C][C]0.038[/C][C]137354.4775[/C][C]160700.4223[/C][C]400.8746[/C][C]0.9474[/C][C]0.8171[/C][/ROW]
[ROW][C]125[/C][C]0.0433[/C][C]0.0778[/C][C]0.0412[/C][C]0.0416[/C][C]475583.731[/C][C]186940.6981[/C][C]432.3664[/C][C]1.7629[/C][C]0.8959[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=&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
1140.0283-0.01930.01930.019223892.089300-0.39510.3951
1150.0289-0.03070.0250.024764083.481243987.7852209.7327-0.64710.5211
1160.03080.00420.01810.01791250.511929742.0274172.45880.09040.3776
1170.03270.06030.02860.029280453.965392420.0119304.00661.35380.6216
1180.03340.05820.03460.0352274262.8748128788.5845358.87131.33880.765
1190.036-0.02140.03240.032828971.9882112152.4851334.8918-0.43510.7101
1200.03750.06130.03650.0372280031.022136135.1332368.96491.35280.8019
1210.0362-0.10260.04480.0447663087.9239202004.232449.4488-2.08160.9618
1220.03980.00210.040.04286.6877179591.1716423.7820.04330.8598
1230.04040.01410.03740.037414029.6243163035.0168403.77590.30280.8041
1240.04140.04260.03790.038137354.4775160700.4223400.87460.94740.8171
1250.04330.07780.04120.0416475583.731186940.6981432.36641.76290.8959



Parameters (Session):
par1 = 0.9TRUEFALSEFALSEFALSE0.9FALSETRUETRUE1212120.912412124121240.9DefaultDefaultFALSETRUEFALSEFALSETRUE1212 ; par2 = 1111100.90.90.90.910.90.90.90.90.90.90.90.90.9 ; par3 = 11100000001011111111 ; par4 = 1211111212121112111111111 ; par5 = 121212121111212121212121212121212 ; par6 = 333303330White NoiseWhite Noise3333300 ; par7 = 1111011110.970.971111111 ; par8 = 2222022202222200 ; par9 = 1111011111111111 ; par10 = FALSEFALSEFALSE ;
Parameters (R input):
par1 = 12 ; par2 = 0.9 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 0 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
R code (references can be found in the software module):
par10 <- 'FALSE'
par9 <- '1'
par8 <- '0'
par7 <- '1'
par6 <- '0'
par5 <- '12'
par4 <- '1'
par3 <- '1'
par2 <- '0.9'
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')