Draws Monte Carlo samples of the log2 scale by sampling fixed-effect
coefficients from a multivariate normal distribution and mapping them
through the design matrix X. This scale model is useful when you
want to encode prior information about how covariates (e.g., treatment,
batch, time) affect scale, rather than specifying scale moments directly
per sample.
coefficient.sm(X, logComp, c.mu = NULL, c.cor = NULL)A numeric matrix of dimension N x nsample giving Monte Carlo
draws of the log2 scale for each sample (rows) across nsample draws
(columns).
A numeric design matrix passed internally by aldex() to the
scale model. Rows correspond to fixed-effect coefficients/covariates
(P = nrow(X)) and columns correspond to samples
(N = ncol(X)). (Automatically supplied by aldex().)
A numeric array of Monte Carlo log-compositions with
dimensions features x samples x nsample. This scale model uses
nsample (the number of Monte Carlo draws) but does not otherwise use
logComp. (Automatically supplied by aldex().)
Numeric vector of length P giving the mean of the fixed
effect coefficients in log2-scale space. Must not be NULL.
Numeric P x P covariance matrix for the fixed effect
coefficients in log2-scale space. Must not be NULL.
Kyle McGovern
Specifically, for each Monte Carlo draw \(b^{(m)} \sim N(c.mu, c.cor)\),
the per-sample log2 scale is computed as \(b^{(m)T} X\), producing an
N x nsample matrix of log2-scale draws.
For example, with an intercept and a treatment indicator where treatment is
expected to increase log2 scale by ~1 on average, one might use
c.mu = c(0, 1) and c.cor = diag(c(0.25, 0.25)) (i.e., SD 0.5
for each coefficient, independent).