rlbm {greed} | R Documentation |
Generate a data matrix using a Latent Block Model
Description
rlbm
returns the adjacency matrix and the cluster labels generated randomly with a Latent Block Model.
Usage
rlbm(Nr, Nc, pir, pic, mu)
Arguments
Nr |
desired Number of rows |
Nc |
desired Number of column |
pir |
A numeric vector of length Kr with rows clusters proportions (will be normalized to sum up to 1). |
pic |
A numeric vector of length Kc with columns clusters proportions (will be normalized to sum up to 1). |
mu |
A numeric matrix of dim Kr x Kc with the connectivity pattern to generate. elements in [0,1]. |
Details
This function takes the desired graph size, cluster proportions and connectivity matrix as input and sample a graph accordingly together with the clusters labels.
Value
A list with fields:
x: the generated data matrix as a
dgCMatrix
clr: vector of row clusters labels
clc: vector of column clusters labels
Kr: number of generated row clusters
Kc: number of generated column clusters
Nr: number of rows
Nc: number of column
pir: row clusters proportions
pic: column clusters proportions
mu: connectivity matrix
Examples
simu <- rlbm(500, 1000, rep(1 / 5, 5), rep(1 / 10, 10), matrix(runif(50), 5, 10))