Learn R Programming

⚠️There's a newer version (1.1.0) of this package.Take me there.

Introduction

ghypernet is an OpenSource R package that allows to estimate and work with Generalised Hypergeometric Ensembles of Random Graphs (gHypEG).

ghypernet has been developed specifically for the analysis of large networks characterised by a large number of repeated edges. It provides efficient methods to perform hypothesis testing and model selection on such data.

The theoretical foundation of this paper, gHypEGs, was developed in the following works:

  1. Casiraghi, G., Nanumyan, V., Scholtes, I., Schweitzer, F. (2016) Generalized Hypergeometric Ensembles: Statistical Hypothesis Testing in Complex Networks. arXiv Prepr. arXiv1607.02441
  2. Casiraghi, G., Nanumyan, V., Scholtes, I., Schweitzer, F. (2017) From Relational Data to Graphs: Inferring Significant Links Using Generalized Hypergeometric Ensembles in Social Informatics. SocInfo 2017 111-120 (Springer Verlag, 2017). doi:10.1007/978-3-319-67256-4_11
  3. Casiraghi, G., Nanumyan, V. (2018) Generalised hypergeometric ensembles of random graphs: the configuration model as an urn problem. arXiv Prepr. arXiv1810.06495
  4. Casiraghi, G. (2018) Analytical Formulation of the Block-Constrained Configuration Model. arXiv Prepr. arXiv1811.05337

Dependencies

The package uses the library BiasedUrn to work with Wallenius' non-central hypergeometric distribution. Although this is not required, it is recommended to install the BiasedUrn R package, increasing the number of 'colors', i.e., the number of dimensions of the distribution. It can be easily done modifying the makevar file. In case the BiasedUrn library cannot be found, all computations will be performed using the multinomial approximation.

Installation

You can install this package directly from GitHub. In R, run the following commands to install the package:

install.packages('devtools')
devtools::install_github("gi0na/r-ghypernet")

library(ghypernet)

Acknowledgements

The research and development behind ghypernet is performed at the Chair of Systems Design, ETH Zürich.

Contributors

Giona Casiraghi (project lead)

Vahan Nanumyan

Laurence Brandenberger

Copyright

ghypernet is licensed under the GNU Affero General Public License.

(c) Copyright ETH Zürich, 2016-2020

Copy Link

Version

Install

install.packages('ghypernet')

Monthly Downloads

209

Version

1.0.0

License

AGPL-3

Maintainer

Giona Casiraghi

Last Published

May 20th, 2020

Functions in ghypernet (1.0.0)

RMSLE

Computes the Root Mean Squared Logged Error
adj2el

Maps adjacency matrix to edgelist
bccm

Fitting bccm models
as.ghype

Map list to ghype object
adj_karate

Zachary's Karate Club graph
coef.nrm

Extraction method for coefficients of models of class 'nrm'.
BootstrapProperty

BootstrapProperty computes igraph analytics function on ensemble
ghype

Fitting gHypEG models
conf.test

Test regular (gnp) vs configuration model
dtcommittee

Swiss MPs committee affiliation data frame.
JnBlock

Fisher Information matrix for estimators in block models.
RMSE

Computes the Root Mean Squared Error
contacts.adj

Highschool contact network adjacency matrix
checkGraphtype

Check graph input type (for whether it's a graph or a edgelist).
gof.test

Perform a goodness-of-fit test
highschool.multiplex

Highschool contact network multiplex representation
nrmChoose

Selects the best set of predictors among the given sets by means of AIC.
nrm_selection

Perform AIC forward selection for nrm.
highschool.predictors

Highschool contact network predictors
loglratio

Compute log-likelihood ratio for ghype models.
logl

General method to compute log-likelihood for ghype models.
el2adj

Maps edgelist to adjacency matrix
reciprocity_stat

Calculate weighted reciprocity change statistics for multi-edge graphs.
cospons_mat

Swiss MPs network adjacency matrix
mcfaddenR2

Computes Mc Fadden pseudo R-squared.
homophily_stat

Calculate homophily in multi-edge graphs.
residuals.nrm

Method to compute residuals of nrm models
mat2vec.ix

Auxiliary function, gives mask for matrix for directed, undirected etc.
lr.test

Perform likelihood ratio test between two ghype models.
ComputeXi

Auxiliary function. Computes combinatorial matrix.
isNetwork

Test null model vs full ghype.
coxsnellR2

Computes Cox and Snell pseudo R-squared for nrm models.
rghype

Generate random realisations from ghype model.
createPredictors

Create a nrmpredictor object from passed argument
regularm

Fit the gnm model
linkSignificance

Estimate statistical deviations from ghype model
summary.nrm_selection

Summary method for elements of class 'nrm_selection'.
nr.ci

Confidence intervals for nrm models.
summary.nrm

Summary method for elements of class 'nrm'.
logLik.ghype

Extract Log-Likelihood
nr.significance

Computes the significance of more complex model against a simpler model by means of a likelihood ratio test.
nrm

Fitting gHypEG regression models for multi-edge networks.
CreateIgGraphs

Convert a list of adjacency matrices to a list of igraph graphs.
FitOmega

Fit propensity matrix for full model
scm

Fit the Soft-Configuration Model
sharedPartner_stat

Calculate (un-)weighted shared partner change statistics for multi-edge graphs.
createPredictors.list

Create a nrmpredictor object from list
vec2mat

Auxiliary function, produces matrix from vector
dt

Swiss MPs attribute data frame.
predict.nrm

Method to predict the expected values of a nrm model
onlinesim_mat

Swiss MPs committee similarity matrix.
vertexlabels

Zachary's Karate Club vertex faction assignment