Compute maximum Sharpe-ratio portfolios, subject to lower and upper bounds on weights.
maxSharpe(m, var, min.return, wmin =-Inf, wmax =Inf, method ="qp", groups =NULL, groups.wmin =NULL, groups.wmax =NULL)
Arguments
m: vector of expected (excess) returns.
var: the covariance matrix: a numeric (real), symmetric matrix
min.return: minimumm required return. This is a technical parameter, used only for QP.
wmin: numeric: a lower bound on weights. May also be a vector that holds specific bounds for each asset.
wmax: numeric: an upper bound on weights. May also be a vector that holds specific bounds for each asset.
method: character. Currently, only "qp" is supported.
groups: a list of group definitions
groups.wmin: a numeric vector
groups.wmax: a numeric vector
Details
The function uses solve.QP from package quadprog. Because of the algorithm that solve.QP uses, var has to be positive definit (i.e. must be of full rank).
Returns
a numeric vector (the portfolio weights) with an attribute variance (the portfolio's variance)
References
Gilli, M., Maringer, D. and Schumann, E. (2019) Numerical Methods and Optimization in Finance. 2nd edition. Elsevier. tools:::Rd_expr_doi("10.1016/C2017-0-01621-X")