Skip to contents

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.

Usage

dpmgpd.causal(
  y = NULL,
  X = NULL,
  treat = NULL,
  data = NULL,
  mcmc = list(),
  formula = NULL,
  ...
)

Arguments

y

Either a response vector or a causal bundle object.

X

Optional design matrix/data.frame.

treat

Binary treatment indicator.

data

Optional data.frame used with formula.

mcmc

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

formula

Optional formula.

...

Additional build arguments passed to build_causal_bundle.

Value

A fitted object of class "causalmixgpd_causal_fit".

Details

The arm-specific predictive distributions \(F_1(y \mid x)\) and \(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 $$\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)
#> ATE (Average Treatment Effect)
#>   Prediction points: 1
#>   Conditional (covariates): NO
#>   Propensity score used: YES
#>   PS scale: logit
#>   Credible interval: credible (95%)
#> 
#> ATE estimates (treated - control):
#>   mean lower upper
#>  1.726 0.486 3.184
# }