Core g-BKMR analysis implementation
run_gbkmr_panel(
sim_popn,
T = 5,
p = 3,
mediator_basenames = c("waist"),
common_covariates = c("sex", "waist0"),
currind = 1,
n = 500,
K = 1000,
sel = seq(22000, 24000, by = 25),
iter = 24000,
n_iter = NULL,
n_knots = 50,
engine = c("bkmr", "fastbkmr"),
n_subset = 10,
n_cores = 10,
outcome_type = c("continuous", "binary"),
a_probs = c(0.25, 0.75),
a_vals = NULL,
astar_vals = NULL,
verbose_every = 50
)Data frame in g-BKMR format (see prepare_gbkmr_data).
Integer. Number of time points (including t=0).
Integer. Number of exposures per time point.
Character vector. Base names for time-dependent confounders.
Character vector. Baseline covariate names.
Integer. Random seed.
Integer. Sample size for analysis.
Integer. Monte Carlo samples for g-computation.
Numeric vector. Post-burn-in MCMC indices for inference.
Integer. MCMC iterations for mediator models.
Integer or NULL. MCMC iterations for outcome model (default: iter).
Integer. Number of knots for BKMR kernel approximation.
Character. Fitting engine: "bkmr" or "fastbkmr".
Integer. Number of subsets for fastBKMR.
Integer. Number of cores for fastBKMR parallel.
Character. "continuous" (Gaussian BKMR, default) or "binary" (probit BKMR via family="binomial"). Binary outcome requires engine="bkmr" (fastBKMR does not yet support non-Gaussian outcomes).
Numeric vector of length 2. Quantile probabilities for intervention levels (default: c(0.25, 0.75)).
Named numeric vector or NULL. Custom intervention values for low-exposure scenario. Overrides a_probs if provided.
Named numeric vector or NULL. Custom intervention values for high-exposure scenario. Overrides a_probs if provided.
Integer. Print progress every N iterations.
A list with causal effect estimate and model fits.