assessFitAdequacy

fun assessFitAdequacy(baseline: MixtureModelingResults, numReplicates: Int = FitAdequacy.defaultNumReplicates, level: Double = FitAdequacy.defaultLevel, fitter: () -> ComponentFitterIfc = { PDFComponentFitter() }, refiner: () -> PartitionRefinerIfc = defaultRefiner, selector: () -> FamilySelectorIfc = defaultSelector, streamNum: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider): FitAdequacy?(source)

Whether the fitted density reproduces the sample it came from.

The question an input model is actually judged on. countAdequacy asks whether the sample can settle how many components there are; this asks whether the density is a fair description of the data, which is what matters when the fit is going to drive a simulation. See FitAdequacy for why the goodness-of-fit p-value is bootstrapped rather than taken at face value, and why a two-sample comparison against the fitting data is not offered.

Opt-in, like every other resampling step here. Each replicate is a refit.

Return

the assessment, or null when nothing was fitted

Parameters

baseline

the results whose density is being tested; must have been fitted to this modeler's data

numReplicates

how many samples to draw from the fitted density

level

the level at which the verdict is read

fitter

a factory for the component fitter, fresh per replicate because the cache is keyed by group range and one carried across replicates would answer with another's fits

refiner

a factory for the refiner, fresh per replicate for the same reason

selector

a factory for the family selector

streamNum

the stream to draw replicates with

streamProvider

the stream provider