kde | R Documentation |
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) = 1/(n (√(2π) h)^d) ∑_{i=1}^n exp( -(||x-X_i||^2)/(2h^2) ).
kde(X, Grid, h, kertype = "Gaussian", weight = 1, printProgress = FALSE)
X |
an n by d matrix of coordinates of points used in the kernel density estimation process, where n is the number of points and d is the dimension. |
Grid |
an m by d matrix of coordinates, where m is the number of points in the grid. |
h |
number: the smoothing paramter of the Gaussian Kernel. |
kertype |
string: if |
weight |
either a number, or a vector of length n. If it is a number, then same weight is applied to each points of |
printProgress |
if |
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.
Jisu Kim and Fabrizio Lecci
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.
kernelDist
, distFct
, dtm
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.