repl.txt (1301B)
1 2 {{alias}}( x, y[, options] ) 3 Two-dimensional kernel density estimation. 4 5 Parameters 6 ---------- 7 x: Array<number> 8 Array of x values. 9 10 y: Array<number> 11 Array of y values. 12 13 options: Object (optional) 14 Function options. 15 16 options.h: number (optional) 17 Array of length two containing the bandwidth values for x and y. 18 19 options.n: number (optional) 20 Number of partitions on the x- and y-axes. Default: `25`. 21 22 options.xMin: number (optional) 23 Lower limit of x. 24 25 options.xMax: number (optional) 26 Upper limit of x. 27 28 options.yMin: number (optional) 29 Lower limit of y. 30 31 options.yMax: number (optional) 32 Upper limit of y. 33 34 options.kernel: string|Function 35 A string or function to specifying the used kernel function. Default: 36 `'gaussian'`. 37 38 Returns 39 ------- 40 out: Object 41 Object containing the density estimates (`z`) along grid points (`x` and 42 `y` values). 43 44 Examples 45 -------- 46 > var x = [ 1, 3, 5, 6, 21, 23, 16, 17, 20, 10 ]; 47 > var y = [ 0.40, 0.20, 0.20, 0.15, 0.05, 0.55, 0.6, 0.33, 0.8, 0.41 ]; 48 > var out = {{alias}}( x, y ) 49 { 'x': [1, ... ], 'y': [0.05, ...], 'z': ndarray{Float64Array[0.031, ...] } 50 51 See Also 52 -------- 53