hypervolume_box: Hypervolume construction via hyperbox kernel density...

View source: R/hypervolume_box.R

hypervolume_boxR Documentation

Hypervolume construction via hyperbox kernel density estimation


Constructs a hypervolume from a set of observations via thresholding a kernel density estimate of the observations. Assumes an axis-aligned hyperbox kernel.


hypervolume_box(data, name = NULL, verbose = TRUE, samples.per.point =
                 ceiling((10^(3 + sqrt(ncol(data))))/nrow(data)),
                 kde.bandwidth = 2*estimate_bandwidth(data),
                 tree.chunksize = 10000)



A m x n matrix or data frame, where m is the number of observations and n is the dimensionality.


A string to assign to the hypervolume for later output and plotting. Defaults to the name of the variable if NULL.


Logical value; print diagnostic output if TRUE.


Number of random points to be evaluated per data point in data.


A scalar or a n x 1 vector corresponding to the half-width of the box kernel in each dimension. If a scalar input, the single value is used for all dimensions. Several esimation methods are available in estimate_bandwidth.


Number of random points to process per internal step. Larger values may have better performance on machines with large amounts of free memory. Changing this parameter does not change the output of the function; only how this output is internally assembled.


Constructs a kernel density estimate by overlaying hyperbox kernels on each datapoint, then sampling uniformly random points from each kernel. Kernel density at each point is then determined by a range query on a recursive partitioning tree and used to resample these random points to a uniform density and fixed number, from which a volume can be inferred.

Note that when comparing among hypervolumes constructed with fixed bandwidth, volume will be approximately a an approximately linear function of the number of input data points.

Note that this function returns an unthresholded hypervolume. To assign a quantile threshold, use hypervolume_threshold.


A Hypervolume-class object corresponding to the inferred hypervolume.

See Also

hypervolume_threshold, estimate_bandwidth


penguins_no_na = as.data.frame(na.omit(penguins))
penguins_adelie = penguins_no_na[penguins_no_na$species=="Adelie",
hv = hypervolume_box(penguins_adelie,name='Adelie')

hypervolume documentation built on May 17, 2022, 1:06 a.m.