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, 21 Dec 2016 09:30:44 +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/21/t1482309052ya25a5eddlgymyl.htm/, Retrieved Fri, 01 Nov 2024 03:31:08 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=301927, Retrieved Fri, 01 Nov 2024 03:31:08 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact86
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2016-12-21 08:30:44] [f20c721eaecf28dbff8d9b9768e8b0c7] [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 time2 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 time2 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301927&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]2 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=301927&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301927&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 time2 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.42642.05662.88760.38720.99990.49570.9999
1221.7411.77161.52242.07660.4221e-040.52460.953
1232.9173.20822.67713.88490.199510.8531
1246.2495.34164.27186.78760.10940.99950.34941
1255.765.89554.68187.55210.43630.33790.56881
1266.254.70983.79355.9360.00690.04660.63011
1275.1345.47824.36256.99510.32830.15930.37731
1284.8314.49923.6285.66310.28820.14250.56441
1293.6952.93012.42293.58450.01100.57491
1302.4622.55292.12653.09740.371800.38370.9999
1312.1462.10791.77342.52940.42970.04980.590.9972
1321.5791.44531.23811.70.151700.30650.3065

\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.4264 & 2.0566 & 2.8876 & 0.3872 & 0.9999 & 0.4957 & 0.9999 \tabularnewline
122 & 1.741 & 1.7716 & 1.5224 & 2.0766 & 0.422 & 1e-04 & 0.5246 & 0.953 \tabularnewline
123 & 2.917 & 3.2082 & 2.6771 & 3.8849 & 0.1995 & 1 & 0.853 & 1 \tabularnewline
124 & 6.249 & 5.3416 & 4.2718 & 6.7876 & 0.1094 & 0.9995 & 0.3494 & 1 \tabularnewline
125 & 5.76 & 5.8955 & 4.6818 & 7.5521 & 0.4363 & 0.3379 & 0.5688 & 1 \tabularnewline
126 & 6.25 & 4.7098 & 3.7935 & 5.936 & 0.0069 & 0.0466 & 0.6301 & 1 \tabularnewline
127 & 5.134 & 5.4782 & 4.3625 & 6.9951 & 0.3283 & 0.1593 & 0.3773 & 1 \tabularnewline
128 & 4.831 & 4.4992 & 3.628 & 5.6631 & 0.2882 & 0.1425 & 0.5644 & 1 \tabularnewline
129 & 3.695 & 2.9301 & 2.4229 & 3.5845 & 0.011 & 0 & 0.5749 & 1 \tabularnewline
130 & 2.462 & 2.5529 & 2.1265 & 3.0974 & 0.3718 & 0 & 0.3837 & 0.9999 \tabularnewline
131 & 2.146 & 2.1079 & 1.7734 & 2.5294 & 0.4297 & 0.0498 & 0.59 & 0.9972 \tabularnewline
132 & 1.579 & 1.4453 & 1.2381 & 1.7 & 0.1517 & 0 & 0.3065 & 0.3065 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301927&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.4264[/C][C]2.0566[/C][C]2.8876[/C][C]0.3872[/C][C]0.9999[/C][C]0.4957[/C][C]0.9999[/C][/ROW]
[ROW][C]122[/C][C]1.741[/C][C]1.7716[/C][C]1.5224[/C][C]2.0766[/C][C]0.422[/C][C]1e-04[/C][C]0.5246[/C][C]0.953[/C][/ROW]
[ROW][C]123[/C][C]2.917[/C][C]3.2082[/C][C]2.6771[/C][C]3.8849[/C][C]0.1995[/C][C]1[/C][C]0.853[/C][C]1[/C][/ROW]
[ROW][C]124[/C][C]6.249[/C][C]5.3416[/C][C]4.2718[/C][C]6.7876[/C][C]0.1094[/C][C]0.9995[/C][C]0.3494[/C][C]1[/C][/ROW]
[ROW][C]125[/C][C]5.76[/C][C]5.8955[/C][C]4.6818[/C][C]7.5521[/C][C]0.4363[/C][C]0.3379[/C][C]0.5688[/C][C]1[/C][/ROW]
[ROW][C]126[/C][C]6.25[/C][C]4.7098[/C][C]3.7935[/C][C]5.936[/C][C]0.0069[/C][C]0.0466[/C][C]0.6301[/C][C]1[/C][/ROW]
[ROW][C]127[/C][C]5.134[/C][C]5.4782[/C][C]4.3625[/C][C]6.9951[/C][C]0.3283[/C][C]0.1593[/C][C]0.3773[/C][C]1[/C][/ROW]
[ROW][C]128[/C][C]4.831[/C][C]4.4992[/C][C]3.628[/C][C]5.6631[/C][C]0.2882[/C][C]0.1425[/C][C]0.5644[/C][C]1[/C][/ROW]
[ROW][C]129[/C][C]3.695[/C][C]2.9301[/C][C]2.4229[/C][C]3.5845[/C][C]0.011[/C][C]0[/C][C]0.5749[/C][C]1[/C][/ROW]
[ROW][C]130[/C][C]2.462[/C][C]2.5529[/C][C]2.1265[/C][C]3.0974[/C][C]0.3718[/C][C]0[/C][C]0.3837[/C][C]0.9999[/C][/ROW]
[ROW][C]131[/C][C]2.146[/C][C]2.1079[/C][C]1.7734[/C][C]2.5294[/C][C]0.4297[/C][C]0.0498[/C][C]0.59[/C][C]0.9972[/C][/ROW]
[ROW][C]132[/C][C]1.579[/C][C]1.4453[/C][C]1.2381[/C][C]1.7[/C][C]0.1517[/C][C]0[/C][C]0.3065[/C][C]0.3065[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301927&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301927&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.42642.05662.88760.38720.99990.49570.9999
1221.7411.77161.52242.07660.4221e-040.52460.953
1232.9173.20822.67713.88490.199510.8531
1246.2495.34164.27186.78760.10940.99950.34941
1255.765.89554.68187.55210.43630.33790.56881
1266.254.70983.79355.9360.00690.04660.63011
1275.1345.47824.36256.99510.32830.15930.37731
1284.8314.49923.6285.66310.28820.14250.56441
1293.6952.93012.42293.58450.01100.57491
1302.4622.55292.12653.09740.371800.38370.9999
1312.1462.10791.77342.52940.42970.04980.590.9972
1321.5791.44531.23811.70.151700.30650.3065







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1210.097-0.02860.02860.02820.004500-0.06880.0688
1220.0878-0.01760.02310.02289e-040.00270.0524-0.03130.05
1230.1076-0.09980.04870.04690.08480.03010.1735-0.29730.1325
1240.13810.14520.07280.07430.82330.22840.47790.92620.3309
1250.1434-0.02350.06290.06410.01840.18640.4317-0.13830.2924
1260.13280.24640.09350.10032.37220.55070.74211.57220.5057
1270.1413-0.0670.08970.09520.11850.48890.6992-0.35130.4836
1280.1320.06870.08710.09220.11010.44160.66450.33870.4655
1290.11390.2070.10040.10760.58510.45750.67640.78080.5005
1300.1088-0.03690.09410.10050.00830.41260.6423-0.09270.4598
1310.1020.01770.08710.0930.00140.37520.61260.03890.4215
1320.08990.08470.08690.09260.01790.34550.58770.13650.3978

\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.097 & -0.0286 & 0.0286 & 0.0282 & 0.0045 & 0 & 0 & -0.0688 & 0.0688 \tabularnewline
122 & 0.0878 & -0.0176 & 0.0231 & 0.0228 & 9e-04 & 0.0027 & 0.0524 & -0.0313 & 0.05 \tabularnewline
123 & 0.1076 & -0.0998 & 0.0487 & 0.0469 & 0.0848 & 0.0301 & 0.1735 & -0.2973 & 0.1325 \tabularnewline
124 & 0.1381 & 0.1452 & 0.0728 & 0.0743 & 0.8233 & 0.2284 & 0.4779 & 0.9262 & 0.3309 \tabularnewline
125 & 0.1434 & -0.0235 & 0.0629 & 0.0641 & 0.0184 & 0.1864 & 0.4317 & -0.1383 & 0.2924 \tabularnewline
126 & 0.1328 & 0.2464 & 0.0935 & 0.1003 & 2.3722 & 0.5507 & 0.7421 & 1.5722 & 0.5057 \tabularnewline
127 & 0.1413 & -0.067 & 0.0897 & 0.0952 & 0.1185 & 0.4889 & 0.6992 & -0.3513 & 0.4836 \tabularnewline
128 & 0.132 & 0.0687 & 0.0871 & 0.0922 & 0.1101 & 0.4416 & 0.6645 & 0.3387 & 0.4655 \tabularnewline
129 & 0.1139 & 0.207 & 0.1004 & 0.1076 & 0.5851 & 0.4575 & 0.6764 & 0.7808 & 0.5005 \tabularnewline
130 & 0.1088 & -0.0369 & 0.0941 & 0.1005 & 0.0083 & 0.4126 & 0.6423 & -0.0927 & 0.4598 \tabularnewline
131 & 0.102 & 0.0177 & 0.0871 & 0.093 & 0.0014 & 0.3752 & 0.6126 & 0.0389 & 0.4215 \tabularnewline
132 & 0.0899 & 0.0847 & 0.0869 & 0.0926 & 0.0179 & 0.3455 & 0.5877 & 0.1365 & 0.3978 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301927&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.097[/C][C]-0.0286[/C][C]0.0286[/C][C]0.0282[/C][C]0.0045[/C][C]0[/C][C]0[/C][C]-0.0688[/C][C]0.0688[/C][/ROW]
[ROW][C]122[/C][C]0.0878[/C][C]-0.0176[/C][C]0.0231[/C][C]0.0228[/C][C]9e-04[/C][C]0.0027[/C][C]0.0524[/C][C]-0.0313[/C][C]0.05[/C][/ROW]
[ROW][C]123[/C][C]0.1076[/C][C]-0.0998[/C][C]0.0487[/C][C]0.0469[/C][C]0.0848[/C][C]0.0301[/C][C]0.1735[/C][C]-0.2973[/C][C]0.1325[/C][/ROW]
[ROW][C]124[/C][C]0.1381[/C][C]0.1452[/C][C]0.0728[/C][C]0.0743[/C][C]0.8233[/C][C]0.2284[/C][C]0.4779[/C][C]0.9262[/C][C]0.3309[/C][/ROW]
[ROW][C]125[/C][C]0.1434[/C][C]-0.0235[/C][C]0.0629[/C][C]0.0641[/C][C]0.0184[/C][C]0.1864[/C][C]0.4317[/C][C]-0.1383[/C][C]0.2924[/C][/ROW]
[ROW][C]126[/C][C]0.1328[/C][C]0.2464[/C][C]0.0935[/C][C]0.1003[/C][C]2.3722[/C][C]0.5507[/C][C]0.7421[/C][C]1.5722[/C][C]0.5057[/C][/ROW]
[ROW][C]127[/C][C]0.1413[/C][C]-0.067[/C][C]0.0897[/C][C]0.0952[/C][C]0.1185[/C][C]0.4889[/C][C]0.6992[/C][C]-0.3513[/C][C]0.4836[/C][/ROW]
[ROW][C]128[/C][C]0.132[/C][C]0.0687[/C][C]0.0871[/C][C]0.0922[/C][C]0.1101[/C][C]0.4416[/C][C]0.6645[/C][C]0.3387[/C][C]0.4655[/C][/ROW]
[ROW][C]129[/C][C]0.1139[/C][C]0.207[/C][C]0.1004[/C][C]0.1076[/C][C]0.5851[/C][C]0.4575[/C][C]0.6764[/C][C]0.7808[/C][C]0.5005[/C][/ROW]
[ROW][C]130[/C][C]0.1088[/C][C]-0.0369[/C][C]0.0941[/C][C]0.1005[/C][C]0.0083[/C][C]0.4126[/C][C]0.6423[/C][C]-0.0927[/C][C]0.4598[/C][/ROW]
[ROW][C]131[/C][C]0.102[/C][C]0.0177[/C][C]0.0871[/C][C]0.093[/C][C]0.0014[/C][C]0.3752[/C][C]0.6126[/C][C]0.0389[/C][C]0.4215[/C][/ROW]
[ROW][C]132[/C][C]0.0899[/C][C]0.0847[/C][C]0.0869[/C][C]0.0926[/C][C]0.0179[/C][C]0.3455[/C][C]0.5877[/C][C]0.1365[/C][C]0.3978[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301927&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301927&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.097-0.02860.02860.02820.004500-0.06880.0688
1220.0878-0.01760.02310.02289e-040.00270.0524-0.03130.05
1230.1076-0.09980.04870.04690.08480.03010.1735-0.29730.1325
1240.13810.14520.07280.07430.82330.22840.47790.92620.3309
1250.1434-0.02350.06290.06410.01840.18640.4317-0.13830.2924
1260.13280.24640.09350.10032.37220.55070.74211.57220.5057
1270.1413-0.0670.08970.09520.11850.48890.6992-0.35130.4836
1280.1320.06870.08710.09220.11010.44160.66450.33870.4655
1290.11390.2070.10040.10760.58510.45750.67640.78080.5005
1300.1088-0.03690.09410.10050.00830.41260.6423-0.09270.4598
1310.1020.01770.08710.0930.00140.37520.61260.03890.4215
1320.08990.08470.08690.09260.01790.34550.58770.13650.3978



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