Pages

11 November 2017

Matrix Iterations for Adaptive Asset Allocation


  • Adaptive Asset Allocation (AAA) is based on the Nobel Prize winning portfolio theory of Markowitz (1952)
  • AAA combines asset’s momentum, volatilities, and cross-correlations for building diversified investment portfolios
  • In a tactical application AAA exploits momentum for crash detection and results in consistent returns at mitigated risk levels

Actually, their encounter was coincidental. The fortuitous conversation between a stockbroker and a young mathematician in the early 1950’s proved to be seminal. After the stockbroker learned about the mathematician’s expertise, linear programming and utility maximization, and its real-life applications, he suggested to apply the math to financial portfolios. Fast-forwarding four decades, in 1990 Harry Markowitz shared the Nobel Prize in Economics for his pioneering work on Modern Portfolio Theory (MPT).

Matrix rain animation courtesy TheCodePlayer.
AniGif created with Gif Brewery.

The mathematical framework of MPT combines asset’s expected returns, volatilities, and cross-correlations for assembling well-balanced and diversified portfolios while maximizing the expected return for a given level of risk. Its key proposition: for a multi asset portfolio returns can be maximized for a given level of risk. Likewise, risk can be minimized for a desired level of return. With the efficient frontier as its famous graphical depiction (see graph below), Markowitz’ MPT is also known as “mean-variance analysis” since the “mean” or expected return is maximized given a certain level of risk, defined as the portfolio variance (which is volatility squared).


Efficient Frontier

MPT proposes a mathematical framework how investors can reduce overall risk while maximizing return by holding a diversified portfolio of non-correlated asset classes. Instead of looking at the risk-return characteristics of each single asset class, MPT assesses risk and return as cumulative factors for the portfolio as a whole. The Markowitz Efficient Frontier is the graphical depiction of the collection of portfolios that offer the lowest risk for a given level of return. In an excellent video Arif Irfanullah explains in merely 3 minutes how the efficient frontier represents the set of portfolios that will give the highest return at each level of risk or the lowest risk for each level of return (highly recommended).

To illustrate key elements of MPT, let’s bring to bear the top selection from a diversified investment universe SPY, EWJ, VGK, EEM, and DBC (both the full universe population as well as the selection methodology are explained in the next section).

The portfolio concept under consideration for this contribution is the long only minimum variance portfolio without leverage, located at the magenta dot on the outer left side of the purple portfolio cloud (see statistics in bold font in the table below the following graph). For this special case portfolio risk is minimized for all feasible long only combinations. To localize this particular portfolio an Adaptive Asset Allocation (AAA) approach is applied. Please note the purple long only portfolio cloud is only a subset of the full unconstrained long/short portfolio space demarcated by the blue portfolio envelop hyperbola.

Speed readers may jump to the next section, others please bear with me while painting the full picture.


In the above risk-return graph the portfolio space is plotted for every unconstrained long/short portfolio of 5 ETFs: SPY, EWJ, VGK, EEM, and DBC, with portfolio weights summed to 100%. All feasible long/short combinations are contained by the blue portfolio envelop hyperbola, with the efficient frontier being the solid upper boundary and the inefficient frontier the dashed lower one. The grey dots represent 10,000 random unconstrained long/short portfolios. The well-known minimum variance portfolio (MVP) is located at the green cross-mark, being the portfolio with the lowest risk; every single other portfolio combination will result in higher risk. The so-called tangency portfolio (TP) is situated at the red tangent point where the capital allocation line (also in red; basis: 1% risk free rate) touches to the efficient frontier. The TP is suggested to be the mathematical optimal non-leveraged portfolio under the mean variance framework (in the continuation of the video Arif Irfanullah discusses the TP too). On the same capital allocation line, but outside the portfolio envelop, are two particular portfolios depicted. This are two portfolio combinations of the five mentioned ETFs along with a separate risk-free asset: the green dot showing the portfolio with reserved or saved capital and the purple dot the one with borrowed capital (leverage), with target volatilities of 6% and 12%, respectively.

With the long only constraint imposed, each of the orange diamonds depicts a 100% holding in one of the five ETFs, and the purple hurricane shaped cloud represents 5,151 long only portfolios consisting of SPY, EWJ, and DBC (with 1% sized steps). As stated, the long only minimum variance portfolio is to be found at the magenta dot on the outer left side of the purple portfolio cloud. Under the long only constraint, the weights for VGK and EEM are fixed at 0% in order to reach minimal risk (shorting is prohibited). Hence the 3 asset purple portfolio cloud. In the remainder of this contribution the localization and characteristics of this special case portfolio will be assessed.


