computept: Computes a persistence terrace of point cloud data.

Description Usage Arguments Value Examples

Description

Computes a persistence terrace of point cloud data for given smoothing parameters. For the detailed explanation of the parameters data, sp, fun, lim, by, lib, sublevel, see the R package TDA. A parallel option is available to reduce computation time.

Usage

1
2
3
computept(data, sp, fun = kde, lim = NULL, by = NULL,
  maxdimension = max(NCOL(data)), lib = "Dionysus", sublevel = FALSE,
  par = FALSE, ncore = NULL)

Arguments

data

a matrix of n by d, a point cloud of n points in d dimensions.

sp

a vector of smoothing parameter values to be used in the persistence terrace.

fun

a smoothing function. The default is the Gaussian kernel density estimator.

lim

a 2 by d matrix specifying the range of space to compute. The default value is NULL.

by

a numeric value or vector that specifies the grid. The default value is NULL.

maxdimension

a integer of specifying the maximum dimension of persistence terrace to compute.

lib

a library to compute persistent homology. The default is "Dionysus".

sublevel

a logical value selecting whether persistent homology is computed to super-level sets (FALSE) or sub-level sets (TRUE). The default value is FALSE.

par

if TRUE, the user can compute the persistence terrace in parallel using multiple cores. The default value is FALSE.

ncore

an integer selecting the number of cores to use when parallel computing option is selected. The default value is NULL.

Value

The function computept returns a list of the computed persistence terraces up to given dimension. For each dimension, the computed persistence terrace includes the following components:

x

The vector of the smoothing parameters used in computation. The x-axis of the persistence terrace.

y

The vector of filtration where the Betti number changes. The y-axis of the persistence terrace.

z

The matrix of Betti numbers.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# load three circle data
data(three_circle_dat)

# input variables
Xlim <- c(-4,12)
Ylim <- c(-4,9)
lim <- cbind(Xlim, Ylim)
by <- 0.2
spseq <- seq(0.01,1.5,length.out = 10)

# compute persistence terrace
threecirclept <- computept(three_circle_dat,sp=spseq,lim=lim,by=by)

## Not run: 
# compute persistence terrace with parallel option
spseq <- seq(0.01,1.5,length.out = 30)
threecirclept <- computept(three_circle_dat,sp=spseq,lim=lim,by=by,par=TRUE)

## End(Not run)

pterrace documentation built on May 2, 2019, 10:08 a.m.

Related to computept in pterrace...