Mixing Machine Learning and Value Investing

Sept. 5, 2023, 7:37 a.m. |Investment Philosophy |Intermediate

There are different ways to wield machine learning to select which securities to invest in. Modellers most commonly use machine learning to unearth connections between factors and the securities' price movements. A modeller may theorize, for example, that positive news will lift a company's stock over the subsequent week. Or, they may conjecture that stocks that fell this past week will likely fall again next week. The modeller would thus set price moves as the target variable, set news sentiment and preceding price moves as inputs, and ask machine learning to try using the inputs to predict the target.

Robot digging for gold

Models constructed this way don't understand why prices respond as they do to inputs. They don't say, "hmmm, I think positive news attracts investors' attention and prompts them to consider buying the stock." They merely note the correlation between news and price moves. If stocks have actually tended to go down following good news, the model doesn't frown and reconsider its worldview, nor would it hesitate to caution us from buying stocks with good press.

There are pros and cons to letting the model train without guidance from intuition. One pro is that this approach saves us from our own biases. We often hold false notions about how the world works. Perhaps there are good reasons, currently outside our imaginations, that cause investors to sell after a company reports good news. Another pro is that this approach can help us discover insights we'd never have thought of by ourselves. The model may find, for instance, that good news exerts a more powerful pull on falling stocks than we would have supposed.

The drawback of directly linking factors to price moves is that the security selection process can become a black box. If a model recommends buying Amazon over Netflix, we may not fully understand why. Its creator can explain the statistical methods used to build the model, and they can trace, step by step, how the model came to each decision. But if the model is complicated enough, it would be like showing someone a 1,000-piece puzzle, one piece at a time, and asking them to describe the completed picture. Information may be within our reach, but comprehension isn't.

Humans generally distrust black boxes, and with good reason - we don't know when a model is defective. If a human stock picker makes a series of bad calls, we can interview them to understand their thought process and judge whether that process is sound. But a model will stay silent as it commits errors, so it's hard to tell whether it's going through a temporary slump or if there's something more fundamentally wrong. It's easy to create a bad model. Building a model is replete with traps, and it's rare to see a modeller evade all of them, especially in the financial domain.

An alternative way to harness the power of machine learning is to use intuition to strategize how securities should be selected and then focus machine learning on just a single component of that strategy. One example of this approach is to aim to buy securities for less than their 'intrinsic value' - a term describing their inherent worth. This approach is known as value investing. The modeller can then ask machine learning to estimate intrinsic values. This process is, in fact, the one I use.

'Value investing' has unfortunately become a loaded term. Many quants use it to describe investing in stocks that look cheap when measured against a handful of financial ratios such as the Price to Book ratio. But I refer to it here as the philosophy of buying securities for less than their intrinsic values. The latter type of investor contends that financial ratios are imprecise and unreliable weight scales of value. Many stocks that therefore appear cheap to these 'value investors' look expensive to quants and vice versa.

Value investors spend much of their time assessing a security's intrinsic value. One can offer several definitions of intrinsic value, but I define it as the discounted stream of cash that an investor can expect to receive from holding a security, assuming they never tried to sell it. Under this definition, we infer the intrinsic value of a bond from the series of interest and the principal payments its owner would expect to receive when they hold the bond until maturity. We'd also tie the intrinsic value of a stock to the dividends we expect it to pay throughout its life, plus its residual value when it goes bankrupt or gets acquired.

We need to discount these streams of cashflows to size up intrinsic values. The discount percentage increases with the length of time that investors must wait to receive the cash and the risk that the cash might not arrive. Expressed in Python code, the intrinsic value calculation would look something like this:

cash_flows = [100, 110, 125, 1000] # Expected cash flows from a hypothetical security
discount_rate = 0.08
intrinsic_value = 0
for i, cash_flow in enumerate(cash_flows):
   # By taking the (i + 1)th power, total discount amount increases in proportion to 
   # the length of wait
   intrinsic_value += cash_flow / (1 + discount_rate) ** (i + 1)

If you run this code unchanged, the intrinsic value of the hypothetical security tallies to $1,021. This number suggests that if you bought the security for $1,021 and if it paid out as expected, you'd enjoy an 8% (i.e. the specified discount rate) rate of return. But what if you could buy this security for less - say, $990? Your rate of return would then be higher. To verify this, try running the code with the discount rate set to 0.09. The intrinsic value would become $990, meaning you'll get a 9% rate of return if you bought the security for that price.

Unless the security doesn't pay as expected, your rate of return from keeping the security to the end will stay fixed, irrespective of what happens to its price after purchase. A hedge fund could push the previously mentioned security's price down to $800, or day traders could raise the price to $1,500. But unless those actions cause the security to change its cash distributions, your rate of return for having purchased it for $1,021 will remain at 8% per year. Value investors ignore market swings and focus solely on guessing a security's cash flow correctly, as doing the latter is sufficient to generate good returns.

Value investing might sound easy to the uninitiated - just find each security's intrinsic value and buy them for less. But there's a reason why many value investors go out of business. Forecasting cash flows is hard, especially over long horizons in ever-changing economic, political, and technological landscapes. Value investors painstakingly dissect financial data, talk to the company's management, and digest the news. They rely heavily on intuition to translate what they've learned into forecasts. Unfortunately, as with any process that relies on gut feeling, the produced estimates are imprecise and afflicted by psychological biases.

Machine learning, by comparison, seems well suited to the task of assessing intrinsic values. It can quickly churn through millions of data points and analyze their relevance to a security's health with precision and emotional detachment. Which is why I created such a model. My model uses dozens of factors to forecast a company's profits and dividends, which I then use to derive each security's intrinsic value.

Machine learning is not a silver bullet, however. Though much more accurate than models that predict price moves, models that forecast fundamentals are still only moderately accurate. One can increase the accuracy with better techniques and more data, and I strive to do that, but I suspect the potential gains are limited. The economy is too chaotic for us to subjugate them into predictable processes. Models also can't grasp many important considerations, such as the attractiveness of a newly announced product - though we can partially patch this deficiency by manually adjusting the model's base estimates up or down.

Even if my model can perfectly nail each security's intrinsic value, we wouldn't have any guarantees that the undervalued stocks we buy will outperform in the short term. Markets can, and often do, push cheap companies down much farther. But this vulnerability is not borne of our use of machine learning. It afflicts all value investing strategies, and it's one that value investors deliberately choose to accept. There are risks with trying to anticipate investor behaviour - what happens if we sell an undervalued security expecting its price to fall, but it doesn't? We'd have missed an opportunity.

There's a famous prayer that goes like this: "God grant me the serenity to accept the things I cannot change, courage to change the things I can, and the wisdom to know the difference." I've offered a similar prayer as I built our machine learning model: "God grant us the serenity to accept the things I can't predict, courage to model the things I can, and the wisdom to know the difference." I have accepted investors' behaviour to be unpredictable and to concentrate solely on measuring securities' intrinsic values. Doing just that well should lead to good returns. Feel free to contact us if you'd like to learn more about my model and how we use it.


Leave a comment

Please enter your name!
Please provide a valid email address!
Please enter a comment message!