inst/examples/0.10/07-m2-fit-cmdstan.R

library(eyeprocess)

sim <- simulate_multimodal_m2(
  n_person = 100,
  n_item = 10,
  seed = 20260817
)

# Manual estimator example. The M2 reference backend is gated and
# requires cmdstanr + a configured CmdStan toolchain.
if (
  requireNamespace("cmdstanr", quietly = TRUE) &&
  nzchar(tryCatch(cmdstanr::cmdstan_path(), error = function(e) ""))
) {
  message(
    "CmdStan is available. Run fit_multimodal_m2(sim) when a full ",
    "Bayesian fit is intended; this example does not start sampling automatically."
  )
} else {
  message(
    "CmdStan is unavailable. No fallback estimator is substituted."
  )
}

Try the eyeprocess package in your browser

Any scripts or data that you put into this service are public.

eyeprocess documentation built on Sept. 28, 2026, 5:08 p.m.