Adaptive Asset Allocation

As stated, the MPT framework relies on estimates for returns, volatilities, and correlations. Since these estimates are notoriously difficult to predict, especially with regard to the future, a tactical timeframe is adopted for the necessary calculations using a heuristically composed diversified investment universe like the one proposed by the InvestReSolve team (formerly Gestaltu) in their AAA-primer: SPY, VGK, EWJ, EEM, VNQ, RWX, DBC, GLD, TLT, and IEF (see also end notes below).

For starters, each month the best 5 out of 10 ETFs are selected based on their 126-day momentum. Next the minimum variance portfolio is determined as the optimal mix of these five ETFs for obtaining the lowest possible risk (=volatility), using the following steps.

First, for this top half a “weighted” covariance matrix ∑(i,j) is calculated by combining 126-day correlations ρ(i,j) with 20-day volatilities σ(i) and σ(j):
∑(i,j) = ρ(i,j) * σ(i) * σ(j),
where i,j refers to the top 5 ETFsFinally, the minimum variance portfolio is obtained by minimizing the following matrix formula:
σ2 = w'∑w, 
where w is the weights vector with sum equal to 100% and w(i) ≥ 0 and ∑ equals the covariance matrix.

To establish the weight combination that satisfies the minimum variance σ2 objective, a Cyclical Coordinate Descent algorithm is deployed (see end notes for sources). For a preset number of cycles, the CCD algo iterates through the weight combinations, approaching closer to the minimum variance objective with each cycle. In the following graph the red zigzag line paints these iterations going from right to left, minimizing portfolio volatility σ.



Native crash protection

By selecting only the best 5 out of 10 assets, AAA is capable of detecting momentum based trend changes. In up-trending markets capital is allocated into offensive assets, like stocks, REITs, and commodities, while during market sell-offs especially intermediate US-treasuries are in vogue. The following diagram shows the allocation transformations during the bear-bull cycles since the turn of the millennium. Notice the waxing of IEF in periods of market stress (shown for the native InvestResolve universe).



Backtesting AAA

The following charts provide a detailed view on AAA’s end-of-month performance using AmiBroker as backtest platform. For this demonstration an alternative investment universe is deployed: SPY, QQQ, IWM, EFA, EEM, VNQ, RWX, DBC, TLT, and IEF.

By substituting VGK, EWJ, and GLD with QQQ, IWM, and EFA the universe at hand is tilted toward domestic US assets, while at the same time demonstrating GLD is not per se required to reach sufficient diversification.

Equity chart with key performance indicators:
NB! Results are derived from simulated daily total return data. Furthermore, trading costs, slippage, and taxes are disregarded. Results are therefore purely hypothetical. Past performance is no guarantee of future results.
Drawdown chart:

Annual returns:

Monthly returns:

Histogram of monthly returns:

Rolling 3-year returns:

Profit contribution:

Average allocation:

Allocation table:

Allocation diagram


Strategy Signals

In case no signals are shown, try to open the google sheet in a separate tab/window (right-click table).
Alternatively request for a personal copy of the stand alone version of the AAA google sheet.

NB! No guarantee whatsoever is given for the soundness of the strategy nor the proper functioning of the table nor for the accuracy of the signals. Data may be delayed. Please do your own due diligence and use at your peril. The Important Notice in the footer applies as well as the Disclaimer.

End notes
  • The native InvestResolve universe is tracked by AllocateSmartly. Their AAA-post offers additional information along with an extended backtest.
  • The AAA-primer by the InvestResolve team and their AAA-book are recommended readings.
  • The implementation of the CCD-algorithm as used in the Google Sheet is developed by Roman Rubsamen, a French quant. Modified for AmiBroker, this implementation is also the core element of the AAA-code used for this contribution. On his GitHub repository Roman shares an expanding JavaScript library with portfolio allocation routines.
  • Mathematically inclined readers may find the treatise interesting on the CCD algorithm in appendix A.2 of this Smart Beta paper by two other French quants, Jean-Charles Richard and Thierry Roncalli.
  • The AAA strategy is published on Seeking Alpha too, featuring the native InvestReSolve / AllocateSmartly investment universe with 10 global asset classes.

The full AmiBroker code for AAA is available upon request. Interested parties are encouraged to support this blog with a donation: