Kernel2width
Kernel2width-func
Definition:
kernel2width( vX, vY, wx, wy[, int method=0, int grid=32]) returns the 2D kernel density optimal bandwidths (wx, wy) of X scale and Y scale for datasets (vX, vY) using two different methods.
When method = 0 (default)
Bivariate Kernel Density Estimator method is used.
This method offers bandwidth based on linear diffusion process.
When method = 1
Rule of Thumb method is used.
The estimation of wx and wy simply can be calculated by:
/math-cec7115d5d7539d52893269c30efe6e0.png)
/math-10e70e705a9ba4b7186d81a054f0ae60.png)
where n is the size of vector vX or vY,
is the sample standard variation for dataset vX, and
for dataset vY accordingly.
Parameters:
- vX (input, vector)
- x values of distributed samples used to estimate bandwidth
- vY (input, vector)
- y values of distributed samples used to estimate bandwidth
- wx (output, double)
- output width for X scale,
/math-17763c8daac5542dfacd11de8d785f61.png)
- wy (output, double)
- output width for Y scale,
/math-23c8ea7b24751838ca2a15810ad0be57.png)
- method (input, int)
- method = 0 (default) for Bivariate Kernel Density Estimator method or 1 for Rule of Thumb method.
- grid (input, int)
- input number of grids in X/Y direction for method=0, grid is a positive integer.