View source: R/bootstrapDiagram.R
bootstrapDiagram | R Documentation |
The function bootstrapDiagram
computes a (1-alpha)
confidence set for the Persistence Diagram of a filtration of sublevel sets (or superlevel sets) of a function evaluated over a grid of points. The function returns the (1-alpha
) quantile of B
bottleneck distances (or Wasserstein distances), computed in B
iterations of the bootstrap algorithm.
bootstrapDiagram(
X, FUN, lim, by, maxdimension = length(lim) / 2 - 1,
sublevel = TRUE, library = "GUDHI", B = 30, alpha = 0.05,
distance = "bottleneck", dimension = min(1, maxdimension),
p = 1, parallel = FALSE, printProgress = FALSE, weight = NULL,
...)
X |
an |
FUN |
a function whose inputs are 1) an |
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 Persistence Diagram should be computed for sublevel sets ( |
library |
a string specifying which library to compute the persistence diagram. The user can choose either the library |
B |
the number of bootstrap iterations. The default value is |
alpha |
The function |
distance |
a string specifying the distance to be used for persistence diagrams: either |
dimension |
|
p |
if |
parallel |
logical: if |
printProgress |
if |
weight |
either NULL, a number, or a vector of length |
... |
additional parameters for the function |
The function bootstrapDiagram
uses gridDiag
to compute the persistence diagram of the input function using the entire sample. Then the bootstrap algorithm, for B
times, computes the bottleneck distance between the original persistence diagram and the one computed using a subsample. Finally the (1-alpha
) quantile of these B
values is returned. See (Chazal, Fasy, Lecci, Michel, Rinaldo, and Wasserman, 2014) for discussion of the method.
The function bootstrapDiagram
returns the (1-alpha
) quantile of the values computed by the bootstrap algorithm.
The function bootstrapDiagram
uses the C++ library Dionysus for the computation of bottleneck and Wasserstein distances. See references.
Jisu Kim and Fabrizio Lecci
Chazal F, Fasy BT, Lecci F, Michel B, Rinaldo A, Wasserman L (2014). "Robust Topological Inference: Distance-To-a-Measure and Kernel Distance." Technical Report.
Wasserman L (2004), "All of statistics: a concise course in statistical inference." Springer.
Morozov D (2007). "Dionysus, a C++ library for computing persistent homology." https://www.mrzv.org/software/dionysus/
bottleneck
, bootstrapBand
,
distFct
, kde
, kernelDist
, dtm
,
summary.diagram
, plot.diagram
## confidence set for the Kernel Density Diagram
# input data
n <- 400
XX <- circleUnif(n)
## Ranges of the grid
Xlim <- c(-1.8, 1.8)
Ylim <- c(-1.6, 1.6)
lim <- cbind(Xlim, Ylim)
by <- 0.05
h <- .3 #bandwidth for the function kde
#Kernel Density Diagram of the superlevel sets
Diag <- gridDiag(XX, kde, lim = lim, by = by, sublevel = FALSE,
printProgress = TRUE, h = h)
# confidence set
B <- 10 ## the number of bootstrap iterations should be higher!
## this is just an example
alpha <- 0.05
cc <- bootstrapDiagram(XX, kde, lim = lim, by = by, sublevel = FALSE, B = B,
alpha = alpha, dimension = 1, printProgress = TRUE, h = h)
plot(Diag[["diagram"]], band = 2 * cc)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.