Learn R Programming

denpro (version 0.9.2)

prunemodes: Prunes modes away from a level set tree or a shape tree

Description

Prunes smallest modes in terms of the excess mass away, from a level set tree or froma a shape tree. The tree is interpreted as a 1D function (in the sense of a volume function, radius function, or a tail probability function). The pruning may be useful to get cleaner plots, especially a location plot of a shape tree may suffer from spurious modes.

Usage

prunemodes(lst, modenum = 1, num = NULL, exmalim = NULL, maxnum = NULL)

Arguments

lst
A level set tree or a shape tree
modenum
positive integer; the desired number of modes
num
internal
exmalim
internal
maxnum
internal

Value

A level set tree or a shape tree, with an additional field "exma.of.modes".

See Also

leafsfirst, treedisc,

Examples

Run this code
dendat<-sim.data(n=100,type="cross")
pcf<-pcf.kern(dendat,h=1,N=c(32,32))
st<-leafsfirst(pcf,propor=0.01)   

td<-treedisc(st,pcf,ngrid=60)
plotbary(td)

td2<-prunemodes(td,modenum=4)
plotbary(td2)


Run the code above in your browser using DataLab