Artificial Intelligence for Long-Term · PDF fileArtificial Intelligence for Long-Term...
Transcript of Artificial Intelligence for Long-Term · PDF fileArtificial Intelligence for Long-Term...
Artificial Intelligence for Long-Term Investing
Magnus Erik Hvass Pedersen
Hvass Laboratories Report HL-1601
First Edition January 21, 2016
Latest Revision
www.Hvass-Labs.org/people/magnus/publications/pedersen2016ai-investing.pdf
Summary
This paper presents the results of using a novel Artificial Intelligence (AI) model for long-term investing. The
AI model takes various financial data as input signals and tries to determine an optimal portfolio allocation.
In these experiments, the AI model considers the stocks of 40 US companies, as well as the S&P 500 index
and US government bonds with one-year maturity. The portfolio is rebalanced annually. Between 1995 and
2015, the equal-weighted rebalancing of these 42 assets outperformed the S&P 500 by 5-6% (percentage
points) per year on average. The AI model outperformed the equal-weighted rebalancing by 12-13%
(percentage points) per year on average, and the AI model outperformed the S&P 500 by about 18%
(percentage points) per year on average. It is uncertain and probably unrealistic that this performance
advantage of the AI model will continue in the future, but it seems feasible that some combination of AI
models could work reasonably well for long-term investing (aka. low-frequency trading).
About the Author
The author has a BSc degree in Computer Science and a PhD degree in Engineering Science. The author’s
previous work in finance includes a comprehensive theory on share buyback valuation, new models for
financial Monte Carlo simulation, and strategies for investing in the S&P 500. The work is available at:
www.Hvass-Labs.Org
Artificial Intelligence for Long-Term Investing
2
1. Introduction There are essentially two problems when allocating an investment portfolio between different assets. The
first problem is to forecast the future returns of each asset. Such forecasts are fundamentally imprecise.
The second problem is to use these imprecise forecasts to create a portfolio that is optimal in some sense.
Modern Portfolio Theory
A common way of optimizing an investment portfolio is to use so-called mean-variance optimization, also
known as Modern Portfolio Theory (MPT), or Markowitz portfolio optimization named after its inventor [1].
Using this method, the mean return of the portfolio is sought maximized while the variance (or the
standard deviation) of the portfolio’s return is sought minimized.
Variance is commonly believed to be a good measure of financial risk and should hence be minimized. But
this is incorrect as can be demonstrated with a short example. Assume asset A can return either 10% or
20% and asset B can return either 4% or 8%. Clearly asset A is preferable to asset B because both possible
returns of asset A are higher than those of asset B. But the variance of asset B is much lower than the
variance of asset A, because the variance measures the spread of possible outcomes. So a portfolio that
was optimized using the MPT method would consider asset B to be less risky than asset A due to asset B’s
lower variance. This is absurd. It gets even worse if we assume another asset C can lose either (5%) or
(6%).1 The variance of asset C is lower than both asset A and B, so asset C should be less risky than both
asset A and B according to this theory, yet asset C only has losses while asset A and B only have gains.
The foundational belief of MPT that variance measures financial risk is absurd– yet Markowitz has received
a Nobel Prize for his work and MPT is now commonly taught at universities and business schools worldwide
as the main method for portfolio optimization, usually without mention of its fatal flaw.
Computer Quants
A pioneer in the use of computers to allocate investment portfolios was Ed Thorp, a mathematics
professor. Thorp published some of his early ideas on arbitrage [2] and used the so-called Kelly criterion for
allocating his portfolio [3]. Thorp was very successful but perhaps the most successful computer-based
trading firm is Renaissance Technologies founded by Jim Simons, another mathematics professor. They
employ a hundred or more elite scientists and engineers who have developed many proprietary models.
Artificial Intelligence
Artificial Intelligence (AI) is also known as Machine Learning. AI is not comparable to human intelligence
which can solve a wide variety of problems. AI can only solve specific tasks, such as recognizing hand-
written letters, translating from one language to another, classifying the contents of an image, etc. AI is
especially useful for tasks that involve noisy or imprecise data with complex structures.
It is commonly believed that AI cannot be used for long-term investing and can only be used in short-term
trading where a lot of data is available. This paper uses a proprietary form of AI for long-term investing and
demonstrates that it may be a viable investment method if researched further. The AI model only
rebalances the portfolio once a year between 42 different assets, yet the AI model was able to double the
average annual return compared to a portfolio using equal-weighted rebalancing of those 42 assets.
1 This paper writes negative percentages in parantheses. For example, (5%) means –5%.
Artificial Intelligence for Long-Term Investing
3
2. The AI Model The AI model is proprietary and will only be described briefly. The AI model takes certain financial data as
input signals and transforms the signals to portfolio weights that are used for annual rebalancing of the
portfolio. The AI model tries to find the combination of assets that will most likely give the highest return,
given the data signals for each asset, the stock-market as a whole, and other relevant data. Not all stocks
can be predicted in the long-term and not all financial and economic data is useful for this. The AI model is
inspired by common AI models but it is a novel variant. It is a so-called unsupervised AI model because of
how it is trained on the historical data – which is a part of its novelty.
3. Test Results This section discusses the results of using the AI model to allocate the investment portfolio. It is assumed
throughout the paper that there were no taxes and trading costs.
3.1. Companies Table 1 shows the companies that were available to the AI model for inclusion in the investment portfolio.
These companies were chosen because the AI model could predict their future returns to some extent.
Other companies such as Berkshire Hathaway and Union Pacific were omitted because the AI model could
not predict their returns.
The companies in Table 1 were also chosen because they have existed for many decades (some have
existed for more than a century) and have at least 20 years of financial data available. Most of the
companies have been leaders in their fields for many years with high returns on assets and equity capital.
Table 1: The AI model allocates the investment portfolio amongst these U.S. companies.
Ticker Name
AXP American Express
BBBY Bed, Bath & Beyond
BID Sotheby's
BA Boeing
CL Colgate-Palmolive
CLX Clorox
CPB Campbell Soup
CSCO Cisco
DE Deere
DIS Disney
EMR Emerson Electric
GD General Dynamics
GIS General Mills
GPC Genuine Parts
GPS The Gap
HD Home Depot
HOG Harley-Davidson
HSY Hershey
IBM IBM
IFF Int. Flavors & Fragrances
Ticker Name
INTC Intel
JNJ Johnson & Johnson
K Kellogg
KO Coca-Cola
LMT Lockheed-Martin
MCD McDonald's
MMM 3M
MSFT Microsoft
NKE Nike
ORCL Oracle
PEP PepsiCo
PG Procter & Gamble
PH Parker-Hannifin
ROK Rockwell Automation
SBUX Starbucks
TIF Tiffany’s
TXN Texas Instruments
VAL Valspar
WMT Wal-Mart
XOM Exxon-Mobil
Artificial Intelligence for Long-Term Investing
4
Selecting Companies
A qualitative assessment is important when selecting the list of companies that the AI model may invest in,
because the historical financial data is only useful if the company’s future will resemble its past somehow.
This is impossible to assess if the business itself is expected to change radically in the future.
It can be debated whether all the companies in Table 1 are predictable 10 years or more into the future.
For example, the computer industry is changing so rapidly that it seems impossible to predict the industry
10 years into the future. Microsoft is included in Table 1 because its stock has exhibited some predictability
in the past, and because Microsoft has a wide range of products that are imperative to other businesses
and that are so deeply embedded everywhere that they will be difficult to replace with other technologies.
This would seem to give Microsoft a competitive advantage which may last many years into the future and
help give Microsoft’s future stock returns some degree of predictability.
Conversely, the company Apple (AAPL) has been omitted from Table 1 because its revenue and earnings
have grown explosively in recent years, led primarily by one product, the iPhone, which accounted for
about 66% of the company’s revenue in fiscal year 2015, while the company’s other major product, the
iPad, actually experienced a (23%) decline in revenue from 2014 to 2015.2 Whether the iPhone will remain
a market-leader in the future is uncertain, because it is reasonably easy for customers to change to another
competing smart-phone, and the technology can also evolve radically during the next 10 years; e.g. Google
Glass was an attempt at evolving the technology and disrupting the market. So it is unclear whether the
historical financial data for Apple is useful in predicting its long-term future stock returns.
The company known as The Gap (GPS) should perhaps also be omitted from the list of companies, as the
clothing and fashion industry seems particularly vulnerable to fads. At the time of this writing in January
2016, numerous fashion and clothing companies are trading at seemingly low valuation multiples because
of recent declines in revenue and earnings in that industry. But it is impossible for me personally to predict
whether the revenue declines are temporary and which of these companies will exist 10 years from now.
It is important to first consider long-term qualitative aspects such as these when selecting the list of
companies available to the AI model.
Survivorship Bias
The companies in Table 1 were selected recently and exclude companies that exited the stock-market
through mergers and acquisitions or through bankruptcies. This is known as survivorship bias.
An example of a company that existed for nearly a century was RadioShack. The company survived the
financial crisis around year 2009, but a few years later it started experiencing financial trouble and
eventually went bankrupt in 2015 where its stock became worthless. Between 1999 and 2010 RadioShack
had a high return on equity capital, which was one of the criteria used in constructing the list of companies
in Table 1. This shows that even a very old company that has being doing the same type of business for
many years, and which has been very profitable and survived major market crashes, may still go bankrupt.
In future research, the AI model should be tested by deliberately including companies such as RadioShack.
2 Form 10-K filed with the US SEC for fiscal year 2015:
www.sec.gov/Archives/edgar/data/320193/000119312515356351/d17062d10k.htm
Artificial Intelligence for Long-Term Investing
5
3.2. Portfolio Weights The AI model determines the portfolio weights for each day. The weights are limited to max 10% of the
portfolio, except for the US government bond which may be 100% of the portfolio. The portfolio weights
must sum to 100% for each day and all weights must be positive, which means that using leverage (i.e.
investing for borrowed money) and short-selling is not allowed.
Table 2 shows the statistics for the portfolio weights between September 30, 1995 and December 31, 2014.
The portfolio weights for US government bonds with one-year maturity ranged between 0% and 20.4% with
the average bond weight being 6.3%. The weight for the S&P 500 was 0% for all days, which means the AI
model could not find a strategy that made it more profitable to invest in the S&P 500 instead of some of
the other assets during these 20 years. Similarly, the portfolio weights for CPB, MMM and PEP were also
near-zero for most of this period.
Conversely, the portfolio weights for some stocks such as AXP and BBBY used nearly the entire range
allowed between 0-10%. The AI model often allocated a significant part of the portfolio to SBUX, with a
minimum portfolio weight of 4.3%, average weight 7.8%, and the maximum weight being the 10% allowed.
This actually causes some concern regarding the viability of the AI model, as mentioned later in the paper.
Table 2: The minimum, mean and maximum portfolio weights between 1995 and 2014.
Asset Portfolio Weight
Min Mean Max
U.S. Bond 0.0% 6.3% 20.4%
S&P 500 0.0% 0.0% 0.0%
AXP 0.0% 2.3% 8.7%
BBBY 0.7% 3.5% 9.5%
BID 0.0% 3.7% 9.3%
BA 0.1% 3.0% 7.5%
CL 0.0% 1.4% 5.4%
CLX 0.1% 1.3% 2.5%
CPB 0.0% 0.0% 0.5%
CSCO 0.1% 1.9% 8.2%
DE 0.7% 3.6% 6.8%
DIS 0.0% 1.0% 5.6%
EMR 0.0% 0.2% 2.4%
GD 0.5% 3.9% 9.3%
GIS 0.0% 0.1% 2.2%
GPC 0.1% 1.2% 4.6%
GPS 0.1% 2.1% 7.9%
HD 0.6% 3.6% 8.4%
HOG 0.1% 2.0% 8.9%
HSY 0.4% 3.4% 7.2%
IBM 0.0% 1.9% 7.7%
Asset Portfolio Weight
Min Mean Max
IFF 0.1% 0.7% 3.0%
INTC 0.1% 1.7% 5.9%
JNJ 0.0% 0.1% 1.4%
K 0.0% 0.1% 1.1%
KO 0.0% 0.2% 1.3%
LMT 1.0% 5.8% 9.6%
MCD 0.1% 2.9% 7.5%
MMM 0.0% 0.1% 0.5%
MSFT 0.1% 1.4% 3.9%
NKE 1.4% 5.5% 8.7%
ORCL 0.3% 5.3% 9.7%
PEP 0.0% 0.0% 0.0%
PG 0.0% 0.9% 5.7%
PH 0.1% 1.5% 5.1%
ROK 0.9% 5.5% 9.9%
SBUX 4.3% 7.8% 10.0%
TIF 0.2% 3.8% 9.5%
TXN 1.2% 3.4% 8.9%
VAL 0.1% 3.1% 7.8%
WMT 0.1% 1.7% 6.8%
XOM 0.1% 1.9% 4.7%
Artificial Intelligence for Long-Term Investing
6
Graphical Plots of Portfolio Weights
Figure 1 shows the portfolio weight for US government bonds with one-year maturity, which ranged
approximately between 0-20%. The AI model allocated almost 20% of the portfolio to US government
bonds around year 2000 which was the time of the Dot-Com bubble. The AI model again allocated nearly
20% of the portfolio to US government bonds towards the end of 2008, which was during a stock-market
crash. Then again starting in 2013, the AI model began increasing the portfolio weight for US government
bonds until it was nearly 20% towards the end of 2014. The AI model apparently considered many of the 40
stocks to be too high-priced for a profitable long-term investment.
Figure 1: Portfolio weights between 1995 and 2014 for U.S. Government Bonds with one-year maturity.
Figure 2 and Figure 3 below show the portfolio weights for the 40 individual stocks. The portfolio weight for
the S&P 500 has been omitted because it was always zero.
Artificial Intelligence for Long-Term Investing
7
Figure 2: Portfolio weights between 1995 and 2014. The range of each weight is 0-10%.
Artificial Intelligence for Long-Term Investing
8
Figure 3: Portfolio weights between 1995 and 2014. The range of each weight is 0-10%.
Artificial Intelligence for Long-Term Investing
9
3.3. Example Table 3 shows the portfolio weights generated by the AI model for December 31, 2014. Also shown is the
return of each asset for the following year until December 31, 2015, as well as the weighted return. It is
assumed that dividends were reinvested and there were no taxes or trading costs. For example, the
portfolio weight for the AXP stock was 0.3% and the stock lost (24.2%) during the year, so the impact on the
portfolio was a loss of about (0.07%) which is rounded to (0.1%) in Table 3. The overall return on the
portfolio of the AI model was 5.3% for the year. Compare this to a return of 1.4% for the S&P 500 and a loss
of (1.3%) for a portfolio consisting of all these assets with equal weights.
A few things should be noted. The weight for the US government bond with one-year maturity was 19.5%,
which suggests the AI model could not find enough investment opportunities amongst these 40 stocks to
fill the entire portfolio. In other words, the AI model believed many of the stocks were more or less over-
priced and would hence be a bad long-term investment.
The positive return of 5.3% for the portfolio was mostly due to a 4.0% return on SBUX which comprised
8.4% of the portfolio (close to the 10% limit) and whose stock had a return of 48.2% during the year. This
may seem like the AI model made a great prediction, but it actually raises some concern about the AI model
which may need further investigation. The reason is that SBUX was not a cheap stock in terms of its
valuation ratios in December 2014, and would thus require significant earnings growth in the future so as to
justify the high valuation ratios. Similarly for NKE which comprised 7.2% of the portfolio and whose stock
had a return of 31.4% for the year, thus contributing a positive return of 2.3% to the portfolio. But NKE was
also expensive in terms of its valuation ratios. The AI model should perhaps not invest so heavily in stocks
whose prices are so high that they require future earnings growth. This is a topic of future research.
Table 3: Portfolio weights on December 31, 2014 and the weighted returns for the following year.
Asset Portfolio Weight
Asset Return
Weighted Return
U.S. Bond 19.5% 0.2% 0.0%
S&P 500 0.0% 1.4% 0.0%
AXP 0.3% (24.2%) (0.1%)
BBBY 2.4% (36.7%) (0.9%)
BID 2.6% (39.7%) (1.0%)
BA 4.1% 14.1% 0.6%
CL 0.1% (1.6%) (0.0%)
CLX 1.8% 25.0% 0.4%
CPB 0.0% 22.6% 0.0%
CSCO 0.2% 0.6% 0.0%
DE 4.1% (11.3%) (0.5%)
DIS 5.1% 12.9% 0.7%
EMR 0.0% (19.7%) (0.0%)
GD 1.7% 1.8% 0.0%
GIS 0.0% 11.5% 0.0%
GPC 1.6% (17.1%) (0.3%)
GPS 1.9% (39.9%) (0.8%)
HD 3.6% 28.5% 1.0%
HOG 1.0% (29.6%) (0.3%)
HSY 2.5% (12.0%) (0.3%)
IBM 0.1% (11.4%) (0.0%)
Asset Portfolio Weight
Asset Return
Weighted Return
IFF 1.9% 20.2% 0.4%
INTC 1.3% (2.2%) (0.0%)
JNJ 0.0% 1.1% 0.0%
K 0.0% 13.8% 0.0%
KO 0.0% 5.1% 0.0%
LMT 7.0% 16.2% 1.1%
MCD 1.5% 30.4% 0.5%
MMM 0.2% (5.9%) (0.0%)
MSFT 0.6% 22.7% 0.1%
NKE 7.2% 31.4% 2.3%
ORCL 5.4% (17.6%) (0.9%)
PEP 0.0% 8.7% 0.0%
PG 0.0% (10.0%) (0.0%)
PH 0.6% (23.1%) (0.1%)
ROK 4.4% (5.5%) (0.2%)
SBUX 8.4% 48.2% 4.0%
TIF 0.3% (27.2%) (0.1%)
TXN 1.9% 5.2% 0.1%
VAL 4.0% (2.6%) (0.1%)
WMT 0.6% (26.6%) (0.2%)
XOM 2.0% (12.8%) (0.3%)
Artificial Intelligence for Long-Term Investing
10
3.4. Statistics for Annualized Returns This section gives some statistics for the annualized returns of the AI model and compares them to those of
equal-weighted rebalancing and the S&P 500. The annualized return is a kind of average return for multiple
years of investing. For example, a portfolio that goes from $1 to $5 over 10 years has returned $4 to the
investor, for a total return of 400% after those 10 years. The so-called annualized return is about 17.46%
per year which compounds into that 400% return after 10 years. Considering the annualized return instead
of the total return makes it easier to compare investment returns for different durations.
The AI Model
The portfolio weights described in section 3.2 are used for annual rebalancing of the portfolio. This is done
for all possible investment periods between 1 and 10 years. The first date was September 30, 1995 and the
last date was December 31, 2015. The daily stock-prices were interpolated for weekends and holidays, so
as to make the data easier to work with. This means there were a total of 7033 one-year investment
periods being considered, a total of 6668 two-year investment periods, and so on. The first one-year
investment period started on September 30, 1995 and lasted until September 30, 1996. The next one-year
investment period started the next day, October 1, 1995 and lasted until October 1, 1996, etc.
Table 4 shows statistics for the annualized returns of the AI model when using these portfolio weights for
annual rebalancing. For example, the average return of all one-year investment periods was 27.8% for the
AI model, but there were large differences from year to year. The worst one-year period occurred in the
year between Mach 2008 and 2009, in which the AI model had a loss of (39.8%). The best one-year period
occurred in the following year between March 2009 and 2010, in which the AI model had a gain of 162.6%.
Table 4 also shows the 1st quartile was 14.8% and the 3rd quartile was 38.1%, which means the AI model
had returns between 14.8% and 38.1% in half of the one-year periods between 1995 and 2015.
Table 4 also shows statistics for longer investment periods. For example, for 10-year investment periods
the AI model had a return of 22.7% per year on average. The lowest annualized return was 15.0% which
occurred in the 10-year period between August 2000 and 2010. The highest annualized return was 33.4%
which occurred in the 10-year period between March 1996 and 2006.
Table 4: Annualized return for the Artificial Intelligence model. Statistics are shown for all investment periods from 1 to 10 years between 1995 and 2015.
Artificial Intelligence
Years of Investing
Mean Stdev Min 1st Qrt. Median 3rd Qrt. Max
1 27.8% 23.9% (39.8%) 14.8% 25.4% 38.1% 162.6%
2 26.6% 16.6% (19.8%) 17.5% 23.7% 35.3% 86.5%
3 26.1% 12.9% (7.6%) 18.1% 23.3% 31.9% 68.3%
4 25.3% 10.8% (3.0%) 19.1% 22.1% 29.5% 57.5%
5 24.4% 8.6% 3.3% 18.8% 22.2% 29.3% 49.3%
6 23.6% 6.7% 11.0% 19.0% 21.0% 29.5% 43.6%
7 22.9% 5.9% 7.0% 19.1% 21.3% 27.8% 36.5%
8 22.8% 5.8% 8.0% 18.9% 20.9% 27.7% 36.3%
9 22.8% 5.3% 11.0% 19.5% 21.1% 27.8% 35.8%
10 22.7% 4.5% 15.0% 19.5% 21.1% 26.8% 33.4%
Artificial Intelligence for Long-Term Investing
11
Equal-Weighted Rebalancing
Table 5 shows the statistics for the annualized returns of equal-weighted rebalancing, in which the portfolio
is rebalanced each year with equal weights for all assets. There are 42 assets in total, consisting of 40
stocks, one stock-index (the S&P 500), and US government bonds with one-year maturity. So the portfolio is
rebalanced at the beginning of each year with about 2.38% invested in each of these 42 assets.
Table 5 shows that the average one-year return was 14.9%, which was almost half that of the AI model
which was 27.8%. The worst loss was (37.7%) which occurred in the year between March 2008 and 2009,
while the best one-year gain was 95.2% which occurred in the following year between March 2009 and
2010.
For 10-year investment periods, the equal-weighted rebalancing returned 10.8% per year on average.
Compare this to 22.7% for the AI model. The worst 10-year period occurred between March 1999 and 2009
where the equal-weighted rebalancing only returned 3.2% per year. The best 10-year period occurred
between October 1995 and 2005 which returned 16.9% per year.
So the AI model has generally performed much better than equal-weighted rebalancing of the portfolio
between 1995 and 2015.
Table 5: Annualized return for equal-weighted rebalancing of the portfolio. Statistics are shown for all investment periods from 1 to 10 years between 1995 and 2015.
Equal-Weighted Rebalancing
Years of Investing
Mean Stdev Min 1st Qrt. Median 3rd Qrt. Max
1 14.9% 16.6% (37.7%) 5.7% 15.0% 25.4% 95.2%
2 13.9% 11.6% (21.3%) 7.5% 13.8% 21.7% 53.6%
3 13.2% 8.9% (10.6%) 7.0% 13.3% 18.3% 37.6%
4 12.4% 7.3% (6.8%) 7.0% 10.6% 17.0% 33.4%
5 11.7% 5.8% (3.1%) 7.6% 10.1% 15.2% 30.3%
6 11.2% 4.2% 3.5% 8.6% 10.1% 13.1% 27.0%
7 10.7% 3.0% (0.5%) 9.1% 10.5% 12.5% 20.7%
8 10.7% 3.1% 0.5% 9.1% 10.8% 12.2% 18.7%
9 10.8% 3.1% 2.1% 9.3% 11.3% 12.5% 18.0%
10 10.8% 2.9% 3.2% 8.8% 11.5% 12.4% 16.9%
Artificial Intelligence for Long-Term Investing
12
S&P 500
Table 6 shows the statistics for the annualized returns of the S&P 500.
For one-year investment periods, the average return was 10.0% for the S&P 500. As with the AI model and
the equal-weighted rebalancing, the worst year occurred between March 2008 and 2009, where the
S&P 500 lost (47.4%) compared to only (39.8%) for the AI model and (37.7%) for equal-weighted
rebalancing. The following year between March 2009 and 2010 was also the best year for the S&P 500,
which returned 72.1%, compared to 162.6% for the AI model and 95.2% for equal-weighted rebalancing.
For ten-year investment periods, the S&P 500 returned 4.9% per year on average. Compare this to 22.7%
for the AI model and 10.8% for equal-weighted rebalancing. The worst ten-year period occurred between
March 1999 and 2009, in which the S&P 500 lost (4.5%) per year on average. The best ten-year period
occurred between January 1996 and 2006, in which the S&P 500 gained 9.7% per year on average.
So the S&P 500 generally performed worse than the equal-weighted rebalancing and much worse than the
AI model.
Table 6: Annualized return for the S&P 500. Statistics are shown for all investment periods from 1 to 10 years between 1995 and 2015.
S&P 500
Years of Investing
Mean Stdev Min 1st Qrt. Median 3rd Qrt. Max
1 10.0% 18.4% (47.4%) 2.7% 13.1% 21.9% 72.1%
2 8.7% 14.4% (28.9%) (1.0%) 11.2% 19.0% 42.5%
3 7.5% 11.7% (17.2%) (2.4%) 10.2% 16.3% 33.3%
4 6.4% 9.4% (11.8%) (1.8%) 5.0% 14.9% 27.0%
5 5.4% 7.1% (8.2%) (0.3%) 2.5% 11.3% 25.2%
6 4.8% 4.7% (1.7%) 1.8% 3.3% 6.3% 23.1%
7 4.4% 2.9% (5.7%) 2.7% 4.2% 6.0% 18.2%
8 4.6% 3.0% (5.7%) 3.0% 5.1% 6.8% 10.0%
9 4.8% 3.5% (6.1%) 2.9% 5.8% 7.5% 9.8%
10 4.9% 3.7% (4.5%) 2.3% 6.7% 7.9% 9.7%
Artificial Intelligence for Long-Term Investing
13
3.5. Probability of Loss Table 7 shows the historical probability of loss. For example, the AI model had 8.0% probability of a loss
after 1 year of investing, which means the AI model experienced a loss in 8.0% of all one-year investment
periods between 1995 and 2015. Compare this to a 15.1% probability of loss for equal-weighted portfolio
rebalancing, and a 22.6% probability of loss for the S&P 500.
The AI model experienced no losses for investment periods of five years or more, while the equal-weighted
rebalancing only rarely experienced losses for 5 and 7 year investment periods. Compare this to the
S&P 500 which experienced losses in 28.1% of all 5-year investment periods between 1995 and 2015, and
experienced losses in 18.3% of all 10-year investment periods.
So the AI model experienced losses much more rarely than equal-weighted rebalancing and the S&P 500.
It was assumed that there were no taxes and trading costs. It is also important to understand, that these
are really historical probabilities (or frequencies) of loss, which may not hold in the future.
Table 7: Probability of loss for the AI model, equal-weighted rebalancing, and the S&P 500, for investment periods ranging from 1 to 10 years between 1995 and 2015.
Probability of Loss
Years of Investing 1 2 3 4 5 6 7 8 9 10
Artificial Intelligence 8.0% 4.8% 1.0% 0.3% 0.0% 0.0% 0.0% 0.0% 0.0% 0.0%
Equal Weighted 15.1% 11.0% 7.2% 2.6% 0.7% 0.0% 0.1% 0.0% 0.0% 0.0%
S&P 500 22.6% 26.4% 29.1% 36.2% 28.1% 7.9% 4.7% 9.0% 11.9% 18.3%
3.6. Probability of Under-Performing Table 8 shows that the AI model under-performed the equal-weighted rebalancing in 1.7% of all one-year
investment periods between 1995 and 2015, while the AI model under-performed the S&P 500 in 2.9% of
all one-year investment periods. For investment periods of two years or more, the AI model never under-
performed the equal-weighted rebalancing and the S&P 500.
It was again assumed that there were no taxes and trading costs. It is again important to understand, that
these are historical probabilities (or frequencies) of under-performance, which may not hold in the future.
Table 8: Probability of the AI model under-performing equal-weighted rebalancing and the S&P 500, for investment periods ranging from 1 to 10 years between 1995 and 2015.
Probability of Under-Performing
Years of Investing 1 2 3 4 5 6 7 8 9 10
AI < Equal Weighted 1.7% 0% 0% 0% 0% 0% 0% 0% 0% 0%
AI < S&P 500 2.9% 0% 0% 0% 0% 0% 0% 0% 0% 0%
Artificial Intelligence for Long-Term Investing
14
3.7. AI Model vs. S&P 500 Figure 4 shows the difference in the return of the AI model and the S&P 500 for the year following each
date. That is, for each date the return of the S&P 500 is subtracted from the return of the AI model and the
difference is plotted. When the difference is positive it means the AI model performed better than the
S&P 500, and when the difference is negative it means the S&P 500 performed better than the AI model.
The plot shows that the AI model mostly performed better than the S&P 500 for one-year investment
periods. There were only few exceptions around year 1997 and 2013 where the S&P 500 returned a few
percentage points more than the AI model.
The AI model performed much better than the S&P 500 during the so-called Dot-Com bubble around year
2000 where many of the stocks in the S&P 500 were severely overvalued. The AI model returned more than
20% (percentage points) each year than the S&P 500 during this period. The AI model also performed much
better than the S&P 500 after the financial crisis around year 2009 where stocks were severely
undervalued. This suggests that the AI model is particularly useful when stocks are extremely mispriced.
The plot for the difference between the AI model and the equal-weighted rebalancing looks similar.
Figure 4: Difference between the return of the AI model and the S&P 500 in the year following each date.
Artificial Intelligence for Long-Term Investing
15
4. Future Research Future research should focus on these issues:
1) Testing: Although the AI model has performed very well on historical data, it is unclear if this
performance can be expected to continue in the future. A common testing method used in Artificial
Intelligence (aka. Machine Learning) is to split the available data-set into a training-set and a test-
set. The AI model is then trained to perform well on the training-set and the performance is tested
on the test-set. This is done to avoid that the AI model becomes over-fitted so it performs well on
historical data but performs poorly on future data. This testing method works well if the data-set
contains thousands or even millions of items that are independent of each other; for example when
training an AI model to recognize hand-written digits. In our case, the data-set contains about 20
years of data which corresponds to more than 7000 data-points. But each stock has typically only
experienced over- and under-valuation a few times during those 20 years, which makes it difficult
to split the data-set into training- and test-sets without losing crucial data-points during training.
The development of novel testing methods is therefore an important research topic.
2) Data: The data from the financial statements of the 40 companies were entered manually by the
author. This was very time-consuming. Ideally, the AI model would consider perhaps 200 worldwide
stocks and then select the best 20-50 stocks for investment each day. This greater diversification
might improve both the returns and reliability of the AI model. But access to a financial database is
required for this. A computer program would then have to be developed for searching the financial
database for stocks that can seemingly be predicted by the AI model. There are numerous
commercial databases available, but they are quite expensive to access.
3) Models: The AI model used in this paper may be extended in numerous ways. Other types of AI
models are also possible. Different types of AI models may be good for predicting returns of
different types of stocks under different circumstances. The portfolios generated by different AI
models can then be combined into a single portfolio. This was actually already done in the above.
The portfolio weights used in the above were the result of 20 different configurations of the AI
model, half of the configurations were trained to perform well on 1-year investment periods, and
half of the configurations were trained to perform well on 10-year investment periods. This
improved several performance aspects as well as making the portfolio more diverse.
4) Rebalancing: Preliminary research suggests that the portfolio’s return is increased if the portfolio is
rebalanced monthly or perhaps even daily. However, more research is needed to ensure that the
gain is not cancelled by the increased cost of more frequent trading.
Artificial Intelligence for Long-Term Investing
16
5. Conclusion This paper presented the results of using a novel and proprietary Artificial Intelligence (AI) model for long-
term investing. The AI model takes various financial data as input signals and tries to determine an optimal
portfolio allocation. In these experiments, the AI model considered the stocks of 40 US companies, as well
as the S&P 500 index and US government bonds with one-year maturity. The portfolio was rebalanced
annually.
Between 1995 and 2015, the equal-weighted rebalancing of a portfolio consisting of these 42 assets
outperformed the S&P 500 by 5-6% (percentage points) per year on average. The AI model outperformed
the equal-weighted rebalancing by 12-13% (percentage points) per year on average, and the AI model
outperformed the S&P 500 by about 18% (percentage points) per year on average.
The AI model performed especially well when stocks were extremely mispriced, e.g. during the Dot-Com
bubble around year 2000 where stocks were generally overpriced, and then again during the financial crisis
where stocks were generally very cheap.
Outperforming the S&P 500 by 18% (percentage points) per year on average may not be realistic in the
future because the AI model may not generalize as well to future and unknown scenarios. But it seems
feasible that some combination of AI models might achieve an average performance of perhaps 5%
(percentage points) more than the S&P 500. The results of this paper certainly merit more research.
Future research should focus on developing novel testing methods, incorporating more companies and
data, extending the current AI model and developing new AI models, and using shorter rebalancing periods.
6. Bibliography
[1] H. Markowitz, Portfolio Selection, Efficient Diversification of Investments.: John Wiley & Sons, 1959.
[2] E.O. Thorp and S.T. Kassouf, Beat the Market: A Scientific Stock Market System.: Random House, 1967.
[3] E.O. Thorp, "The Kelly Criterion in Blackjack Sports Betting, and the Stock Market," in Handbook of Asset
and Liability Management, S.A. Zenios and W. Ziemba, Eds.: Elsevier, 2006, ch. 9.