Skip to contents

The bml analogues of brms::make_stancode() / make_standata(): build the model exactly as bml would, but return the generated JAGS model string (make_jagscode) or the JAGS data list (make_jagsdata) instead of fitting.

Usage

make_jagscode(
  formula,
  data,
  family = stats::gaussian(),
  prior = NULL,
  monitor = TRUE
)

make_jagsdata(
  formula,
  data,
  family = stats::gaussian(),
  prior = NULL,
  monitor = TRUE
)

Arguments

formula, data, family, prior

As in bml.

monitor

As in bml (affects which nodes the model defines).

Value

make_jagscode(): a character scalar of class "bml_jagscode" (prints nicely). make_jagsdata(): a named list.

Examples

if (FALSE) { # \dontrun{
code <- make_jagscode(
  y ~ x + mm(id = id(pid, gid), vars = vars(z), w = w(~ 1/n), fn = fn("sum")),
  data = dat, family = gaussian()
)
code
} # }