clvm: Fit a CLVM Model

Description Usage Arguments Value Examples

View source: R/clvm.R

Description

Fit a covariate latent variable model using coordinate ascent variational inference.

Usage

1
2
3
4
clvm(y, x, maxiter = 10000, elbo_tol = 1e-05, thin = 1, verbose = TRUE,
  z_init = 1, tau_q = 1, tau_mu = 1, tau_c = 1, a = 2, b = 2,
  tau_alpha = 1, a_beta = 10, b_beta = 1, q = rep(0, nrow(y)),
  model_mu = FALSE, scale_y = TRUE)

Arguments

y

A N-by-G (dynamic) input matrix

x

A N-by-P (static) input matrix

maxiter

Maximum number of CAVI iterations

elbo_tol

The (percent) change in the ELBO below which it is considered converged

thin

The number of iterations to wait each time before re-calculating the elbo

verbose

Print convergence messages

z_init

The initialisation of the latent trajectory. Should be one of

  1. A positive integer describing which principal component of the data should be used for initialisation (default 1), or

  2. A numeric vector of length number of samples to be used directly for initialisation, or

  3. The text character "random", for random initialisation from a standard normal distribution.

tau_q

Hyperparameter tau_q

tau_mu

Hyperparameter tau_mu

tau_c

Hyperparameter tau_c

a

Hyperparameter a

b

Hyperparameter b

tau_alpha

Hyperparameter tau_alpha

a_beta

Hyperparameter a_beta

b_beta

Hyperparameter b_beta

q

Priors on the latent variables

model_mu

Logical - should a gene-specific intercept term be modelled?

scale_y

Logical - should the expression matrix be centre scaled?

Value

A list whose entries correspond to the converged values of the variational parameters along with the ELBO.

Examples

1
2
sim <- simulate_phenopath()
fit <- clvm(sim$y, matrix(sim$x))

phenopath documentation built on Nov. 8, 2020, 6:53 p.m.