Computes the Evidence Lower Bound (ELBO) and its gradients with respect to
the model and variational parameters for a zero‑inflated Poisson
log‑normal (ZIP‑PLN) latent factor model. This is a thin R wrapper around
a fast C++ implementation, with a small preprocessing step that replaces
NA values in Y by zeros before delegation.
Arguments
- data
A list with elements:
YNumeric
n x pcount matrix (may containNA).XNumeric
n x ddesign matrix for the abundance/log‑mean part.RNumeric/binary design matrix for the zero‑inflation (logit) part (same number of rows as
Y); can beNULLif not used.
- params
A list with elements:
BMatrix of regression coefficients for
X(abundance).DMatrix of regression coefficients for
X(zero‑inflation).CLoadings matrix for the latent factors (rank
q).MVariational means of the latent factors.
SVariational standard deviations (or log‑SDs) of the latent factors.
- tolxi
Numeric, convergence tolerance used for the variational bound on the logistic term.
Value
A list containing at least:
elboScalar numeric, the ELBO value.
grad_B, grad_D, grad_C, grad_M, grad_SGradients w.r.t. the corresponding parameters.