% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/wrappers.R
\name{dpmgpd.causal}
\alias{dpmgpd.causal}
\title{Fit a causal two-arm Dirichlet process mixture with a spliced GPD tail}
\usage{
dpmgpd.causal(
  y = NULL,
  X = NULL,
  treat = NULL,
  data = NULL,
  mcmc = list(),
  formula = NULL,
  ...
)
}
\arguments{
\item{y}{Either a response vector or a causal bundle object.}

\item{X}{Optional design matrix/data.frame.}

\item{treat}{Binary treatment indicator.}

\item{data}{Optional data.frame used with \code{formula}.}

\item{mcmc}{Named list of run arguments passed to \code{mcmc()} (including
optional performance controls such as \code{parallel_arms},
\code{workers}, \code{timing}, and \code{z_update_every}).}

\item{formula}{Optional formula.}

\item{...}{Additional build arguments passed to \code{\link{build_causal_bundle}}.}
}
\value{
A fitted object of class \code{"causalmixgpd_causal_fit"}.
}
\description{
\code{dpmgpd.causal()} is the highest-level causal fitting wrapper. It builds
or accepts a causal bundle, runs posterior sampling for the treated and
control arms, and returns a single causal fit ready for prediction and effect
estimation.
}
\details{
The arm-specific predictive distributions
\eqn{F_1(y \mid x)} and \eqn{F_0(y \mid x)} inherit
the spliced bulk-tail structure. Downstream causal estimands are computed as
functionals of these two predictive laws, for example
\deqn{\mathrm{QTE}(\tau) = Q_1(\tau) - Q_0(\tau), \qquad
\mathrm{ATE} = E(Y_1) - E(Y_0).}
}
\examples{
\donttest{
data("causal_pos500_p3_k2", package = "CausalMixGPD")
idx <- seq_len(30)
fit <- dpmgpd.causal(
  y = causal_pos500_p3_k2$y[idx],
  X = causal_pos500_p3_k2$X[idx, , drop = FALSE],
  treat = causal_pos500_p3_k2$A[idx],
  kernel = "gamma",
  backend = "sb",
  components = 3,
  mcmc = list(niter = 60, nburnin = 30, thin = 1, nchains = 1, seed = 1,
              show_progress = FALSE, quiet = TRUE)
)
ate(fit, show_progress = FALSE)
}
}
\seealso{
\code{\link{build_causal_bundle}},
\code{\link{bundle}}, \code{\link{dpmix.causal}},
\code{\link{predict.causalmixgpd_causal_fit}}, \code{\link{ate}},
\code{\link{qte}}, \code{\link{cate}}, \code{\link{cqte}}.
}
