expose_model_functions.bgmfit {bsitar} | R Documentation |
Expose User-Defined Stan Functions for Post-Processing
Description
The expose_model_functions() function is a wrapper
around rstan::expose_stan_functions()
that exposes user-defined Stan
function(s). These functions are necessary for post-processing the
posterior draws.
Usage
## S3 method for class 'bgmfit'
expose_model_functions(
model,
scode = NULL,
expose = TRUE,
select_model = NULL,
returnobj = TRUE,
vectorize = FALSE,
verbose = FALSE,
envir = NULL,
...
)
expose_model_functions(model, ...)
Arguments
model |
An object of class |
scode |
A character string containing the user-defined Stan function(s)
in |
expose |
A logical (default |
select_model |
A character string (default |
returnobj |
A logical (default |
vectorize |
A logical (default |
verbose |
A logical argument (default |
envir |
The environment used for function evaluation. The default is
|
... |
Additional arguments passed to the
|
Value
An object of class bgmfit
if returnobj = TRUE
;
otherwise, it returns NULL
invisibly.
Author(s)
Satpal Sandhu satpal.sandhu@bristol.ac.uk
See Also
rstan::expose_stan_functions()
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 the model fit object 'berkeley_exfit' exists
berkeley_exfit <- getNsObject(berkeley_exfit)
model <- berkeley_exfit
# To save time, argument expose is set as FALSE, which runs a dummy test
# and avoids model compilation that often takes time.
expose_model_functions(model, expose = FALSE)