Portfolio Optimization with Proportional Rebalancing Costs
Summary
The document discusses mean-variance portfolio choice when trading costs are proportional to the absolute change in asset weights. Its proposed objective balances expected return against variance and total rebalancing cost. The formulation represents buys and sells separately and includes a condition intended to prevent simultaneous buying and selling of the same asset, alongside a full-investment constraint. The author asks how to solve this nonlinear optimization and presents a small numerical example using an absolute-weight-change penalty.
The answer suggests an alternative practical formulation: define nonnegative buy and sell variables, link them linearly to changes in portfolio weights, and constrain their combined amount by a turnover budget. The budget can be adjusted in light of per-unit trading costs. This provides a tractable way to control rebalancing, though it imposes a turnover limit rather than directly solving the original cost-penalized objective. The answer also highlights that the assumed cost parameter can materially affect the selected portfolio; no empirical comparison or universal setting is supplied.
Key ideas
- A proportional transaction-cost penalty can be modeled using the absolute changes in portfolio weights.
- The proposed objective trades off expected return, portfolio variance, and rebalancing costs.
- Buy and sell variables can express weight changes through linear equalities.
- A turnover constraint offers a practical way to limit trading and relate turnover to costs.
- Portfolio results can be sensitive to the assumed cost parameter.
Tags
Full text
# Portfolio optimization subject to transaction costs
# Portfolio optimization subject to transaction costs
Mean-Variance portfolio optimization attracted lots of attention in this forum so far. I am interested in the effect of incorporating transaction costs into the decision framework and I would like to obtain 'optimal' portfolios. In other words, approaches which are still capable of being solved using quadratic programing by constraining maximum turnover are not what I am looking for. Just recently, this question was solved with the help of the community in order to obtain optimal portfolios if we consider quadratic transaction costs. However, what happens if we come up with transaction costs in a V-shape, which means we pay a fee proportionally to the sum of absolute rebalancing: $$TC(\omega_\text{new}) \propto ||\omega_\text{new}-\omega_\text{old}||.$$ This (rather old) paper by Atsushi Yoshimoto handles exactly the optimization problem I want to solve: $$ \omega_\text{new} = \arg\max {\omega'\mu - \sum_{i=1}^N c_i -\lambda \omega'\Sigma\omega} \\ \text{s.t.} c_i = k(d^+ _{i,t} + d^- _{i,t}), \forall i \\ \omega_{i}-\omega_{old} = d_{i} ^+ - d_{i} ^-, \forall i \\ d_i ^+ d_i ^- =0, \forall i \\ d_i ^+, d_i ^- \geq 0 \forall i \\\omega'\iota=1 $$ Intuitively speaking the optimization is doing the following: Given estimates of future returns $\mu$ and volatility $\Sigma$, we search for $\omega$ which maximizes our Certainty equivalent. This value is decreased with total transaction costs $\sum c$. Transaction costs occur if we rebalance our portfolio: Given we increase the share of wealth in one asset $i$, this affects $d_i ^+$ and, vice versa, if we decrease the share of wealth in one asset, this increases $d_i ^-$. Total rebalancing in asset $i$ is therefore $d_i ^+ +d_i ^-$. The constraint $d_i ^+ d_i ^- = 0$ ensures, that one cannot buy and sell simultaneously one asset (which should be clear). The last constraint requires that our new portfolio weights $\omega$ sum up to 1, therefore we are investing all the money into the available assets (I did not incorporate an additional short sell constraint here, opposed to Yoshimoto).
I would love to implement this optimization in R, Matlab, Python, whatever, but I do not understand the structure explained in this paper: All which is explained is that a nonlinear optimizer called GAMS/MINOS was used. I think, 20 Years after publishing there should certainly be a publicly available approach to to this, therefore I ask (i) does an implementation already exist? (ii) If not, how to do this properly?
EDIT: To show my first approach I worked out this small example for R. Hereby I neglect the estimation of the mean but only consider volatility timing:
```
library(alabama)
library(quantmod)
symbols <- c("MSFT","AAPL","MMM")
getSymbols(symbols,src='yahoo',from = '1995-01-01')
N <- length(symbols)
MSFT <- to.monthly(MSFT)
AAPL <- to.monthly(AAPL)
MMM <- to.monthly(MMM)
returns <- data.frame(MSFT=diff(log(MSFT$MSFT.Adjusted)),
AAPL=diff(log(AAPL$AAPL.Adjusted)),
MMM=diff(log(MMM$MMM.Adjusted)))
returns <- na.omit(returns)
names(returns) <- symbols
mu <- rep(1,N)
sigma <- cov(returns)
lambda <- 4
costpara <- 50/10000
wold <- rep(1/N,N)
fn <- function(w) -w%*%mu + costpara*sum(abs(w- wold))+lambda*t(w)%*%sigma%*%w
heq <- function(w) return(sum(w)-1)
out <- constrOptim.nl(par=wold, fn=fn,heq=heq)
rbind(out$par,wold)
wnew 0.3333233 0.08347908 0.5831977
wold 0.3333333 0.33333333 0.3333333
```
However, I am not too familiar with numerical optimization, so can anyone confirm this approach is correct, or point out ways to improve the optimization?
## Answer by Richi Wa (score 2, accepted)
https://quant.stackexchange.com/a/30942
What you do looks ok. But in practice how would you set `costpara`? This coud have a huge impact on your optimization.
So I would do something different. Define the buys $b_i>0$ and the sells $s_i>0$ then you have $$ w_i = wold_i + b_i - s_i $$ or in other terms: $$ w_i-wold_i - b_i + s_i = 0. $$ This is a linear equality that you cas use in your `heq`. Then you add a constraint $$ \sum_{i=1}^n b_i + s_i \le T $$ for some turnover limit $T$. Then you make sure that the problem is optimized under a turnover constraint. Multipliying this $T$ by your cost of one percent sold or bought gives you control over transaction costs.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.