# Markowitz Portfolio Management: Theory, Concepts, and Practice ## Introduction In his groundbreaking 1952 paper "Portfolio Selection," Harry Markowitz introduced Modern Portfolio Theory (MPT), revolutionizing investment management. MPT provides a structured approach to balance risk and return, emphasizing diversification – the strategic allocation of assets to minimize risk for a given level of return. ### Core Concepts and Equations 1. **Forming Beliefs:** Investors begin by estimating: * **Expected Returns $\mu$:** The anticipated average return of each asset. * **Covariance Matrix $\Sigma$:** Captures the volatility and correlations between assets. Diagonal elements are individual asset variances, while off-diagonal elements are covariances. 2. **Portfolio Optimization:** Two key optimization models are used: * **E-V Rule (Minimize Variance):** Maximize return while keeping risk (measured by variance) below a target: \begin{split}\text{maximize}&\quad \mu^T w \\ \text{subject to}&\quad w^T \Sigma w \leq (\sigma_{tar})^2, \quad 1^T w = 1 \end{split} where: * $w$ is the vector of portfolio weights (proportions of investment in each asset) * $\mu$ is the vector of expected asset returns * $\Sigma$ is the covariance matrix of asset returns * $\sigma_{tar}$ is the target portfolio risk (standard deviation) * **Maximize Risk-Adjusted Return:** Maximize return penalized by a factor reflecting the investor's risk aversion $\gamma$: \begin{split} \text{maximize}&\quad \mu^T w - \gamma w^T \Sigma w \\ \text{subject to}&\quad 1^T w = 1 \end{split} 3. **Analytical Solutions:** * Optimal Weights $w^*$ can be derived analytically for the risk-adjusted return model: $$w^* = \frac{1}{2\gamma} \Sigma^{-1}(\mu + \nu^* 1)$$ where $$\nu^* = \frac{2\gamma-1^T \Sigma^{-1} \mu}{1^T \Sigma^{-1} 1}$$ * These solutions involve the inverse of the covariance matrix $\Sigma^{-1}$, making it sensitive to input errors. ### Challenges and Criticisms 1. **Data Sensitivity:** The model's reliance on accurate input data makes it sensitive to estimation errors, potentially leading to unrealistic portfolios. 2. **Risk Symmetry Assumption:** The model treats upside and downside risk equally, which might not align with investors' preferences. 3. **Expected Utility vs. Variance:** Some argue for maximizing expected utility (satisfaction) instead of just minimizing variance. 4. **Ignoring Higher Moments:** The model focuses on mean and variance, neglecting higher moments like skewness and kurtosis. ## Portfolio Construction: Holdings, Trades, and Costs This section defines key concepts and notation for portfolio holdings, trades, and the associated constraints and costs that shape portfolio construction. ### Portfolio Weights * **Universe:** A portfolio is constructed from a universe of $n$ liquid assets (e.g., stocks, bonds, currencies), potentially held long or short, plus a cash account. * **Asset Weights $w$:** The proportion of the total portfolio value allocated to each asset $i$, denoted by $w_i$. Positive values indicate long positions, negative values indicate short positions. * Example: $w_i = 0.05$ means 5% of the portfolio is invested in asset $i$; $w_k = -0.01$ means a 1% short position in asset $k$. * **Cash Weight $c$:** The proportion of the portfolio held in cash (positive) or borrowed (negative). * **Constraints:** * **Weight Limits:** Each asset and cash weight is bounded: * $w_{min} \leq w \leq w_{max}$ * $c_{min} \leq c \leq c_{max}$ * **Budget Constraint:** The sum of all asset weights and the cash weight must equal 1: $$\mathbf{1}^T w + c = 1$$ ### Leverage * **Definition:** Leverage $L$ is the sum of the absolute values of asset weights, indicating the degree to which borrowed capital is used: $$L = \sum_{i=1}^n |w_i| = \|w\|_1$$ * **Leverage Limit:** A leverage limit $L_{tar}$ can be imposed to manage risk: $$L \leq L_{tar}$$ ### Trading * **Trade Vector $z$:** The change in portfolio weights from the previous period $w_{pre}$ to the current period $w$. * **Turnover $T$:** The total volume of trading, measured as half the sum of absolute trade values: $$T = \frac12 \sum_{i=1}^n |z_i| = \frac12 \|z\|_1$$ * Turnover Limit: A limit $T_{tar}$ to control trading activity: $$T \leq T_{tar}$$ ### Costs * **Holding Costs:** Costs associated with borrowing assets (for short positions) or cash. They are modeled as a linear function of negative weights: $$\phi^{hold}(w, c) = (\kappa^{short})^T (-w)_+ + \kappa^{borrow}(-c)_+$$ where: * $(\cdot)_+$ denotes the non-negative part (applied element-wise) * $\kappa^{short}$ is the vector of borrow cost rates for assets * $\kappa^{borrow}$ is the borrow cost for cash * **Trading Costs:** * **Bid-Ask Spread:** Cost due to the difference between buying and selling prices. * **Bid-Ask Spread:** Cost due to the difference between buying and selling prices. * **Model:** Approximated as: $$\phi^{trade}(z) = (\kappa^{spread})^T |z| + (\kappa^{impact})^T |z|^{3/2}$$ where: * $\kappa^{spread}$ represents half the asset's bid-ask spreads * $\kappa^{impact}$ captures market impact, depending on trading volume and asset volatility * **Liquidation Cost:** The cost of closing all positions, often approximated as: $$(\kappa^{spread})^T|w|$$ ## Forecasting Return and Risk: Models and Robustness This section explores methods for forecasting asset returns and the associated risks, crucial inputs for Markowitz portfolio optimization. It introduces models that account for uncertainty and techniques to make these forecasts more resilient to errors. ### Return * **Gross Portfolio Return $R$:** Total return before costs, calculated as the weighted sum of asset returns $r$ and the risk-free rate $r^{rf}$ applied to cash holdings $c$: $$R = r^Tw + r^{rf}c$$ * **Excess Return:** Portfolio return exceeding the risk-free rate: $$R - r^{rf} = r^Tw+r^{rf}(c-1)$$ * **Net Portfolio Return $R^{net}$:** Return after deducting holding and trading costs: $$R^{net} = R - \phi^{\text{hold}}(w) - \phi^{\text{trade}}(z)$$ * **Active Return:** Return relative to a benchmark portfolio $w^b$: $$r^Tw + r^{rf}c - r^Tw^b = r^T(w-w^b) + r^{rf}c$$ * **Cash as Slack:** Holding cash provides flexibility and buffers against estimation errors. ### Probabilistic Asset Return Model This model treats asset returns as random variables, characterized by: * **Mean $\mu$:** The expected average return of each asset. * **Covariance Matrix $\Sigma$:** Captures asset return variances (diagonal elements) and covariances (off-diagonal elements). Asset volatilities $s$ are derived as $s=\text{diag}(\Sigma)^{1/2}$. #### Expected Return and Risk Under this model, the portfolio return $R$ and active return $R^a$ are random variables with the following mean and variance: * **Portfolio Return:** * Mean: $\bar{R}=\mu^Tw+r^{rf}c$ * Variance: $\sigma^2= w^T \Sigma w$ * **Active Return:** * Mean: $\bar{R}^a=\mu^T(w-w^b)+r^{rf}c$ * Variance: $(\sigma^a)^2= (w-w^b)^T \Sigma (w-w^b)$ Risk and active risk are often annualized by scaling them by the square root of the number of periods per year. #### Optimizing Expected Return and Risk Two common approaches are used to balance return and risk: * **Risk-Adjusted Return:** Maximizes $\overline{R} - \lambda \sigma^2$, where $\lambda$ (risk aversion) controls the trade-off. * **Risk Budget/Target:** Maximizes return subject to a risk constraint $\sigma \leq \sigma_{tar}$. Other approaches include maximizing the Sharpe ratio (return/risk) or information ratio (active return/active risk). ### Factor Model This model decomposes asset returns into: * **Common Factors $f$:** Returns on broad market trends, with loadings $F$ quantifying asset sensitivities. * **Idiosyncratic Returns $\epsilon$:** Asset-specific returns. #### Mathematical Representation $$ r = Ff + \epsilon $$ Asset and portfolio return means and variances can be derived from the factor model: \begin{split} \mu= F\bar{f}+\bar{\epsilon},& \quad \Sigma= F \Sigma^f F^T +D \\ \bar{R} = (F \bar{f})^Tw + \bar{\epsilon}^Tw+r^{rf}c,& \quad \sigma^2=(F^T w)^T \Sigma^f (F^T w) + w^T D w \end{split} #### Advantages * **Improved Covariance Estimation:** Particularly useful for large asset universes. * **Computational Efficiency:** Reduces complexity compared to full covariance estimation. ### Robust Forecasting Forecasted returns $\mu$ and covariances $\Sigma$ are inherently uncertain. Robust methods mitigate errors: #### Robust Return Forecast * **Nominal Estimate $\mu$:** Baseline estimate of expected returns. * **Uncertainty Intervals $\rho$:** Ranges around $\mu$ within which actual returns may fall. * **Worst-Case Return $R^{wc}$:** Minimum possible return, accounting for uncertainty: $$R^{wc} = \min_{||\delta|| \leq \rho} \{(\mu + \delta)^Tw \} = \bar{R} - \rho^T |w|$$ where: * $\bar{R}$ is the nominal mean portfolio return * $\rho^T |w|$ is the portfolio return forecast error penalty, representing the potential decrease in return due to uncertainty. #### Robust Covariance Forecast * **Nominal Estimate $\Sigma$:** Baseline estimate of the covariance matrix. * **Uncertainty Level $\zeta$:** A parameter between 0 and 1 that quantifies the level of uncertainty in the covariance matrix: $$|\Delta_{ij}|\le \zeta (\Sigma_{ii} \Sigma_{jj})^{1/2}$$ * **Worst-Case Risk $\sigma_{wc}$:** Maximum possible risk, incorporating uncertainty: $$(\sigma_{wc})^2 = \sigma^2 + \zeta \left(\sum_{i=1}^n \Sigma_{ii}^{1/2} |w_i| \right)^2$$ where: * $\sigma^2$ is the nominal portfolio risk * The second term is the covariance forecast error penalty, representing the increase in risk due to uncertainty. ## Single-Period Optimization The core Markowitz portfolio optimization problem is a convex optimization problem designed to maximize the worst-case net portfolio return, accounting for both holding and trading costs. ### Objective Function \begin{split} \text{maximize} &\quad R^{wc} - \gamma_{hold} \phi^{hold}(w) - \gamma_{trade} \phi^{trade}(z) \\ \text{subject to}&\quad 1^T w + c = 1, \quad z = w - w_{pre},\\ &\quad w_{min} \leq w \leq w_{max}, \quad L \leq L_{tar}, \quad c_{min} \leq c \leq c_{max}, \\ &\quad z_{min} \leq z \leq z_{max}, \quad T \leq T_{tar}, \\ &\quad \sigma^{wc} \leq \sigma_{tar} \end{split} where: * $R^{wc}$: worst-case mean portfolio return * $\phi^{hold}(w)$: holding costs * $\phi^{trade}(z)$: trading costs * $\gamma_{hold}, \gamma_{trade}$: parameters scaling the impact of costs * $w$: vector of asset weights * $c$: cash weight * $z$: trade vector (change in weights) * $w_{pre}$: pre-trade portfolio weights * $L$: Leverage * $T$: Turnover * $\sigma^{wc}$: Worst-case portfolio risk * ${min}, {max}, {tar}$: minimum, maximum, and target values for various quantities #### Data and Parameters The optimization requires: * **Data:** Pre-trade weights, return forecasts, risk model parameters, and cost parameters. * **Parameters:** Pre-trade weights, return forecasts, risk model parameters, and cost parameters. ### Softening Constraints Strict constraints can lead to issues in volatile markets. Softening them involves allowing minor violations with penalties in the objective function. For instance, a constraint like $f \leq f_{max}$ becomes $f \leq f_{max} + s$, where $s \geq 0$ is a slack variable, and a penalty term $\gamma s$ is added to the objective. In practice, constraints on risk, leverage, and turnover are often softened, while budget and long-only constraints remain hard. Priority parameters, tuned via backtesting, control the tolerance for violations. ### Back-testing and Parameter Tuning Backtesting simulates trading strategies on historical data, calculating the simulated net return $R^{net}_t$ based on realized values. Portfolio trajectory and metrics like return and volatility are tracked. Portfolio value over time: $$ V_t = V_1 \prod_{\tau=1}^{t-1} (1 + R_\tau^{net}) $$ where $V_1$ is the initial value. Backtesting is essential for parameter tuning, where parameters like the trading cost factor $\gamma_{trade}$ are adjusted to optimize a composite metric, often considering multiple factors like Sharpe ratio and drawdown. ## Multi-Period Optimization Multi-period optimization (MPO) extends the Markowitz model to encompass a planning horizon of $H$ periods into the future. Instead of making decisions solely based on the current time period, MPO aims to find an optimal sequence of trades that maximizes the total risk-adjusted return over the entire planning horizon while adhering to various constraints. ### Estimation in MPO Since many quantities (e.g., returns, covariances) are unknown in future periods, they must be estimated. We denote our estimate of a quantity $Z$ at time $\tau$, given information available at the beginning of period $t$, as $\hat{Z}_{\tau|t}$. If $\tau$ is in the past ($\tau < t$), then $\hat{Z}_{\tau|t}$ simply equals the realized value $Z_\tau$. ### Objective Function MPO seeks to: \begin{split} \text{maximize} &\quad \sum_{\tau=t}^{t+H-1} R^{wc}_{\tau|t} - \gamma_{hold} \phi^{hold}(w_{\tau}) - \gamma_{trade} \phi^{trade}(z_\tau) \\ \text{subject to}&\quad 1^T w_{\tau} + c_{\tau} = 1, \quad z_{\tau} = w_\tau - w_{\tau-1},\\ &\quad w_{min} \leq w_\tau \leq w_{max}, \quad L_\tau \leq L_{tar}, \quad c_{min} \leq c_\tau \leq c_{max}, \\ &\quad z_{min} \leq z_\tau \leq z_{max}, \quad T_\tau \leq T_{tar}, \\ &\quad \sigma^{wc}_{\tau|t} \leq \sigma_{tar}, \\ &\quad \forall \tau \in \{t+1, \dots, t+H\} \end{split} ### Interpretation and Rationale The MPO problem can be seen as a trading plan optimization, finding a sequence of trades that are expected to perform well over the entire horizon, considering estimated returns, risks, and costs. Importantly, while we optimize over future trades $z_{t+1}, \dots, z_{t+H-1}$, we only intend to execute the current trade $z_t$. The optimization over future periods is a planning exercise to ensure that current decisions do not lead to undesirable future scenarios. This concept of planning ahead while executing only the immediate action is prevalent in various fields, including automatic control (model predictive control) and supply chain optimization. ## Reference * Markowitz, H. (1952), PORTFOLIO SELECTION*. The Journal of Finance, 7: 77-91. https://doi.org/10.1111/j.1540-6261.1952.tb01525.x * Stephen BoydKasper JohanssonRonald KahnPhilipp SchieleThomas Schmelzer, Markowitz Portfolio Construction at Seventy, The Journal of Portfolio Management Special Issue Dedicated to Harry Markowitz, 50 (8) 117 - 160 * Boyd, Stephen & Busseti, Enzo & Diamond, Steven & Kahn, Ronald & Koh, Kwangmoo & Nystrup, Peter & Speth, Jan. (2017). Multi-Period Trading via Convex Optimization. 3. 10.1561/2400000023. * [Cvxportfolio Documentation](https://www.cvxportfolio.com/en/stable/index.html) * [cvxmarkowitz](https://github.com/cvxgrp/cvxmarkowitz)