test

fun test(maxModes: Int, numBootstrapSamples: Int = defaultNumBootstrapSamples): ModalityTestResult(source)

Silverman's test of "at most this many modes", by the smoothed bootstrap.

Resamples are drawn from the estimate at the critical bandwidth itself and rescaled to preserve the sample variance. That rescaling is not optional: without it the resamples carry the variance of the data plus the variance of the smoothing noise, their own critical bandwidths run large, and the test becomes conservative in a way nothing would flag.

Repeated calls advance the streams, as everything else in the library does. For a repeatable answer call resetStartStream first, or give the analyzer a provider of its own.

Parameters

maxModes

the hypothesis

numBootstrapSamples

how many resamples to draw