Learn R Programming

nett

nett is an R package for the analysis of network data with a focus on community detection and implements multiple methods for hypothesis testing. It includes model selection and goodness-of-fit tests of SBM/DCSBM to network data, which are useful in network statistical analysis. Some of the implemented functionality are follows:

  • Spectral clustering with regularization
  • Conditional pseudo-likelihood for community detection (Amini, Chen, Bickel and Levina).
  • Spectral goodness-of-test for SBM and DCSBM (inspired by Bickel and Sarkar, and Lei's work).
  • Likelihood ratio tests and BIC selection for SBM and DCSBM (inspired by Wang and Bickel's work among others.)
  • Likelihood computations for SBM and DCSBM.
  • Network Adjusted Chi-square test for SBM and DCSBM (Zhang and Amini).
  • Bethe-Hessian Selection for DCSBM (inspired by Le and Levina's work).
  • ...

Most of the computations haven been adapted to Poisson models to make them fast and scalable.

Check out the articles for some examples of how to use the package.

Installation

To install, you can use the following command

Related repo

See the related repo linfanz/nac-test, for some experiments comparing goodness-of-fit and model selection approaches.

Copy Link

Version

Install

install.packages('nett')

Monthly Downloads

215

Version

1.0.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Arash A. Amini

Last Published

November 9th, 2022

Functions in nett (1.0.0)

adj_spec_test

Adjusted spectral test
bethe_hessian_select

Beth-Hessian model selection
eval_dcsbm_loglr

Log-likelihood ratio of two DCSBMs (fast with poi = TRUE)
label_vec2mat

Convert label vector to matrix
get_dcsbm_exav_deg

Calculate the expected average degree of a DCSBM
extract_largest_cc

Extract largest component
%>%

Pipe operator
plot_deg_dist

Plot degree distribution
plot_net

Plot a network
sample_dclvm

Sample from a DCLVM
sample_dcpp

Sample from a DCPP
nac_test

NAC test
spec_repr

Spectral Representation
label_mat2vec

Convert label matrix to vector
plot_roc

Plot ROC curves
rsymperm

Generate random symmetric permutation matrix
sample_dcer

Sample from a DCER
eval_dcsbm_bic

Compute BIC score
compute_mutual_info

Compute normalized mutual information (NMI)
snac_resample

Resampled SNAC+
snac_select

Estimate community number with SNAC+
spec_clust

Spectral clustering (fast)
polblogs

Political blogs network
estim_dcsbm

Estimate model parameters of a DCSBM
snac_test

SNAC test
eval_dcsbm_like

Log likelihood of a DCSBM (fast with poi = TRUE)
extract_low_deg_comp

Extract low-degree component
simulate_roc

Simulate data to estimate ROC curves
fast_cpl

CPL algorithm for community detection (fast)
plot_smooth_profile

Plot community profiles
sinkhorn_knopp

Sinkhorn--Knopp matrix scaling
fast_sbm

Sample from a SBM (fast)
gen_rand_conn

Generate randomly permuted connectivity matrix
pp_conn

Generate planted partition (PP) connectivity matrix
printf

The usual "printf" function
sample_dcsbm

Sample from a DCSBM
sample_tdcsbm

Sample truncated DCSBM (fast)
compute_block_sums

Block sum of an adjacency matrix
compute_confusion_matrix

Compute confusion matrix