# Nickel and Cobalt Price Volatility Forecasting Using a Self-Attention-Based Transformer Model
## 4 Empirical Results
### Application of TFTs Based on Training History of Five Months and One Year  
The study using the Temporal Fusion Transformer model (TFT) examined two different scenarios based on the historical period. The first scenario involved a 30-day forecast with a training history of one year, which reflects the medium-to-long-term trend. The second scenario involved a 30-day forecast with a training history of approximately five months, which reflects the short-term trend. To evaluate the accuracy of the forecasts, the total dataset was divided into training and test sets, with the training set consisting of approximately 97% of the data and the test set consisting of approximately 3%. In Scenario 1, the TFT model was estimated using the last 365 observations of the training set, corresponding to a one-year history, while in Scenario 2 the model was estimated using the last 142 observations of the training set, corresponding to a five-month history. \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & & **Cobalt** & & \\ \hline
**MAPE** & **TFT** & **BLSTM** & **GRU** & **NCF** \\ \hline
15 & 26.91 & 35.463 & 31.7975 & 27.6 \\ \hline
20 & 3.4785 & 15.394 & 12.021 & 4.1105 \\ \hline
30 & 9.05 & 16.882 & 16.459 & 5.0178 \\ \hline  & & **Nickel** & & \\ \hline
**MAPE** & **TFT** & **BLSTM** & **GRU** & **NCF** \\ \hline
15 & 26.98 & 26.39 & 28.92 & 28.22 \\ \hline
20 & 2.817 & 2.95 & 4.336 & 5.9525 \\ \hline
30 & 3.659 & 4.11 & 5.17 & 6.178 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: MAPE values of forecasting accuracy of the used models. The TFT model forecasts on the test set with other models such as; similar to the first scenario, the forecasts did not show a good fit. The mean absolute percentage error concerning the volatility of Cobalt returns was 9.7%, while concerning the volatility of Nickel returns, the MAPE was 13.8%; both values were well above the benchmark value for a good fit of 5%. Since Scenario 2 considered a history of about five months, the results suggest that from information representing the short term it was not possible to predict a month of daily observations in an acceptable manner with the TFT model on the test set, and this continues to provide evidence of the poor predictive power of WTI crude oil prices as an explanatory variable (as shown in Section 3). Since the sample covered the period from 7 March 2013 to 12 December 2022, the Out-of-Sample forecasts for one month of daily observations covered the period 1 January 2023 to 30 January 2023. Figures 2 and 3 show the Out-of-Sample forecasts under Scenario 1. \begin{table}
\begin{tabular}{c c c c} \hline  & \multicolumn{2}{c}{**Cobalt**} \\ \hline
**TFT** & **NCF** & **GRU** & **BLSTM** \\ \hline
15 & 0.02(2.193) & 0.04(1.069) & 1.87(\(-\)1.53939) \\ \hline
20 & 0.01(2.47) & 0.039(2.069) & 0.54(0.60129) \\ \hline
30 & 0.003(2.92) & 0.000217(3.69) & 0.98(0.023) \\ \hline \multicolumn{4}{c}{**Nickel**} \\ \hline
**TFT** & **NCF** & **GRU** & **BLSTM** \\ \hline
15 & 0.12(1.5364) & 0.145(1.457) & 0.0841(\(-\)1.539) \\ \hline
20 & 0.015(2.4158) & 0.148(1.1446) & 0.00414(2.867) \\ \hline
30 & 0.04(1.345) & 0.000217(3.69) & 0.023(1.98) \\ \hline \end{tabular}
\end{table} 
Table 4: The levels of statistical significance as shown by Diebold–Mariano Test, indicating a 5% level of significance, based on the \(p\)-value and DM statistics (inside the brackets). Figure 2: Out-of-Sample Forecast: Scenario 1, Volatility: Cobalt/Confidence Intervals 95% (where LimInf and Limsup are lower and upper confidence limits). As can be seen, while the in-sample fit was not very accurate, the Out-of-Sample forecasts under Scenario 1 appeared to capture the short-term trend. For example, with respect to the volatility of Cobalt price returns, the forecasts appeared to reflect the trend at the end of the volatility series (more precisely, that of the 7 December 2021 to 12 December 2022 period), with the confidence intervals capturing the variability of the earlier period.