Skip to contents

sigma() returns the fitted scale-like parameter from a drmTMB model. For univariate Gaussian location-scale models this is the fitted residual sigma_i vector on the response scale. For Student-t models this is the Student-t scale parameter; when nu > 2, the residual standard deviation is sigma * sqrt(nu / (nu - 2)). For lognormal models this is the fitted standard deviation of log(y). For Gamma models this is the fitted coefficient of variation. For beta and beta-binomial models this is the public scale parameter where internal precision is phi = 1 / sigma^2. Cumulative-logit ordinal, Poisson, and zero-inflated Poisson models have no fitted residual scale parameter and return a fixed unit dispersion vector for consistency with base-R sigma() conventions. For negative-binomial 2, zero-truncated negative-binomial 2, hurdle negative-binomial 2, and zero-inflated negative-binomial 2 models this is the fitted overdispersion scale in the untruncated NB2 component Var(y | component) = mu + sigma^2 * mu^2. For bivariate Gaussian models it returns a list with fitted sigma1 and sigma2 vectors.

Usage

# S3 method for class 'drmTMB'
sigma(object, ...)

Arguments

object

A drmTMB fit.

...

Reserved for future scale-extractor options.

Value

A numeric vector for univariate models, or a named list of numeric vectors for bivariate Gaussian models.

Details

In meta-analytic models fitted with meta_known_V(V = V), this is the modelled residual heterogeneity scale, not the square root of the known sampling variance plus residual variance. Simulation and Pearson residuals combine known sampling covariance with residual scale internally.

Examples

dat <- data.frame(y = c(0.2, 0.5, 1.1, 1.4), x = c(-1, 0, 1, 2))
fit <- drmTMB(bf(y ~ x, sigma ~ x), data = dat)
sigma(fit)
#> [1] 0.06708199 0.06708202 0.06708205 0.06708208