bnmf: Bayesian NMF inference of count matrix

View source: R/bayesian.R

bnmfR Documentation

Bayesian NMF inference of count matrix

Description

Perform variational Bayes NMF and store factor matrices in object

Usage

bnmf(
  object,
  ranks = 2:10,
  nrun = 1,
  verbose = 2,
  progress.bar = TRUE,
  initializer = "random",
  Itmax = 10000,
  hyper.update = rep(TRUE, 4),
  gamma.a = 1,
  gamma.b = 1,
  Tol = 1e-05,
  hyper.update.n0 = 10,
  hyper.update.dn = 1,
  fudge = NULL,
  kstar = "kmax",
  useC = FALSE,
  unif.stop = TRUE,
  sindex = NULL
)

Arguments

object

scNMFSet object containing count matrix.

ranks

Rank for factorization; can be a vector of multiple values.

nrun

No. of runs with different initial guesses.

progress.bar

Display progress bar with verbose = 1 for multiple runs.

initializer

If 'random', randomized initial conditions; 'svd2' for singular value decomposed initial condition.

Itmax

Maximum no. of iteration.

hyper.update

Vector of four logicals, each indcating whether hyperparameters c(aw, bw, ah, bh) should be optimized.

gamma.a

Gamma distribution shape parameter.

gamma.b

Gamma distribution mean. These two parameters are used for fixed hyperparameters with hyper.update elements FALSE.

Tol

Tolerance for terminating iteration.

hyper.update.n0

Initial number of steps in which hyperparameters are fixed.

hyper.update.dn

Step intervals for hyperparameter updates.

fudge

Small positive number used as lower bound for factor matrix elements to avoid singularity. If fudge = NULL (default), it will be replaced by .Machine$double.eps. Can be set to 0 to skip regularization.

unif.stop

Terminate if any of columns in basis matrix is uniform.

Details

The main input is the tempoSig object with count matrix. This function performs non-negative factorization using Bayesian algorithm and gamma priors. Slots basis, coeff, and ranks are filled.

When run with multiple values of ranks, factorization is repeated for each rank and the slot measure contains log evidence and optimal hyperparameters for each rank. With nrun > 1, the solution with the maximum log evidence is stored for a given rank.

Value

Object of class scNMFSet with factorization slots filled.


mskcc/tempoSig documentation built on Feb. 3, 2023, 8:35 a.m.