Skip to contents

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.

Value

A bage_mod object

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.

See also

Examples

mod <- mod_pois(injuries ~ age:sex + ethnicity + year,
                data = nzl_injuries,
                exposure = popn)
mod
#> 
#>     ------ Unfitted Poisson model ------
#> 
#> 
#>    injuries ~ age:sex + ethnicity + year
#> 
#>   exposure = popn
#> 
#> 
#>         term  prior along n_par n_par_free
#>  (Intercept) NFix()     -     1          1
#>    ethnicity NFix()     -     2          2
#>         year   RW()  year    19         18
#>      age:sex   RW()   age    24         22
#> 
#> 
#>  n_draw pr_mean_disp var_time var_age var_sexgender
#>    1000            1     year     age           sex
#> 

mod |>
  set_n_draw(n_draw = 5000)
#> 
#>     ------ Unfitted Poisson model ------
#> 
#> 
#>    injuries ~ age:sex + ethnicity + year
#> 
#>   exposure = popn
#> 
#> 
#>         term  prior along n_par n_par_free
#>  (Intercept) NFix()     -     1          1
#>    ethnicity NFix()     -     2          2
#>         year   RW()  year    19         18
#>      age:sex   RW()   age    24         22
#> 
#> 
#>  n_draw pr_mean_disp var_time var_age var_sexgender
#>    5000            1     year     age           sex
#>