6.2. Connectome extraction: inverse covariance for direct connections#
6.2.1. Sparse inverse covariance for functional connectomes#
Functional connectivity can be obtained by estimating a covariance (or correlation) matrix for signals from different brain regions decomposed, for example on resting-state or naturalistic-stimuli datasets. The same information can be represented as a weighted graph, vertices being brain regions, weights on edges being covariances (gaussian graphical model). However, coefficients in a covariance matrix reflect direct as well as indirect connections. Covariance matrices form very dense brain connectomes, and it is rather difficult to extract from them only the direct connections between two regions.
As shown in [Smith 2011], [Varoquaux 2010], it is more interesting to use the inverse covariance matrix, ie the precision matrix. It gives only direct connections between regions, as it contains partial covariances, which are covariances between two regions conditioned on all the others.
To recover well the interaction structure, a sparse inverse covariance
estimator is necessary. The GraphicalLasso, implemented in scikit-learn’s
sklearn.covariance.GraphicalLassoCV is a good, simple
solution. To use it, you need to create an estimator object:
from sklearn.covariance import GraphicalLassoCV
estimator = GraphicalLassoCV()
And then you can fit it on the activation time series, for instance extracted in the previous section:
The covariance matrix and inverse-covariance matrix (precision matrix)
can be found respectively in the
of the estimator:
6.2.2. Sparse inverse covariance on multiple subjects#
To work at the level of a group of subject, it can be interesting to estimate multiple connectomes for each, with a similar structure but differing connection values across subjects.
For this, nilearn provides the
estimator. Its usage is similar to the GraphicalLassoCV object, but it takes
a list of time series:
estimator.fit([time_series_1, time_series_2, ...])
And it provides one estimated covariance and inverse-covariance (precision) matrix per time-series: for the first one:
One specific case where this may be interesting is for group analysis across multiple subjects. Indeed, one challenge when doing statistics on the coefficients of a connectivity matrix is that the number of coefficients to compare grows quickly with the number of regions, and as a result correcting for multiple comparisons takes a heavy toll on statistical power.
In such a situation, you can use the
alpha value a bit higher than the alpha value selected by
cross-validation in the
GroupSparseCovarianceCV. Such a choice
will enforce a stronger sparsity on the precision matrices for each
subject. As the sparsity is common to each subject, you can then do the
group analysis only on the non zero coefficients.
6.2.3. Comparing the different approaches on simulated data#
We simulate several sets of signals, one set representing one subject, with different precision matrices, but sharing a common sparsity pattern: 10 brain regions, for 20 subjects.
A single-subject estimation can be performed using the
sklearn.covariance.GraphicalLassoCV estimator from scikit-learn.
It is also possible to fit a graph lasso on data from every subject all together.
The results are the following:
The group-sparse estimation outputs matrices with the same sparsity pattern, but different values for the non-zero coefficients. This is not the case for the graph lasso output, which all have similar but different structures. Note that the graph lasso applied to all subjects at once gives a sparsity pattern close to that obtained with the group-sparse one, but cannot provide per-subject information.