DeltaCalc.Concentration (DeltaCalc v0.3.0)

Copy Markdown View Source

Concentration-risk primitives for portfolio asset weights.

HHI is returned on the normalized 0-1 scale: equal weights move toward 0 and a single-asset portfolio returns 1.

API Functions

FunctionArityDescriptionParam Kinds
hhi1Calculate Herfindahl-Hirschman Index over asset weights.weights: value

Summary

Functions

Return the normalized HHI: sum((weight / total_weight)^2).

Types

weight_input()

@type weight_input() :: %{optional(term()) => Decimal.t()} | [Decimal.t()]

Functions

hhi(weights)

@spec hhi(weight_input()) :: Decimal.t()

Return the normalized HHI: sum((weight / total_weight)^2).