CausalMixGPD
  • Home
  • Roadmaps
    • Website roadmap
    • Package roadmap
  • Start
    • Start Hub
    • Roadmap
    • Usage Diagrams
    • Start Here
    • Basic Compile and Run
    • Backends and Workflow
    • Troubleshooting
  • Tracks
    • Quickstart
    • Modeling (1-arm)
    • Causal
    • Clustering
    • Kernels & tails
    • Customization
  • Examples
  • Kernels
  • Advanced
  • Developers
  • Reference
    • Reference hub
    • Function reference by job
  • News
  • Cite
  • Coverage
  • API Reference

Backends, Kernels, and Workflow Map

Website workflow note. This page reflects the current exported API and recommended wrapper-first usage. Last updated: 2026-02-19.

For the full package narrative, see the main package vignettes (basic, unconditional, conditional, and causal).

Workflow roadmap

Big picture

CausalMixGPD has two orthogonal dials you turn when building models:

  • Backend (how the mixture weights / clustering are represented)
    • CRP: Chinese Restaurant Process representation.
    • SB: stick-breaking truncation with a fixed number of components.
  • Kernel / family (what distribution models the bulk of the data)
    • Examples: normal, lognormal, gamma, inverse-Gaussian, Laplace, Cauchy, Amoroso, etc.

Optionally, you can also turn on:

  • GPD = TRUE/FALSE to splice a Generalized Pareto tail beyond a threshold.

For the math behind the bulk–tail “spliced” construction (threshold exceedances, DPM bulk, and spliced quantiles), see Theory: GPD tails + DPM bulk + splicing.

What changes between CRP and SB?

Both backends target the same posterior over densities. The difference is representation:

  • CRP learns a random number of occupied clusters within a finite components cap.
  • SB uses the same finite components cap and learns stick-breaking weights.

Practical rule of thumb:

  • CRP is convenient when you want adaptive complexity while still using a finite components cap.
  • SB is convenient when you want predictable memory/time and easy vectorization.

What does the workflow look like?

CausalMixGPD uses a consistent build -> run -> summarize loop:

  1. Build a bundle using bundle() (or causal builders if you are doing TE work).
  2. Fit directly using dpmix() (or dpmgpd() when GPD = TRUE).
  3. Inspect and summarize using print(), summary(), plot().
  4. Predict using predict(). For conditional (covariate) models, fitted() is also available.
Code
# Build
bundle <- bundle(
  x = rnorm(50),
  backend = "crp",
  kernel = "normal",
  GPD = FALSE,
  components = 5,
  mcmc = mcmc
)

# Run
fit <- load_or_fit("quickstart-backends-and-workflow-fit", dpmix(bundle))

# Summarize
print(fit)
MixGPD fit | backend: Chinese Restaurant Process | kernel: Normal Distribution | GPD tail: FALSE
n = 50 | components = 5 | epsilon = 0.025
MCMC: niter=400, nburnin=100, thin=2, nchains=1 
Fit
Use summary() for posterior summaries; plot() for diagnostics; predict() for predictions.
Code
summary(fit)
MixGPD summary | backend: Chinese Restaurant Process | kernel: Normal Distribution | GPD tail: FALSE | epsilon: 0.025
n = 50 | components = 5
Summary
Initial components: 5 | Components after truncation: 1

WAIC: 126.441
lppd: -57.216 | pWAIC: 6.004

Summary table
  parameter  mean    sd q0.025 q0.500 q0.975    ess
 weights[1] 0.962  0.08  0.735      1      1 23.073
      alpha 0.306 0.291  0.005  0.218  1.046 46.898
    mean[1] 0.128 0.133 -0.104  0.112  0.404    150
      sd[1] 1.539 0.422  0.967  1.483  2.602 80.825
Code
if (DO_PLOTS) plot(fit)

Kernel support quick check

Use kernel_support_table() and the kernel registry helpers to confirm what is available.

Code
kernel_support_table()
             kernel gpd covariates sb crp
normal       normal   ✔          ✔  ✔   ✔
lognormal lognormal   ✔          ✔  ✔   ✔
invgauss   invgauss   ✔          ✔  ✔   ✔
gamma         gamma   ✔          ✔  ✔   ✔
laplace     laplace   ✔          ✔  ✔   ✔
amoroso     amoroso   ✔          ✔  ✔   ✔
cauchy       cauchy  ❌          ✔  ✔   ✔

Manual runners and simulation helpers

Most users should stick to dpmix() / dpmgpd() (and their causal / clustering counterparts). For debugging or reproducibility workflows, the package also exports:

  • run_mcmc_bundle_manual() / run_mcmc_causal() for an explicit build → compile → run pipeline (useful when you want to inspect intermediate NIMBLE objects).
  • sim_bulk_tail(), sim_causal_qte(), and sim_survival_tail() for generating toy datasets that match the package’s bulk/tail and causal examples.

Where to go next

  • Available distributions: see the Kernels hub and kernel catalog pages.
  • Basic build/compile/run: see Start: basic-model-compile-run.
  • Unconditional / Conditional / Causal: continue through ex01+.

Workflow Navigation

  • Previous: basic-model-compile-run
  • Next: ex01-unconditional-dpm-crp
  • Workflow index: Roadmap
  • Practical entry: Examples

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: Start Here
  • 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.
(c) CausalMixGPD - Bayesian semiparametric modeling for heavy-tailed data
- - Cite - API - GitHub