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 computationMon, 15 Dec 2014 07:39:15 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2014/Dec/15/t14186299632rgbhgglc78es0n.htm/, Retrieved Thu, 16 May 2024 08:12:26 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=267950, Retrieved Thu, 16 May 2024 08:12:26 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact88
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2014-12-15 07:39:15] [0a6fc2c777821367d2239c664b701a36] [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 Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Herman Ole Andreas Wold' @ wold.wessa.net

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 2 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ wold.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=267950&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]2 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ wold.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=267950&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=267950&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 Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Herman Ole Andreas Wold' @ wold.wessa.net







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.53022.11433.05910.26290.99990.64620.9999
1221.7411.87851.59182.23610.22560.00420.73840.978
1232.9173.45582.81674.2970.104710.92231
1246.2495.82574.43417.84260.34040.99760.57651
1255.766.51154.89518.89640.26840.58540.73461
1266.255.17543.92856.98970.12280.26380.76651
1275.1346.17784.55728.63490.20250.4770.64250.9999
1284.8314.83513.62636.62460.49820.37170.6820.9999
1293.6953.11672.40424.12980.13165e-040.68550.9991
1302.4622.72382.10923.59320.27750.01430.57930.9969
1312.1462.26131.76892.94780.3710.28330.71820.9839
1321.5791.5131.21141.91980.37520.00110.50380.5038

