RecoveryMeasures

Computes how close a fitted mixture is to the truth.

Density distance is the primary measure, not family labels. A mixture of heterogeneous families need not have identifiable family labels at all: an exponential is a gamma of shape one and a Weibull of shape one, and a uniform is a beta with both shapes one, so a recovery measure keyed on the label would report failures that are not failures. Distance between densities is invariant to that relabeling, which is why it leads.

Family recovery is still reported, but against equivalence classes rather than exact labels, and only when the component counts agree so that a matching exists.

Properties

Link copied to clipboard

The largest number of components for which the matching is solved exactly by enumeration.

Link copied to clipboard

How far the true density may integrate from one on the quadrature grid before the density distances computed on that grid are treated as meaningless.

Functions

Link copied to clipboard
fun compare(trueWeights: DoubleArray, trueComponents: List<ContinuousDistributionIfc>, trueTypes: List<RVParametersTypeIfc>, fittedWeights: DoubleArray, fittedComponents: List<ContinuousDistributionIfc>, fittedTypes: List<RVParametersTypeIfc>, numPoints: Int = DensityQuadrature.defaultNumQuadraturePoints): RecoveryResult

Compares a fitted mixture against the truth.

Link copied to clipboard

The Hellinger distance between two single distributions.

Link copied to clipboard
fun familiesEquivalent(trueName: String, fittedName: String): Boolean

Indicates whether two family names count as recovering one another.

Indicates whether the fitted family counts as recovering the true one, allowing for the families that coincide at some parameter values.

Link copied to clipboard
fun matchComponents(trueComponents: List<ContinuousDistributionIfc>, fittedComponents: List<ContinuousDistributionIfc>, numPoints: Int = 2001): IntArray

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

Link copied to clipboard
fun quadratureGrid(components: List<ContinuousDistributionIfc>, numPoints: Int = DensityQuadrature.defaultNumQuadraturePoints): DoubleArray

The quadrature abscissae for a set of components: one sub-grid per component over its own effective range, merged and de-duplicated.