R: Calculate Variance-Covariance Matrix for a fitted 'PLN()'...

vcov.PLNfit {PLNmodels} | R Documentation

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

Θ

, 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 class '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 Θ or "covariance" for Σ
`...` | additional parameters for S3 compatibility. Not used

### Value

A matrix of variance/covariance extracted from the PLNfit model. If type="main" and Θ 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.PLNfit()`, `coef.PLNfit()`, `standard_error.PLNfit()`

### Examples

    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

[Package PLNmodels version 0.11.4 Index]