update_model.bgmfit {bsitar} | R Documentation |
Update model
Description
The update_model() is a wrapper around the
update()
function in the brms package which refits the model
as per the user specified updated arguments.
Usage
## S3 method for class 'bgmfit'
update_model(
model,
newdata = NULL,
recompile = NULL,
expose_function = FALSE,
verbose = FALSE,
check_newargs = FALSE,
envir = NULL,
...
)
update_model(model, ...)
Arguments
model |
An object of class |
newdata |
An optional |
recompile |
A logical to indicate whether the Stan model should be
recompiled. When |
expose_function |
An optional logical argument to indicate whether to
expose Stan functions (default |
verbose |
An optional argument (logical, default |
check_newargs |
A logical (default |
envir |
Environment used for function evaluation. The default is
|
... |
Other arguments passed to |
Details
This is an adapted version of the update() function from available the thebrms package.
Value
An updated object of class brmsfit
.
Author(s)
Satpal Sandhu satpal.sandhu@bristol.ac.uk
Examples
# Fit Bayesian SITAR model
# To avoid mode estimation which takes time, the Bayesian SITAR model fit to
# the 'berkeley_exdata' has been saved as an example fit ('berkeley_exfit').
# See 'bsitar' function for details on 'berkeley_exdata' and 'berkeley_exfit'.
# Check and confirm whether model fit object 'berkeley_exfit' exists
berkeley_exfit <- getNsObject(berkeley_exfit)
model <- berkeley_exfit
# Update model
# Note that in case all arguments supplied to the update_model() call are
# same as the original model fit (checked via check_newargs = TRUE), then
# original model object is returned.
# To explicitly get this information whether model is being updated or not,
# user can set verbose = TRUE. The verbose = TRUE also useful in getting the
# information regarding what all arguments have been changed as compared to
# the original model.
model2 <- update_model(model, df = 5, check_newargs = TRUE, verbose = TRUE)