Causal internals
This page documents the causal pipeline for contributors.
For user-facing workflows, prefer causal wrapper entry points (dpmix.causal() / dpmgpd.causal()) over direct mcmc() calls.
Objects
A causal fit typically contains: - treatment-arm fit - control-arm fit - (optional) propensity score model output - derived estimands (ate(), att(), qte(), qtt(), cate(), cqte()) and their summaries
Computation outline
- Preferred user path: fit via
dpmix.causal(..., treat=...)ordpmgpd.causal(..., treat=...). - Internal contributor path: build a causal bundle (
bundle()), optionally including a PS sub-bundle. - Internal contributor path: run MCMC (
mcmc()), producing a causal fit object. - Compute marginal estimands (
ate(),att(),qte(),qtt()) on training data; compute conditional estimands (cate(),cqte()) onnewdataif supplied, otherwise trainingX.
Estimand contract notes
cate()/cqte()are conditional estimands and require a model fitted withX(they are unavailable for no-Xcausal fits).ate()/att()/qte()/qtt()are marginal estimands and always use training data; any suppliednewdata/yis ignored with a warning.- R-mean is supported for mean-based estimands via
type = "rmean"incate(),ate(),att(), and throughate_rmean().
Important constraint
ImportantGolden rules (do not break)
- Notation: mixture components use subscript j; restriction time uses L; Cox shorthand is ph.
- User-facing output: the “GPD flag” must display as TRUE/FALSE (not ON/OFF).
- Causal legality: the only unused/disallowed combo is SB + normal + GPD = FALSE.
Prereqs
- Required packages and data for this page are listed in the setup chunks above.
Outputs
- This page renders model fits, diagnostics, and summary artifacts generated by package APIs.
Interpretation
- Canonical concept page: Spec And Contracts
- Treat this page as an application/example view and use the canonical page for core definitions.
Next
- Continue to the linked canonical concept page, then return for implementation-specific details.