Learn R Programming

PLNmodels (version 0.9.5)

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. The function can also be used to return the variance-covariance matrix of the residuals. The latter matrix can also be accessed via sigma

Usage

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

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

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. .

See Also

sigma, coef, standard_error

Examples

Run this code
# NOT RUN {
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