3.5.3.2.6 ks2d

Definition:

ks2d returns the 2D kernel density at point (x, y) with specified bandwidth method and density method. Refer to this page for detailed algorithm.

Syntax:

 vector  ks2d(vector vx, vector vy[, int bandwidth, int grid, int interp, int binned])

Parameters:

vx

is a vector of X coordinate values which you want to calculate the kernel density.

xy

is a vector of Y coordinate values which you want to calculate the kernel density.

bandwidth

is the bandwidth method of the 2D Kernel Density. Optional.
• 0 = default Bivariate Kernel Density Estimator
• 1 = Rules of Thumb

grid

is the number of equally spaced grid points for the density estimation. Only meaningful for bandwidth=0. Default is 151.

interp

determines whether to interpolate density points: 0=false, 1=true(default). Optional..

binned

is the density method. Only meaningful for interp=1.
• 0 = Exact Estimation
• 1 = default. Binned Approximate Estimation

Return:

Returns the 2D kernel density with specified bandwidth method and density method.