Taking another look at portfolio optimization methods as they apply to relative strength- & momentum-based GTAA portfolios, this time I present a novel method that uses factor momentum in an attempt to tilt the allocation towards the factors behind the momentum, and away from factors that do not have strong momentum. The approach was inspired by a nice little paper by Bhansali et al.: The Risk in Risk Parity: A Factor Based Analysis of Asset Based Risk Parity.

My first idea was something I would have termed “Global Tactical Factor Allocation”: a relative strength & momentum approach based directly on risk factors instead of assets. It failed miserably, but the work showed some interesting alternative paths. One of these was to decompose returns into their principal components (factors) and base a weighting algorithm on factor momentum. Early testing shows promise.

### PCA basics

A quick intro to principal component analysis (you can skip to the next section if you’re not interested) before we proceed. PCA is method to linear transform data in a potentially useful way. It re-expresses data such that the principal components are uncorrelated (orthogonal) to each other, and the first component expresses the direction of maximum variance (i.e. it explains the greatest possible part of the total variance of any orthogonal component), and so forth for the 2nd…nth components. It can be used as a method of dimensionality reduction by ignoring the lower-variance components, but that is not relevant to the present analysis^{1}.

The principal components can be obtained very easily. In MATLAB:

- Assume r are the de-meaned returns of our assets.
*[V D] = eig(cov(r));*will give us the eigenvectors (V) and eigenvalues (D) of the covariance matrix of r.- The diagonal of D contains the variance of each principal component. To get the % of total variance explained by each component, simply: 100 *
*flipud(diag(D)) / sum(diag(D)).* - V contains the linear coefficients of our assets to each component;
*fliplr(V)*to get them in the “right” order. - Finally, to find the actual principal components we simply multiply the returns with V:
*r*V*.

### Data & Methodology

The assets used are the following:

The data covers the period from January 2002 to October 2012 and includes dividends. Some of the assets do not have data for the entire period; they simply become available when they have 252 days of data. The methodology is essentially the standard relative-strength & momentum GTAA approach:

- Rebalance every Friday.
- Rank assets by their 120-day returns and pick the top 5.
- Discard any assets that had negative returns during the period, even if they are in the top 5.
- Apply portfolio optimization algorithm.
- Trade on close.

Commissions are not taken into account (though I acknowledge they are a significant issue due to frequent rebalancing). The algorithms I will be benchmarking against are: equal weights, naïve risk parity (RP), equal risk contribution (ERC), and minimum correlation (MCA). See this post for more on these methods.

### A look at the factors

When extracting principal components from asset returns there is typically an a posteriori identification of each component with a risk factor. Looking at stock returns, the first factor is typically identified as the so-called “market” factor. Bhansali et al. identify the two first factors as “growth” and “inflation”. I leave this identification process as homework to the reader.

Using the last 250 days in the data, here is the % of total variance explained by each factor:

And here are the factor loadings (for the top 3 factors) for each asset:

### Factor momentum weighting

The general idea is to decompose the returns of our chosen assets into principal components, identify the factors that have relative strength and absolute momentum, and then tilt the weights towards them and away from the low- and negative-momentum factors. We are left with the non-trivial problem of constructing a portfolio that has exposure to the factor(s) we want, and are neutral to the rest. We will do this by setting target betas for the portfolio and then minimizing the difference between the target and realized betas given a set of weights (using a numerical optimizer).

- After selecting the assets using the above steps, decompose their returns into their principal components.
- Rank the factors on their 120-day returns and pick the top 3.
- Discard any factors that had negative returns during the period, even if they are in the top 3.
- Discarded factors have a target beta of 0.
- The other factors have a target beta of 1
^{2}.

The objective then is to minimize:

where **t _{i}** is the target portfolio beta to risk factor i,

**β**is the portfolio beta to risk factor i, and

_{i}**M**is the number of risk factors.

### Results

Here are the performance metrics of the benchmarks and the factor momentum algorithm:

The selling point of the factor momentum approach is the consistency it manages to achieve, while also maintaining excellent volatility-adjusted and drawdown-adjusted returns. There are two long periods during which the other optimization methods did quite badly (2008-2009 and from the middle of 2011 to the present); factor momentum just keeps going.

One interesting point is that the factor momentum algorithm tends to allocate to fewer holdings than the other approaches (because all the other algorithms will always have non-zero weights for any assets selected, which is not the case for FM). There may be some low-hanging fruit here in terms of diversification.

Some other potentially interesting ideas for the future: is there any value in the momentum of residuals (in a regression against the factor returns), similar to the Blitz, Huij & Martens approach? An interesting extension would be to loosen the factor-neutral constraint to leave room for other objectives. Finding a smarter way to calculate target betas would also be an interesting and probably fruitful exercise; taking each factor’s volatility and momentum into account is probably the most obvious idea.

Footnotes- Dimensionality reduction can be extremely useful in trading, particularly when dealing with machine learning or simply when there is a need to combine multiple overlapping indicators.[↩]
- This is of course a very primitive approach; each factor has different volatility, so equal betas means unequal risk allocated to each factor.[↩]

## tstudent says:

Please can you explicitate with a small numerical example this passage:

# Rank the factors on their 120-day returns and pick the top 3.

I can’t figure out this passage.

## qusma says:

Each principal component will have its own returns series (r*V). These can then be used to calculate the 120-day returns to each specific factor.

## VarCovar says:

Interesting article! Would you mind sharing your optimization algo? Many thanks!

## Tactical Alpha: The Case for Active Asset Allocation | GestaltU says:

[…] Using Factor Momentum to Optimize GTAA Portfolios – QUSMA […]

## Mat says:

Hey Alex do you have the C# code for this implementation or did you do this all in Matlab?

## qusma says:

Did this in matlab. In C# you can replicate the matrix math very easily with the ILNumerics library.

## Tactical Alpha: The Case for Active Asset Allocation | GestaltUGestaltU says:

[…] Using Factor Momentum to Optimize GTAA Portfolios – QUSMA […]

## AYA says:

My guess that doing PCA on large universes could be time-consuming in backtesting. Why can’t you just use academically proven return factors, such as momentum, value, low beta etc.?

## mahlegha says:

This article is excellent. Special thanks. سایپا–نمایندگی سایپا–نمای کامپوزیت

## sajadi says:

Your information is very useful for every user. Special thanks

راهبند اتوماتیک–درب پارکینگ–کرکره برقی–لامپ کم مصرف

## Tactical Alpha: The Case for Active Asset Allocation - GestaltU says:

[…] Using Factor Momentum to Optimize GTAA Portfolios – QUSMA […]

## Optimal Stock Quantity, Selection and Weights for Momentum Investing – Quants Portal says:

[…] 2012. Using factor momentum to optimize GTAA portfolios. [online] Available at: http://qusma.com/2012/11/12/using-factor-momentum-to-optimize-gtaa-portfolios/ [Accessed 25 June […]