leafsfirst: Computes a level set tree, shape tree, or tail tree

Description Usage Arguments Value Author(s) See Also Examples

View source: R/denpro.R View source: R/leafsfirst.R

Description

Computes a level set tree or shape tree from a piecewise constant function, or calculates a tail tree from a data set.

Usage

1
2
3
leafsfirst(pcf = NULL, lev = NULL, refe = NULL, type = "lst", 
levmet = "radius", ordmet = "etaisrec", ngrid = NULL, dendat = NULL, rho = 0,
propor= NULL, lowest = "dens", f=NULL)

Arguments

pcf

piecewise constant function; output of "pcf.kern", or "pcf.func", for example

lev

positive real number; a level of the level set whose shape tree will be calculated

refe

vector of d real numbers; the reference point of the shape tree

type

"lst" or "shape"; not needed

levmet

"radius" or "proba"; radius plot or probability content plot

ordmet

"etaisrec" or "baryrec"; a distance to a rectangle is defined to be the distance to the boundary or the distance to the barycenter; concerns shape trees

ngrid

a positive integer; the tree will be pruned to contain "ngrid" levels

dendat

n*d data matrix; gives the data set when a tail tree will be calculated

rho

positive real number; the resolution threshold for the tail tree

propor

0<propor<1; a shape tree of the level set whose level is "propor" times the maximum value of the function will be calculated

lowest

a character; if lowest="dens", then it is assumed that the function whose level set tree we calculate is nonnegative

f

a vector of estimated values of the density at the data points; this is used in the case of tail trees to estimate the volumes of the regions

Value

a level set tree, shape tree, or tail tree

Author(s)

Jussi Klemela

See Also

pcf.kern, treedisc, plotvolu, plotbary,

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
dendat<-sim.data(n=100,type="mulmod")
pcf<-pcf.kern(dendat,h=1,N=c(32,32))

# level set tree

lst<-leafsfirst(pcf)          

td<-treedisc(lst,pcf,ngrid=30)
plotvolu(td)

# shape tree

st<-leafsfirst(pcf,propo=0.1)   # 10% level set  

tdst<-treedisc(st,pcf,ngrid=30)
plotvolu(tdst)

# tail tree

rho<-0.65
tt<-leafsfirst(dendat=dendat,rho=rho)

plotbary(tt)

denpro documentation built on May 2, 2019, 8:55 a.m.