| get_auxiliary {insight} | R Documentation |
Get auxiliary parameters from models
Description
Returns the requested auxiliary parameters from models, like dispersion, sigma, or beta...
Usage
get_auxiliary(
x,
type = "sigma",
summary = TRUE,
centrality = "mean",
verbose = TRUE,
...
)
Arguments
x |
A model. |
type |
The name of the auxiliary parameter that should be retrieved.
|
summary |
Logical, indicates whether the full posterior samples
( |
centrality |
Only for models with posterior samples, and when
|
verbose |
Toggle warnings. |
... |
Currently not used. |
Details
Currently, only sigma and the dispersion parameter are returned, and only for a limited set of models.
Sigma Parameter
See get_sigma().
Dispersion Parameter
There are many different definitions of "dispersion", depending on the context.
get_auxiliary() returns the dispersion parameters that usually can
be considered as variance-to-mean ratio for generalized (linear) mixed
models. Exceptions are models of class glmmTMB, where the dispersion
equals σ2.
In detail, the computation of the dispersion parameter for generalized linear
models is the ratio of the sum of the squared working-residuals and the
residual degrees of freedom. For mixed models of class glmer, the
dispersion parameter is also called φ
and is the ratio of the sum of the squared Pearson-residuals and the residual
degrees of freedom. For models of class glmmTMB, dispersion is
σ2.
brms models
For models of class brmsfit, there are different options for the
type argument. See a list of supported auxiliary parameters here:
find_parameters.BGGM().
Value
The requested auxiliary parameter, or NULL if this information
could not be accessed.
Examples
# from ?glm
clotting <- data.frame(
u = c(5, 10, 15, 20, 30, 40, 60, 80, 100),
lot1 = c(118, 58, 42, 35, 27, 25, 21, 19, 18),
lot2 = c(69, 35, 26, 21, 18, 16, 13, 12, 12)
)
model <- glm(lot1 ~ log(u), data = clotting, family = Gamma())
get_auxiliary(model, type = "dispersion") # same as summary(model)$dispersion