# pcf.greedy.kernel: Computes a discretized kernel estimator with an adaptive... In delt: Estimation of Multivariate Densities Using Adaptive Partitions

## Description

Computes a discretized kernel estimator with an adaptive partition and the output is a piecewise constant function object.

## Usage

 ```1 2``` ```pcf.greedy.kernel(dendat, h, leaf=round(dim(dendat)[1]/2), minobs=NULL, type="greedy") ```

## Arguments

 `dendat` n*d matrix of real numbers; the data matrix `h` d vector of positive real numbers; vector of smoothing parameters `leaf` positive integer `minobs` positive integer smaller than n; the partition is such that there are at most "minobs" observation in each member `type` a character string; "greedy" (partition is generated by binary splits using maximum likelihood), "cpp" (just like "greedy" but uses C++ code, which is not a part of the package but has to loaded separately, see home page of delt), "dyadic" (only splits at the midpoints are made, which leads to a loss of accuracy), "prune" (using CART pruning), "old" (not recommended).

## Value

a piecewise constant function object with an adaptive partition, see the web site

Jussi Klemela

## See Also

`densplit`

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20``` ```library(denpro) # generate data seed<-1 n<-50 d<-2 l<-3; D<-4; c<-D/sqrt(2) M<-matrix(0,l,d); M[2,]<-c; M[3,]<--c sig<-matrix(1,l,d) p<-rep(1/l,l) dendat<-sim.data(type="mixt",n=n,M=M,sig=sig,p=p,seed=seed) # colored volume function h<-(4/(d+2))^(1/(d+4))*n^(-1/(d+4))*apply(dendat,2,sd) minobs<-1 pcf<-pcf.greedy.kernel(dendat,h,minobs=minobs,type="greedy") #lst<-leafsfirst.adagrid(pcf) #plotvolu(lst,colo=TRUE) #dp<-draw.pcf(pcf) #contour(dp\$x,dp\$y,dp\$z,drawlabels=FALSE) ```

delt documentation built on May 2, 2019, 3:42 p.m.