gs.sbm.fit: Stochastic Block Model

Description Usage Arguments Value Author(s)

Description

A function to fit the 3 parameter (number of vertices, community assignment for each vertex, and matrix community interactions) Stochastic Block Model to a weighted or unweighted graph. The community interactions for pairs of unique communities is either a probability matrix (unweighted graph) or an edge-expectation matrix (weighted graph).

Usage

1
gs.sbm.fit(g, communities, edge.attr = NULL, output.type = "matrix")

Arguments

g

an igraph object or an nxn adjacency matrix with n vertices.

communities

an n vector containing the community label for each of the n vertices in g.

edge.attr

if g is a igraph, the name of the attribute to use for weights. Defaults to NULL, which assumes the graph is binary.

is.null(edge.attr)

constructs sbm on the graph as a binary adjacency matrix.

is.character(edge.attr)

constructs sbm of the graph the graph as a weighted adjacency matrix, with edge-weights for E(g) given by get.edge.attribute(g, attr=edge.attr).

output.type

the type of output to produce for the between community expectations. Defaults to matrix.

"matrix"

produces a matrix for the between-communitity interactions.

"graph"

produces an igraph object for the between-community interactions.

Value

An object of class SBM containing the following:

n.v

the number of vertices in the graph.

v.communities

the community each vertex is assigned to.

P

a representation of the between-community edge probabilities (unweighted) or expectations (weighted).

Author(s)

Eric Bridgeford


neurodata/graphstats documentation built on May 14, 2019, 5:19 p.m.