\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.5302 & 2.1143 & 3.0591 & 0.2629 & 0.9999 & 0.6462 & 0.9999 \tabularnewline
122 & 1.741 & 1.8785 & 1.5918 & 2.2361 & 0.2256 & 0.0042 & 0.7384 & 0.978 \tabularnewline
123 & 2.917 & 3.4558 & 2.8167 & 4.297 & 0.1047 & 1 & 0.9223 & 1 \tabularnewline
124 & 6.249 & 5.8257 & 4.4341 & 7.8426 & 0.3404 & 0.9976 & 0.5765 & 1 \tabularnewline
125 & 5.76 & 6.5115 & 4.8951 & 8.8964 & 0.2684 & 0.5854 & 0.7346 & 1 \tabularnewline
126 & 6.25 & 5.1754 & 3.9285 & 6.9897 & 0.1228 & 0.2638 & 0.7665 & 1 \tabularnewline
127 & 5.134 & 6.1778 & 4.5572 & 8.6349 & 0.2025 & 0.477 & 0.6425 & 0.9999 \tabularnewline
128 & 4.831 & 4.8351 & 3.6263 & 6.6246 & 0.4982 & 0.3717 & 0.682 & 0.9999 \tabularnewline
129 & 3.695 & 3.1167 & 2.4042 & 4.1298 & 0.1316 & 5e-04 & 0.6855 & 0.9991 \tabularnewline
130 & 2.462 & 2.7238 & 2.1092 & 3.5932 & 0.2775 & 0.0143 & 0.5793 & 0.9969 \tabularnewline
131 & 2.146 & 2.2613 & 1.7689 & 2.9478 & 0.371 & 0.2833 & 0.7182 & 0.9839 \tabularnewline
132 & 1.579 & 1.513 & 1.2114 & 1.9198 & 0.3752 & 0.0011 & 0.5038 & 0.5038 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=267950&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.5302[/C][C]2.1143[/C][C]3.0591[/C][C]0.2629[/C][C]0.9999[/C][C]0.6462[/C][C]0.9999[/C][/ROW]
[ROW][C]122[/C][C]1.741[/C][C]1.8785[/C][C]1.5918[/C][C]2.2361[/C][C]0.2256[/C][C]0.0042[/C][C]0.7384[/C][C]0.978[/C][/ROW]
[ROW][C]123[/C][C]2.917[/C][C]3.4558[/C][C]2.8167[/C][C]4.297[/C][C]0.1047[/C][C]1[/C][C]0.9223[/C][C]1[/C][/ROW]
[ROW][C]124[/C][C]6.249[/C][C]5.8257[/C][C]4.4341[/C][C]7.8426[/C][C]0.3404[/C][C]0.9976[/C][C]0.5765[/C][C]1[/C][/ROW]
[ROW][C]125[/C][C]5.76[/C][C]6.5115[/C][C]4.8951[/C][C]8.8964[/C][C]0.2684[/C][C]0.5854[/C][C]0.7346[/C][C]1[/C][/ROW]
[ROW][C]126[/C][C]6.25[/C][C]5.1754[/C][C]3.9285[/C][C]6.9897[/C][C]0.1228[/C][C]0.2638[/C][C]0.7665[/C][C]1[/C][/ROW]
[ROW][C]127[/C][C]5.134[/C][C]6.1778[/C][C]4.5572[/C][C]8.6349[/C][C]0.2025[/C][C]0.477[/C][C]0.6425[/C][C]0.9999[/C][/ROW]
[ROW][C]128[/C][C]4.831[/C][C]4.8351[/C][C]3.6263[/C][C]6.6246[/C][C]0.4982[/C][C]0.3717[/C][C]0.682[/C][C]0.9999[/C][/ROW]
[ROW][C]129[/C][C]3.695[/C][C]3.1167[/C][C]2.4042[/C][C]4.1298[/C][C]0.1316[/C][C]5e-04[/C][C]0.6855[/C][C]0.9991[/C][/ROW]
[ROW][C]130[/C][C]2.462[/C][C]2.7238[/C][C]2.1092[/C][C]3.5932[/C][C]0.2775[/C][C]0.0143[/C][C]0.5793[/C][C]0.9969[/C][/ROW]
[ROW][C]131[/C][C]2.146[/C][C]2.2613[/C][C]1.7689[/C][C]2.9478[/C][C]0.371[/C][C]0.2833[/C][C]0.7182[/C][C]0.9839[/C][/ROW]
[ROW][C]132[/C][C]1.579[/C][C]1.513[/C][C]1.2114[/C][C]1.9198[/C][C]0.3752[/C][C]0.0011[/C][C]0.5038[/C][C]0.5038[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=267950&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=267950&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.53022.11433.05910.26290.99990.64620.9999
1221.7411.87851.59182.23610.22560.00420.73840.978
1232.9173.45582.81674.2970.104710.92231
1246.2495.82574.43417.84260.34040.99760.57651
1255.766.51154.89518.89640.26840.58540.73461
1266.255.17543.92856.98970.12280.26380.76651
1275.1346.17784.55728.63490.20250.4770.64250.9999
1284.8314.83513.62636.62460.49820.37170.6820.9999
1293.6953.11672.40424.12980.13165e-040.68550.9991
1302.4622.72382.10923.59320.27750.01430.57930.9969
1312.1462.26131.76892.94780.3710.28330.71820.9839
1321.5791.5131.21141.91980.37520.00110.50380.5038







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1210.1067-0.07260.07260.070.029300-0.17480.1748
1220.0971-0.0790.07580.0730.01890.02410.1553-0.14030.1576
1230.1242-0.18470.11210.1050.29030.11280.3359-0.550.2884
1240.17660.06770.1010.09630.17920.12940.35980.43210.3243
1250.1869-0.13050.10690.10150.56480.21650.4653-0.76710.4129
1260.17890.17190.11770.1161.15490.37290.61071.0970.5269
1270.2029-0.20330.130.12581.08960.47530.6894-1.06550.6038
1280.1888-8e-040.11380.110200.41590.6449-0.00420.5289
1290.16590.15650.11860.11680.33450.40680.63780.59030.5357
1300.1628-0.10630.11730.11520.06850.3730.6107-0.26720.5089
1310.1549-0.05370.11160.10950.01330.34030.5834-0.11770.4733
1320.13720.04180.10570.10390.00440.31230.55880.06740.4395

\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.1067 & -0.0726 & 0.0726 & 0.07 & 0.0293 & 0 & 0 & -0.1748 & 0.1748 \tabularnewline
122 & 0.0971 & -0.079 & 0.0758 & 0.073 & 0.0189 & 0.0241 & 0.1553 & -0.1403 & 0.1576 \tabularnewline
123 & 0.1242 & -0.1847 & 0.1121 & 0.105 & 0.2903 & 0.1128 & 0.3359 & -0.55 & 0.2884 \tabularnewline
124 & 0.1766 & 0.0677 & 0.101 & 0.0963 & 0.1792 & 0.1294 & 0.3598 & 0.4321 & 0.3243 \tabularnewline
125 & 0.1869 & -0.1305 & 0.1069 & 0.1015 & 0.5648 & 0.2165 & 0.4653 & -0.7671 & 0.4129 \tabularnewline
126 & 0.1789 & 0.1719 & 0.1177 & 0.116 & 1.1549 & 0.3729 & 0.6107 & 1.097 & 0.5269 \tabularnewline
127 & 0.2029 & -0.2033 & 0.13 & 0.1258 & 1.0896 & 0.4753 & 0.6894 & -1.0655 & 0.6038 \tabularnewline
128 & 0.1888 & -8e-04 & 0.1138 & 0.1102 & 0 & 0.4159 & 0.6449 & -0.0042 & 0.5289 \tabularnewline
129 & 0.1659 & 0.1565 & 0.1186 & 0.1168 & 0.3345 & 0.4068 & 0.6378 & 0.5903 & 0.5357 \tabularnewline
130 & 0.1628 & -0.1063 & 0.1173 & 0.1152 & 0.0685 & 0.373 & 0.6107 & -0.2672 & 0.5089 \tabularnewline
131 & 0.1549 & -0.0537 & 0.1116 & 0.1095 & 0.0133 & 0.3403 & 0.5834 & -0.1177 & 0.4733 \tabularnewline
132 & 0.1372 & 0.0418 & 0.1057 & 0.1039 & 0.0044 & 0.3123 & 0.5588 & 0.0674 & 0.4395 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=267950&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.1067[/C][C]-0.0726[/C][C]0.0726[/C][C]0.07[/C][C]0.0293[/C][C]0[/C][C]0[/C][C]-0.1748[/C][C]0.1748[/C][/ROW]
[ROW][C]122[/C][C]0.0971[/C][C]-0.079[/C][C]0.0758[/C][C]0.073[/C][C]0.0189[/C][C]0.0241[/C][C]0.1553[/C][C]-0.1403[/C][C]0.1576[/C][/ROW]
[ROW][C]123[/C][C]0.1242[/C][C]-0.1847[/C][C]0.1121[/C][C]0.105[/C][C]0.2903[/C][C]0.1128[/C][C]0.3359[/C][C]-0.55[/C][C]0.2884[/C][/ROW]
[ROW][C]124[/C][C]0.1766[/C][C]0.0677[/C][C]0.101[/C][C]0.0963[/C][C]0.1792[/C][C]0.1294[/C][C]0.3598[/C][C]0.4321[/C][C]0.3243[/C][/ROW]
[ROW][C]125[/C][C]0.1869[/C][C]-0.1305[/C][C]0.1069[/C][C]0.1015[/C][C]0.5648[/C][C]0.2165[/C][C]0.4653[/C][C]-0.7671[/C][C]0.4129[/C][/ROW]
[ROW][C]126[/C][C]0.1789[/C][C]0.1719[/C][C]0.1177[/C][C]0.116[/C][C]1.1549[/C][C]0.3729[/C][C]0.6107[/C][C]1.097[/C][C]0.5269[/C][/ROW]
[ROW][C]127[/C][C]0.2029[/C][C]-0.2033[/C][C]0.13[/C][C]0.1258[/C][C]1.0896[/C][C]0.4753[/C][C]0.6894[/C][C]-1.0655[/C][C]0.6038[/C][/ROW]
[ROW][C]128[/C][C]0.1888[/C][C]-8e-04[/C][C]0.1138[/C][C]0.1102[/C][C]0[/C][C]0.4159[/C][C]0.6449[/C][C]-0.0042[/C][C]0.5289[/C][/ROW]
[ROW][C]129[/C][C]0.1659[/C][C]0.1565[/C][C]0.1186[/C][C]0.1168[/C][C]0.3345[/C][C]0.4068[/C][C]0.6378[/C][C]0.5903[/C][C]0.5357[/C][/ROW]
[ROW][C]130[/C][C]0.1628[/C][C]-0.1063[/C][C]0.1173[/C][C]0.1152[/C][C]0.0685[/C][C]0.373[/C][C]0.6107[/C][C]-0.2672[/C][C]0.5089[/C][/ROW]
[ROW][C]131[/C][C]0.1549[/C][C]-0.0537[/C][C]0.1116[/C][C]0.1095[/C][C]0.0133[/C][C]0.3403[/C][C]0.5834[/C][C]-0.1177[/C][C]0.4733[/C][/ROW]
[ROW][C]132[/C][C]0.1372[/C][C]0.0418[/C][C]0.1057[/C][C]0.1039[/C][C]0.0044[/C][C]0.3123[/C][C]0.5588[/C][C]0.0674[/C][C]0.4395[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=267950&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=267950&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.1067-0.07260.07260.070.029300-0.17480.1748
1220.0971-0.0790.07580.0730.01890.02410.1553-0.14030.1576
1230.1242-0.18470.11210.1050.29030.11280.3359-0.550.2884
1240.17660.06770.1010.09630.17920.12940.35980.43210.3243
1250.1869-0.13050.10690.10150.56480.21650.4653-0.76710.4129
1260.17890.17190.11770.1161.15490.37290.61071.0970.5269
1270.2029-0.20330.130.12581.08960.47530.6894-1.06550.6038
1280.1888-8e-040.11380.110200.41590.6449-0.00420.5289
1290.16590.15650.11860.11680.33450.40680.63780.59030.5357
1300.1628-0.10630.11730.11520.06850.3730.6107-0.26720.5089
1310.1549-0.05370.11160.10950.01330.34030.5834-0.11770.4733
1320.13720.04180.10570.10390.00440.31230.55880.06740.4395



Parameters (Session):
par1 = 12 ; par2 = -0.3 ; par3 = 0 ; par4 = 0 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 2 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = -0.3 ; par3 = 0 ; par4 = 0 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 2 ; par9 = 0 ; par10 = FALSE ;
R code (references can be found in the software module):
par10 <- 'TRUE'
par9 <- '0'
par8 <- '0'
par7 <- '0'
par6 <- '3'
par5 <- '12'
par4 <- '0'
par3 <- '0'
par2 <- '-0.3'
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
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,par1))
(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')