toMixtureDistribution

The assembled candidate as a continuous distribution, suitable for any scoring model, plot, or goodness-of-fit test that accepts one.

A single-component candidate is returned as that component rather than as a mixture of one. The library's mixture distribution requires at least two components — reasonably, in that a mixture of one is not a mixture — so wrapping one would fail, and returning the component is both the honest answer and the useful one. This matters in practice because one component is how a single distribution is expressed here, and comparing a mixture against a single distribution is the first thing a user wants to do.

The return type is therefore the interface rather than the mixture class. Callers needing the mixture's own members, such as its mixing CDF, should check the type; a candidate with two or more components always yields one.