% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/causal.R
\name{run_mcmc_causal}
\alias{run_mcmc_causal}
\title{Run posterior sampling for a causal bundle}
\usage{
run_mcmc_causal(
  bundle,
  show_progress = TRUE,
  quiet = FALSE,
  parallel_arms = FALSE,
  workers = NULL,
  timing = FALSE,
  z_update_every = NULL
)
}
\arguments{
\item{bundle}{A \code{"causalmixgpd_causal_bundle"} from \code{build_causal_bundle()}.}

\item{show_progress}{Logical; if TRUE, print step messages and render progress where supported.}

\item{quiet}{Logical; if TRUE, suppress step messages and progress display.}

\item{parallel_arms}{Logical; if TRUE, run control and treated outcome arms in parallel.}

\item{workers}{Optional integer workers for parallel arm execution.}

\item{timing}{Logical; if TRUE, return arm and total timings in \code{$timing}.}

\item{z_update_every}{Integer >= 1 passed to arm-level outcome MCMC.}
}
\value{
A list of class \code{"causalmixgpd_causal_fit"} containing the
fitted treated/control outcome models, optional PS fit, the original
bundle, and timing metadata when requested.
}
\description{
\code{run_mcmc_causal()} executes the PS block (when enabled) and the two
arm-specific outcome models prepared by \code{\link{build_causal_bundle}},
then returns a single \code{"causalmixgpd_causal_fit"} object.
}
\details{
The fitted object contains the posterior draws needed to evaluate arm-level
predictive distributions \eqn{F_1(y \mid x)} and
\eqn{F_0(y \mid x)}, followed by marginal or conditional causal
contrasts. When \code{PS = FALSE} in the bundle, the PS block is skipped and
outcome prediction uses only the original covariates.
}
\examples{
\donttest{
N <- 25
X <- data.frame(x1 = stats::rnorm(N))
A <- stats::rbinom(N, 1, 0.5)
y <- abs(stats::rnorm(N)) + 0.1
mcmc_small <- list(niter = 100, nburnin = 50, thin = 1, nchains = 1, seed = 1)
cb <- build_causal_bundle(y = y, X = X, A = A, backend = "sb", kernel = "normal",
                         mcmc_outcome = mcmc_small, mcmc_ps = mcmc_small)
fit <- run_mcmc_causal(cb)
}
}
\seealso{
\code{\link{build_causal_bundle}}, \code{\link{mcmc}},
\code{\link{predict.causalmixgpd_causal_fit}}, \code{\link{ate}},
\code{\link{qte}}.
}
