exact.kde {eHDPrep}R Documentation

Exact kernel density estimation

Description

Calculates KDE for a set of points exactly, rather than an approximation as per the density() core function.

Usage

exact.kde(x, bw, output.domain = x, na.rm = FALSE)

Arguments

x

A numeric vector of values

bw

The bandwidth to use - either a single value, or a vector of values the same length as x if using adaptive bandwidth estimation (with each value giving the bandwidth at the corresponding data point).

output.domain

The domain of values over which to estimate the density. Defaults to x. To use the same domain of x values as R's density, set to NULL.

na.rm

Remove missing values if TRUE

Details

Only tractable for around 10,000 data points or less - otherwise consider using the density() core function for a close approximation.

The density() core function approximation is normally a very good approximation, but some small values close to zero may become zero rather than just very small. This makes it less suitable for mutual information estimation.

Value

The exact kernel density estimate as a density object, compatible with R's density function.

Author(s)

Alexander Lyulph Robert Lubbock, Ian Overton


[Package eHDPrep version 1.2.1 Index]