Learn R Programming

PLNmodels (version 0.11.7)

sigma.PLNmixturefit: Extract variance-covariance of residuals 'Sigma'

Description

Extract the variance-covariance matrix of the residuals, usually noted $$\Sigma$$ in PLN models. This captures the correlation between the species in the latent space. or PLNmixture, it is a weighted mean of the variance-covariance matrices of each component.

Usage

# S3 method for PLNmixturefit
sigma(object, ...)

Value

A semi definite positive matrix of size p, assuming there are p species in the model.

Arguments

object

an R6 object with class PLNmixturefit

...

additional parameters for S3 compatibility. Not used

See Also

coef.PLNmixturefit() for other ways to access $$\Sigma$$.

Examples

Run this code
data(trichoptera)
trichoptera <- prepare_data(trichoptera$Abundance, trichoptera$Covariate)
myPLN <- PLNmixture(Abundance ~ 1 + offset(log(Offset)),
           data = trichoptera, control_main = list(iterates = 0))  %>% getBestModel()
sigma(myPLN) ## Sigma

Run the code above in your browser using DataLab