rlca {greed}R Documentation

Generate data from lca model

Description

rlca returns a data.frame with factor sampled from an lca model

Usage

rlca(N, pi, theta)

Arguments

N

The size of the graph to generate

pi

A numeric vector of length K with clusters proportions (will be normalized to sum up to 1).

theta

A list of size V

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:

Examples

theta <- list(
  matrix(c(0.1, 0.9, 0.9, 0.1, 0.5, 0.5, 0.3, 0.7), ncol = 2, byrow = TRUE),
  matrix(c(0.5, 0.5, 0.3, 0.7, 0.05, 0.95, 0.3, 0.7), ncol = 2, byrow = TRUE),
  matrix(c(0.5, 0.5, 0.9, 0.1, 0.5, 0.5, 0.1, 0.9), ncol = 2, byrow = TRUE)
)
lca.data <- rlca(100, rep(1 / 4, 4), theta)

[Package greed version 0.6.1 Index]