JuliaStats / KernelDensity.jl

Kernel density estimators for Julia
Other
172 stars 40 forks source link

allow matrix as input for bivariate kde #102

Open szcf-weiya opened 2 years ago

szcf-weiya commented 2 years ago

Since the estimate of bivariate kde allow matrix as input, e.g.,

x = randn(100, 2)
f = kde(x)

it would be more convenient when evaluating at each points of x by pdf(f, x) than

[pdf(f, x[i, 1], x[i,2]) for i = 1:size(x,1)]

BTW, at the first glance, I misunderstood the defined pdf(f, x, y), which evaluates at the grid formed by x and y instead of the pair of points. Sometimes, it would be also common to evaluate the pdf at some given points.