View source: R/helpers-model.R
| extract_stan_blocks | R Documentation |
This function extracts the code from the different program blocks of a STAN
program. This can be used in combination with the stancode function to
access information about the STAN code generated by brms and bmm.
extract_stan_blocks(
stan_code,
blocks = c("functions", "data", "transformed data", "parameters",
"transformed parameters", "model", "generated quantities")
)
stan_code |
The STAN code for which the elements should be extracted |
blocks |
A character vector specifying for which program blocks the code should be extracted. The default extracks all standard blocks: "functions", "data", "transformed data", "parameters", "transformed parameters", "model", and "generated quantities" |
A named list with each element containing the code of one of the STAN program blocks. If a block
# generate simple stan code from brms
stan_code <- stancode(brms::bf(x ~ 1), data = data.frame(x = rnorm(100)))
extracted_program_blocks <- extract_stan_blocks(stan_code)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.