Skip to contents

Translate a compiled gretaR_model into Stan code suitable for use with cmdstanr. The generated code preserves the model structure defined via the gretaR DSL.

Usage

compile_to_stan(model)

Arguments

model

A gretaR_model object created by model().

Value

A character string containing valid Stan code.

Examples

if (FALSE) { # \dontrun{
mu <- normal(0, 10)
sigma <- half_cauchy(2)
y <- as_data(rnorm(50, 3, 1.5))
distribution(y) <- normal(mu, sigma)
m <- model(mu, sigma)
cat(compile_to_stan(m))
} # }