landmarks_maxmin: Ball-based Landmark Sets

Description Usage Arguments Details Author(s) References Examples

View source: R/landmarks-maxmin.r

Description

Compute landmark sets based on fixed-radius balls.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
minmax(x, y = NULL, dist_method = "euclidean")

maxmin(x, y = NULL, dist_method = "euclidean")

landmarks_maxmin(
  x,
  dist_method = "euclidean",
  pick_method = "first",
  num = NULL,
  radius = NULL,
  frac = FALSE,
  seed_index = 1L,
  engine = NULL,
  cover = FALSE,
  extend_num = extension(mult = 0, add = 0),
  extend_radius = extension(mult = 0, add = 0)
)

Arguments

x

a data matrix.

y

a data matrix of the same dimension as x; if NULL, taken to be x.

dist_method

a character string specifying the distance metric to use; passed to proxy::dist(method). Any distance measure in the proxy package is supported.

pick_method

a character string specifying the method for selecting one among indistinguishable points, either "first" (the default), "last", or "random".

num

a positive integer; the desired number of landmark points, or of sets in a ball cover.

radius

a positive number; the desired radius of each landmark ball, or of each set in a ball cover.

frac

logical; whether to treat radius as a fraction of the diameter of x.

seed_index

an integer (the first landmark to seed the algorithm) or one of the character strings "random" (to select a seed uniformly at random) and "minmax" (to select a seed from the minmax set).

engine

character string specifying the implementation to use; one of "original", "C++", or "R". When not specified, the R engine is used.

cover

logical; whether to return a data frame of landmark indices and cover sets (by member index) rather than only a vector of landmark indices.

extend_num, extend_radius

length-two numeric vectors used to extend landmark parameters for cover set construction. See extension().

Details

This function uses the maxmin procedure to produce a set of evenly spaced landmark points from a data set. Maxmin is a simple greedy algorithm that is relatively efficient, but it has a tendency to pick out extremal points.

One, both, or neither of num and radius may be passed values. If neither is specified, then num is defaulted to 24L. If the values yield balls that do not cover x, then their number is increased until the radius necessary to cover x is at most radius. To generte a complete landmark set, use radius = 0L.

Author(s)

Matt Piekenbrock

Jason Cory Brunson

Yara Skaf

References

De Silva, Vin, and Gunnar E. Carlsson. "Topological estimation using witness complexes." SPBG 4 (2004): 157-166.

Dłotko, Paweł. "Ball Mapper: A Shape Summary for Topological Data Analysis." (2019). Web.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
set.seed(3)
# small circle sample
X <- tdaunif::sample_circle(n = 12L)
# random seed index
l <- landmarks_maxmin(X, seed_index = "random")
# plot landmark order at point positions
plot(X, asp = 1, pch = NA)
text(X, labels = order(l))
# minmax seed index
l <- landmarks_maxmin(X, seed_index = "minmax")
# plot landmark order at point positions
plot(X, asp = 1, pch = NA)
text(X, labels = order(l))

corybrunson/maxmin documentation built on Feb. 3, 2022, 1:58 a.m.