coef.PLNmixturefit: Extract model coefficients

View source: R/PLNmixturefit-S3methods.R

coef.PLNmixturefitR Documentation

Extract model coefficients

Description

Extracts model coefficients from objects returned by PLN() and its variants

Usage

## S3 method for class 'PLNmixturefit'
coef(object, type = c("main", "means", "covariance", "mixture"), ...)

Arguments

object

an R6 object with class PLNmixturefit

type

type of parameter that should be extracted. Either "main" (default) for

\Theta

, "means" for

\mu

, "mixture" for

\pi

or "covariance" for

\Sigma

...

additional parameters for S3 compatibility. Not used

Value

A matrix of coefficients extracted from the PLNfit model.

See Also

sigma.PLNmixturefit()

Examples

data(trichoptera)
trichoptera <- prepare_data(trichoptera$Abundance, trichoptera$Covariate)
myPLN <- PLNmixture(Abundance ~ 1 + offset(log(Offset)),
           data = trichoptera, control = PLNmixture_param(smoothing = "none"))  %>% getBestModel()
coef(myPLN) ## Theta - empty here
coef(myPLN, type = "mixture") ## pi
coef(myPLN, type = "means") ## mu
coef(myPLN, type = "covariance") ## Sigma

PLN-team/PLNmodels documentation built on Oct. 13, 2024, 4:01 a.m.