update_hbm | R Documentation |
This function updates an existing hbmfit object generated by hbm()
, hbm_beta()
, hbm_logitnormal()
, and hbm_lognormal()
.
It allows updating the formula, data, and other arguments, following the behavior of brms::update()
.
update_hbm(
model,
newdata = NULL,
iter = NULL,
warmup = NULL,
chains = NULL,
cores = NULL,
control = NULL,
...
)
model |
A |
newdata |
(optional) A new dataset with the same structure as the original |
iter |
(optional) Number of MCMC iterations |
warmup |
(optional) Number of warmup iterations |
chains |
(optional) Number of MCMC chains |
cores |
(optional) Number of cores to use for sampling |
control |
(optional) A named list of control parameters passed to Stan |
... |
Other arguments passed to |
Update a Hierarchical Bayesian Model (hbm) object
An updated hbmfit
object
library(hbsaems)
# Load example data
data("data_fhnorm")
# Fit initial model
model <- hbm(
formula = bf(y ~ x1 + x2 + x3),
hb_sampling = "gaussian",
hb_link = "identity",
data = data_fhnorm,
chains = 2,
iter = 10000,
warmup = 2000,
cores = 2
)
# Update number of iterations and warmup
updated_model <- update_hbm(
model,
newdata = data_fhnorm,
iter = 10000,
warmup = 2000,
chains = 2,
cores = 2
)
# Check updated model summary
summary(updated_model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.