enclosing_radius {TDApplied} | R Documentation |
Compute the enclosing radius for a dataset.
Description
The enclosing radius is the minimum (Euclidean distance) radius beyond which no topological changes will occur.
Usage
enclosing_radius(X, distance_mat = FALSE)
Arguments
X |
the input dataset, must either be a matrix or data frame. |
distance_mat |
whether or not 'X' is a distance matrix, default FALSE. |
Value
the numeric enclosing radius.
Author(s)
Shael Brown - shaelebrown@gmail.com
Examples
# create a persistence diagram from a 2D Gaussian
df = data.frame(x = rnorm(n = 20,mean = 0,sd = 1),y = rnorm(n = 20,mean = 0,sd = 1))
# compute the enclosing radius from the point cloud
enc_rad <- enclosing_radius(df, distance_mat = FALSE)
# compute the distance matrix manually, stored as a matrix
dist_df <- as.matrix(dist(df))
# compute the enclosing radius from the distance matrix
enc_rad <- enclosing_radius(dist_df, distance_mat = TRUE)
[Package TDApplied version 3.0.4 Index]