Example: Portfolio optimizationThis example, from finance, is a basic portfolio optimization problem. For some more details, see Boyd and Vandenberghe, 4.6.3. Optimization problemWe are given the parameters
and wish to choose asset weights to minimize our risk-adjusted mean return, subject to a budget constraint and a limit on our total short position. Thus, we have the optimization problem CVXGEN codedimensions
n = 50 # assets. m = 10 # factors. end parameters alpha (n) # vector of mean returns. lambda positive # risk aversion. sigma (n) positive # idiosyncratic (asset-specific) variance. eta positive # limit on total short position. F (m,n) # factor exposure matrix. Sigma (m,m) psd # factor covariance matrix. end variables w (n) # asset weights. end maximize alpha'*w - lambda*(quad(F*w, Sigma) + sigma'*square(w)) # risk adjusted mean return. subject to sum(w) == 1 # budget constraint. sum(neg(w)) <= eta # limit on total short position. end |