Learn R Programming

TDA (version 1.9.1)

plot.maxPersistence: Summary plot for the maxPersistence function

Description

The function plot.maxPersistence plots an object of class maxPersistence, for the selection of the optimal smoothing parameter for persistent homology. For each value of the smoothing parameter, the plot shows the number of detected features, their persistence, and a bootstrap confidence band.

Usage

# S3 method for maxPersistence
plot(
    x, features = "dimension", colorBand = "pink",
    colorBorder = NA, ...)

Arguments

x

an object of class maxPersistence, as returned by the functions maxPersistence

features

string: if "all" then all the features are plotted; if "dimension" then only the features of the dimension used to compute the confidence band are plotted.

colorBand

the color for filling the confidence band. The default is "pink". (NA leaves the band unfilled)

colorBorder

the color to draw the border of the confidence band. The default is NA and omits the border.

...

additional graphical parameters.

Author

Fabrizio Lecci

References

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.

See Also

maxPersistence

Examples

Run this code
## 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)

Run the code above in your browser using DataLab