Outstanding previous research has applied machine-learning techniques with different training periods and different prediction time horizons to model the recent history of copper prices. The period from 2008 to 2011 was used by [49
] to predict up to 2016. The training period from 2009 to 2015 was used to predict copper prices from 2016 to 2017 by [51
]. The period from 2002 to 2014 was analyzed by [41
]. Using more recent periods, [50
] fitted an ANN for the period 2006 to 2018.
Acknowledging that the literature has successfully modelled the recent history of copper prices, and to challenge the predictive ability of the proposed framework, the criterion for selecting the training periods was to choose those with the highest volatility. Volatility, or standard deviation of price returns, is an indicator of the variability of the data and always negatively impacts the forecasting ability of the models. Furthermore, the level of difficulty increases when the period exhibits non-constant volatility and volatility clustering [52
], in which large changes tend to follow large changes and small changes tend to follow small changes, as is the case for copper returns.
depicts the annualized five-day rolling window volatility of copper returns from 1999 to 2018. In blue is the first period (period 1) used in this research, from May 2006 to September 2008, with an average volatility of 32%. In red is the second period (period 2) used in this research with even greater volatility, an average of 42%, associated with the extreme events related to the collapse of Lehman Brothers in September 2008, and the resulting turmoil in the world financial markets up to 2010. The rest of the periods, in black, with an average volatility of 20%, can be considered as quieter in terms of the dynamics of copper prices.
The period from 2006 to 2008 has been extensively studied not only in the literature but also by the United Nations [53
] to understand the reasons for the increase in volatility of commodities markets. One of the reasons found by [53
] was financialisation and as a consequence, the effects of index-based investment in commodity futures causing a bubble-like increase of energy and non-ferrous metal prices. The same authors also estimated the price impact of index-based investment on energy and metal prices in the order of 3–10 per cent in 2006–2007 and 20–25 per cent in the first half of 2008. Which implies in the case of copper, that when the price was 402 USç/pound in April 2008, it would have been 333 USç/pound without index-based investment. Additionally, as explained by [54
], from 2004 to 2008 the open interest in derivative markets grew significantly as passive, long-only commodity index investors sought commodities for incremental risk/return enhancement in large diversified portfolios. All these reasons make the period 2006 to 2008 especially interesting, because the high level of volatility was explained by reasons related to investors and financial market movements.
From a modelling point of view, the period from 2008 to 2010 is also extremely interesting because yearly volatility reached peaks of more than 120% and included clusters of volatility around 60% and 40% (Figure 1
). The period also shows a sharp decrease of copper prices of 60%, from 313 USç/pound in September 2008 to 128 USç/pound in December 2008, and a progressive rise in prices up to 350 USç/pound in September 2010. Additionally, in this case, the turbulences were not only explained by financial market factors. Considering all these facts, it is expected that the predictive ability of the model for period 2 will be seriously affected.
In line with previous research on the prediction of copper prices [49
], the first data set consisted of 601 daily closing prices of copper spot prices of the LME in USç/pound, ranging from 10 May 2006 to 22 September 2008. The second dataset included 529 daily observations from 22 September 2008 to 22 October 2010. In both cases, the last 24 observations were reserved as an out-of-sample prediction data set.
As inputs to our algorithms, we selected 25 different variables described in Table 1
. All the input variables present a 5-day lag except the copper price itself, which includes 5, 6, 7 lags. The output variable copper price has no lag, meaning that we want to predict copper prices five days ahead. This fact is key in the design of the robo-advisor, as we can predict five days ahead with today’s information and, this way, generate an algorithm to rebalance or maintain the long or short positions in our portfolio for the following days.
To represent commodities markets we included prices of oil, copper, copper return and volatility, and prices of other metals. Data on West Texas and Brent spot oil prices were downloaded from the webpage of the US Energy Information Administration [55
]. We collected the LME spot prices of metals through the webpage of ’Comisión Chilena del Cobre‘ (Cochilco) [56
In line with previous research in the forecasting of metal prices [25
], to represent fundamentals of the economy we included two variables: 1) The S&P 500 index, with data from Yahoo Finance [59
], as a representation of one major US stock index. 2) The Euro/USD exchange rate, obtained from the European Central Bank [60
], because copper prices are fixed in US Dollars, and depreciation of the currency may imply increases in the commodity prices, and vice versa. The Euro/USD currency pair is one of the most traded in forex markets and has been previously used in the creation of models for metals [57
We included the change in copper inventories in major exchanges [25
] to represent the copper world demand by calculating the sum of the daily changes of inventories from the LME, New York Mercantile Exchange (COMEX) and the Shanghai Futures Exchange (SFE), also downloaded from Cochilco.
To include the ‘day of the week effect’, meaning more negative returns on Mondays, and more positive returns on Fridays, found in previous research in the copper markets [61
], we created a dummy variable representing the day of the week; 1 for Mondays, 2 for Tuesdays, Wednesdays and Thursdays, and 3 for Fridays.
To represent the expectations of the big players in the OTC markets we used the Commitments of Traders (COT) reports provided by the US Commodity Futures Trading Commission [40
], including open interest and positions of speculators and hedgers in the OTC derivatives markets.
To homogenize the data when a missing value appeared, we used the last price available to fill the gap. In regards to the return of copper prices, given the price level P1, P2, ..., Pt, we calculated the rate of return at time t as Rt = log(Pt/Pt-1). The volatility was calculated as a 5-day rolling window standard deviation of log returns. Because the COT reports provide weekly data, the same value was used for all the trading days of a given week.
To find the best model for each period dataset, we trained almost 300 different ANNs combining different architectures (MLP or Elman), and internal structures of hidden layers. For each period, the four ANNs with lower (MAPE) and higher Pearson’s correlation coefficient between the daily copper price series and the model prediction can be seen in Table 2
In both periods, the MLP net structure outperformed the others, with MAPE smaller than the 4% obtained by [49
], and correlations with the original series were in the order of 98%, almost 9% higher than the correlation of 89% of the MLP proposed by [41
]. The adjustment between the selected models for each period and the copper prices is depicted in Figure 2
To assess the predictive ability of the model to forecast changes in prices, we first calculated difference in copper and predicted prices and applied the following rule: if the price goes up, the change is recorded as ‘up’, and if it goes down, the change is recorded to ‘down’. With this data we created the confusion matrix with the R library Caret [64
] for the training and out-of-sample sets (Table 3
). The confusion matrix measures the proportion of times that the model predicts a price movement and the market moves in that direction, for example, in the training set (Table 3
a) the model correctly predicts a down movement in 185 days, and fails in 91 days, in which predicts an up movement and the market goes down. Accuracy is the number of total correct predictions divided by total predictions. The level of accuracy of the model for the training set of period 1 is 66.7%, and 53.4% for the model of period 2 (Table 3
a,c). The accuracy for the out-of-sample sets increases to 78.2% and 65.2% for the models of periods 1 and 2, respectively (Table 3
To further test the ability of the model to be used as a robo-advisor, a simulation exercise during the 24 days of the out-of-sample predictions was performed, consisting of staying long if the model forecasts an up movement and short if the model forecasts a down movement. That strategy is compared to the result with the two basic passive strategies [65
], buy and hold, and sell and hold, during the 24-day out-of-sample window. The model for period 1 outperformed both strategies (Table 4
a) with a cumulative return of 29.1%, compared to 16.9% for the sell and hold strategy and −16.9% for the buy and hold strategy (no rebalancing fees were included because of the flat fee nature, of most robo-advisors). The 8.9% cumulative return of the model for period 2 (Table 4
b) was slightly below the 10% obtained with the best passive strategy, buy and hold.
also shows the calculations of the average daily returns, daily standard deviations and Sharpe ratios [66
] (using a US T. Bond risk-free rate of 3.69% for September 2008 and 2.56% for September 2010) for each one of the strategies and the two different periods. In the case of period 1, the robo-advisor is the one that performs better with a higher average return, lower standard deviation and higher Sharpe ratio of 0.71 as opposed to the values obtained for the buy and hold, and sell and hold of −0.36 and 0.35, respectively. The results of the model for period 2 are slightly worse with a lower mean return; 0.44% of the buy and hold strategy compared to 0.39% of the model, almost the same standard deviation, and a Sharpe ratio of 0.31 compared to 0.35 for the buy and hold strategy.