Learn R Programming

NPflow

Overview

NPflow is a package for performing Bayesian estimation of Dirichlet process mixtures of multivariate skew $t$-distributions. It is especially oriented towards flow-cytometry data preprocessing applications, but can be useful for numerous other applications.

The main function of the package is DPMpost().

The method implemented in this package is detailed in the following article:

Hejblum BP, Alkhassim C, Gottardo R, Caron F and Thiebaut R (2019). Sequential Dirichlet Process Mixtures of Multivariate Skew t-distributions for Model-based Clustering of Flow Cytometry Data. The Annals of Applied Statistics, 13(1):638-660. <doi: 10.1214/18-AOAS1209> <arXiv: 1702.04407>

Installation

The easiest way to get NPflow is to install it from CRAN:

install.packages("NPflow")

Or to get the development version from GitHub:

#install.packages("devtools")
devtools::install_github("sistm/NPflow", ref="CRANrelease")

– Boris Hejblum

Copy Link

Version

Install

install.packages('NPflow')

Monthly Downloads

365

Version

0.13.6

License

LGPL-3 | file LICENSE

Maintainer

Boris P. Hejblum

Last Published

August 20th, 2025

Functions in NPflow (0.13.6)

DPMGibbsSkewT_SeqPrior_parallel

Slice Sampling of Dirichlet Process Mixture of skew Student's t-distributions
DPMGibbsSkewT_SeqPrior

Slice Sampling of Dirichlet Process Mixture of skew Student's t-distributions
DPMGibbsSkewT_parallel

Slice Sampling of Dirichlet Process Mixture of skew Student's t-distributions
DPMpost

Posterior estimation for Dirichlet process mixture of multivariate (potentially skew) distributions models
DPMGibbsN_SeqPrior

Slice Sampling of Dirichlet Process Mixture of Gaussian distributions
DPMGibbsSkewT

Slice Sampling of Dirichlet Process Mixture of skew Student's t-distributions
DPMGibbsN

Slice Sampling of the Dirichlet Process Mixture Model with a prior on alpha
DPMGibbsN_parallel

Slice Sampling of the Dirichlet Process Mixture Model with a prior on alpha
DPMGibbsSkewN_parallel

Parallel Implementation of Slice Sampling of Dirichlet Process Mixture of skew normal distributions
DPMGibbsSkewN

Slice Sampling of Dirichlet Process Mixture of skew normal distributions
MLE_NiW_mmEM

EM MLE for mixture of NiW
NPflow-package

Bayesian Nonparametrics for Automatic Gating of Flow Cytometry data
MAP_sNiW_mmEM

EM MAP for mixture of sNiW
FmeasureC

C++ implementation of the F-measure computation
MLE_sNiW

MLE for sNiW distributed observations
MLE_gamma

MLE for Gamma distribution
Fmeasure_costC

Multiple cost computations with the F-measure as the loss function
MLE_sNiW_mmEM

EM MLE for mixture of sNiW
Flimited

Compute a limited F-measure
FmeasureC_no0

C++ implementation of the F-measure computation without the reference class 0
cluster_est_pear

Gets a point estimate of the partition using posterior expected adjusted Rand index (PEAR)
cluster_est_Fmeasure

Point estimate of the partition using the F-measure as the cost function.
cluster_est_binder

Point estimate of the partition for the Binder loss function
evalClustLoss

ELoss of a partition point estimate compared to a gold standard
cytoScatter

Scatterplot of flow cytometry data
NuMatParC

C++ implementation of similarity matrix computation using pre-computed distances
burn.DPMMclust

Burning MCMC iterations from a Dirichlet Process Mixture Model.
cluster_est_Mbinder_norm

Point estimate of the partition using a modified Binder loss function
mmNiWpdfC

C++ implementation of multivariate Normal inverse Wishart probability density function for multiple inputs
mmsNiWlogpdf

Probability density function of multiple structured Normal inverse Wishart
print.summaryDPMMclust

Methods for a summary of a DPMMclust object
mmvstpdfC

C++ implementation of multivariate Normal probability density function for multiple inputs
mmvsnpdfC

C++ implementation of multivariate skew Normal probability density function for multiple inputs
mmNiWpdf

multivariate Normal inverse Wishart probability density function for multiple inputs
mmsNiWpdfC

C++ implementation of multivariate structured Normal inverse Wishart probability density function for multiple inputs
mmvnpdfC

C++ implementation of multivariate Normal probability density function for multiple inputs
mmvtpdfC

C++ implementation of multivariate Normal probability density function for multiple inputs
mvnlikC

C++ implementation of multivariate Normal probability density function for multiple inputs
plot_DPM

Plot of a Dirichlet process mixture of gaussian distribution partition
invwishrnd

Sample from a inverse-Wishart distribution
lgamma_mv

Multivariate log gamma function
mvnpdf

multivariate-Normal probability density function
plot_DPMsn

Plot of a Dirichlet process mixture of skew normal distribution partition
mvtpdf

multivariate Student's t-distribution probability density function
plot_ConvDPM

Convergence diagnostic plots
similarityMat

Computes the co-clustering (or similarity) matrix
similarityMatC

C++ implementation
rNiW

Sample from a Normal inverse-Wishart distribution whose parameter are given by the structure hyper
mvnpdfC

C++ implementation of multivariate normal probability density function for multiple inputs
priormix

Construction of an Empirical based prior
rCRP

Generating cluster data from the Chinese Restaurant Process
rNNiW

Sample from a normal inverse Wishart distribution whose parameter are given by the structure SufStat
plot_DPMst

Plot of a Dirichlet process mixture of skew t-distribution partition
mvsnpdf

multivariate Skew-Normal probability density function
mvsnlikC

C++ implementation of multivariate skew normal likelihood function for multiple inputs
postProcess.DPMMclust

Post-processing Dirichlet Process Mixture Models results to get a mixture distribution of the posterior locations
mvstpdf

multivariate skew-t probability density function
mvstlikC

C++ implementation of multivariate skew t likelihood function for multiple inputs
summary.DPMMclust

Summarizing Dirichlet Process Mixture Models
sample_alpha

Sampler for the concentration parameter of a Dirichlet process
similarityMat_nocostC

C++ implementation
sampleClassC

C++ implementation of the multinomial sampling from a matrix of column vectors, each containing the sampling probabilities for their respective draw
wishrnd

Sample from a Wishart distribution
vclust2mcoclustC

C++ implementation
traceEpsC

C++ implementation of residual trace computation step used when sampling the scale
update_SS

Return updated sufficient statistics S with new data matrix z
update_SSst

Return updated sufficient statistics S for skew t-distribution with data matrix z
update_SSsn

Return updated sufficient statistics S with new data matrix z