a fitted level of a unilevel network once $do_vem() is done

Public fields

vbound

vector of variational bound for convergence monitoring

Active bindings

adjacency

Get the adjacency matrix

mask

Get the mask matrix for dealing with NA

nb_nodes

Get the number of nodes of the level

nb_clusters

Get the number of blocks

distribution

Get the distribution used for the connections

directed

Get if the level is directed or not

mixture_parameter

Access the block proportions

connectivity_parameter

Access the connectivity matrix

membership

Access the variational parameters

entropy

Get the entropy of the model

bound

Get the variational bound of the model

df_mixture

Get the degree of freedom of the block proportion

df_connect

Get the degree of freedom of the connection parameters

connect

Get the number of observed dyads

ICL

Get the ICL model selection criterion

penalty

Get the penalty used for computing the ICL

Z

Access the vector of block membership (clustering)

X_hat

Get the connection probability matrix

X_likelihood

adjacency part of the log likelihood

Z_likelihood

block part of the log likelihood

likelihood

complete log likelihood

Methods


Method new()

Constructor for FitSBM R6 class

Usage

FitSBM$new(
  Q = 1,
  X = NULL,
  M = NULL,
  directed = FALSE,
  distribution = "bernoulli"
)

Arguments

Q

Number of blocks

X

Adjacency matrix

M

Mask matrix

directed

boolean

distribution

string (only "bernoulli")

Returns

A new FitSBM object


Method update_alpha()

Update the connection parameter for the M step

Usage

FitSBM$update_alpha(safeguard = 1e-06)

Arguments

safeguard

Parameter live in a compact [safeguard, 1-safeguard]


Method update_pi()

Update the upper level mixture parameter for the M step

Usage

FitSBM$update_pi(safeguard = 1e-06)

Arguments

safeguard

Parameter live in a compact [safeguard, 1-safeguard]


Method init_clustering()

init_clustering Initial clustering for VEM algorithm

Usage

FitSBM$init_clustering(safeguard = 1e-06, method = "hierarchical", Z = NULL)

Arguments

safeguard

Parameter live in a compact [safeguard, 1-safeguard]

method

Algorithm used to initiate the clustering, either "spectral", "hierarchical" or "merge_split" (if Z is provided)

Z

Initial clustering if provided


Method m_step()

m_step Compute the M step of the VEM algorithm

Usage

FitSBM$m_step(safeguard = 1e-06)

Arguments

safeguard

Parameter live in a compact [safeguard, 1-safeguard]


Method ve_step()

Compute the VE step of the VEM algorithm

Usage

FitSBM$ve_step(threshold = 1e-06, fixPointIter = 100, safeguard = 1e-06)

Arguments

threshold

The convergence threshold

fixPointIter

The maximum number of fixed point iterations

safeguard

Parameter live in a compact [safeguard, 1-safeguard]


Method do_vem()

Launch a Variational EM algorithm

Usage

FitSBM$do_vem(
  init = "hierarchical",
  threshold = 1e-06,
  maxIter = 1000,
  fixPointIter = 100,
  safeguard = 1e-06,
  Z = NULL
)

Arguments

init

The method for self$init_clustering

threshold

The convergence threshold

maxIter

The max number of VEM iterations

fixPointIter

The max number of fixed point iterations for VE step

safeguard

Parameter live in a compact [safeguard, 1-safeguard]

Z

Initial clustering if provided


Method permute_empty_class()

permute_empty_class Put empty blocks numbers at the end

Usage

FitSBM$permute_empty_class()


Method clear()

Reset all parameters

Usage

FitSBM$clear()


Method clone()

The objects of this class are cloneable with this method.

Usage

FitSBM$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.