ks2d returns the 2D kernel density at point (x, y) with specified bandwidth method and density method. Refer to this page for detailed algorithm.
vector ks2d(vector vx, vector vy[, int bandwidth, int grid, int interp, int density])
- is a vector of X coordinate values which you want to calculate the kernel density.
- is a vector of Y coordinate values which you want to calculate the kernel density.
is the bandwidth method of the 2D Kernel Density. Optional.
- 0 = default Bivariate Kernel Density Estimator
- 1 = Rules of Thumb
- is the number of equally spaced grid points for the density estimation. Only meaningful for bandwidth=0. Default is 151.
- determines whether to interpolate density points: 0=false, 1=true(default). Optional..
is the density method. Only meaningful for interp=1.
- 0 = Exact Estimation
- 1 = default. Binned Approximate Estimation
Returns the 2D kernel density with specified bandwidth method and density method.