| bootstrapDiagram {TDA} | R Documentation | 
Bootstrapped Confidence Set for a Persistence Diagram, using the Bottleneck Distance (or the Wasserstein distance).
Description
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.
Usage
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,
    ...)
Arguments
| 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  | 
Details
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.
Value
The function bootstrapDiagram returns the (1-alpha) quantile of the values computed by the bootstrap algorithm. 
Note
The function bootstrapDiagram uses the C++ library Dionysus for the computation of bottleneck and Wasserstein distances. See references.
Author(s)
Jisu Kim and Fabrizio Lecci
References
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/
See Also
bottleneck, bootstrapBand,
distFct, kde, kernelDist, dtm,
summary.diagram, plot.diagram
Examples
## 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)