Sparse structure estimation for multivariate count data with PLN-network

PLN team

2020-01-14

Preliminaries

This vignette illustrates the basical use of the PLNnetwork function and the methods accompaning the R6 Classes PLNnetworkfamily and PLNnetworkfit.

Requirements

The packages required for the analysis are PLNmodels plus some others for data manipulation and representation:

Data set

We illustrate our point with the trichoptera data set, a full description of which can be found in the corresponding vignette. Data preparation is also detailed in the specific vignette.

The trichoptera data frame stores a matrix of counts (trichoptera$Abundance), a matrix of offsets (trichoptera$Offset) and some vectors of covariates (trichoptera$Wind, trichoptera$Temperature, etc.)

Mathematical background

The network model for multivariate count data that we introduce in Chiquet, Robin, and Mariadassou (2019) is a variant of the Poisson Lognormal model of Aitchison and Ho (1989), see the PLN vignette as a reminder. Compare to the standard PLN model we add a sparsity constraint on the inverse covariance matrix \({\boldsymbol\Sigma}^{-1}\triangleq \boldsymbol\Omega\) by means of the \(\ell_1\)-norm, such that \(\|\boldsymbol\Omega\|_1 < c\). PLN-network is the equivalent of the sparse multivariate Gaussian model (Banerjee, Ghaoui, and d’Aspremont 2008) in the PLN framework. It relates some \(p\)-dimensional observation vectors \(\mathbf{Y}_i\) to some \(p\)-dimensional vectors of Gaussian latent variables \(\mathbf{Z}_i\) as follows \[\begin{equation} \begin{array}{rcl} \text{latent space } & \mathbf{Z}_i \sim \mathcal{N}\left({\boldsymbol\mu},\boldsymbol\Omega^{-1}\right) & \|\boldsymbol\Omega\|_1 < c \\ \text{observation space } & Y_{ij} | Z_{ij} \quad \text{indep.} & Y_{ij} | Z_{ij} \sim \mathcal{P}\left(\exp\{Z_{ij}\}\right) \end{array} \end{equation}\]

The parameter \({\boldsymbol\mu}\) corresponds to the main effects and the latent covariance matrix \(\boldsymbol\Sigma\) describes the underlying structure of dependence between the \(p\) variables.

The \(\ell_1\)-penalty on \(\boldsymbol\Omega\) induces sparsity and selection of important direct relationships between entities. Hence, the support of \(\boldsymbol\Omega\) correspond to a network of underlying interactions. The sparsity level (\(c\) in the above mathematical model), which corresponds to the number of edges in the network, is controlled by a penalty parameter in the optimization process sometimes referred to as \(\lambda\). All mathematical details can be found in Chiquet, Robin, and Mariadassou (2019).

Covariates and offsets

Just like PLN, PLN-network generalizes to a formulation close to a multivariate generalized linear model where the main effect is due to a linear combination of \(d\) covariates \(\mathbf{x}_i\) and to a vector \(\mathbf{o}_i\) of \(p\) offsets in sample \(i\). The latent layer then reads \[\begin{equation} \mathbf{Z}_i \sim \mathcal{N}\left({\mathbf{o}_i + \mathbf{x}_i^\top\boldsymbol\Theta},\boldsymbol\Omega^{-1}\right), \qquad \|\boldsymbol\Omega\|_1 < c , \end{equation}\] where \(\boldsymbol\Theta\) is a \(d\times p\) matrix of regression parameters.

Alternating optimization

Regularization via sparsification of \(\boldsymbol\Omega\) and vizualization of the consecutive network is the main objective in PLN-network. To reach this goal, we need to first estimate the model parameters. Inference in PLN-network focuses on the regression parameters \(\boldsymbol\Theta\) and the inverse covariance \(\boldsymbol\Omega\). Technically speaking, we adopt a variational strategy to approximate the \(\ell_1\)-penalized log-likelihood function and optimize the consecutive sparse variational surrogate with an optimization scheme that alternates between two step

  1. a gradient-ascent-step, performed with the CCSA algorithm of Svanberg (2002) implemented in the C++ library (Johnson 2011), which we link to the package.
  2. a penalized log-likelihood step, performed with the graphical-Lasso of Friedman, Hastie, and Tibshirani (2008), implemented in the package fastglasso (Sustik and Calderhead 2012).

More technical details can be found in Chiquet, Robin, and Mariadassou (2019)

Analysis of trichoptera data with a PLNnetwork model

In the package, the sparse PLN-network model is adjusted with the function PLNnetwork, which we review in this section. This function adjusts the model for a series of value of the penalty parameter controling the number of edges in the network. It then provides a collection of objects with class PLNnetworkfit, corresponding to networks with different levels of density, all stored in an object with class PLNnetworkfamily.

