Thursday, October 10, 2024

Applying Machine Learning Techniques to Metals and Mining Portfolio Construction

Mining has been at the core of our development since the earliest times. From the Stone Age until the present, our ability to transform the elements into tools has been key for our success. Much like in the past, in the 21st Century, the technologies that will take us into the future will require large amounts of critical materials. Artificial intelligence and machine learning, cloud and mobile computing, the global internet, web technologies and the internet of things, quantum computing, advanced robotics, the substitution of oil for renewable energies, biotechnology, etc; will not flourish unless, cleaner and more effective techniques to mine resources from the ground are developed.

The value of mining firms derives from the value of their mineral reserves and resources. These are tangible assets with intrinsic, measurable value. They trade at low Price-to-earnings and price-to-book multiples because of their cyclical nature, because their growth is limited to how fast they can grow their pool of resources and because their growth requires high capital expenditure and long implementation periods. Furthermore, mining company valuations are highly dependent upon volatile commodity prices. When prices are low, valuations decline leading to lower and seemingly attractive multiples.

Metal prices fluctuate in cycles that can last as long as 10 years. Mining fields take a long time from discovery to production, even decades. Low mining firm valuations are, therefore, not necessarily an indication of short-term appreciation potential. A catalyst is required to trigger a change of phase in the cycle. Until this phase of change occurs, mining stocks may underperform. This is why successful mining investors tend to be very patient. The ideal investment horizon for a mining investor is at least ten years long.

The cyclicality of Mining and Metals performance can be summarized by the MSCI World Metals and Mining Index which is composed of over 1500 stocks representing around 85% of the market capitalization of mining firms in 23 developed markets. When compared to the MSCI World Index -a benchmark of world stock markets performance- over the 10 years ending in July 2024, it has generated about half the annual 9.53% return produced by the world benchmark. Over the last five years, though, both indexes have roughly generated the same 12% annual return.

These averages hide a large dispersion in the performance of mining companies. For instance, YTD in 2024, First Quantum Minerals, traded in the Toronto Stock Exchange, rose by 58%. This compares to the 24% that Vale, the Brazilian Iron and Nickel giant, fell. When comparing large, diversified mining firms, stark differences arise as well. Over the same period, BHP Group of Australia fell by 16% whereas Ma`aden of Saudi Arabia rose by 14%.

Such dispersion of returns leads me to believe that there is room for improving performance by adopting an active security selection approach to investing in mining. Through the remainder of this note, I will outline a formal process in which this can be done using Machine Learning Techniques. In particular, Stochastic Optimization using Montecarlo Simulations (SO) and Principal Component Analysis (PCA) on time series and cross-sectional data. The application of these techniques to this particular problem is in progress. I remain curious and optimistic about its results though based on my experience using the same methods to solve other asset allocation and securities selection problems. Anyone who shares this interest may contact me at josepedromartinezsanguinetti@gmail.com, jmartinez@rimac.com.pe, or by WhatsApp at 51988113792.

PCA is a technique that allows us to identify the drivers of variability in a set of data. This set of data can be a time series, like the performance of one index throughout time, or a series of observations of different entities in the same lapse, like the business performance of the firms composing an index during the same period. Because the variables that most explain the pattern of variability of the data are identified, it allows to reduce the dimensionality of data in complex analysis and focus on the most relevant ones leaving the rest aside.

PCA and SO allow for the application of a factor investing approach to portfolio construction. This can be accomplished by taking the following steps:

(1) By means of PCA identify the root sources of variation in the index or indexes whose performance is sought to improve. Most of the variation in a series of data can be explained by four or five uncorrelated factors. When applied to mining indexes, I would expect these factors to be highly correlated with metal prices or world economic growth, with exchange rates or inflation and with interest rates and credit spreads or the cost of capital. Risk aversion, fear and greed measurements, or the traditional value and size factors may also be key sources of variability.

(2) Having identified the economic forces explaining the evolution of the series, test how the firms that compose the index correlate with the factors identified. Since firms composing an index could be over a thousand, it would be advisable to first perform PCA analysis on a cross-sectional set of data measuring the business performance of the firms composing the index over the same period. This would identify clusters of entities whose performance is highly correlated. These clusters would form around attributes like profitability, metals or minerals produced, ore grades, elasticity of substitution, countries of operation, leverage, cost of capital or size among others. A representative firm for each cluster can be chosen and used in subsequent analysis. This would furthermore reduce the dimensionality of the analysis cutting the number of securities in question as well as the number of factors that govern their performance. This reduces a multidimensional problem to a more tractable one with fewer factors and fewer securities without losing key information or levels of diversification.

(3) Having reduced the number of factors and having identified the representative securities, it is possible to estimate the elasticity of each representative security to each one of the factors.

(4) Using these elasticities, it is possible to rebalance the index using a risk/return portfolio optimization process to create an optimal portfolio. This can be set to maximize return, risk adjusted return, the Sharpe or Sortino ratios or minimize the maximum drawdown during liquidity events in the market. It can also be used to express subjective expectations like “copper and gold mining firms are likely to outperform” or “firms exposed to coal and oil are likely to underperform”.

This optimization problem can be solved using past performance data. However, past performance is not indicative of future performance. To deal with uncertainty, this analysis must be completed with an evaluation of the expected performance of the rebalanced portfolio in multiple potential future outcomes. This is when SO enters the process. A Montecarlo Simulation can be set to test the expected behavior of the rebalanced portfolio over a multitude of potential future scenarios and alternatively estimate an optimal portfolio in uncertainty. Key return and risk indicators for this portfolio can be estimated and set as targets for the investable portfolio.

(5) Once the optimal portfolio is set, the investable portfolio can be built with as few securities as required to mimic the characteristics of the former. Key performance indicators must be regularly measured against those of the optimal portfolio and, subsequently, both the optimal and investable portfolios can be rebalanced.
The process described above is quantitative in the use of Machine Learning techniques but also qualitative in the sense that it introduces subjective expectations, the subjective optimization horizon and judgment is exercised when choosing the relevant factors or company clusters when PCA is applied. Though its use for this problem remains underway, I wait with curiosity and excitement to see its results.

Latest