Learn R Programming

PLNmodels (version 0.11.7)

vcov.PLNfit: Calculate Variance-Covariance Matrix for a fitted PLN() model object

Description

Returns the variance-covariance matrix of the main parameters of a fitted PLN() model object. The main parameters of the model correspond to $$\Theta$$, as returned by coef.PLNfit(). The function can also be used to return the variance-covariance matrix of the residuals. The latter matrix can also be accessed via sigma.PLNfit()

Usage

# S3 method for PLNfit
vcov(object, type = c("main", "covariance"), ...)

Value

A matrix of variance/covariance extracted from the PLNfit model. If type="main" and \(\Theta\) is a matrix of size d * p, the result is a block-diagonal matrix with p (number of species) blocks of size d (number of covariates). if type="main", it is a symmetric matrix of size p. .

Arguments

object

an R6 object with class PLNfit

type

type of parameter that should be extracted. Either "main" (default) for $$\Theta$$ or "covariance" for $$\Sigma$$

...

additional parameters for S3 compatibility. Not used

See Also

sigma.PLNfit(), coef.PLNfit(), standard_error.PLNfit()

Examples

Run this code
data(trichoptera)
trichoptera <- prepare_data(trichoptera$Abundance, trichoptera$Covariate)
myPLN <- PLN(Abundance ~ 1 + offset(log(Offset)), data = trichoptera)
vcov(myPLN) ## variance-covariance of Theta
vcov(myPLN, type = "covariance") ## Sigma

Run the code above in your browser using DataLab