Optimize eSVD for matrices or sparse matrices.
opt_esvd.default.Rd
Optimize eSVD for matrices or sparse matrices.
Arguments
- input_obj
Dataset (either
matrix
ordgCMatrix
) where the \(n\) rows represent cells and \(p\) columns represent genes. The rows and columns of the matrix should be named.- x_init
Initial matrix of the cells' latent vectors that is \(n\) rows and \(k\) columns. The row names should be the same as
input_obj
.- y_init
Initial matrix of the genes' latent vectors that is \(p\) rows and \(k\) columns. The row names should be the same as the column names of
input_obj
.- z_init
Initial matrix of the genes' coefficient vectors that is \(p\) rows and
ncol(covariates)
columns. The row names should be the same as the column names ofinput_obj
, and the column names should be the same ascovariates
.- covariates
matrix
object with \(n\) rows with the same rownames asinput_obj
where the columns represent the different covariates. Notably, this should contain only numerical columns (i.e., all categorical variables should have already been split into numerous indicator variables).- family
String among
"gaussian"
,"curved_gaussian"
,"exponential"
,"poisson"
,"neg_binom"
,"neg_binom2"
, or"bernoulli"
. Notably, with exception of"neg_binom2"
, all the other families are parameterized such that eSVD is fitting the dot product to be the canonical parameter of these expoential-family distributions. For"neg_binom2"
, the dot product is the log-mean of the distribution (i.e., similar to the canonical parameterization of the Poisson family).- l2pen
Small positive number for the amount of penalization for both the cells' and the genes' latent vectors as well as the coefficients.
- library_multipler
Vector of positive numerics of length \(n\). It is the multiplier such that the variance of cell
i
's entries is the mean of celli
's entries times the square-root of celli
's value inlibrary_multipler
(entry-wise). This is used as an alternative interpretation of how library-size affects a cell's gene expression (instead of using the library size as a covariate to be regressed out).- max_iter
Positive integer for number of iterations.
- nuisance_vec
Vector of non-negative numerics (or
NA
's) of length \(p\), representing each gene's nuisance parameter when using an exponential-family distribution that requires one. It is used only whenfamily
is"curved_gaussian"
or"neg_binom"
or"neg_binom2"
.- offset_variables
A vector of strings depicting which column names in
input_obj$covariate
be treated as an offset during the optimization (i.e., their coefficients will not change throughout the optimization).- tol
Small positive number to differentiate between zero and non-zero.
- verbose
Integer
- ...
Additional parameters