View source: R/maxPersistence.R
maxPersistence | R Documentation |
Given a point cloud and a function built on top of the data, we are interested in studying the evolution of the sublevel sets (or superlevel sets) of the function, using persistent homology. The Maximal Persistence Method selects the optimal smoothing parameter of the function, by maximizing the number of significant topological features, or by maximizing the total significant persistence of the features. For each value of the smoothing parameter, the function maxPersistence
computes a persistence diagram using gridDiag
and returns the values of the two criteria, the dimension of detected features, their persistence, and a bootstrapped confidence band. The features that fall outside of the band are statistically significant. See References.
maxPersistence(
FUN, parameters, X, lim, by,
maxdimension = length(lim) / 2 - 1, sublevel = TRUE,
library = "GUDHI", B = 30, alpha = 0.05,
bandFUN = "bootstrapBand", distance = "bottleneck",
dimension = min(1, maxdimension), p = 1, parallel = FALSE,
printProgress = FALSE, weight = NULL)
FUN |
the name of a function whose inputs are: 1) |
parameters |
a numerical vector, storing a sequence of values for the smoothing paramter of |
X |
a |
lim |
a |
by |
either a number or a vector of length |
maxdimension |
a number that indicates the maximum dimension to compute persistent homology to. The default value is |
sublevel |
a logical variable indicating if the persistent homology should be computed for sublevel sets of |
library |
a string specifying which library to compute the persistence diagram. The user can choose either the library |
bandFUN |
the function to be used in the computation of the confidence band. Either |
B |
the number of bootstrap iterations. |
alpha |
for each value store in |
distance |
optional (if bandFUN == bootstrapDiagram): a string specifying the distance to be used for persistence diagrams: either |
dimension |
optional (if bandFUN == bootstrapDiagram): an integer or a vector specifying the dimension of the features used to compute the bottleneck distance. 0 for connected components, 1 for loops, 2 for voids. The default value is |
p |
optional (if bandFUN == bootstrapDiagram AND distance == "wasserstein"): integer specifying the power to be used in the computation of the Wasserstein distance. The default value is |
parallel |
logical: if |
printProgress |
if |
weight |
either NULL, a number, or a vector of length |
The function maxPersistence
calls the gridDiag
function, which computes the persistence diagram of sublevel (or superlevel) sets of a function, evaluated over a grid of points.
The function maxPersistence
returns an object of the class "maxPersistence", a list with the following components
parameters |
the same vector |
sigNumber |
a numeric vector storing the number of significant features in the persistence diagrams computed using each value in |
sigPersistence |
a numeric vector storing the sum of significant persistence of the features in the persistence diagrams, computed using each value in |
bands |
a numeric vector storing the bootstrap band's width, for each value in |
Persistence |
a list of the same lenght of |
Jisu Kim and Fabrizio Lecci
Chazal F, Cisewski J, Fasy BT, Lecci F, Michel B, Rinaldo A, Wasserman L (2014). "Robust Topological Inference: distance-to-a-measure and kernel distance."
Fasy BT, Lecci F, Rinaldo A, Wasserman L, Balakrishnan S, Singh A (2013). "Statistical Inference For Persistent Homology", (arXiv:1303.7117). Annals of Statistics.
gridDiag
, kde
, kernelDist
, dtm
, bootstrapBand
## input data: circle with clutter noise
n <- 600
percNoise <- 0.1
XX1 <- circleUnif(n)
noise <- cbind(runif(percNoise * n, -2, 2), runif(percNoise * n, -2, 2))
X <- rbind(XX1, noise)
## limits of the Gird at which the density estimator is evaluated
Xlim <- c(-2, 2)
Ylim <- c(-2, 2)
lim <- cbind(Xlim, Ylim)
by <- 0.2
B <- 80
alpha <- 0.05
## candidates
parametersKDE <- seq(0.1, 0.5, by = 0.2)
maxKDE <- maxPersistence(kde, parametersKDE, X, lim = lim, by = by,
bandFUN = "bootstrapBand", B = B, alpha = alpha,
parallel = FALSE, printProgress = TRUE)
print(summary(maxKDE))
par(mfrow = c(1,2))
plot(X, pch = 16, cex = 0.5, main = "Circle")
plot(maxKDE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.