matchComponents

fun matchComponents(trueComponents: List<ContinuousDistributionIfc>, fittedComponents: List<ContinuousDistributionIfc>, numPoints: Int = 2001): IntArray(source)

Matches fitted components to true components so as to minimize the total component-wise Hellinger distance.

Matching is on distance between the component densities, not on their means. A mean is a poor summary of a skewed component, so matching on means pairs the wrong components precisely in the heterogeneous cases this work exists to handle.

The assignment is exact by enumeration up to exactMatchingLimit components, and greedy beyond that.

Parameters

trueComponents

the true components

fittedComponents

the fitted components, equal in number

numPoints

the number of quadrature points