stan
Stan code helpers.
This module exposes wrappers for generating Stan code from brms models without running sampling.
Notes
Executed inside the worker process that hosts the embedded R session.
Classes¶
Functions¶
make_stancode(formula, data, priors=None, family='poisson', sample_prior='no', formula_args=None)
¶
Generate Stan code using R brms::make_stancode().
Useful for inspecting the generated Stan model before fitting.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
formula
|
str or FormulaConstruct
|
Model formula. |
required |
data
|
DataFrame
|
Model data. |
required |
priors
|
Sequence[PriorSpec] or None
|
Optional prior specifications created via |
None
|
family
|
str
|
Distribution family (e.g. |
"poisson"
|
sample_prior
|
str
|
Prior sampling mode passed to brms ( |
"no"
|
formula_args
|
dict or None
|
Reserved for future use. Currently ignored. |
None
|
Returns:
| Type | Description |
|---|---|
str
|
Complete Stan program as a string. |
See Also
brms::make_stancode : R documentation
Examples: