defineSBM: Define a network

Description Usage Arguments Value Examples

View source: R/defineSBM.R

Description

Define a network

Usage

1
2
3
4
5
6
7
8
defineSBM(
  netMat,
  model = "bernoulli",
  type = ifelse(ncol(netMat) == nrow(netMat), "simple", "bipartite"),
  directed = !isSymmetric(netMat),
  dimLabels = c(row = "row", col = "col"),
  covariates = list()
)

Arguments

netMat

a matrix describing the network: either an adjacency (square) or incidence matrix with possibly weighted entries.

model

character describing the model for the relation between nodes ('bernoulli', 'poisson', 'gaussian', ...). Default is 'bernoulli'.

type

Type of the matrix, choice between 'simple' and 'bipartite'

directed

logical: is the network directed or not? Only relevant when type is 'Simple'. Default is TRUE if netMat is symmetric, FALSE otherwise

dimLabels

an optional list of labels for each dimension (in row, in column)

covariates

a list of matrices with same dimension as mat describing covariates at the edge level. No covariate per Default.

Value

an object SimpleSBM or BipartiteSBM with the informations required to define a future multipartite network

Examples

1
2
A <- matrix(rbinom(100,1,.2), 10, 10)
myNet <- defineSBM(A, "poisson", "simple", TRUE, "Actor")

GrossSBM/sbm documentation built on April 8, 2021, 5:53 a.m.