Adjusting a collection of network - a.k.a. a regularization path

PLNnetwork finds an hopefully appropriate set of penalties on its own. This set can be controlled by the user, but use it with care and check details in ?PLNnetwork. The collection of models is fitted as follows:

## 
##  Initialization...
##  Adjusting 30 PLN with sparse inverse covariance estimation
##  Joint optimization alternating gradient descent and graphical-lasso
##  sparsifying penalty = 3.632497 
    sparsifying penalty = 3.355232 
    sparsifying penalty = 3.09913 
    sparsifying penalty = 2.862576 
    sparsifying penalty = 2.644078 
    sparsifying penalty = 2.442258 
    sparsifying penalty = 2.255842 
    sparsifying penalty = 2.083656 
    sparsifying penalty = 1.924612 
    sparsifying penalty = 1.777708 
    sparsifying penalty = 1.642017 
    sparsifying penalty = 1.516684 
    sparsifying penalty = 1.400916 
    sparsifying penalty = 1.293986 
    sparsifying penalty = 1.195217 
    sparsifying penalty = 1.103987 
    sparsifying penalty = 1.019721 
    sparsifying penalty = 0.9418862 
    sparsifying penalty = 0.8699928 
    sparsifying penalty = 0.803587 
    sparsifying penalty = 0.7422499 
    sparsifying penalty = 0.6855946 
    sparsifying penalty = 0.6332638 
    sparsifying penalty = 0.5849273 
    sparsifying penalty = 0.5402803 
    sparsifying penalty = 0.4990411 
    sparsifying penalty = 0.4609498 
    sparsifying penalty = 0.4257659 
    sparsifying penalty = 0.3932675 
    sparsifying penalty = 0.3632497 
##  Post-treatments
##  DONE!

Note the use of the formula object to specify the model, similar to the one used in the function PLN.

Structure of PLNnetworkfamily

The network_models variable is an R6 object with class PLNnetworkfamily, which comes with a couple of methods. The most basic is the show/print method, which sends a very basic summary of the estimation process:

## --------------------------------------------------------
## COLLECTION OF 30 POISSON LOGNORMAL MODELS
## --------------------------------------------------------
##  Task: Network Inference 
## ========================================================
##  - 30 penalties considered: from 0.3632497 to 3.632497 
##  - Best model (greater BIC): lambda = 0.87 
##  - Best model (greater EBIC): lambda = 0.87

One can also easily access the successive values of the criteria in the collection

param nb_param loglik BIC ICL R_squared n_edges EBIC pen_loglik density stability
3.632497 17 -1275.896 -1308.977 -2594.376 0.9638801 0 -1308.977 -1284.436 0 NA
3.355232 17 -1267.262 -1300.342 -2585.740 0.9638809 0 -1300.342 -1275.488 0 NA
3.099130 17 -1259.192 -1292.272 -2577.668 0.9638817 0 -1292.272 -1267.107 0 NA
2.862576 17 -1251.662 -1284.742 -2570.136 0.9638827 0 -1284.742 -1259.268 0 NA
2.644078 17 -1244.643 -1277.723 -2563.109 0.9638860 0 -1277.723 -1251.943 0 NA
2.442258 17 -1238.110 -1271.191 -2556.567 0.9638917 0 -1271.191 -1245.110 0 NA

A diagnostic of the optimization process is available via the convergence field:

param nb_param objective convergence outer_iterations inner_iterations inner_status inner_message
3.632497 17 1284.43581962249 2.87671791151721e-06 4 12 4 xtol_rel or xtol_abs was reached
3.355232 17 1275.4879352439 5.03958783058726e-07 2 9 4 xtol_rel or xtol_abs was reached
3.099130 17 1267.10661802273 5.5119185311077e-07 2 9 4 xtol_rel or xtol_abs was reached
2.862576 17 1259.26765218451 6.56685963540542e-07 2 9 4 xtol_rel or xtol_abs was reached
2.644078 17 1251.9430805361 2.42885387182528e-07 2 9 4 xtol_rel or xtol_abs was reached
2.442258 17 1245.10961969972 2.36746807559169e-07 2 8 4 xtol_rel or xtol_abs was reached

An nicer view of this output comes with the option “diagnostic” in the plot method:

Exploring the path of networks

By default, the plot method of PLNnetworkfamily displays evolution of the criteria mentioned above, and is a good starting point for model selection:

In this case, the variational lower bound of the log-likelihood is hopefully strictly increasing with a lower level of penalty (meaning more edges in the network). The same holds true for the penalized counterpart of the variational surrogate. Generally, smoothness of these criteria is a good sanity check of optimization process. BIC and its extended-version high-dimensional version EBIC are classically used for selecting the correct amount of penalization with sparse estimator like the one used by PLN-network. However, we will consider later a more robust albeit more computationally intensive strategy to chose the appropriate number of edges in the network.

