Skip to content

dichio/bl-ERGM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ERGMs for Brain Networks

Source code for the app ERGMs for Brain Networks in Brainlife.io. This app estimates the parameters of an Exponential Random Graph Model (ERGM) on brain network data.

Authors

Basics

ERGM in a nutshell

Given a graph G and a set of sufficient statistics $\mathbf{x}(G)\in\mathbb{R}^m$ and a set of parameters $\mathbf{\theta}\in\mathbb{R}^m$, an ERGM assigns is specified by the following p.d.f.:

Screenshot 2021-11-20 at 12 50 53

the goal of an ERGM fit is to estimate the parameters $\mathbf{\theta}$, given an observed graph $G$. Current implementations are based on MCMC-MLE procedures, from which estimates can be drawn together with st.deviations. In addition, model assessment can be performed by simulating synthetic networks from the estimated model and resorting graphical Goodness of Fit (GoF) methods.

Implementation

The current app is based on the ergm package for R language [1]. We refer to the documentation for details on the estimation procedure; useful tutorials are provided by the statnet community e.g. here. For examples of applications to neuroscience, see for instance [2-3]. The default model implemented here is the one selected in [3].

Input/Output

Input

  • Network: The network can be either fully connected and weighted (unfiltered) or thresholded and binarized (filtered). The input brain network must be stored in the v2 JSON graph format. The edge objects contain information about the elements of connectivity (or adjacency) matrix, together with any other user-specified edge covariate. In the node objects it is possible to store nodal attributes. (NB: An example of R code to transform raw data into the v2JSON format is provided in dichio/bl-ERGM/RawTov2JSON/v2JSON-writer.R)
  • ERGM formula: String containing the ERGM formula according to the guidelines of the ergm package for R [1].
  • nsim_gof: Integer number of simulated networks used for Goodness of Fit (GoF) model assessment.
  • unfiltered: Boolean variable specifying if the input network is not thresholded and binarized. If this is the case (unfiltered=TRUE), the app applies the ECO filtering criterion ($k=3$) [4].

Output

  • estimation.txt: Result of the fitting procedure i.e. estimated parameters, st.errors, covariance matrix.
  • log-computation.txt
  • gof.pdf: Standard plots for the Goodness of Fit as implemented in the ergm package [1].
  • mcmc-diagnostic.pdf: sanity check for the MCMC procedure.

References

[1] Hunter, D. R. et al. (2008). ergm: A package to fit, simulate and diagnose exponential-family models for networks. Journal of statistical software, 24(3), nihpa54860.

[2] Simpson, S. L., Hayasaka, S., & Laurienti, P. J. (2011). Exponential random graph modeling for complex brain networks. PloS one, 6(5), e20039.

[3] Obando, C., & De Vico Fallani, F. (2017). A statistical model for brain networks inferred from large-scale electrophysiological signals. Journal of The Royal Society Interface, 14(128), 20160940.

[4] De Vico Fallani, F., Latora, V., & Chavez, M. (2017). A topological criterion for filtering information in complex brain networks. PLoS computational biology, 13(1), e1005305.

About

Source code for ERGM app in BrainLife.io

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors