Barebone function to compute starting points for B, M and S when fitting a PLN. Mostly intended for internal use.
compute_PLN_starting_point(Y, X, O, w, s = 0.1)
a named list of starting values for model parameter B and variational parameters M and S used in the iterative optimization algorithm of PLN()
The default strategy to estimate B and M is to fit a linear model with covariates X
to the response count matrix (after adding a pseudocount of 1, scaling by the offset and taking the log). The regression matrix is used to initialize B
and the residuals to initialize M
. S
is initialized as a constant conformable matrix with value s
.
if (FALSE) { # \dontrun{
data(barents)
Y <- barents$Abundance
X <- model.matrix(Abundance ~ Latitude + Longitude + Depth + Temperature, data = barents)
O <- log(barents$Offset)
w <-- rep(1, nrow(Y))
compute_PLN_starting_point(Y, X, O, w)
} # }