| Kernel Density Estimation | R Documentation |
Kernel density estimation of a univariate sample using a Gaussian kernel.
kde(y, h, ncores = 1)
y |
A numeric vector containing the sample data. |
h |
A numeric value for boundwidth. |
ncores |
The number of cores to use. If greater than 1, parallel computing will take place. It is advisable to use it if you have many observations and or many variables, otherwise it will slow down the process. The default is 1, meaning that code is executed serially. |
The kernel density estimate (KDE) provides a smooth estimate of the probability density function of the sample data. In this implementation, the KDE is evaluated only at the observed sample points themselves.
A numeric vector of density estimates corresponding to each observation in y.
Michail Tsagris and Christos Adam.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr and Christos Adam econp266@econ.soc.uoc.gr.
set.seed(123)
y <- rnorm(200)
dens <- kde(y, h = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.