stantva_code: Generate StanTVA code

stantva_codeR Documentation

Generate StanTVA code

Description

Creates a StanTVA model code object.

Usage

stantva_code(
  formula = NULL,
  locations,
  task = c("wr", "pr"),
  regions = list(),
  C_mode = c("equal", "locations", "regions"),
  w_mode = c("locations", "regions", "equal"),
  t0_mode = c("constant", "gaussian", "exponential", "shifted_exponential"),
  K_mode = c("bernoulli", "free", "binomial", "hypergeometric"),
  max_K = locations,
  allow_guessing = FALSE,
  parallel = isTRUE(rstan_options("threads_per_chain") > 1L),
  save_log_lik = FALSE,
  priors = NULL,
  sanity_checks = TRUE,
  debug_neginf_loglik = FALSE
)

Arguments

formula

Optional formulas for nested and hierarchical model parameters.

locations

The number of display locations (items).

task

The task. Currently implemented: wr (whole report) and pr (partial report)

regions

An optional list of groups of display locations (regions).

C_mode

The mode/family for the $C$ parameter.

w_mode

The mode/family for the $w$ parameter.

t0_mode

The mode/family for the $t_0$ parameter.

K_mode

The mode for the $K$ parameter.

max_K

The upper bound of $K$.

allow_guessing

(logical) Whether to allow guessing.

parallel

(logical) Whether to use parallel chains.

save_log_lik

(logical) Whether to save the log likelihood (needed for likelihood-based model comparison such as loo).

priors

The priors.

sanity_checks

(logical) Whether to perform sanity checks.

debug_neginf_loglik

(logical) Whether to debug negative infinity log likelihood.

Value

The StanTVA model code object.

Examples

model <- stantva_code(locations = 4, task = "pr")
model

RStanTVA documentation built on April 16, 2025, 5:10 p.m.