Generates count tables from the data-generating processes used in the simulation studies of the paper: counts are drawn from a rounded multivariate log-normal with a size factor, a three-component mixture of baseline abundances producing excess zeros, and a covariance built either from a sparse factor structure (Simulation 1) or arbitrarily by the vine method of Lewandowski, Kurowicka and Joe (Simulations 2 and 3).
Arguments
- n
Number of samples. With
covariate = TRUEthis must be even: one sample per level is generated for each ofn/2subjects.- J
Integer vector of features per domain. Default
c(150, 50).- K_true
Number of true latent factors, used when
type = "block". Default5.- type
"block"(default) builds \(\Sigma^{tr} = \Lambda^{tr} \Lambda^{tr\prime} + V^{tr}\) with onlyactivefeatures loading on a single randomly chosen factor, so that the remaining features do not interact."vine"generates an arbitrary sparse correlation matrix by the vine method and rescales it with feature-specific variances.- active
List of length
length(J)giving, per domain, the indices of the features that interact. Used only bytype = "block". Defaults to the first half of each domain. Simulation 1 of the paper corresponds tolist(c(1:25, 51:75), 1:25)withJ = c(150, 50).- covariate
Logical; include a two-level categorical covariate as in Simulation 2, with a sparse effect (
beta_zeroof the coefficients are exactly zero). DefaultFALSE.- beta_zero
Probability that a covariate effect is exactly zero. Default
0.8.- zero_prop
Optional vector of per-feature probabilities of the "zero" mixture component, of length
sum(J). WhenNULL(default) the mixture weights are drawn fromDirichlet(30, 40, 30)as in Simulation 1. Supplying the empirical zero rates of a real dataset reproduces the setup of Simulations 2 and 3.- v2
Idiosyncratic variance per domain when
type = "block". Default0.25.- seed
Optional integer seed.
Value
A list with elements Y (a list of count matrices),
Sigma and cor (the true covariance and correlation),
Lambda (the true loadings, type = "block" only),
alpha, r, beta, X, subject and
J.