View source: R/helper_methods.R
newmodel | R Documentation |
Initialize an object of class newmodel
newmodel( X, V, W, beta, gamma, alpha, zeta, epsilon, epsilon_beta, epsilon_gamma, epsilon_W, epsilon_alpha, epsilon_zeta, n, J, K )
X |
matrix. The design matrix containing sample-level covariates, one sample per row. |
V |
matrix. The design matrix containing gene-level covariates, one gene per row. |
W |
matrix. The factors of sample-level latent factors. |
beta |
matrix or NULL. The coefficients of X in the regression of mu. |
gamma |
matrix or NULL. The coefficients of V in the regression of mu. |
alpha |
matrix or NULL. The coefficients of W in the regression of mu. |
zeta |
numeric. A vector of log of inverse dispersion parameters. |
epsilon |
nonnegative scalar. Regularization parameter. |
epsilon_beta |
nonnegative scalar. Regularization parameter for beta. |
epsilon_gamma |
nonnegative scalar. Regularization parameter for gamma. |
epsilon_W |
nonnegative scalar. Regularization parameter for W. |
epsilon_alpha |
nonnegative scalar. Regularization parameter for alpha |
epsilon_zeta |
nonnegative scalar. Regularization parameter for zeta. |
n |
integer. Number of samples. |
J |
integer. Number of genes. |
K |
integer. Number of latent factors. |
This is a wrapper around the new() function to create an
instance of class newmodel
. Rarely, the user will need to create a
newmodel
object from scratch, as tipically this is the result of
newFit
.
If any of X
, V
, W
matrices are passed,
n
, J
, and K
are inferred. Alternatively, the user can
specify one or more of n
, J
, and K
.
The regularization parameters can be set by a unique parameter
epsilon
or specific values for the different regularization
parameters can also be provided.
If only epsilon
is specified, the other parameters take the
following values:
epsilon_beta = epsilon/J
epsilon_gamma = epsilon/n
epsilon_W = epsilon/n
epsilon_alpha = epsilon/J
epsilon_zeta = epsilon
We empirically found that large values of epsilon
provide a more
stable estimation of W
.
A call with no argument has the following default values: n =
50
, J = 100
, K = 0
, epsilon=J
.
Although it is possible to create new instances of the class by
calling this function, this is not the most common way of creating
newmodel
objects. The main use of the class is within the
newFit
function.
an object of class newmodel
.
a <- newmodel() numberSamples(a) numberFeatures(a) numberFactors(a)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.