Clustering, density estimation, and anomaly detection · Mixture and density models · UCL044 · Model
Poisson mixture model
Model latent subpopulations of count observations, such as activity levels or event rates, without pretending counts are continuous Gaussian measurements.
In CodeSplash
A CodeSplash method runs this entry in Python and R. Set it up from the method's page.
- Count and direction mixtures Verified in Python and R
Do it in CodeSplash Run it on your own data, in Python or R.
- Availability
- Runs in CodeSplash
- Code example
- Component demo, not a trained model
- Who ran it
- CodeSplash's run and the reference's record
- CodeSplash's run
- Verified in Python and R through discover.mixture. The reference's example ran in Python and R here, and they agree.
- The reference's record
- Python: Ran in the reference's review. The report doesn't record which version of the code ran. R: Reviewed but not run: R wasn't available to the reference's authors.
Purpose
Model latent subpopulations of count observations, such as activity levels or event rates, without pretending counts are continuous Gaussian measurements.
Question / hypotheses
Which probability model adequately explains the reference distribution and its latent heterogeneity? This entry defines an estimation or optimization objective, not an intrinsic null/alternative hypothesis test.
Architecture / computational structure
A weighted sum of Poisson mass functions, optionally with independent count coordinates.
Assumptions
Within each component a Poisson distribution equates mean and variance; mixtures can add marginal overdispersion, but zero inflation or within-component dependence may still require other models. Very similar rates produce poorly identified components.
Formula / computational definition
For one count, . Multivariate product-Poisson components use separate rates and conditional independence across features. EM updates a rate using responsibility-weighted counts; known exposure requires an offset so rates remain comparable.
Parameters and notation
Learned or fitted quantities: Mixture proportions, rates, and posterior memberships. User-set hyperparameters/design choices: Choose component count, exposure treatment, regularization, and initialization. Tune these against the stated objective and stability/validation criteria; do not select settings on the final evaluation set.
Fitting, fine-tuning, and adaptation
Refit likelihood or posterior parameters on the new reference population; neural fine-tuning does not apply to this classical model. Warm starts can reduce computation but should be compared with fresh initialization. Recheck predictive fit and regularization after a domain shift.
How to use and calibrate
Check count histograms, zeros, tails, held-out log probability, and posterior predictive mean–variance relationships. Compare population rates on a common exposure scale and inspect class uncertainty.
Example application
Group event-count populations with different rates under a common exposure definition. Define the reference population, measurement units, and success criterion before fitting; investigate whether discovered groups or alerts reflect the intended phenomenon.
Interpretation / pitfalls
Watch out
The reported result is conditional on the representation and objective. A stable partition can reflect nuisance structure such as batch, collection site, or missingness. Confirm the interpretation in original variables and an independent sample.
Python and R code examples
R flexmix documents FLXMCmvpois for Poisson clustering. Python can implement EM with SciPy Poisson log probabilities and stable responsibility normalization. A Poisson regression mixture is an extension involving covariates, not interchangeable with intercept-only count clustering.
Component: Poisson mixture probability and posterior assignment. Python: executed successfully; R: not executed (Rscript unavailable). These small fixtures establish the arithmetic operation, not full-method accuracy or reproduction of paper results.
Python and R
The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.
Component demo, not a trained model — Poisson mixture probability and posterior assignment. · needs numpy, scipy
import numpy as np
from scipy.stats import poisson
x=3; rate=np.array([1.,5.]); pi=np.array([.4,.6]); w=pi*poisson.pmf(x,rate)
result=np.r_[w.sum(),w/w.sum()]
print(result)
Component demo, not a trained model — Poisson mixture probability and posterior assignment.
x=3; rate=c(1,5); pi=c(.4,.6); w=pi*dpois(x,rate)
result=c(probability=sum(w),w/sum(w))
print(result)
Sources
- Source 1cran.r-project.org
- Source 2cran.r-universe.dev
From the CodeSplash reference, entry UCL044.