minCVaR | R Documentation |
Compute minimum-CVaR portfolios, subject to lower and upper bounds on weights.
minCVaR(R, q = 0.1, wmin = 0, wmax = 1,
min.return = NULL, m = NULL,
method = "Rglpk",
groups = NULL, groups.wmin = NULL, groups.wmax = NULL,
Rglpk.control = list())
R |
the scenario matrix: a numeric (real) matrix |
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 |
minimal required return. If |
method |
character. Currently, only |
groups |
a list of group definitions |
groups.wmin |
a numeric vector |
groups.wmax |
a numeric vector |
Rglpk.control |
a list: settings passed to |
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.
a numeric vector (the portfolio weights); attached is an
attribute whose name matches the method
name
Enrico Schumann
Gilli, M., Maringer, D. and Schumann, E. (2019) Numerical Methods and Optimization in Finance. 2nd edition. Elsevier. \Sexpr[results=rd]{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.
Schumann, E. (2023) Financial Optimisation with R (NMOF Manual). https://enricoschumann.net/NMOF.htm#NMOFmanual
Schumann, E. (2020) Minimising Conditional Value-at-Risk (CVaR). https://enricoschumann.net/notes/minimising-conditional-var.html
minvar
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
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.