stancode {brms} | R Documentation |
Stan Code for Bayesian models
Description
stancode
is a generic function that can be used to
generate Stan code for Bayesian models. Its original use is
within the brms package, but new methods for use
with objects from other packages can be registered to the same generic.
Usage
stancode(object, ...)
make_stancode(formula, ...)
Arguments
object |
An object whose class will determine which method to apply. Usually, it will be some kind of symbolic description of the model form which Stan code should be generated. |
... |
Further arguments passed to the specific method. |
formula |
Synonym of |
Details
See stancode.default
for the default
method applied for brms models.
You can view the available methods by typing: methods(stancode)
The make_stancode
function is an alias of stancode
.
Value
Usually, a character string containing the generated Stan code.
For pretty printing, we recommend the returned object to be of class
c("character", "brmsmodel")
.
See Also
stancode.default
, stancode.brmsfit
Examples
stancode(rating ~ treat + period + carry + (1|subject),
data = inhaler, family = "cumulative")