View source: R/persistence_diagram_sample.R
| mean.persistence_diagram_sample | R Documentation | 
Currently computes the Fréchet mean associated with the 2-Wasserstein distance, a.k.a Wasserstein barycenter.
## S3 method for class 'persistence_diagram_sample'
mean(x, initial_center = NULL, verbose = FALSE, ...)
| x | An object of class persistence_diagram_sample. | 
| initial_center | Either an integer value specifying the index of a
persistence diagram in the input list to be used as initial center or an
object of class persistence_diagram to be used as initial center.
Defaults to  | 
| verbose | A boolean specifying whether information should be displayed
into the console. Defaults to  | 
| ... | Further arguments passed to or from other methods. | 
An object of class persistence_diagram.
dg1 <- as_persistence_diagram(tibble::tibble(birth = 0.2, death = 0.5))
dg2 <- as_persistence_diagram(tibble::tibble(birth = 0.2, death = 0.7))
dg3 <- as_persistence_diagram(tibble::tibble(
  birth = c(0.3, 0.7, 0.2),
  death = c(0.6, 0.8, 0.3)
))
pdset <- as_persistence_diagram_sample(list(dg1, dg2, dg3))
bary <- mean(pdset)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.