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
16
Embed
Artificial Intelligence for Long-Term · PDF fileArtificial Intelligence for Long-Term Investing 3 2. The AI Model The AI model is proprietary and will only be described briefly. The
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
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.
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.