Run posterior sampling for a causal bundle
run_mcmc_causal.Rdrun_mcmc_causal() executes the PS block (when enabled) and the two
arm-specific outcome models prepared by build_causal_bundle,
then returns a single "causalmixgpd_causal_fit" object.
Usage
run_mcmc_causal(
bundle,
show_progress = TRUE,
quiet = FALSE,
parallel_arms = FALSE,
workers = NULL,
timing = FALSE,
z_update_every = NULL
)Arguments
- bundle
A
"causalmixgpd_causal_bundle"frombuild_causal_bundle().- show_progress
Logical; if TRUE, print step messages and render progress where supported.
- quiet
Logical; if TRUE, suppress step messages and progress display.
- parallel_arms
Logical; if TRUE, run control and treated outcome arms in parallel.
- workers
Optional integer workers for parallel arm execution.
- timing
Logical; if TRUE, return arm and total timings in
$timing.- z_update_every
Integer >= 1 passed to arm-level outcome MCMC.
Value
A list of class "causalmixgpd_causal_fit" containing the
fitted treated/control outcome models, optional PS fit, the original
bundle, and timing metadata when requested.
Details
The fitted object contains the posterior draws needed to evaluate arm-level
predictive distributions \(F_1(y \mid x)\) and
\(F_0(y \mid x)\), followed by marginal or conditional causal
contrasts. When PS = FALSE in the bundle, the PS block is skipped and
outcome prediction uses only the original covariates.
Examples
if (FALSE) { # \dontrun{
cb <- build_causal_bundle(y = y, X = X, A = A, backend = "sb", kernel = "normal")
fit <- run_mcmc_causal(cb)
} # }