MixtureBootstrap

Assesses how much a mixture recommendation depends on the particular sample it was fitted to.

A single fit reports one number of components and one family per component. Nothing in that report says whether a slightly different sample would have produced the same answer, and for this method it very often would not: measured across a designed experiment, the criterion recovers the true number of components on well under half of attempts. Refitting on resampled data turns that general warning into a measurement on the data actually in hand.

This is deliberately not part of fit. It costs a full fit per resample and a user should choose to pay that.

A caution particular to this method. Resampling with replacement produces repeated values, and a resample of size n contains only about 63% as many distinct values as the original. That matters more here than it does when fitting a single distribution, because a cut may not split tied observations and each group must contain a minimum number of distinct values. The distinct-value count is therefore reported alongside the frequencies, and a parametric alternative is offered which produces no ties at all — at the cost of assuming the fitted mixture is correct, which is the very thing being questioned. Neither is right on its own; disagreement between them is itself informative.

Properties

Link copied to clipboard

The resamples drawn when no number is given.

Functions

Link copied to clipboard
fun componentCountFrequency(data: DoubleArray, numBootstrapSamples: Int = defaultNumBootstrapSamples, numComponentsRange: IntRange = MixtureModeler.defaultNumComponentsRange, fitter: () -> ComponentFitterIfc = { PDFComponentFitter() }, criterion: MixtureCriterionIfc = MixtureBICCriterion(), refiner: () -> PartitionRefinerIfc = MixtureModeler.defaultRefiner, selector: () -> FamilySelectorIfc = MixtureModeler.defaultSelector, streamNum: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider): MixtureBootstrapResults

Refits the mixture on resamples of the data and tabulates what was recommended.

Link copied to clipboard
fun parametricComponentCountFrequency(fitted: ContinuousDistributionIfc, sampleSize: Int, numBootstrapSamples: Int = defaultNumBootstrapSamples, numComponentsRange: IntRange = MixtureModeler.defaultNumComponentsRange, fitter: () -> ComponentFitterIfc = { PDFComponentFitter() }, criterion: MixtureCriterionIfc = MixtureBICCriterion(), refiner: () -> PartitionRefinerIfc = MixtureModeler.defaultRefiner, selector: () -> FamilySelectorIfc = MixtureModeler.defaultSelector, streamNum: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider): MixtureBootstrapResults

Refits the mixture on samples drawn from a fitted mixture rather than from the data.