ZI‑PLN-PCA (missing data) — variational E‑step solver
Source:R/Miss_ZIPLNPCA_VE.R
Miss.ZIPLNPCA_VE.RdFits a zero‑inflated Poisson log‑normal (ZI‑PLN-PCA) latent factor model on a count matrix with missing values using a single call to a variational optimization backend (VE). Returns model/variational parameters and expected Poisson means suitable for imputation and prediction.
Arguments
- Y
Numeric
n x pcount matrix. May containNA.- X
Numeric design matrix with
n*prows anddcolumns, aligned withvec(Y)(vectorization by columns).- q
Integer, latent rank (dimension of the latent space).
- params
Optional list of initial parameters. If
NULL,Init_ZIPis called.- config_vem
List of outer VE controls (stopping and bounds), with fields:
maxiterMaximum iterations (not always used by this backend, default
10000).ftolELBO tolerance (default
1e-08).xtolParameter tolerance (default
1e-04).tolSList with
lower,upperbounds forS(defaultlist(lower = 1e-4, upper = 1)).tolxiTolerance for the Jaakkola‑type \(\xi\) updates (default
1e-04).
- config
List of NLOpt controls for the backend (algorithm, tolerances,
maxeval, etc.). IfNULL, sensible defaults are provided.
Value
A list with components:
mStepModel parameters:
gamma(d x 1),beta(d x 1), loadingsC(p x q).eStepVariational parameters:
M(n x q),S(n x q),xi(n x p).predList with predictors and expected counts:
mu(n x p),nu(n x p), backend meanA(n x p), andpredictedrecomputed in R.elboFinal ELBO value.
params.initInitial parameters used.
monitoringBackend diagnostics (if provided).
elbo1, elbo2, elbo3, elbo4, elbo5Decomposition terms of the ELBO (as returned by the backend).
Details
Missing entries are handled via a binary mask R = 1_{observed}(Y),
and a working copy Y.na with zeros at missing locations for the
objective evaluation. Box constraints on S are injected into
config$lower_bounds and config$upper_bounds using
config_vem$tolS.
Predicted mean: ici, la recomposition côté R utilise $$ \exp\!\big( X B + M C^\top + 0.5\, S \,(C\odot C)^\top \big). $$ D'autres fonctions du package emploient \(0.5\,(S\odot S)\,(C\odot C)^\top\). Vérifie et harmonise selon la paramétrisation attendue par ton backend.