treedisc: Prunes a level set tree or a tail tree

Description Usage Arguments Value Author(s) See Also Examples

View source: R/denpro.R View source: R/treedisc.R

Description

Prunes a level set tree or a tail tree so that it contains fewer levels. The pruning makes plotting of the trees much faster. The quality does not typically decrease essentially when a tree is pruned.

Usage

1
treedisc(lst, pcf, ngrid = NULL, r = NULL, type = NULL, lowest = "dens")

Arguments

lst

level set tree or a shape tree; output of for example "leafsfirst"

pcf

piecewise constant function; output of for example "pcf.kern" or "pcf.func"; "lst" should be the level set tree or shape tree of "pcf"

ngrid

positive integer; the number of levels which the pruned tree will have

r

vector of positive reals in increasing order; we may give the set of levels explicitely with the argument "r"; then the levels need not be equispaced as when we apply argument "ngrid"

type

"lst" or "shape"; not needed

lowest

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

Value

a level set tree or a shape tree which contains fewer levels than the input

Author(s)

Jussi Klemela

See Also

leafsfirst

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
dendat<-sim.data(n=100,type="mulmod")
pcf<-pcf.kern(dendat,h=1,N=c(32,32))
lst<-leafsfirst(pcf)          # level set tree
td<-treedisc(lst,pcf,ngrid=30)

plotvolu(td)

r<-c(0.01,0.03,0.04)
td<-treedisc(lst,pcf,r=r)

plotvolu(td)

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