Learn R Programming

NMOF (version 2.10-0)

divRatio: Diversification Ratio

Description

Compute the diversification ratio of a portfolio.

Usage

divRatio(w, var)

Value

a numeric vector of length one

Arguments

w

numeric: a vector of weights

var

numeric matrix: the variance--covariance matrix

Author

Enrico Schumann

Details

The function provides an efficient implementation of the diversification ratio, suitable for optimisation.

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")

Yves Choueifaty and Yves Coignard (2008) Toward Maximum Diversification. Journal of Portfolio Management 35(1), 40--51.

See Also

pm, drawdown

Examples

Run this code
na  <- 10     ## number of assets
rho <- 0.5    ## correlation
v_min <- 0.2  ## minimum vol
v_max <- 0.4  ## maximum vol

## set up a covariance matrix S
C <- array(rho, dim = c(na,na))
diag(C) <- 1
vols <- seq(v_min, v_max, length.out = na)
S <- outer(vols, vols) * C

w <- rep(1/na, na)  ## weights
divRatio(w, S)

Run the code above in your browser using DataLab