plotsupport {densup}R Documentation

Estimates the support by pruning a previously grown tree

Description

Prunes a multitree created by "grow", and produces an estimate for the support of the density. Estimate is plotted immediately. The values needed to plot the tree are returned optionally.

Usage

plotsupport(dendat, tree, alpha, h, lambda, data=F)

Arguments

dendat n*d data matrix; the same matrix which was used to create "tree"
tree list of vectors; output of "grow"
alpha positive number or vector of positive numbers; smoothing parameter values; large values of "alpha" result to oversmoothing; when "alpha" is a vector, then an overlaid picture of all estimates with given smoothing parameter values will be plotted
h nonnegative number; determines how much the smallest rectangle containing the data will be blown up to get the rectangle which will be partitioned to bins; should be the same as in "grow"
lambda positive number; parameter of the excess mass functional
data T or F; TRUE if one wants data returned which ables to plot the estimate

Author(s)

Jussi Klemelä

References

http://www.rni.helsinki.fi/~jsk/densup

See Also

grow

Examples

dendat<-matrix(rnorm(20),10)
#Grow the tree
N<-c(8,8)
h<-0.1
tree<-grow(dendat,N,h)
#Prune the tree
alpha<-0.00065
lambda<-0.1
ps<-plotsupport(dendat,tree,alpha,h,lambda,data=T)
ps
$x
             [,1]
 [1,] -0.85257483
 [2,] -0.59438833
 [3,] -0.33620183
 [4,] -0.07801533
 [5,]  0.18017117
 [6,]  0.43835766
 [7,]  0.69654416
 [8,]  0.95473066
 [9,]  1.21291716
[10,]  1.47110366

$y
             [,1]
 [1,] -1.37841358
 [2,] -1.03898570
 [3,] -0.69955782
 [4,] -0.36012994
 [5,] -0.02070207
 [6,]  0.31872581
 [7,]  0.65815369
 [8,]  0.99758157
 [9,]  1.33700945
[10,]  1.67643732
 
$z
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    0    0    0    0    0    0    0    0    0     0
 [2,]    0    1    0    0    0    0    0    0    0     0
 [3,]    0    1    0    1    0    0    0    0    0     0
 [4,]    0    1    0    0    0    0    0    0    0     0
 [5,]    0    1    0    0    0    1    1    1    1     0
 [6,]    0    1    0    1    0    0    0    0    0     0
 [7,]    0    0    0    1    0    1    0    0    0     0
 [8,]    0    0    0    1    0    0    0    1    0     0
 [9,]    0    0    0    1    0    0    0    0    0     0
[10,]    0    0    0    0    0    0    0    0    0     0       




[Package Contents]