% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ComplexDistance.R
\name{complex_distance}
\alias{complex_distance}
\title{Wasserstein/bottleneck distance between two point clouds, via one chosen complex}
\usage{
complex_distance(
  points1,
  points2,
  method = c("VR", "Delaunay", "Alpha", "Cech", "Witness"),
  distance = c("wasserstein", "bottleneck"),
  dimension = 0,
  p = 2,
  ground = NULL,
  eps_max = NULL,
  landmarks = NULL,
  nu = 1
)
}
\arguments{
\item{points1, points2}{Numeric matrices or data.frames, one point per row.}

\item{method}{One of \code{"VR"}, \code{"Delaunay"}, \code{"Alpha"},
\code{"Cech"}, \code{"Witness"} - passed to \code{\link{build_filtration}}.}

\item{distance}{One of \code{"wasserstein"} or \code{"bottleneck"}.}

\item{dimension}{Homological dimension to compare.}

\item{p}{Wasserstein order, used only when \code{distance = "wasserstein"}.}

\item{ground}{Ground metric passed to the chosen distance function
(\code{"L2"} or \code{"Linf"}). Defaults to each distance's own default
(\code{"L2"} for Wasserstein, \code{"Linf"} for bottleneck) if left
\code{NULL}.}

\item{eps_max}{Maximum scale, passed to \code{\link{build_filtration}}.
Required for \code{"VR"}, \code{"Cech"} and \code{"Witness"}; optional
for \code{"Alpha"} (defaults to \code{Inf}); ignored for
\code{"Delaunay"}.}

\item{landmarks}{Passed to \code{\link{build_filtration}} for
\code{"Witness"}; if \code{NULL}, defaults independently for each point
cloud to \code{min(30, nrow(points))} landmarks, with a message.}

\item{nu}{Passed to \code{\link{build_filtration}} for \code{"Witness"}.}
}
\value{
A list with:
\describe{
  \item{distance}{The computed distance (a single number).}
  \item{method, distance_type, dimension}{Echoed back for reference.}
  \item{diagram1, diagram2}{The two persistence diagrams (data frames)
    the distance was computed from.}
}
}
\description{
Picks a single \code{\link{build_filtration}} method, builds the
persistence diagram of each point cloud with it, and compares the two
diagrams with either \code{\link{wasserstein_distance}} or
\code{\link{bottleneck_distance}}. Useful for asking "how different are
these two datasets topologically", holding the complex construction fixed
so the comparison is apples-to-apples.
}
\examples{
set.seed(1)
cloud_a <- matrix(rnorm(24), ncol = 2)
cloud_b <- matrix(rnorm(24), ncol = 2) + 0.1
complex_distance(cloud_a, cloud_b, method = "VR", distance = "bottleneck",
                  dimension = 0, eps_max = 0.6)
}
