get_code | R Documentation |
Returns the Stan code of the model. Mostly useful for debugging or for building a customized version of the model.
get_code(x, ...)
## S3 method for class 'dynamiteformula'
get_code(x, data, time, group = NULL, blocks = NULL, ...)
## S3 method for class 'dynamitefit'
get_code(x, blocks = NULL, ...)
x |
[ |
... |
Ignored. |
data |
[ |
time |
[ |
group |
[ |
blocks |
[ |
The Stan model blocks as a character
string.
Model outputs
as.data.frame.dynamitefit()
,
as.data.table.dynamitefit()
,
as_draws_df.dynamitefit()
,
coef.dynamitefit()
,
confint.dynamitefit()
,
dynamite()
,
get_data()
,
get_parameter_dims()
,
get_parameter_names()
,
get_parameter_types()
,
ndraws.dynamitefit()
,
nobs.dynamitefit()
data.table::setDTthreads(1) # For CRAN
d <- data.frame(y = rnorm(10), x = 1:10, time = 1:10, id = 1)
cat(get_code(obs(y ~ x, family = "gaussian"),
data = d, time = "time", group = "id"
))
# same as
cat(dynamite(obs(y ~ x, family = "gaussian"),
data = d, time = "time", group = "id",
debug = list(model_code = TRUE, no_compile = TRUE)
)$model_code)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.