skfolio.measures.effective_number_assets#

skfolio.measures.effective_number_assets(weights)[source]#

Computes the effective number of assets, defined as the inverse of the Herfindahl index [1]:

\[N_{eff} = \frac{1}{\Vert w \Vert_{2}^{2}}\]

It quantifies portfolio concentration, with a higher value indicating a more diversified portfolio.

Parameters:
weightsndarray of shape (n_assets,)

Weights of the assets.

Returns:
valuefloat

Effective number of assets.

References

[1]

“Banking and Financial Institutions Law in a Nutshell”. Lovett, William Anthony (1988)