Troubleshooting
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).
Common issues and solutions
This vignette collects common errors and fixes encountered when building or running CausalMixGPD models.
1. “Number of columns in ‘x’ does not match training design matrix”
Cause: New data has different columns than the training X.
Fix: Use the same column names and order as the training matrix.
X_train <- fit$data$X
X_new <- X_train[1:5, , drop = FALSE]
X_new <- X_new[, colnames(X_train), drop = FALSE]
predict(fit, newdata =X_new, type = "mean")2. “Cauchy kernels are never paired with GPD tails”
Cause: The Cauchy kernel is not allowed with GPD tails.
Fix: Use a different kernel or disable GPD.
bundle <- bundle(
y = y,
kernel = "cauchy",
backend = "sb",
GPD = FALSE
)3. “GPD tail not moving” (threshold/shape stuck)
Cause: Very short chains or overly restrictive priors.
Fix: Increase iterations or relax tail priors.
bundle <- bundle(
y = y,
kernel = "gamma",
backend = "crp",
GPD = TRUE,
components = 6,
mcmc = mcmc
)4. “future.globals.maxSize exceeded”
Cause: Parallel predictions export large functions/objects.
Fix: Set a higher limit or use ncores = 1.
options(future.globals.maxSize = 4 * 1024^3)
pred <- predict(fit, newdata =X_new, y = y_grid, type = "density", ncores = 2)5. MCMC is slow
Cause: Large datasets, many components, or heavy kernels.
Fix: Use smaller components/J, shorter niter, or start with CRP.
bundle <- bundle(
y = y,
backend = "crp",
kernel = "normal",
components = 4,
mcmc = mcmc
)6. fitted() and residuals() for unconditional models
Cause: You called fitted() or residuals() on an unconditional (no-covariate) fit.
Fix: fitted() and residuals() are not supported for unconditional models. Use predict() for predictions and posterior summaries (e.g. predict(fit, type = "mean"), predict(fit, type = "quantile", p = 0.5)).
7. PS not used in causal model
Cause: PS=FALSE or X missing.
Fix: Provide X and enable PS.
cb <- bundle(
y = y,
treat = A,
X = X,
PS = "logit"
)
fit <- dpmix.causal(cb, mcmc = list(parallel_arms = TRUE, workers = max_workers))8. Kernel mismatch when mixing arms
Cause: Using kernels with different supports across arms.
Fix: Ensure both arms use kernels on the same support (e.g., both positive-support or both real-line).
cb <- bundle(
y = y,
treat = A,
X = X,
kernel = c("gamma", "lognormal"),
backend = c("sb", "crp")
)9. “Cannot resolve owner of file” / “No mapping between account names and security IDs” (Windows)
Cause: The project or package lives in OneDrive (or another synced/network path). Windows cannot map file-owner SIDs to account names when R uses file.info() on those paths.
Fix: The warnings are harmless; CausalMixGPD and nimble load and run normally. If you keep the project in OneDrive (e.g. as a backup to GitHub), the project .Rprofile suppresses these warnings automatically when using R >= 4.0. Otherwise, move the project to a local non-synced path or take ownership of the OneDrive folder (right-click -> Properties -> Security -> Advanced -> Take ownership).
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.