Description Usage Arguments Value Examples
Takes a distance matrix and returns its Vietoris-Rips complex at a given level.
The output is a clique complex that can be used by other functions in the
RayleighSelection
package.
1 | vr_complex(dist, epsilon, clique = TRUE)
|
dist |
a distance matrix. |
epsilon |
filtration distance at which the complex is generated |
clique |
if set to FALSE the computation of 2-simplices is skipped. |
An object of the class simplicial
. The class simplicial
inherits from
the class igraph
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(RayleighSelection)
# Load MNIST example dataset
data("mnist")
# Compute a distance matrix for a subset of the MNIST dataset using only pixels with high variance
mnist_test <- mnist[,1:800]
mnist_test_top <- mnist_test[apply(mnist_test, 1, var) > 0.9,]
mnist_test_distances <- (1.0 - cor(mnist_test_top))
# Compute Vietoris-Rips complex at filtration distance 0.5
gg <- vr_complex(mnist_test_distances, 0.5)
# Plot the skeleton of the Vietoris-Rips complex colored by the intensity of the 500th pixel
plot_skeleton(gg, k=as.numeric(mnist_test[500,]))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.