expose_model_functions.bgmfit {bsitar} | R Documentation |
Expose user defined Stan function for post-processing
Description
The expose_model_functions() is a wrapper around the
rstan::expose_stan_functions()
to expose user defined
Stan
function(s). These exposed functions are needed during the
post-processing of 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 ( |
expose |
A logical (default |
select_model |
A character string (default |
returnobj |
A logical (default |
vectorize |
A logical (default |
verbose |
An optional argument (logical, default |
envir |
Environment used for function evaluation. The default is
|
... |
Additional arguments passed to the
|
Value
An object of class bgmfit
if returnobj=TRUE
, otherwise
invisible NULL
.
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 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 avoid model compilation which often takes time
expose_model_functions(model, expose = FALSE)