NIFA: Main NIFA function

View source: R/NIFA.R

NIFAR Documentation

Main NIFA function

Description

Main NIFA function

Usage

NIFA(X, K = 6, M = 4, init="sd", S.init=NULL, A.init=NULL, L1.sd = NULL, L2.sd = NULL , verbose=F, beta_threshold = 2e-5, 
     S_threshold = 6e-5, max.iter = 1000, ref=NULL, rho_S_diff=1.5,phi_S_prior=1, a_S_prior=1,b_S_prior=1, a_noise_prior=1, 
     b_noise_prior=1,lambda_A_prior=1, eta_A_prior=0, ELBO=F, A.immediate =F, beta_expect_flag = NULL)

Arguments

X

the data to be processed with genes in rows and samples in columns.

K

number of latent factors (default: 6)

M

maximum number of mixtures associated with each latent factor (default: 4)

init

initialization method and there are three options: "random", "ICA" and "sd" (default: "sd"-simple decomposition)

S.init

initialization values for latent factors S (default: NULL)

A.init

initialization values for loadings A (default: NULL)

L1.sd

regularization parameter L1 in simple decomposition (default: NULL)

L2.sd

regularization parameter L2 in simple decomposition (default: NULL)

verbose

print out intermediate messages (default: F)

beta_threshold

threshold for relateive change of beta (default: 2e-5)

S_threshold

threshold for relative change of S (default: 6e-5)

max.iter

maximum number of iterations (default: 1000)

ref

independent measurement that can be associated with S, e.g., one_hot_encode(celltype) (default: NULL)

rho_S_diff

hyperparameter to initialize rho (default: 1.5)

phi_S_prior

hyperparameter to initialize phi (default: 1)

a_S_prior

prior parameter for S (default: 1)

b_S_prior

prior parameter for S (default: 1)

a_noise_prior

prior paramter for beta (default: 1)

b_noise_prior

prior parameter for beta (default: 1, recommended: prod(dim(X))*5)

lambda_A_prior

prior parameter for A (default: 1)

eta_A_prior

prior parameter for A (default: 0)

ELBO

whether calculate ELBO or not (default: F)

A.immediate

where update A till convergence within each iteration (default: F, recommended: F)

beta_expect_flag

you can specify a fixed beta_expect by assigning a value, e.g., 1e-2 (default: NULL)

Value

X

same as input

K

same as input

M

same as input

beta_threshold

same as input

S_threshold

same as input

rho_S_diff

same as input

phi_S_prior

same as input

a_S_prior

same as input

b_S_prior

same as input

a_noise_prior

same as input

b_noise_prior

same as input

lambda_A_prior

same as input

eta_A_prior

same as input

loop

number of iterations before converge

S_expect

expectation of latent factors S, see the matching table

S_2_expect

see the matching table

mu_S_expect

see the matching table

epsilon_expect

see the matching table

sigma_log_S_expect

see the matching table

beta_expect

see the matching table

sigma_expect

see the matching table

mu_S_2_expect

see the matching table

mean_A_expect

expectation of loading A, see the matching table

var_A_expect

see the matching table

sigma_S

see the matching table

mu_S

see the matching table

lambda_S

see the matching table

pi_S

see the matching table

rho_S

see the matching table

phi_S

see the matching table

a_S

see the matching table

b_S

see the matching table

a_noise

see the matching table

b_noise

see the matching table

lambda_A

see the matching table

eta_A

see the matching table

mu_A

see the matching table

sigma_A

see the matching table

rho_S_0

initial values of rho_S

phi_S_0

initial values of phi_S

a_S_0

initial values of a_S

b_S_0

initial values of b_S

lambda_S_0

initial values of lambda_S

pi_S_0

initial values of pi_S

a_noise_0

initial values of a_noise

b_noise_0

initial values of b_noise

lambda_A_0

initial values of lambda_A

eta_A_0

initial values of eta_A

mu_S_change

relative change of mu_S, normF(mu_S-mu_S_old)/normF(mu_S_old)

beta_change

relative change of beta

ELBO_accu

ELBO value

Examples

NIFA.res <- NIFA(tscale(rnaseq.norm), K = 25, M = 4, max.iter = 500, S_threshold = 6e-5, init = "sd", 
                 ref = one_hot_encode(celltype), b_noise_prior = prod(dim(rnaseq.norm))*5)

wgmao/NIFA documentation built on March 31, 2022, 2:10 a.m.