portfolio.optimize {ghyp} | R Documentation |
This function performs a optimization of a portfolio with respect to one of the risk measures “variance”, “quantile” or “expected-shortfall”, a level of risk and the requested portfolio return given a multivariate generalized hyperbolic distribution.
portfolio.optimize(object, ptf.mean = 0.01, risk.measure = c("variance", "quantile", "expected-shortfall"), level = 0.95,...)
object |
A multivariate ghyp object. |
ptf.mean |
The required expected return of the portfolio. |
risk.measure |
The risk measure to which the portfolio should be optimized. Must be one of “variance”, “quantile” or “expected-shortfall”. |
level |
The level of the risk.measure . Not used when risk.measure
is “variance”. |
... |
Arguments passed to optim . |
A list with components:
portfolio |
An univariate generalized hyperbolic object of class ghyp which
represents the generalized hyperbolic distribution of the optimal portfolio. |
risk.measure |
The optimization criterion. |
value |
The value of the risk measure. |
opt.weights |
The optimal weights. |
convergence |
Convergence returned from optim . |
message |
A possible error message returned from optim . |
n.iter |
The number of iterations returned from optim . |
The setting of constraints (e.g. avoid short-selling) is not supported yet.
If the risk measure is “variance” the returned portfolio is simply an efficient frontier.
David Lüthi
data(smi.stocks) mv.fit <- fit.ghypmv(data = smi.stocks[, 2:6], opt.pars = c(lambda = FALSE), lambda = 2, control = list(rel.tol = 1e-5, abs.tol = 1e-5)) optimal.portfolio <- portfolio.optimize(mv.fit, ptf.mean = 1e-3, risk.measure = "expected-shortfall", level = 0.99) plot(optimal.portfolio$portfolio, type = "l" , col = "red") ## Not run: lines(density(smi.stocks[, 2:6] ## End(Not run)