Draws Monte Carlo samples of the log2 scale for each sample using user-supplied moments. This scale model is useful when external measurements (e.g., qPCR, flow cytometry, spike-ins) provide information about absolute scale, or when you want to encode prior information about scale on a per-sample basis.
sample.sm(X, logComp, s.mu = NULL, s.var = NULL, s.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. Columns correspond to samples (N = ncol(X)). This scale
model does not use X directly, but N is inferred from it.
(Automatically supplied by aldex().)
A numeric array of Monte Carlo log-compositions with dimensions
features x samples x nsample. This scale model uses nsample
to determine the number of Monte Carlo draws, but does not otherwise use
logComp. (Automatically supplied by aldex().)
Numeric vector of length N giving the mean of the log2
scale for each sample. Must not be NULL.
Numeric vector of length N giving the marginal variance of
the log2 scale for each sample. Use this when assuming samples' log2 scales
are independent. Must be NULL if s.cor is provided.
Numeric N x N covariance matrix for the log2 scale across
samples. Use this when encoding correlations between samples' log2 scales.
Must be NULL if s.var is provided.
Kyle McGovern
Exactly one of s.var or s.cor must be provided:
s.var: independent per-sample log2-scale variance (diagonal covariance)
s.cor: full N x N log2-scale covariance matrix
The returned matrix has N rows (samples) and nsample columns
(Monte Carlo draws), consistent with the ALDEx3 scale-model interface.