View source: R/bage_mod-methods.R
components.bage_mod | R Documentation |
Extract values for hyper-parameters from a model object. Hyper-parameters include main effects and interactions, dispersion and variance terms, and SVD or spline coefficients.
## S3 method for class 'bage_mod'
components(object, quiet = FALSE, ...)
object |
Object of class |
quiet |
Whether to suppress messages.
Default is |
... |
Unused. Included for generic consistency only. |
A tibble with four columns columns:
The return value contains the following columns:
term
Model term that the hyper-parameter belongs to.
component
Component within term.
level
Element within component .
.fitted
An rvec containing
draws from the posterior distribution.
components()
is typically called on a fitted
model. In this case, the modelled values are
draws from the joint posterior distribution for the
hyper-parameters in the model.
components()
can, however, be called on an
unfitted model. In this case, the modelled values
are draws from the joint prior distribution.
In other words, the modelled values are informed by
model priors, and by any exposure
, size
, or weights
argument in the model, but not by the observed outcomes.
augment()
Extract data and values for rates,
means, or probabilities
tidy()
Extract a one-line summary of a model
mod_pois()
Specify a Poisson model
mod_binom()
Specify a binomial model
mod_norm()
Specify a normal model
fit()
Fit a model
is_fitted()
See if a model has been fitted
unfit()
Reset a model
## specify model
mod <- mod_pois(injuries ~ age + sex + year,
data = nzl_injuries,
exposure = popn)
## extract prior distribution
## of hyper-parameters
mod |>
components()
## fit model
mod <- mod |>
fit()
## extract posterior distribution
## of hyper-parameters
mod |>
components()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.