MyNixOS website logo
Description

Inference for a Generalised SBM with a Split Merge Sampler.

Inference in a Bayesian framework for a generalised stochastic block model. The generalised stochastic block model (SBM) can capture group structure in network data without requiring conjugate priors on the edge-states. Two sampling methods are provided to perform inference on edge parameters and block structure: a split-merge Markov chain Monte Carlo algorithm and a Dirichlet process sampler. Green, Richardson (2001) <doi:10.1111/1467-9469.00242>; Neal (2000) <doi:10.1080/10618600.2000.10474879>; Ludkin (2019) <arXiv:1909.09421>.

SBMSplitMerge

SBMSplitMerge is an R package for performing inference on the number of blocks and the edge-state parameters in a Generalised Stochastic Block Model using a split-merge sampler. This allows for inference in non-conjugate edge-state models in a Bayesian framework.

This package accompanies the paper ArXiV https://arxiv.org/abs/1909.09421.

The git repository stores this package as well as the examples and data examples available on github: DOI

Getting the package

install.packages("SBMSplitMerge")

Model for the package

Suppose that you have network data in the form of counts of interaction between a set of $N$ animals. You think the animals may display group like behaviour, via their interactions such that individuals in the same group have a higher change of interacting. You also are unsure of the number of groups in the network.

Classic network modelling techniques are based on graphs where the interactions are binary. This is a major restriction. Some methods allow the practitioner to specify a distribution for the interactions, so long as it has a conjugate prior. A flexible model would allow the practitioner to place any distribution on the interaction process.

The number of groups or blocks in the network is a key parameter. Some models in the literature set a joint prior on the number of blocks and assignment of individuals to blocks. This can lead to too many smaller blocks and inconsistent posterior behaviour c.f. Miller and Harrison

The GSBM allows an explicit prior on the number of groups and an arbitrary distribution for the interaction process.

Using the package

Consider the example at the start of this section. Suppose the interactions are in a $N$ by $N$ matrix in R called \code{interacts}. First, you must specify the parts of the model:

  • the interaction process in a edgemod object
  • the prior for the parameters of the edge-model in a parammod object
  • the prior for the number of blocks in a blockmod object

The general method is to specify each of these objects in a list (named, say, model), then call

posterior <- sampler(interacts, model, 10000, "rj")

to run 10000 iterations of the split-merge sampler. The returned list, posterior, contains the trace for the number of blocks, parameter values, block memberships.

The output can be evaluated by some posterior diagnostic plots by calling

print(eval_plots(posterior))

this will plot the traces of the above variables and a posterior probability that two individuals belong to the same block.

For details on setting the model up see the accompanying vignette for a negative binomial model:

vignette("Weibull-edges")
Metadata

Version

1.1.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows