Learn R Programming

ghyp (version 1.1.0)

portfolio.optimize: Portfolio optimization given a multivariate generalized hyperbolic distribution

Description

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.

Usage

portfolio.optimize(object, ptf.mean = 0.01, 
           risk.measure = c("variance", "quantile", "expected-shortfall"), 
           level = 0.95,...)

Arguments

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.

Value

  • A list with components:
  • portfolioAn univariate generalized hyperbolic object of class ghyp which represents the generalized hyperbolic distribution of the optimal portfolio.
  • risk.measureThe optimization criterion.
  • valueThe value of the risk measure.
  • opt.weightsThe optimal weights.
  • convergenceConvergence returned from optim.
  • messageA possible error message returned from optim.
  • n.iterThe number of iterations returned from optim.

See Also

transform, fit.ghypmv

Examples

Run this code
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")
  lines(density(smi.stocks[, 2:6]

Run the code above in your browser using DataLab