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 computationWed, 31 Jan 2018 17:18:39 +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/Jan/31/t15174155961p27la1e1a7mc30.htm/, Retrieved Tue, 07 May 2024 01:01:24 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=313057, Retrieved Tue, 07 May 2024 01:01:24 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact55
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2018-01-31 16:18:39] [682069e719bd2f9152088540ff138e3c] [Current]
Feedback Forum

Post a new message
Dataseries X:
1.894
1.757
3.582
5.321
5.561
5.907
4.944
4.966
3.258
1.964
1.743
1.262
2.086
1.793
3.548
5.672
6.084
4.914
4.990
5.139
3.218
2.179
2.238
1.442
2.205
2.025
3.531
4.977
7.998
4.880
5.231
5.202
3.303
2.683
2.202
1.376
2.422
1.997
3.163
5.964
5.657
6.415
6.208
4.500
2.939
2.702
2.090
1.504
2.549
1.931
3.013
6.204
5.788
5.611
5.594
4.647
3.490
2.487
1.992
1.507
2.306
2.002
3.075
5.331
5.589
5.813
4.876
4.665
3.601
2.192
2.111
1.580
2.288
1.993
3.228
5.000
5.480
5.770
4.962
4.685
3.607
2.222
2.467
1.594
2.228
1.910
3.157
4.809
6.249
4.607
4.975
4.784
3.028
2.461
2.218
1.351
2.070
1.887
3.024
4.596
6.398
4.459
5.382
4.359
2.687
2.249
2.154
1.169
2.429
1.762
2.846
5.627
5.749
4.502
5.720
4.403
2.867
2.635
2.059
1.511
2.359
1.741
2.917
6.249
5.760
6.250
5.134
4.831
3.695
2.462
2.146
1.579




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=313057&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 time7 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[120])
1081.169-------
1092.429-------
1101.762-------
1112.846-------
1125.627-------
1135.749-------
1144.502-------
1155.72-------
1164.403-------
1172.867-------
1182.635-------
1192.059-------
1201.511-------
1212.3592.46962.12572.88940.302810.57511
1221.7411.68361.47111.93790.329200.27290.9084
1232.9173.16912.6933.76070.201810.85781
1246.2495.33934.41726.52820.066810.31761
1255.765.36934.43996.56840.26150.07520.26741
1266.254.9864.1396.07290.01130.08140.80861
1275.1345.38234.44946.58650.3430.07890.29131
1284.8314.15393.48145.00540.05950.0120.28321
1293.6953.1752.69633.77040.043500.84471
1302.4622.44952.10522.87080.476900.19411
1312.1462.0181.74892.34360.22050.00380.40260.9989
1321.5791.52861.33941.75390.330500.56070.5607

