Previous: Univariate Distributions | Technical Reference | Next: Competing Risks
MixtureModel represents a population in which each observation is generated by one unobserved component. This differs from competing risks, where multiple processes can occur in the same block and the recorded value is their minimum or maximum.
Let
For exact independent observations,
When IsZeroInflated is enabled, the implementation is a point mass at exactly zero plus continuous components conditioned on
Every component must have finite
Numerics.Distributions.Mixture.PDF(0) returns
BestFit fixes the atom to
Uncertain, interval, and threshold records never determine the atom. Negative exact values are invalid.
Low-outlier, interval, and threshold contributions use the corrected mixed CDF and survival function. For measurement-error density
BestFit retains its normalized 20-point Gauss-Legendre window. The atom is added separately and is not approximated as Lebesgue density.
Numerics preserves its public contract: constructors, Weights, GetParameters, NumberOfParameters, every SetParameters overload, constraints, and MLE results use all
BestFit preserves its public model, prior-configuration, EM, and project-model vector with all
The Bayesian sampler is identified by omitting the last weight:
Every sampler-target evaluation performs this affine expansion inside BestFit before invoking the established full-$K$ likelihood and prior methods. Sampled weights must be finite and nonnegative. A residual weight below
All
The scalar factors PriorLogLikelihood and PointwisePriorLogLikelihood retain their full-$K$ public inputs, and the pointwise terms sum to the same scalar prior kernel.
New mixture MCMCResults store MCMCResults. Legacy full-$K$ results follow the identity path and require no migration.
Component labels remain exchangeable under symmetric families and priors. Verification resolves labels by component location; applied analyses should use scientifically distinguishable components or interpret label-specific summaries cautiously 1.
ExpectationMaximization(...) preserves the established approximate-MLE contract, iteration limit, tolerance, bounded Nelder-Mead component optimization, and convergence order. It does not include parameter, Jeffreys-scale, or quantile priors. On exact non-outlier data, BestFit delegates to Numerics, producing identical responsibilities, conditioning, simplex normalization, impossible-row behavior, iterations, and physical weights.
EM evaluates exact, censored, interval, positive-conditional and measurement-error contributions logarithmically through responsibility normalization. It centers observation log contributions before adding log weights, preserving relative weights even when a common log density has very large magnitude. Zero-weight components are skipped before singular-density and effective-support checks; active-component, atom, physical-weight and serialization rules remain unchanged.
For mixed records, BestFit adds the fixed atom to each row total and assigns component responsibilities only to continuous contributions:
Component weights are rescaled to
BestFit's public EM method returns all
It is symmetric, has negative off-diagonal entries, zero row sums, and rank at most
BestFit adds scalar component priors to Equation (10). UseJeffreysRuleForScale adds
MixtureAnalysis uses EM as a deterministic basin finder. Its full-$K$ center and covariance are reduced to the identified coordinates by omitting
The full initial population is sampled with the configured sampler seed from a multivariate Normal using covariance multiplier 1.5. A proposal receives at most 20 replacement draws, is accepted only with finite full-posterior fitness after the residual weight has been derived, and the best population members seed the chains. Failure of that EM population resets to randomized initialization. There is no mixture-specific MAP refinement or numerical Hessian. This changes no DEMCzs sampling default, seed, covariance multiplier, or retry limit and does not use a Dirichlet initializer.
private static MixtureAnalysis ConfigureLatentPopulationMixture(
global::RMC.BestFit.Models.DataFrame annualPeaks)
{
var model = new MixtureModel(
annualPeaks,
new List<UnivariateDistributionType>
{
UnivariateDistributionType.LogNormal,
UnivariateDistributionType.GeneralizedExtremeValue
});
model.EnableQuantilePriors = false;
return new MixtureAnalysis(model);
}- Observations are conditionally independent given their latent component.
- Weights are stationary; covariate-dependent mixing is not implemented.
- BestFit supports one to three stationary components.
- The hurdle option is an atom at exactly zero, not left censoring or a generic nonpositive category.
- Negligible weights or parameters on bounds indicate weak identification.
- Mixture information criteria remain nonregular near boundaries or with unresolved label switching.
The public model and project configuration remain full
The dependence backend and normalized 20-point measurement-error quadrature retain their existing scope. These calculations do not provide arbitrary-precision multivariate tails. Positive conditioning can lose a correction when separately returned component logs have already rounded to the same enormous magnitude, for example a Normal mean of -1e100 conditioned above zero.
Fast contracts cover the full-$K$ public boundary,
The mixture verification report separates the independent scikit-learn two-Normal mixture optimum from the retained six generation/recovery cells. A production-path comparison can protect a representation contract, but it is not an independent optimum oracle. The external comparison uses the same observations, orders components by mean, reconciles all physical weights and scales, and checks the common likelihood as well as the fitted result.
Bayesian recovery assesses identified component parameters and weights under the declared sample and prior settings, with central 95% posterior inclusion and explicit R-hat/ESS gates. Label switching and poorly separated components remain limitations: a smooth fitted mixture density can coexist with weakly identified component parameters. The evidence does not justify interpreting every fitted component as a distinct physical flood mechanism.
| Concern | Implementation |
|---|---|
| Full-$K$ model, likelihood, prior, EM output, and project-model contract | Models/UnivariateDistribution/MixtureModel.cs |
| Identified sampler initialization and physical reconstruction | Analyses/Univariate/MixtureAnalysis.cs |
| Sampled-coordinate result storage and diagnostics | Estimation/BayesianAnalysis.cs and Diagnostics/ |
| Physical parameter-set display | RMC.BestFit.App/GUI/Support/Controls/ParameterSetsControl.xaml.cs |
| Physical simplex and hurdle distribution | sibling Numerics/Distributions/Univariate/Mixture.cs |
| Fast regressions | RMC.BestFit.Tests/Univariate/MixtureLikelihoodContractTests.cs |
| Generation, recovery parity, and Bayesian recovery | RMC.BestFit.Verification/Univariate/MixtureTests/MixtureRecoveryTests.cs |
[1] G. McLachlan and D. Peel, Finite Mixture Models. New York, NY, USA: Wiley, 2000.
[2] A. P. Dempster, N. M. Laird, and D. B. Rubin, “Maximum likelihood from incomplete data via the EM algorithm,” Journal of the Royal Statistical Society: Series B, vol. 39, no. 1, pp. 1–38, 1977.
Previous: Univariate Distributions | Technical Reference | Next: Competing Risks