Skip to contents

Build and fit a Dirichlet-process mixture for clustering without causal estimands or posterior prediction for a response surface. This interface focuses on latent partition recovery from a formula specification and returns a cluster-fit object that can be summarized, plotted, or converted into labels and posterior similarity matrices with predict.dpmixgpd_cluster_fit().

Usage

dpmix.cluster(
  formula,
  data,
  type = c("weights", "param", "both"),
  default = "weights",
  mcmc = list(),
  ...
)

Arguments

formula

Model formula. The response must be present in data.

data

Data frame containing the response and optional predictors.

type

Clustering mode:

  • "weights": links mixture weights to predictors

  • "param": links kernel parameters to predictors

  • "both": links both weights and kernel parameters to predictors

default

Default mode used when type is omitted.

mcmc

MCMC control list passed into the cluster bundle.

...

Additional arguments passed to build_cluster_bundle(), including kernel settings, prior overrides, component counts, and monitoring controls.

Value

Object of class dpmixgpd_cluster_fit.

Details

The fitted model targets a latent partition \(z_1, \dots, z_n\) with component-specific kernel parameters. Depending on type, predictors can enter through the gating probabilities $$ \Pr(z_i = k \mid x_i) = \pi_k(x_i) $$ or through linked kernel parameters for each component. The returned fit stores posterior draws of the latent cluster labels and associated parameters; the representative clustering is extracted later by predict.dpmixgpd_cluster_fit() using Dahl's least-squares rule.

Use type = "weights" or type = "both" only when the formula includes predictors and when an explicit number of components is supplied. Otherwise the builder stops before fitting.