| ebpmf_log | R Documentation |
Fit empirical Bayes Poisson matrix factorization with log link function
ebpmf_log(
Y,
l0 = NULL,
f0 = NULL,
var_type = "by_col",
general_control = list(),
vga_control = list(),
flash_control = list(),
sigma2_control = list(),
init_control = list(),
verbose = TRUE
)
Y |
count data matrix, can be sparse format |
l0, f0 |
The background loadings and factors, see the model in ‘Details’. |
var_type |
variance type, "by_row", "by_col" or "constant", see the model in ‘Details’ |
general_control |
A list of parameters controlling the behavior of the algorithm. See ‘Details’. |
vga_control |
A list of parameters controlling the behavior of the VGA step. See ‘Details’. |
flash_control |
A list of parameters controlling the behavior of the flash step. See ‘Details’. |
sigma2_control |
A list of parameters controlling the behavior of updating variance. See ‘Details’. |
verbose |
TRUE to print the model fitting progress |
The model is
y_{ij}\sim \text{Poisson}(\exp(\mu_{ij})),
\mu_{ij} = l_{i0} + f_{j0} + \sum_k l_{ik}f_{jk} + \epsilon_{ij},
l_{i0}\sim g_{l_0}(\cdot), f_{j0}\sim g_{f_0}(\cdot),
l_{ik}\sim g_{l_k}(\cdot),f_{jk}\sim g_{f_k}(\cdot),
\epsilon_{ij}\sim N(0,\sigma^2_{ij}).
The init_control argument is a list in which any of the following
named components will override the default algorithm settings (as
defined by ebpmf_log_init_control_default):
sigma2_initThe init value of sigma2
M_initthe initial value for latent M
init_toltolerance for initialization
init_maxitermax iteration for initialization
verboseTRUE to print initialization progress
printeverySet a number to determine how often to print progress
ebpm_initwhether use ash_pois for single gene model, as init for vga
conv_typefor init vga fit, use either 'elbo' or 'sigma2abs' for convergence criteria
n_coresCan utilize more than 1 core to perform initialization, using 'mclapply' function.
flash_est_sigma2TRUE to use flash for initializing sigma2
log_init_for_non0yIf TRUE, then for non-0 counts, use log(Y/exp(offset)) as init valuesn_refit_flash_initThe times to refit flash using another seed if no structure was found in initialization
deal_with_no_init_factorIf no factor found in initialization, use 'reduce_var' to reduce init var for flash, or 'flash_dryrun' for not providing the variance
The general_control argument is a list in which any of the following
named components will override the default algorithm settings (as
defined by ebpmf_log_general_control_default):
batch_sizeSet this number to 1000 or 10000 or similar to reduce memory usage for vga step by looping subsets of dataset.
maxitermax iteration allowed.
conv_toltolerance for convergence
printeveryHow often to print progress over iterations
verboseTRUE to print progress
garbage_collection_everyHow often to perform 'gc()' to reduce memory usage
save_init_valTRUE to return initailization values of latent mu and sigma2
save_latent_MTRUE to return latent M, its size can be very large
save_fit_everyHow often to save intermediate results?
save_fit_pathWhere to save intermediate results path
save_fit_nameWhat is the name to save intermediate results
The flash_control argument is a list in which any of the following
named components will override the default algorithm settings (as
defined by ebpmf_log_flash_control_default):
ebnm.fnsee '?flash', 'ebnm_fn'.
ebnm.fn.offsetThe prior for l_0, f_0, if not fixing them.
loadings_signsee '?flash_greedy_init_default' sign_constraints, must match ebnm.fn
factors_signsee '?flash_greedy_init_default' sign_constraints, must match ebnm.fn
fix_l0fix l_0?
fix_f0fix f_0?
Kmaxsee '?flash', 'greedy_Kmax'.
add_greedy_KmaxThe Kmax in add_greedy in iterations
add_greedy_warmstartsee '?flash_greedy'
add_greedy_extrapolatesee '?flash_greedy'
add_greedy_everyperform flash_greedy every 'add_greedy_every' iterations.
maxiter_backfittingmax iterations for the flash backfitting,see '?flash_backfit'
backfit_extrapolatesee '?flash_backfit'
backfit_warmstartsee '?flash_backfit'
verbose_flashwhether print flash updates
The vga_control argument is a list in which any of the following
named components will override the default algorithm settings (as
defined by ebpmf_log_vga_control_default):
maxiter_vgamax iterations for vga step Newton's method
vga_toltolerance for stopping the optimization.
The sigma2_control argument is a list in which any of the following
named components will override the default algorithm settings (as
defined by ebpmf_log_sigma2_control_default):
est_sigma2whether estimate the variance term or fix it at sigma2_init
a0,b0Inverse-Gamma(a0,b0) prior on sigma2 for regularization.
cap_var_mean_ratioonly update sigma2 when if var/mean > (1+cap_var_mean_ratio). i.e. when overdispersion is low enough, stop updating sigma2 to boost convergence.
return_sigma2_traceTRUE to return the sigma2 values along the iterations. internal usage only
A list of:
fit_flash: |
fitted flash object |
elbo: |
evidence lower bound value |
K_trace: |
trace of number of factors |
elbo_trace: |
trace of elbo |
sigma2: |
the variance estimates |
run_time: |
run time of the algorithm |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.