Ensures the fit object was created with the expected inference mode. Useful for enforcing mode requirements in downstream analysis.
Examples
# \donttest{
sim <- sim_ratiod(n = 100, family = ratiod_poisson_gamma(), seed = 1)
fit <- tratio(y_num | y_denom ~ x1 + (1 | group), data = sim$data,
family = ratiod_poisson_gamma(),
control = list(iter = 1000, chains = 2, seed = 1))
validate_mode(fit, "hmc")
#> [1] TRUE
validate_mode(fit, "laplace", error = FALSE)
#> [1] FALSE
# }