% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cluster.R
\name{dpmgpd.cluster}
\alias{dpmgpd.cluster}
\title{Fit a clustering-only bulk-tail model}
\usage{
dpmgpd.cluster(
  formula,
  data,
  type = c("weights", "param", "both"),
  default = "weights",
  mcmc = list(),
  ...
)
}
\arguments{
\item{formula}{Model formula. The response must be present in \code{data}.}

\item{data}{Data frame containing the response and optional predictors.}

\item{type}{Clustering mode:
\itemize{
\item \code{"weights"}: links mixture weights to predictors
\item \code{"param"}: links kernel parameters to predictors
\item \code{"both"}: links both weights and kernel parameters to predictors
}}

\item{default}{Default mode used when \code{type} is omitted.}

\item{mcmc}{MCMC control list passed into the cluster bundle.}

\item{...}{Additional arguments passed to \code{build_cluster_bundle()}, including kernel settings,
prior overrides, component counts, and monitoring controls.}
}
\value{
Object of class \code{dpmixgpd_cluster_fit}.
}
\description{
Variant of \code{\link[=dpmix.cluster]{dpmix.cluster()}} that augments the cluster kernel with a generalized Pareto tail.
This is the clustering analogue of the spliced bulk-tail workflow used by \code{\link[=dpmgpd]{dpmgpd()}}.
}
\details{
For observations above a component-specific threshold, the component density is spliced as
\deqn{
f(y) = (1 - F_{bulk}(u)) g_{GPD}(y \mid u, \sigma_u, \xi_u), \qquad y \ge u,
}
so cluster assignment can be informed by both central behavior and tail behavior.

This interface is preferable when cluster separation is driven by upper-tail differences rather
than bulk-only shape or location differences.
}
\examples{
\donttest{
data("nc_posX100_p3_k2", package = "CausalMixGPD")
dat <- data.frame(y = nc_posX100_p3_k2$y[1:20],
                  nc_posX100_p3_k2$X[1:20, , drop = FALSE])
fit <- dpmgpd.cluster(
  y ~ x1 + x2 + x3,
  data = dat,
  kernel = "gamma",
  type = "param",
  components = 3,
  mcmc = list(niter = 60, nburnin = 30, thin = 1, nchains = 1, seed = 1)
)
cluster_profiles(fit)
}
}
\seealso{
\code{\link[=dpmix.cluster]{dpmix.cluster()}}, \code{\link[=predict.dpmixgpd_cluster_fit]{predict.dpmixgpd_cluster_fit()}},
\code{\link[=dpmgpd]{dpmgpd()}}, \code{\link[=sim_bulk_tail]{sim_bulk_tail()}}.

Other cluster workflow: 
\code{\link{cluster_profiles}()},
\code{\link{dpmix.cluster}()},
\code{\link{plot.dpmixgpd_cluster_bundle}()},
\code{\link{predict.dpmixgpd_cluster_fit}()},
\code{\link{print.dpmixgpd_cluster_bundle}()},
\code{\link{print.dpmixgpd_cluster_fit}()},
\code{\link{print.dpmixgpd_cluster_labels}()},
\code{\link{print.dpmixgpd_cluster_psm}()},
\code{\link{summary.dpmixgpd_cluster_bundle}()},
\code{\link{summary.dpmixgpd_cluster_fit}()},
\code{\link{summary.dpmixgpd_cluster_labels}()},
\code{\link{summary.dpmixgpd_cluster_psm}()}
}
\concept{cluster workflow}
