simBin: Simulate a Multivariate Binary Matrix

View source: R/simBin.R

simBinR Documentation

Simulate a Multivariate Binary Matrix

Description

Simulates a binary data matrix from a logistic biplot latent variable model with known parameters, useful for benchmarking and cross-validation studies.

Usage

simBin(n, p, k, D, C = 1)

Arguments

n

Number of rows (individuals).

p

Number of columns (variables).

k

Number of underlying latent dimensions.

D

Sparsity control: the marginal probability of a 1 in the population. A value close to 0 or 1 yields a sparse or dense matrix, respectively.

C

Variance scaling factor for the row scores. Default is C = 1.

Value

A named list with components:

X

Simulated binary matrix (n \times p).

P

Matrix of true Bernoulli probabilities (n \times p).

Theta

Matrix of true log-odds (natural parameters).

A

True row-marker matrix (n \times k).

B

True column-marker matrix (p \times k), orthonormal.

mu

True intercept vector of length p.

D

Observed proportion of ones in X.

n

Number of rows.

p

Number of columns.

Author(s)

Giovany Babativa <jgbabativam@unal.edu.co>

See Also

cv_LogBip

Examples

x <- simBin(n = 100, p = 50, k = 3, D = 0.5)

BiplotML documentation built on May 8, 2026, 5:06 p.m.

Related to simBin in BiplotML...