# Ks2density

ks2density-func

## Definition:

**z = ks2density(x, y, vX, vY, wx, wy)** returns the 2D kernel density at point (x, y) with respect

to a function established by datasets (vX, vY) with scale (wx, wy), where scale (wx, wy) are determined by estimation function Kernel2width.

where *n* is the number of elements in vector vX or vY, is *ith* element in vector vX and is *ith* element in vector vY.

## Parameters:

- (input, double)
- x value to evaluate for 2D kernel density
- (input, double)
- y value to evaluate for 2D kernel density
- (input, vector)
- x values of distributed samples used as kernel centers
- (input, vector)
- y values of distributed samples used as kernel centers
- (input, double)
- The bandwidth of X scale,
- (input, double)
- The bandwidth of Y scale,
- (output, double)
- 2D kernel density at point with respect to a function established by datasets (vX,vY) with scale