In this series, I (Jin Choi) talk about my goal of reaching $1 million in my TFSA account by 2033. If you want to know what a TFSA is, I recommend you read my free book. In this article, I’ll also show why it’s been unexpectedly difficult to forecast company financials using machine learning.
November Results: Up 1.6%
At the end of November, I had $48,103 in my TFSA account, which was up by 1.6% since the start of the month. By comparison, the Canadian stock market went up by 0.5% while the U.S. stock market went up by 3.1% in Canadian dollar terms. Therefore, my portfolio slightly underperformed.
The majority of my portfolio still consists of oil and gas stocks. In November, oil prices climbed again from $54.36/bbl to $57.40/bbl. Unfortunately, my oil stocks only had a tepid response to the increase. Though my oil stocks will generate decent profits at current oil price levels, I think there’s some worry among investors that the oil price will go down again once shale drillers get back into growth mode.
To be fair, there are some signs of this happening. The latest Energy Information Administration (EIA) report states that oil production in the U.S. jumped by nearly 300,000 barrels/day in September. Also, after bottoming at 729 a month ago, the number of active oil rigs in the U.S. has gone up steadily since, and currently stands at 747.
However, I don’t think these recent developments are enough to sink oil prices again. For instance, the EIA currently believes U.S. oil production will rise by about 700,000 barrels/day in 2018. The U.S. is the pretty much the only place we’ll see significant oil production growth next year, so if global oil demand rises by more than 1 million barrels/day again (demand growth has averaged about 1.5 million barrels/day in recent years), then oil prices should continue to rise.
For the rest of this article, I’ll talk about my latest machine learning initiative to forecast company fundamentals (e.g. earnings growth, revenue growth).
Using Past Fundamentals To Predict A Company’s Growth
First, let me recap why I’ve chosen to forecast stock fundamentals instead of prices. The main problem with forecasting prices is that human behaviour largely influences price. If a stock price exhibits a predictable pattern, sophisticated investors will develop trading algorithms that exploit that pattern. The introduction of such algorithms will change the behaviour of stock prices, and the pattern may disappear.
A company’s fundamentals, on the other hand, should be immune to such behavioural effects. In other words, trading algorithms shouldn’t be able to influence how much money a company will make in future years. Therefore, I believed that any patterns in company fundamentals would persist for a long time. What’s more, I believed that such patterns would be easier to discover.
For my first foray, I theorized that past fundamentals could be used to predict future fundamentals. In order to test this theory, I gathered annual financial metrics from all U.S. stocks starting in 2007. The metrics gauge different aspects of each stock. For example, “current ratio” gauges whether a company had enough money to operate normally, whereas “asset turnover” gauges how efficiently a company could generate sales using its own resources. I chose to consider 43 such metrics altogether.
With these metrics, I investigated whether I could predict a company’s operating income growth over the ensuing year. Operating income is different from the headline “net profit” in that it excludes charges related to taxes, interest and some one time items. For example, let’s say a company’s net income was $10 million after having paid $3 million in taxes and $1 million in interest, and $2 million in one time items. Then, the company’s operating income would be $10 +3 + 1 + 2 = $16 million.
I chose to predict operating income instead of net income because operating income tends to be more stable. One time items in particular can swing a company from profit to loss (or vice versa) in any given year. It also helps that operating income tends to be positive more frequently than net income. This is relevant because of the way we calculate operating income growth, which is (income in next year)/(income in previous year) - 1.0. If income in the previous year is negative, we get misleading results. For example, if a company’s operating income goes from -$2 million to -$3 million, then the growth according to this formula will be 3/2-1.0 = 50%. Therefore, I’ve chosen to exclude data where income in year 1 is negative.
Once I’d gathered all the data, I then had to transform the data so that it was more suitable for machine learning. This step is necessary because financial metrics tend to have extreme numbers. For example, the following chart shows the histogram of the “current ratio” metric.
As you can see, most companies’ current ratios tend to range from 0 to 10. However, there are some outlier companies whose current ratios go up to as much as 120. Since current ratio measures the ratio of current assets to current liabilities, the metric can blow out to a high number if a company has very little in current liabilities.
There are a few different ways of transforming the data. I’ve tried a couple of methods, but the one I want to highlight is the quantile transformation. This transformation involves mapping the distribution of each metric onto a normal distribution. For example, once I applied the transformation to the current ratio metric, its histogram looked as follows:
Having transformed the data, I trained some dense neural networks to see if some combination of financial metrics could predict operating income growth. A dense neural network is a popular type of machine learning model, which I’ve written about in the past.
I tried different configurations of dense neural networks, but to my surprise, I couldn’t get any of them to learn how to predict operating income growth. To find answers, I plotted the relationship between various financial metrics and operating income growth. Below is one such graph that shows the relationships between return on assets (roa), return on equity (roe), return on invested capital (roic), and operating income growth (y).
If there is a correlation between any two variables, the dots in the graph should either form a diagonal or an off diagonal. For instance, you can see that ‘roe’ and ‘roa’ are related to each other because the points align along the diagonal. However, you can’t detect any such patterns between any of the variables and ‘y’, meaning that there appears to be no relationship between either ‘roa’, ‘roe’, or ‘roic’ and operating income growth.
This lack of any apparent relationship even extends to metrics which we think should predict operating earnings growth. For example, one would think that a company that has increased operating earnings in the past should continue to grow earnings into the future. After all, we “know” that companies like Google generally increase their earnings every year. However, that doesn’t appear to be the case in general, as the following chart shows.
The chart shows the relationships between the previous year’s operating income growth (ebitgrowth), net income growth (netincomegrowth), revenue growth (revenuegrowth) and next year’s operating income growth (y). As we can see from the bottom set of charts, there similarly doesn’t appear to be any relationship between ‘y’ and any of the other variables.
But how can this be? What about the likes of Google, for which we can safely predict constantly growing income? As it turns out, such companies are the exception, rather than the norm. Most companies’ incomes tend to fluctuate up and down a lot more. As a random example, Cedar Fair’s (ticker: FUN) operating income went up by nearly 30% in 2013, fell by 8% in 2014, and then grew by 5% in 2015.
Since operating income appears to move randomly from year to year, my machine learning models had a hard time learning how to predict its future growth. I still think it’s possible to train a model to predict growth, but it’s likely that I’ll need to feed the models more information than what I’ve been feeding them so far. I’ll keep you updated on my progress through this blog.
In the meantime, this exercise has given me more appreciation for stocks like Facebook, Google and Amazon, for which you can safely forecast growing revenues and earnings. These stocks may appear richly valued when you look at metrics such as the price to earnings ratios, but perhaps dependable growth is worth paying a high price for.