View source: R/internal_family.R
| negbin | R Documentation |
A family object for negative binomial responses, for use as
the family argument of cf_glm_hv and
cf_dglm_hv. With theta = NULL (default) the dispersion
parameter \theta (variance \mu + \mu^2/\theta) is estimated by
maximum likelihood: it is re-estimated on the training samples after the
initial GLM and after every accepted spatial scale, so that it reflects the
over-dispersion that remains once the multiscale spatial process is modeled.
A numeric theta keeps the dispersion fixed (equivalent to
MASS::negative.binomial(theta), which is also accepted).
negbin(theta = NULL, link = "log")
theta |
|
link |
Link function: |
An object of class "family". The fitted value of
\theta is stored in family$theta of the family returned in
mod_hv$other$family (and mod$other$family).
cf_glm_hv, cf_dglm_hv
set.seed(1)
n <- 300
coords <- cbind(runif(n), runif(n))
y <- rnbinom(n, size = 2, mu = exp(1 + sin(4 * coords[, 1])))
mod_hv <- cf_glm_hv(y = y, coords = coords, family = negbin())
mod_hv$other$family$theta # estimated dispersion
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.