Movatterモバイル変換


[0]ホーム

URL:


CRANdownloads

tdaunif:Uniform manifold samplers for topological data analysis

This R package contains sampling functions for topological manifoldsembedded (or immersed) in Euclidean space.

motivation

consolidation

Statistical topology and topological data analysis include a varietyof methods for detecting topological structure from point cloud datasets, most famously persistent homology. (SeeWeinberger(2011) for a brief introduction.) These methods are often validatedby applying them to point clouds sampled from spaces with knowntopology. Functions that generate such samples are therefore valuable todevelopers of topological–statistical software.

Such samplers have not been easy to find in the R package ecosystem.Handfuls exist in several different packages, but no single package orcode repository has assembled a large collection for convenient use.That is the goal of this package.

uniformity

The simplest validations use points sampled uniformly from thesurfaces of manifolds embedded in Euclidean space. Uniformity here iswith respect to the surface area of the embedded manifold, but suchuniform sampling is not trivial to do when the manifold can only beexpressed via parameterization from a simpler parameter space, as whena square isrolled and bent into a torus. Uniform sampling on the parameterspace may then produce uneven sampling on the manifold, regions ofgreater compression being oversampled relative to regions of greaterexpansion. One especially important motivation for this package istherefore to include uniform samplers for popular embeddings oftopological manifolds, including functions that allow users to buildtheir own with minimal effort (seehelp(manifold, package = "tdaunif")).

usage

installation

The latest release oftdaunif can be installed fromCRAN:

install.packages("tdaunif")

You can install the current development version oftdaunif from GitHub usingtheremotespackage:

remotes::install_github("tdaverse/tdaunif",build_vignettes =TRUE)

To stabilize this document, this chunk saves the default graphicssettings (as required by CRAN) and initializes the random numbergenerator:

oldpar<-par(no.readonly =TRUE)set.seed(0)

illustration

Anintuitive embedding of the Klein bottle into 4-space is adapted fromthe popular “donut” embedding of the torus in 3-space. Intdaunif this is called the “tube” parameterization. Wecan sample uniformly from this embedding (without noise) and examine thecoordinate projections as follows:

x<-sample_klein_tube(n =360,ar =3,sd =0)pairs(x,asp =1,pch =19,cex = .5)

Compare these neat projections to those of the same sample with noiseadded in the ambient Euclidean space:

x<-add_noise(x,sd = .2)pairs(x,asp =1,pch =19,cex = .5)

For a thorough discussion of this sampler, seemy blogpost describing the method presented inDiaconis,Holmes, and Shahshahani (2013).

another illustration

A subset of samplers allow stratified sampling, which relies on ananalytic solution to the problem of length or area distortion created bymost parameterizations. For example, the planar triangle sampler can bestratified to produce a more uniform arrangement of points than aproperly uniform sample would produce:

equilateral<-cbind(c(0,0),c(0.5,sqrt(3)/2),c(1,0))x<-sample_triangle_planar(n =720,triangle = equilateral)y<-sample_triangle_planar(n =720,triangle = equilateral,bins =24)par(mfrow =c(1L, 2L))plot(x,asp =1,pch =19,cex = .5)plot(y,asp =1,pch =19,cex = .5)

SeeArvo(1995) and Arvo’s notes fromSiggraph2001 for a detailed treatment of this technique.

par(oldpar)

[8]ページ先頭

©2009-2025 Movatter.jp