q: the Value-at-Risk level: a number between 0 and 0.5
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.
m: vector of expected returns. Only used if min.return is specified.
min.return: minimal required return. If m is not specified, the column means of R are used.
method: character. Currently, only "Rglpk" is supported.
groups: a list of group definitions
groups.wmin: a numeric vector
groups.wmax: a numeric vector
Rglpk.control: a list: settings passed to Rglpk_solve_LP
Details
Compute the minimum CVaR portfolio for a given scenario set. The default method uses the formulation as a Linear Programme, as described in Rockafellar/Uryasev (2000).
The function uses Rglpk_solve_LP from package Rglpk.
Returns
a numeric vector (the portfolio weights); attached is an attribute whose name matches the method name
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")
Rockafellar, R. T. and Uryasev, S. (2000). Optimization of Conditional Value-at-Risk. Journal of Risk. 2 (3), 21--41.
if(requireNamespace("Rglpk")){ ns <-5000## number of scenarios na <-20## nunber of assets R <- randomReturns(na, ns, sd =0.01, rho =0.5) res <- minCVaR(R,0.25) c(res)## portfolio weights}