powered by
Diversification is defined as 1 minus the sum of the squared weights $$diversification = 1 - sum(w^2)$$
diversification(weights)
vector of asset weights
Ross Bennett