Skip to contents

Perform DBSCAN clustering on functional data and optimize parameters `eps` and `minPts`.

Usage

fdbscan(
  fdataobj,
  eps,
  minPts = 5,
  metric = metric.lp,
  par.metric = list(lp = 2)
)

Arguments

fdataobj

An object of class `fdata` containing functional data.

eps

Neighborhood parameter (`eps`) for DBSCAN. If NULL, it is estimated automatically.

minPts

Minimum cluster size (`minPts`). If NULL, it is estimated automatically.

metric

Metric function to compute distances. Default is `metric.lp`.

par.metric

List of arguments for the metric function.

Value

A list with the following elements:

  • `optimal`: Data frame with the best parameters (`eps`, `minPts`, `quality`).

  • `model`: DBSCAN clustering model with refined clusters.

  • `results`: Data frame with all combinations of `eps` and `minPts` tested.

Examples

if (FALSE) { # \dontrun{
t <- seq(0, 2 * pi, length.out = 101)
res <- rprocKclust(t, n = c(30, 50, 40), process = c("cos_sin", "sin", "cos"),
                   c = c(-1, 1, 1), k = c(NA, NA, NA), s = c(0.2, 0.3, 0.1))
opt_results <- optim.fdbscan(res$X, metric = metric.lp, par.metric = list(lp = 2))
print(opt_results$optimal)
plot(res$X, col = opt_results$model$cluster+1, main = "Optimal DBSCAN Clustering")
} # }