Skip to contents

Generates a dataset mirroring Simulation 1 of the paper: a categorical design with two factors (a binary and a ternary covariate) giving six experimental conditions, a rank-K_true covariate-varying covariance, and mean-abundance regression coefficients. Useful for quick demonstrations and for reproducing the simulation study.

Usage

simulate_bcaia(n = 30, J = 15, K_true = 2, sigma = 0.5, seed = NULL)

Arguments

n

Number of samples (must be a multiple of 6). Default 30.

J

Number of features. Default 15.

K_true

True number of covariate-varying factors. Default 2.

sigma

True idiosyncratic standard deviation. Default 0.5.

seed

Optional integer seed.

Value

A list with the count matrix Y, the design matrices Xmean and Xcov, and a truth sublist containing Sigma (a J x J x n array), Q, F, beta, ri, alpha and mu.

Examples

sim <- simulate_bcaia(seed = 6)
dim(sim$Y)
#> [1] 30 15