genInits | R Documentation |
Generate initialization for optimization
genInits(W, M, X, X_star, np, npstar, link, phi.link, nstart = 1, use = TRUE)
W |
Numeric vector of counts |
M |
Numeric vector of sequencing depth |
X |
Matrix of covariates associated with abundance (including intercept) |
X_star |
Matrix of covariates associated with dispersion (including intercept) |
np |
Number of covariates associated with abundance (including intercept) |
npstar |
Number of covariates associated with dispersion (including intercept) |
link |
ink function for abundance covariates |
phi.link |
ink function for dispersion covariates |
nstart |
Integer. Defaults to |
use |
Boolean. Defaults to |
Matrix of initializations
set.seed(1)
seq_depth <- rpois(20, lambda = 10000)
my_counts <- rbinom(20, size = seq_depth, prob = 0.001) * 10
my_covariate <- cbind(rep(c(0,1), each = 10))
colnames(my_covariate) <- c("X1")
genInits(W = my_counts, M = seq_depth,
X = cbind(1, my_covariate), X_star = cbind(1, my_covariate),
np = 2, npstar = 2,
link = "logit",
phi.link = "logit", nstart = 2, use = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.