The Poisson lognormal model and variants (Chiquet et al. 2021) can be used for a variety of multivariate problems when count data are at play. This package implements efficient variational algorithms to fit such models, accompanied with a set of functions for visualization and diagnostic. See all the dedicated vignettes for a comprehensive introduction.
PLNmodels covers the following models, all built around the multivariate Poisson-lognormal distribution and sharing a common formula-based interface (covariates, offsets, weights) and a choice of optimization backends (a fast built-in Newton solver, NLOPT, and an experimental torch backend):
- PLN (Aitchison and Ho 1989): unpenalized multivariate Poisson regression, with several covariance structures (full, diagonal, spherical, fixed, or a genetic/heritability structure).
- PLNPCA (Chiquet et al. 2018): probabilistic Poisson PCA — a rank-constrained covariance for dimension reduction and visualization.
- PLNLDA: Poisson lognormal discriminant analysis (Fisher 1936) for the supervised classification of count data.
- PLNnetwork (Chiquet et al. 2019): sparse inverse-covariance (network) inference via a graphical-lasso-like penalty (Friedman et al. 2008).
- PLNmixture: model-based clustering (Fraley and Raftery 1999) of count data via a mixture of PLN models.
- ZIPLN (Batardière et al. 2025): a zero-inflated
extension of PLN for data with excess zeros, with the same family of
covariance structures and an optional sparse (
ZIPLNnetwork) variant (Tous et al. 2025).
PLNmodels is available on CRAN. The development version is available on GitHub.
install.packages("PLNmodels") # last stable version, from CRAN
remotes::install_github("pln-team/PLNmodels") # development version, from GitHub
remotes::install_github("pln-team/PLNmodels@tag_number") # a specific tagged releaseWe illustrate the main models on the barents data set (Fossheim et
al. 2006): the abundance of 30 fish species observed
in 89 sites in the Barents sea, along with depth, temperature and
geographic coordinates for each site.
library(PLNmodels)This is package 'PLNmodels' version 1.3.0-9010
data(barents)
## a simple North/South split of the sites, used below to illustrate PLNLDA
barents$zone <- factor(ifelse(barents$Latitude > median(barents$Latitude), "North", "South"))myPLN <- PLN(Abundance ~ Depth + Temperature + offset(log(Offset)), data = barents) Initialization...
Adjusting a full covariance PLN model with nlopt optimizer
Post-treatments...
DONE!
myPLNA multivariate Poisson Lognormal fit with full covariance model.
==================================================================
nb_param loglik BIC AIC ICL
555 -4412.385 -5657.981 -4967.385 -8194.015
==================================================================
* Useful fields
$model_par, $latent, $latent_pos, $var_par, $optim_par
$loglik, $BIC, $ICL, $loglik_vec, $nb_param, $criteria
* Useful S3 methods
print(), coef(), sigma(), vcov(), fitted()
predict(), predict_cond(), standard_error()
corrplot::corrplot(cov2cor(sigma(myPLN)), order = "AOE", type = "upper", tl.cex = 0.6)myLDA <- PLNLDA(Abundance ~ offset(log(Offset)), grouping = zone, data = barents) Performing discriminant Analysis...
DONE!
plot(myLDA)myPCAs <- PLNPCA(Abundance ~ Depth + Temperature + offset(log(Offset)), data = barents, ranks = 1:5) Initialization...
Adjusting 5 PLN models for PCA analysis.
Rank approximation = 1
Rank approximation = 2
Rank approximation = 3
Rank approximation = 4
Rank approximation = 5
Post-treatments
DONE!
myPCA <- getBestModel(myPCAs)
factoextra::fviz_pca_biplot(
myPCA, select.var = list(contrib = 10), col.ind = barents$Temperature,
title = "Biplot (10 most contributing species, sites colored by temperature)"
) + ggplot2::labs(col = "Temperature") + ggplot2::scale_color_viridis_c()myNets <- PLNnetwork(Abundance ~ Depth + Temperature + offset(log(Offset)), data = barents) Initialization...
Adjusting 30 PLN with sparse inverse covariance estimation
Joint optimization alternating gradient descent and graphical-lasso
sparsifying penalty = 3.77829
sparsifying penalty = 3.489896
sparsifying penalty = 3.223515
sparsifying penalty = 2.977467
sparsifying penalty = 2.7502
sparsifying penalty = 2.540279
sparsifying penalty = 2.346382
sparsifying penalty = 2.167285
sparsifying penalty = 2.001858
sparsifying penalty = 1.849058
sparsifying penalty = 1.707921
sparsifying penalty = 1.577557
sparsifying penalty = 1.457143
sparsifying penalty = 1.345921
sparsifying penalty = 1.243188
sparsifying penalty = 1.148296
sparsifying penalty = 1.060648
sparsifying penalty = 0.9796893
sparsifying penalty = 0.9049105
sparsifying penalty = 0.8358394
sparsifying penalty = 0.7720405
sparsifying penalty = 0.7131113
sparsifying penalty = 0.6586802
sparsifying penalty = 0.6084037
sparsifying penalty = 0.5619647
sparsifying penalty = 0.5190704
sparsifying penalty = 0.4794502
sparsifying penalty = 0.4428542
sparsifying penalty = 0.4090515
sparsifying penalty = 0.377829
Post-treatments
DONE!
plot(getBestModel(myNets), remove.isolated = TRUE)my_mixtures <- PLNmixture(Abundance ~ offset(log(Offset)), data = barents, clusters = 1:4,
control = PLNmixture_param(smoothing = "none")) Initialization...
Adjusting 4 PLN mixture models.
number of cluster = 1
number of cluster = 2
number of cluster = 3
number of cluster = 4
Post-treatments
DONE!
myMixture <- getBestModel(my_mixtures)
plot(myMixture, "pca", main = "Clustering membership in the individual factor map")table(cluster = myMixture$memberships, zone = barents$zone) zone
cluster North South
1 11 0
2 11 22
3 1 17
4 21 6
Aitchison, J., and C. H. Ho. 1989. “The Multivariate Poisson-Log Normal Distribution.” Biometrika 76 (4): 643–53.
Batardière, Bastien, Julien Chiquet, François Gindraud, and Mahendra Mariadassou. 2025. “Zero-Inflation in the Multivariate Poisson Lognormal Family.” Statistics and Computing 35. https://doi.org/10.1007/s11222-025-10729-0.
Chiquet, Julien, Mahendra Mariadassou, and Stéphane Robin. 2018. “Variational Inference for Probabilistic Poisson PCA.” The Annals of Applied Statistics 12: 2674–98.
Chiquet, Julien, Mahendra Mariadassou, and Stéphane Robin. 2021. “The Poisson-Lognormal Model as a Versatile Framework for the Joint Analysis of Species Abundances.” Frontiers in Ecology and Evolution 9 (March): 588292. https://doi.org/10.3389/fevo.2021.588292.
Chiquet, Julien, Stephane Robin, and Mahendra Mariadassou. 2019. “Variational Inference for Sparse Network Reconstruction from Count Data.” In Proceedings of the 36th International Conference on Machine Learning, edited by Kamalika Chaudhuri and Ruslan Salakhutdinov, vol. 97. Proceedings of Machine Learning Research. PMLR. http://proceedings.mlr.press/v97/chiquet19a.html.
Fisher, R. A. 1936. “The Use of Multiple Measurements in Taxonomic Problems.” Annals of Eugenics 7 (2): 179–88. https://doi.org/10.1111/j.1469-1809.1936.tb02137.x.
Fossheim, Maria, Einar M. Nilssen, and Michaela Aschan. 2006. “Fish Assemblages in the Barents Sea.” Marine Biology Research 2 (4): 260–69. https://doi.org/10.1080/17451000600815698.
Fraley, Chris, and Adrian E. Raftery. 1999. “MCLUST: Software for Model-Based Cluster Analysis.” Journal of Classification 16 (2): 297–306. https://doi.org/10.1007/s003579900058.
Friedman, J., T. Hastie, and R. Tibshirani. 2008. “Sparse Inverse Covariance Estimation with the Graphical Lasso.” Biostatistics 9 (3): 432–41.
Tous, Jeanne, Julien Chiquet, Amy E. Deacon, Ada Fontrodona-Eslava, Douglas F. Fraser, and Anne E. Magurran. 2025. “A JSDM with Zero-Inflation to Improve Inference of Association Networks from Count Community Data with Structural Zeros.” https://doi.org/10.1101/2025.07.24.666553.




