kde2dWeighted: Two-Dimensional Weighted Kernel Density Estimation

Description Usage Arguments Value References See Also Examples

Description

Two-dimensional weighted kernel density estimation with an axis-aligned bivariate normal kernel, evaluated on a rectangular grid

Usage

1
kde2dWeighted(x, y, w, h, n, lims = c(range(x), range(y)),proba.min=1E-6)

Arguments

x

x coordinate of data

y

y coordinate of data

w

Vector of same length than x and y, weight of (x,y) coordinate.

h

Vector of bandwidths for x and y directions. Defaults to normal reference bandwidth (see bandwidth.nrd). A scalar value will be taken to apply to both directions.

n

Vector of number of grid points in the two directions. A scalar value will be taken to apply to both directions.

lims

The limits of the rectangle covered by the grid as c(xl, xu, yl, yu).

proba.min

Scalar giving the minimum value for the density estimation. Every density <proba.min will be set to 0.

Value

A dataframe of dim n[1]*n[2], 3 giving x, y and z.

References

Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth edition. Springer.

See Also

kde2d

Examples

1
2
3
4
5
6
7
8
data(sample)

# Diagram with linear grayscale for z axis
STdiag(data=sample)

# Kernel density estimation on data sample
s2=kde2dWeighted(x=sample$x,y=sample$y,w=sample$z)
STdiag(data=s2)

STdiag documentation built on May 2, 2019, 4:58 p.m.