# Nickel and Cobalt Price Volatility Forecasting Using a Self-Attention-Based Transformer Model
## 4 Empirical Results
### Forecasts Generated from the Test Set  
For the first part, three set-ups were considered from the perspective of the historical period: (i) 30-day forecasts and training history of one year (this scenario would reflect the medium-long term), (ii) 20-day forecast and training history of one year, and finally (iii) 15-day forecast and training history of one year, scenarios that would reflect the short term trend, respectively. Additionally, other sequential models such as BiLSTM (Bidirectional Long Short-term memory) and GRU (Gated Recurrent Units) were also tested for the future 15, 20 and 30 days. \begin{table}
\begin{tabular}{c c c c} \hline \hline  & \multicolumn{2}{c}{**Volatility**} & \multicolumn{2}{c}{**Prices**} \\ \cline{2-4}  & **Cobalt** & **Nickel** & **WTI** \\ \hline Mean & 1.31 & 1.3 & 65.05 \\ \hline SD & 0.46 & 0.47 & 22.16 \\ \hline Min & 0.54 & 0.75 & 19.78 \\ \hline Max & 2.41 & 3.1 & 123.7 \\ \hline Skewness & 0.13 & 1.43 & 0.54 \\ \hline Kurtosis & \(-\)1.13 & 1.46 & \(-\)0.75 \\ \hline Jarque-Bera & 54.07 & 413.87 & 69.32 \\ \hline N & 974 & 974 & 974 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The descriptive statistics of the variables of interest in the study over the total dataset. \begin{table}
\begin{tabular}{c c c c} \hline \hline  & \multicolumn{2}{c}{**Optimum Values**} \\ \hline
**Parameters** & **Range** & **Scenario 1** & **Scenario 2** \\ \hline No. of Trials & 200 & 200 & 200 \\ \hline Maximum No. of Epochs & 50 & 50 & 50 \\ \hline Gradient Clip Value Range & (0.01, 1.0) & 0.150672 & 0.011087 \\ \hline Hidden Size Units & (8, 128) & 23 & 119 \\ \hline Hidden Continuous Size Units & (8, 128) & 11 & 14 \\ \hline Attention Head Size & (1, 4) & 3 & 2 \\ \hline Learning Rate & (0.001, 0.1) & 0.001071 & 0.002029 \\ \hline Dropout & (0.1, 0.3) & 0.115563 & 0.130221 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Parameters for the optimal model. The forecasts of the TFT model on the test set for 15 days, as can be seen from Table 3, did not show a good fit; the mean absolute percentage error (MAPE) with respect to the volatility of Cobalt returns was 26.91%, while with respect to the volatility of Nickel returns the MAPE was 26.98%. As the horizon period increased to 20 days, the error rate decreased to a drastic level of 3.47% for Cobalt and 2.817% for Nickel using the TFT model. Similar settings were noticeable in no change forecasts, where there was a drastic change in the error values. This was somehow the result of internal designs of TFTs, which favor only the key features to be taken to gauge future values. In contrast the error values for BLSTM and GRU forecasts, a major change can be seen for the Nickel forecasts but not for the Cobalt forecast. A familiar leaning was shown for the 30-day-ahead forecasts. All in all, the TFT forecasts were the most accurate in comparison to all other models, and this was evidenced by the Diebold-Mariano test in Table 4. In the case of Cobalt (Table 4), TFTs were significantly better at predicting pricing volatilities for different time horizons, namely, 15, 20 and 30 days in comparison to No change and GRU forecasts. However, with respect to BiLSTMs, the accuracy results were not found to be statistically significant for 20- and 30-days-ahead forecasts, and were less accurate for 15-day-ahead forecasts. Likewise, for the case of Nickel, the accuracy of TFTs was found to be greater with comparison to the No change forecasts as well as GRUs; however, this was not statistically significant for the 15-days-ahead forecasts. In comparison to the BiLSTMs forecasts, the results were not much different. Additionally, the empirical practice considered a MAPE less than or equal to a 5% good fit, which was the case with accuracy measures of TFT forecasts.