fitSpecified

fun fitSpecified(numComponents: Set<Int>, generator: PartitionGeneratorIfc = JenksPartitionGenerator(mySortedData, maxRequested(numComponents)), refiner: PartitionRefinerIfc = defaultRefiner(), selector: FamilySelectorIfc = defaultSelector()): MixtureModelingResults(source)

Fits the numbers of components the caller is choosing between.

The generalization of fit(numComponents) to an analyst weighing more than one reading of a histogram — two plausible groupings, say — who wants the criteria's opinion between them without pretending a range was searched. The recommendation is the best of the specified counts; one component is fitted alongside them for the comparison, as above.

Deliberately a separate name rather than another fit overload. A Set<Int> is an Iterable<Int>, so an overload taking one would silently capture existing calls that pass a set to the range form and change what they mean.

Parameters

numComponents

the counts to fit. Every one must be feasible for this sample.

generator

the partition generator supplying the initial partition

refiner

improves the generated partition

selector

chooses one family per group

Throws

when the set is empty or holds a count that cannot be fitted to this sample, naming the constraint that refuses it