stancode.default | R Documentation |
Generate Stan code for brms models
## Default S3 method:
stancode(
object,
data,
family = gaussian(),
prior = NULL,
autocor = NULL,
data2 = NULL,
cov_ranef = NULL,
sparse = NULL,
sample_prior = "no",
stanvars = NULL,
stan_funs = NULL,
knots = NULL,
drop_unused_levels = TRUE,
threads = getOption("brms.threads", NULL),
normalize = getOption("brms.normalize", TRUE),
save_model = NULL,
...
)
object |
An object of class |
data |
An object of class |
family |
A description of the response distribution and link function to
be used in the model. This can be a family function, a call to a family
function or a character string naming the family. Every family function has
a |
prior |
One or more |
autocor |
(Deprecated) An optional |
data2 |
A named |
cov_ranef |
(Deprecated) A list of matrices that are proportional to the
(within) covariance structure of the group-level effects. The names of the
matrices should correspond to columns in |
sparse |
(Deprecated) Logical; indicates whether the population-level
design matrices should be treated as sparse (defaults to |
sample_prior |
Indicate if draws from priors should be drawn
additionally to the posterior draws. Options are |
stanvars |
An optional |
stan_funs |
(Deprecated) An optional character string containing
self-defined Stan functions, which will be included in the functions
block of the generated Stan code. It is now recommended to use the
|
knots |
Optional list containing user specified knot values to be used
for basis construction of smoothing terms. See
|
drop_unused_levels |
Should unused factors levels in the data be
dropped? Defaults to |
threads |
Number of threads to use in within-chain parallelization. For
more control over the threading process, |
normalize |
Logical. Indicates whether normalization constants should
be included in the Stan code (defaults to |
save_model |
Either |
... |
Other arguments for internal usage only. |
A character string containing the fully commented Stan code
to fit a brms model. It is of class c("character", "brmsmodel")
to facilitate pretty printing.
stancode(rating ~ treat + period + carry + (1|subject),
data = inhaler, family = "cumulative")
stancode(count ~ zAge + zBase * Trt + (1|patient),
data = epilepsy, family = "poisson")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.