\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[120]) \tabularnewline
108 & 1.169 & - & - & - & - & - & - & - \tabularnewline
109 & 2.429 & - & - & - & - & - & - & - \tabularnewline
110 & 1.762 & - & - & - & - & - & - & - \tabularnewline
111 & 2.846 & - & - & - & - & - & - & - \tabularnewline
112 & 5.627 & - & - & - & - & - & - & - \tabularnewline
113 & 5.749 & - & - & - & - & - & - & - \tabularnewline
114 & 4.502 & - & - & - & - & - & - & - \tabularnewline
115 & 5.72 & - & - & - & - & - & - & - \tabularnewline
116 & 4.403 & - & - & - & - & - & - & - \tabularnewline
117 & 2.867 & - & - & - & - & - & - & - \tabularnewline
118 & 2.635 & - & - & - & - & - & - & - \tabularnewline
119 & 2.059 & - & - & - & - & - & - & - \tabularnewline
120 & 1.511 & - & - & - & - & - & - & - \tabularnewline
121 & 2.359 & 2.4696 & 2.1257 & 2.8894 & 0.3028 & 1 & 0.5751 & 1 \tabularnewline
122 & 1.741 & 1.6836 & 1.4711 & 1.9379 & 0.3292 & 0 & 0.2729 & 0.9084 \tabularnewline
123 & 2.917 & 3.1691 & 2.693 & 3.7607 & 0.2018 & 1 & 0.8578 & 1 \tabularnewline
124 & 6.249 & 5.3393 & 4.4172 & 6.5282 & 0.0668 & 1 & 0.3176 & 1 \tabularnewline
125 & 5.76 & 5.3693 & 4.4399 & 6.5684 & 0.2615 & 0.0752 & 0.2674 & 1 \tabularnewline
126 & 6.25 & 4.986 & 4.139 & 6.0729 & 0.0113 & 0.0814 & 0.8086 & 1 \tabularnewline
127 & 5.134 & 5.3823 & 4.4494 & 6.5865 & 0.343 & 0.0789 & 0.2913 & 1 \tabularnewline
128 & 4.831 & 4.1539 & 3.4814 & 5.0054 & 0.0595 & 0.012 & 0.2832 & 1 \tabularnewline
129 & 3.695 & 3.175 & 2.6963 & 3.7704 & 0.0435 & 0 & 0.8447 & 1 \tabularnewline
130 & 2.462 & 2.4495 & 2.1052 & 2.8708 & 0.4769 & 0 & 0.1941 & 1 \tabularnewline
131 & 2.146 & 2.018 & 1.7489 & 2.3436 & 0.2205 & 0.0038 & 0.4026 & 0.9989 \tabularnewline
132 & 1.579 & 1.5286 & 1.3394 & 1.7539 & 0.3305 & 0 & 0.5607 & 0.5607 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=313057&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[120])[/C][/ROW]
[ROW][C]108[/C][C]1.169[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]2.429[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]1.762[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]2.846[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]5.627[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]5.749[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]4.502[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]5.72[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]116[/C][C]4.403[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]117[/C][C]2.867[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]118[/C][C]2.635[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]119[/C][C]2.059[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]120[/C][C]1.511[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]2.359[/C][C]2.4696[/C][C]2.1257[/C][C]2.8894[/C][C]0.3028[/C][C]1[/C][C]0.5751[/C][C]1[/C][/ROW]
[ROW][C]122[/C][C]1.741[/C][C]1.6836[/C][C]1.4711[/C][C]1.9379[/C][C]0.3292[/C][C]0[/C][C]0.2729[/C][C]0.9084[/C][/ROW]
[ROW][C]123[/C][C]2.917[/C][C]3.1691[/C][C]2.693[/C][C]3.7607[/C][C]0.2018[/C][C]1[/C][C]0.8578[/C][C]1[/C][/ROW]
[ROW][C]124[/C][C]6.249[/C][C]5.3393[/C][C]4.4172[/C][C]6.5282[/C][C]0.0668[/C][C]1[/C][C]0.3176[/C][C]1[/C][/ROW]
[ROW][C]125[/C][C]5.76[/C][C]5.3693[/C][C]4.4399[/C][C]6.5684[/C][C]0.2615[/C][C]0.0752[/C][C]0.2674[/C][C]1[/C][/ROW]
[ROW][C]126[/C][C]6.25[/C][C]4.986[/C][C]4.139[/C][C]6.0729[/C][C]0.0113[/C][C]0.0814[/C][C]0.8086[/C][C]1[/C][/ROW]
[ROW][C]127[/C][C]5.134[/C][C]5.3823[/C][C]4.4494[/C][C]6.5865[/C][C]0.343[/C][C]0.0789[/C][C]0.2913[/C][C]1[/C][/ROW]
[ROW][C]128[/C][C]4.831[/C][C]4.1539[/C][C]3.4814[/C][C]5.0054[/C][C]0.0595[/C][C]0.012[/C][C]0.2832[/C][C]1[/C][/ROW]
[ROW][C]129[/C][C]3.695[/C][C]3.175[/C][C]2.6963[/C][C]3.7704[/C][C]0.0435[/C][C]0[/C][C]0.8447[/C][C]1[/C][/ROW]
[ROW][C]130[/C][C]2.462[/C][C]2.4495[/C][C]2.1052[/C][C]2.8708[/C][C]0.4769[/C][C]0[/C][C]0.1941[/C][C]1[/C][/ROW]
[ROW][C]131[/C][C]2.146[/C][C]2.018[/C][C]1.7489[/C][C]2.3436[/C][C]0.2205[/C][C]0.0038[/C][C]0.4026[/C][C]0.9989[/C][/ROW]
[ROW][C]132[/C][C]1.579[/C][C]1.5286[/C][C]1.3394[/C][C]1.7539[/C][C]0.3305[/C][C]0[/C][C]0.5607[/C][C]0.5607[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=313057&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=313057&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[120])
1081.169-------
1092.429-------
1101.762-------
1112.846-------
1125.627-------
1135.749-------
1144.502-------
1155.72-------
1164.403-------
1172.867-------
1182.635-------
1192.059-------
1201.511-------
1212.3592.46962.12572.88940.302810.57511
1221.7411.68361.47111.93790.329200.27290.9084
1232.9173.16912.6933.76070.201810.85781
1246.2495.33934.41726.52820.066810.31761
1255.765.36934.43996.56840.26150.07520.26741
1266.254.9864.1396.07290.01130.08140.80861
1275.1345.38234.44946.58650.3430.07890.29131
1284.8314.15393.48145.00540.05950.0120.28321
1293.6953.1752.69633.77040.043500.84471
1302.4622.44952.10522.87080.476900.19411
1312.1462.0181.74892.34360.22050.00380.40260.9989
1321.5791.52861.33941.75390.330500.56070.5607







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1210.0867-0.04690.04690.04580.012200-0.11290.1129
1220.0770.03290.03990.03960.00330.00780.08810.05860.0857
1230.0952-0.08640.05540.0540.06350.02640.1623-0.25730.1429
1240.11360.14560.0780.07980.82760.22670.47610.92860.3393
1250.11390.06780.07590.07790.15260.21180.46030.39880.3512
1260.11120.20220.0970.10241.59770.44280.66541.29030.5077
1270.1141-0.04840.090.09450.06170.38840.6232-0.25350.4714
1280.10460.14020.09630.10150.45850.39710.63020.69120.4989
1290.09570.14070.10120.10710.27040.38310.61890.53080.5024
1300.08770.00510.09160.09692e-040.34480.58720.01270.4535
1310.08230.05960.08870.09370.01640.31490.56120.13060.4241
1320.07520.03190.0840.08860.00250.28890.53750.05150.3931

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
121 & 0.0867 & -0.0469 & 0.0469 & 0.0458 & 0.0122 & 0 & 0 & -0.1129 & 0.1129 \tabularnewline
122 & 0.077 & 0.0329 & 0.0399 & 0.0396 & 0.0033 & 0.0078 & 0.0881 & 0.0586 & 0.0857 \tabularnewline
123 & 0.0952 & -0.0864 & 0.0554 & 0.054 & 0.0635 & 0.0264 & 0.1623 & -0.2573 & 0.1429 \tabularnewline
124 & 0.1136 & 0.1456 & 0.078 & 0.0798 & 0.8276 & 0.2267 & 0.4761 & 0.9286 & 0.3393 \tabularnewline
125 & 0.1139 & 0.0678 & 0.0759 & 0.0779 & 0.1526 & 0.2118 & 0.4603 & 0.3988 & 0.3512 \tabularnewline
126 & 0.1112 & 0.2022 & 0.097 & 0.1024 & 1.5977 & 0.4428 & 0.6654 & 1.2903 & 0.5077 \tabularnewline
127 & 0.1141 & -0.0484 & 0.09 & 0.0945 & 0.0617 & 0.3884 & 0.6232 & -0.2535 & 0.4714 \tabularnewline
128 & 0.1046 & 0.1402 & 0.0963 & 0.1015 & 0.4585 & 0.3971 & 0.6302 & 0.6912 & 0.4989 \tabularnewline
129 & 0.0957 & 0.1407 & 0.1012 & 0.1071 & 0.2704 & 0.3831 & 0.6189 & 0.5308 & 0.5024 \tabularnewline
130 & 0.0877 & 0.0051 & 0.0916 & 0.0969 & 2e-04 & 0.3448 & 0.5872 & 0.0127 & 0.4535 \tabularnewline
131 & 0.0823 & 0.0596 & 0.0887 & 0.0937 & 0.0164 & 0.3149 & 0.5612 & 0.1306 & 0.4241 \tabularnewline
132 & 0.0752 & 0.0319 & 0.084 & 0.0886 & 0.0025 & 0.2889 & 0.5375 & 0.0515 & 0.3931 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=313057&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]121[/C][C]0.0867[/C][C]-0.0469[/C][C]0.0469[/C][C]0.0458[/C][C]0.0122[/C][C]0[/C][C]0[/C][C]-0.1129[/C][C]0.1129[/C][/ROW]
[ROW][C]122[/C][C]0.077[/C][C]0.0329[/C][C]0.0399[/C][C]0.0396[/C][C]0.0033[/C][C]0.0078[/C][C]0.0881[/C][C]0.0586[/C][C]0.0857[/C][/ROW]
[ROW][C]123[/C][C]0.0952[/C][C]-0.0864[/C][C]0.0554[/C][C]0.054[/C][C]0.0635[/C][C]0.0264[/C][C]0.1623[/C][C]-0.2573[/C][C]0.1429[/C][/ROW]
[ROW][C]124[/C][C]0.1136[/C][C]0.1456[/C][C]0.078[/C][C]0.0798[/C][C]0.8276[/C][C]0.2267[/C][C]0.4761[/C][C]0.9286[/C][C]0.3393[/C][/ROW]
[ROW][C]125[/C][C]0.1139[/C][C]0.0678[/C][C]0.0759[/C][C]0.0779[/C][C]0.1526[/C][C]0.2118[/C][C]0.4603[/C][C]0.3988[/C][C]0.3512[/C][/ROW]
[ROW][C]126[/C][C]0.1112[/C][C]0.2022[/C][C]0.097[/C][C]0.1024[/C][C]1.5977[/C][C]0.4428[/C][C]0.6654[/C][C]1.2903[/C][C]0.5077[/C][/ROW]
[ROW][C]127[/C][C]0.1141[/C][C]-0.0484[/C][C]0.09[/C][C]0.0945[/C][C]0.0617[/C][C]0.3884[/C][C]0.6232[/C][C]-0.2535[/C][C]0.4714[/C][/ROW]
[ROW][C]128[/C][C]0.1046[/C][C]0.1402[/C][C]0.0963[/C][C]0.1015[/C][C]0.4585[/C][C]0.3971[/C][C]0.6302[/C][C]0.6912[/C][C]0.4989[/C][/ROW]
[ROW][C]129[/C][C]0.0957[/C][C]0.1407[/C][C]0.1012[/C][C]0.1071[/C][C]0.2704[/C][C]0.3831[/C][C]0.6189[/C][C]0.5308[/C][C]0.5024[/C][/ROW]
[ROW][C]130[/C][C]0.0877[/C][C]0.0051[/C][C]0.0916[/C][C]0.0969[/C][C]2e-04[/C][C]0.3448[/C][C]0.5872[/C][C]0.0127[/C][C]0.4535[/C][/ROW]
[ROW][C]131[/C][C]0.0823[/C][C]0.0596[/C][C]0.0887[/C][C]0.0937[/C][C]0.0164[/C][C]0.3149[/C][C]0.5612[/C][C]0.1306[/C][C]0.4241[/C][/ROW]
[ROW][C]132[/C][C]0.0752[/C][C]0.0319[/C][C]0.084[/C][C]0.0886[/C][C]0.0025[/C][C]0.2889[/C][C]0.5375[/C][C]0.0515[/C][C]0.3931[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=313057&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=313057&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
1210.0867-0.04690.04690.04580.012200-0.11290.1129
1220.0770.03290.03990.03960.00330.00780.08810.05860.0857
1230.0952-0.08640.05540.0540.06350.02640.1623-0.25730.1429
1240.11360.14560.0780.07980.82760.22670.47610.92860.3393
1250.11390.06780.07590.07790.15260.21180.46030.39880.3512
1260.11120.20220.0970.10241.59770.44280.66541.29030.5077
1270.1141-0.04840.090.09450.06170.38840.6232-0.25350.4714
1280.10460.14020.09630.10150.45850.39710.63020.69120.4989
1290.09570.14070.10120.10710.27040.38310.61890.53080.5024
1300.08770.00510.09160.09692e-040.34480.58720.01270.4535
1310.08230.05960.08870.09370.01640.31490.56120.13060.4241
1320.07520.03190.0840.08860.00250.28890.53750.05150.3931



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