set_n_draw: Specify Number of Draws from Prior or Posterior Distribution

View source: R/bage_mod-functions.R

set_n_drawR Documentation

Specify Number of Draws from Prior or Posterior Distribution

Description

Specify the number of draws from the posterior distribution to be used in model output. A newly-created bage_mod object has an n_draw value of 1000. Higher values may be appropriate for characterizing the tails of distributions, or for publication-quality graphics and summaries.

Usage

set_n_draw(mod, n_draw = 1000L)

Arguments

mod

An object of class "bage_mod", created with mod_pois(), mod_binom(), or mod_norm().

n_draw

Number of draws.

Details

If the new value for n_draw is greater than the old value, and the model has already been fitted, then the model is unfitted, and function fit() may need to be called again.

Value

A bage_mod object

See Also

  • augment(), components() functions for drawing from prior or posterior distribution - the output of which is affected by the value of n_draw.

  • mod_pois(), mod_binom(), mod_norm() Specify a model

  • set_prior() Specify prior for a term

  • set_disp() Specify prior for dispersion

  • fit() Fit a model

  • unfit() Reset a model

Examples

mod <- mod_pois(injuries ~ age:sex + ethnicity + year,
                data = nzl_injuries,
                exposure = popn)
mod

mod |>
  set_n_draw(n_draw = 5000)

bage documentation built on April 3, 2025, 8:53 p.m.