To pursue the analysis, we can represent the coefficient path (i.e., value of the edges in the network according to the penalty level) to see if some edges clearly come off. An alternative and more intuitive view consists in plotting the values of the partial correlations along the path, which can be obtained with the options . To this end, we provide the S3 function coefficient_path:

Model selection issue: choosing a network

To select a network with a specific level of penalty, one uses the getModel(lambda) S3 method. We can also extract the best model according to the BIC or EBIC with the method getBestModel().

An alternative strategy is to use StARS (Liu, Roeder, and Wasserman 2010), which performs resampling to evaluate the robustness of the network along the path of solutions in a similar fashion as the stability selection approach of Meinshausen and Bühlmann (2010), but in a network inference context.

## 
## Stability Selection for PLNnetwork: 
## subsampling: ++++++++++++++++++++

When “StARS” is requested for the first time, getBestModel automatically calls the method stability_selection with the default parameters. After the first call, the stability path is available from the plot function:

Structure of a PLNnetworkfit

The variables model_BIC, model_StARS and model_pen are other R6Class objects with class PLNnetworkfit. They all inherits from the class PLNfit and thus own all its methods, with a couple of specific one, mostly for network vizualization purposes. Most fields and methods are recalled when such an object is printed:

## Poisson Lognormal with sparse inverse covariance (penalty = 0.686)
## ==================================================================
##  nb_param    loglik      BIC       ICL R_squared n_edges      EBIC pen_loglik
##        23 -1176.654 -1221.41 -2506.716     0.964       6 -1230.773  -1179.898
##  density
##    0.042
## ==================================================================
## * Useful fields
##     $model_par, $latent, $var_par, $optim_par
##     $loglik, $BIC, $ICL, $loglik_vec, $nb_param, $criteria
## * Useful S3 methods
##     print(), coef(), sigma(), vcov(), fitted(), predict(), standard_error()
## * Additional fields for sparse network
##     $EBIC, $density, $penalty 
## * Additional S3 methods for network
##     plot.PLNnetworkfit()

The plot method provides a quick representation of the inferred network, with various options (either as a matrix, a graph, and always send back de plotted object invisibly if users needs to perform additional analyses).

## IGRAPH 6efe0da UNW- 17 6 -- 
## + attr: name (v/c), label (v/c), label.cex (v/n), size (v/n),
## | label.color (v/c), frame.color (v/l), weight (e/n), color (e/c),
## | width (e/n)
## + edges from 6efe0da (vertex names):
## [1] Hym--Hsp Aga--Hsp Set--All Set--Hsp Han--Sta Hfo--Hsp

We can finally check that the fitted value of the counts – even with sparse regularization of the covariance matrix – are close to the observed ones:

fitted value vs. observation

fitted value vs. observation

References

Aitchison, J., and C.H. Ho. 1989. “The Multivariate Poisson-Log Normal Distribution.” Biometrika 76 (4). Oxford University Press: 643–53.

Banerjee, Onureena, Laurent El Ghaoui, and Alexandre d’Aspremont. 2008. “Model Selection Through Sparse Maximum Likelihood Estimation for Multivariate Gaussian or Binary Data.” Journal of Machine Learning Research 9 (Mar): 485–516.

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, 97:1162–71. Proceedings of Machine Learning Research. Long Beach, California, USA: PMLR. http://proceedings.mlr.press/v97/chiquet19a.html.

Friedman, J., T. Hastie, and R. Tibshirani. 2008. “Sparse Inverse Covariance Estimation with the Graphical Lasso.” Biostatistics 9 (3). Biometrika Trust: 432–41.

Johnson, Steven G. 2011. The Nlopt Nonlinear-Optimization Package. http://ab-initio.mit.edu/nlopt.

Liu, Han, Kathryn Roeder, and Larry Wasserman. 2010. “Stability Approach to Regularization Selection (Stars) for High Dimensional Graphical Models.” In Proceedings of the 23rd International Conference on Neural Information Processing Systems - Volume 2, 1432–40. USA.

Meinshausen, Nicolai, and Peter Bühlmann. 2010. “Stability Selection.” Journal of the Royal Statistical Society: Series B (Statistical Methodology) 72 (4). Wiley Online Library: 417–73.

Sustik, Mátyás A, and Ben Calderhead. 2012. “GLASSOFAST: An Efficient Glasso Implementation.” UTCS Technical Report TR-12-29 2012. University of Texas at Austin Austin.

Svanberg, Krister. 2002. “A Class of Globally Convergent Optimization Methods Based on Conservative Convex Separable Approximations.” SIAM Journal on Optimization 12 (2). SIAM: 555–73.