10 Portfolio Choice under Transaction Costs and Estimation Uncertainty

10.1 Constrained optimization and backtesting

In this exercise we extend the simple portfolio analysis substantially and bring the simulation closer to a realistic framework. We will penalize turnover, evaluate the out-of-sample performance after transaction costs and introduce some robust optimization procedures in the spirit of the paper Large-scale portfolio allocation under transaction costs and model uncertainty, available in Absalon. We start with standard mean-variance efficient portfolios. Then, we introduce further constraints step-by-step. Numerical constrained optimization is performed by the packages quadprog (for quadratic objective functions such as in typical mean-variance framework) and alabama (for more general, non-linear objectives and constraints). I refer to Exercise Set Portfolio Choice Problems for a basic introduction into numerical optimization, etc.


  1. For the exercise set, you will use the monthly Fama-French industry portfolio returns. Download them either directly from Kenneth French’s homepage or extract the data from the file tidy_finance.sqlite.
  2. Write a function that computes efficient portfolio weight allowing for \(L_2\) transaction costs (conditional on the holdings before reallocation). \(L_2\) transaction costs means that within this exercise we assume that transaction costs are quadratic and of the form \[\frac{\beta}{2}\left(w_{t+1} - w_{t^+}\right)'\left(w_{t+1} - w_{t^+}\right).\]. Thus, the function should take the moment estimates \(\mu_t\) and \(\Sigma_t\), the previous portfolio weight \(\omega_{t^+} := \frac{\omega_{t} \odot \left(1 + r_t\right)}{1 + w_t'r_t}\) where \(\odot\) denotes element-wise multiplication as well as the transaction cost parameter \(\beta\) and the risk aversion \(\gamma\) as inputs. You can consult Equation (7) in Hautsch et al (2019) for further information. Compute the efficient portfolio for an arbitrary initial portfolio based on the industry returns.
  3. Analyse how different transaction cost values \(\beta\) affect portfolio rebalancing. You can assume that the previous allocation was the naive portfolio. Show that for high values of \(\beta\) the initial portfolio becomes more relevant. What happens for different values of the risk aversion \(\gamma\)?
  4. Write a script that simulates the performance of 3 different strategies before and after adjusting for transaction costs for different values of \(\beta\) with \(L_1\) transaction costs: A (mean-variance) utility maximization (risk aversion \(\gamma = 4\)), a naive allocation that rebalances daily and a (mean-variance) utility with turnover adjustment (risk aversion \(\gamma = 4\)). Assume that \(\beta = 1\). Evaluate the out-of-sample mean, standard deviation and Sharpe ratios. What do you conclude about the relevance of turnover penalization?


All solutions are provided in the book chapter Constrained optimization and backtesting.