kde {TDA} | R Documentation |
Kernel Density Estimator over a Grid of Points
Description
Given a point cloud X
(n
points), the function kde
computes the Kernel Density Estimator over a grid of points. The kernel is a Gaussian Kernel with smoothing parameter h
. For each x \in R^d
, the Kernel Density estimator is defined as
p_X (x) = \frac{1}{n (\sqrt{2 \pi} h )^d} \sum_{i=1}^n \exp \left( \frac{- \Vert x-X_i \Vert_2^2}{2h^2} \right).
Usage
kde(X, Grid, h, kertype = "Gaussian", weight = 1,
printProgress = FALSE)
Arguments
X |
an |
Grid |
an |
h |
number: the smoothing paramter of the Gaussian Kernel. |
kertype |
string: if |
weight |
either a number, or a vector of length |
printProgress |
if |
Value
The function kde
returns a vector of length m
(the number of points in the grid) containing the value of the kernel density estimator for each point in the grid.
Author(s)
Jisu Kim and Fabrizio Lecci
References
Larry Wasserman (2004), "All of statistics: a concise course in statistical inference", Springer.
Brittany T. Fasy, Fabrizio Lecci, Alessandro Rinaldo, Larry Wasserman, Sivaraman Balakrishnan, and Aarti Singh. (2013), "Statistical Inference For Persistent Homology: Confidence Sets for Persistence Diagrams", (arXiv:1303.7117). To appear, Annals of Statistics.
See Also
Examples
## Generate Data from the unit circle
n <- 300
X <- circleUnif(n)
## Construct a grid of points over which we evaluate the function
by <- 0.065
Xseq <- seq(-1.6, 1.6, by=by)
Yseq <- seq(-1.7, 1.7, by=by)
Grid <- expand.grid(Xseq,Yseq)
## kernel density estimator
h <- 0.3
KDE <- kde(X, Grid, h)