The Problem: Unintended Bias in Portfolio Construction
Investors often build their portfolios by allocating ETFs based on personal judgment, intuition, or informal criteria. While this approach may seem practical, it can lead to unintended risks and suboptimal diversification. For example, consider a portfolio composed of two factor-based ETFs: one focused on momentum and the other on value. A common allocation might be a 50-50 split between the two. However, this strategy could unintentionally result in an imbalanced exposure to medium- and small-cap companies.
The reason for this lies in the underlying assets of the ETFs. Typically, a value ETF tends to have a larger portion of its holdings in medium- to small-cap stocks, as these companies are often undervalued and are more likely to exhibit value characteristics. On the other hand, a momentum ETF might predominantly invest in medium- to large-cap companies, as larger firms with strong growth trends often lead momentum strategies. As a result, by allocating equally to both ETFs, an investor could inadvertently increase exposure to medium- and small-cap stocks, potentially leading to an overweight position in these segments of the market.
Moreover, adjusting the allocation to better align the underlying portfolio with the overall market capitalization helps compensate for indices that are composed of a limited number of stocks. Some indices include only a subset of the total market (e.g., the top 100 momentum stocks or the 200 cheapest value stocks), which can introduce concentration risks.
In this post, I propose a new, systematic approach for ETF allocation based on market capitalization. By considering the market cap composition of each ETF, we aim to optimize the allocation process to identify the allocation that best replicates the market exposure. This approach provides a more nuanced method for building diversified portfolios and helps mitigate the risks associated with arbitrary ETF allocations.
Why Market-Cap Weighting is Optimal: A CAPM Perspective
According to the Capital Asset Pricing Model (CAPM), the market portfolio, where assets are weighted by their market capitalization, is the tangency portfolio on the efficient frontier. This means that:
where
- is the expected return on asset
- is the risk-free rate
- is the expected return of the market portfolio
- is the systematic risk of asset , given by
The market portfolio is optimal in CAPM because:
- It provides the highest Sharpe ratio when combined with a risk-free asset.
- It is the mean-variance efficient portfolio under the assumption of market efficiency.
- Deviating from the market portfolio implies a bet against the Efficient Market Hypothesis (EMH), assuming that certain assets are mispriced. A portfolio with a naive allocation can exhibit higher risk without necessarily providing a better risk-adjusted return.
Mathematical Formulation: Finding the Optimal Index Weights
We want to find the weights of Index ETFs composing the portfolio that match the market-cap exposure as closely as possible (*). To solve this problem, we define the market index (e.g. MSCI World Index) and indices composing the portfolio (e.g. MSCI World Momentum and MSCI World Value). Then we define the following variables:
- : A vector containing the market-cap weights of all individual stocks in the market index in decreasing order, e.g., is the most capitalized stock in the market index.
- : A matrix where each column represents an index, and each row contains the weight of a market stock within that index, e.g., element contains the weight of most capitalized stock within the index.
- : The vector of index weights we want to determine.
Our objective is to find the best combination of index ETFs that approximates the market-cap weights. This translates into the following least-squares optimization problem:
subject to the constraint:
This ensures that the final portfolio remains fully invested.
Additionally, to prevent shorting, we can impose the constraint which ensures that each index receives a non-negative weight.
This is a constrained least-squares problem, which can be solved using numerical optimization methods.
(*) In this article, we assume zero tracking error, as it is deemed an irrelevant factor for the analysis at hand. Therefore, the terms “index” and “ETF” will be used interchangeably, as the primary focus is on the exposure to the underlying assets.
Least-Squares Optimization in Code: Solving for Optimal Allocation in MATLAB
To solve for , we can use MATLAB’s lsqlin function, which solves linear least-squares problems with constraints.
A = [...]; % Matrix containing stock weights in each index
b = [...]; % Vector containing stock weights in market index
% Solve for x using constrained least squares
x = lsqlin(A, b, [], [], ones(1, n), 1, 0, 1);
Results: Application to a Momentum-Value Portfolio
The results of the optimal allocation applied to a momentum-value portfolio are presented below.
- An additional intermediate step of data pre-cleaning has been incorporated, which involves in removing outliers (highlighted in blue) from momentum and value indices.
- The exposure of the underlying portfolio derived from the optimal allocation (shown in red) is compared to the overall market exposure (represented in blue).
- The resulting optimal allocation consists of 69% momentum ETF and 31% value ETF.



Found solution:
[*] 68.91 % - IWMO
[*] 31.09 % - IWVL
removeOutliers flag: 1
RMS error: 0.2204 %
Squared norm error: 0.0066
Portfolio underlying assets: 654
Market underlying assets: 1349
Conclusions: A Market-Cap-Based Approach to ETFs Allocation
By using a least-squares optimization approach, we find the best ETFs allocation that reconstructs the market portfolio as closely as possible. This approach provides a systematic and theoretically grounded method for ETFs allocation, moving away from arbitrary or heuristic choices. By minimizing unintended biases, it ensures that the portfolio remains consistent with the principles of the Capital Asset Pricing Model (CAPM) and modern portfolio theory while still allowing for investor preferences in ETF selection.