% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sequence-distances-clustering.R
\name{bootstrap_sequence_clusters}
\alias{bootstrap_sequence_clusters}
\title{Bootstrap sequence-cluster stability}
\usage{
bootstrap_sequence_clusters(
  distance,
  k,
  method = c("hierarchical", "pam", "clara"),
  n_boot = 100L,
  sample_fraction = 0.8,
  seed = 1L,
  linkage = "average",
  ...
)
}
\arguments{
\item{distance}{Sequence distance object.}

\item{k}{Number of clusters.}

\item{method}{Clustering method.}

\item{n_boot}{Number of subsamples.}

\item{sample_fraction}{Fraction of sequences sampled in each iteration.}

\item{seed}{Reproducibility seed.}

\item{linkage}{Hierarchical linkage.}

\item{...}{Additional clustering arguments.}
}
\value{
An object of class \code{gp3_sequence_cluster_bootstrap}.
}
\description{
Uses repeated subsampling without replacement and records pairwise
co-clustering agreement relative to the full-data solution.
}
\examples{
sequences <- data.frame(
  sequence_id = rep(c("s1", "s2", "s3", "s4"), each = 4L),
  sequence_order = rep(1:4, times = 4L),
  state = c("A", "B", "C", "D", "A", "B", "C", "C",
            "D", "C", "B", "A", "D", "C", "A", "A"),
  group = rep(c("g1", "g2"), each = 8L),
  stringsAsFactors = FALSE
)
distance <- compute_sequence_distance(sequences)
bootstrap_sequence_clusters(distance, k = 2L, n_boot = 5L, seed = 1L)

}
