Description Usage Arguments Details Value Examples
Two-dimensional kernel density estimation with an axis-aligned bivariate normal kernel, evaluated on a square grid. Originally from MASS
package, this function was copied to avoid CRAN notes.
1 | kernel2d_est(x, y, h, n = 25, lims = c(range(x), range(y)))
|
x |
Type: numeric vector. x coordinate of data. |
y |
Type: numeric vector. y coordinate of data. |
h |
Type: numeric vector. Vector of bandwidths for x and y directions. Defaults to normal reference bandwidth. A scalar value will be taken to apply to both directions. |
n |
Type: numeric vector. Number of grid points in each direction. Can be scalar or a length-2 integer vector. |
lims |
Type: numeric vector. The limits of the rectangle covered by the grid as |
Return a list of three components:
The x coordinates of the grid points, vector of length n
The y coordinates of the grid points, vector of length n
An n[1] by n[2] matrix of the estimated density: rows correspond to the value of x, columns to the value of y.
A list of three elements.
1 2 3 4 | ## Not run:
#?MASS::kde2d
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.