Skip to content

PDF of list of points? #128

@orenbenkiki

Description

@orenbenkiki

How do I get the PDF at an arbitrary set of points? For example:

using KernelDensity
xs = rand(5);
ys = rand(5);
k = kde((xs, ys));
m = pdf(k, xs, ys);
println("Got size: $(size(m))");
e = [InterpKDE(k).itp(x, y) for (x, y) in zip(xs, ys)];
println("Expected: $(size(v))");

Gives:

Got size: (5, 5)
Expected: (5,)

Sure, I can write [InterpKDE(k).itp(x, y) for (x, y) in zip(xs, ys)] myself - is this the recommended way to achieve this, though?

Naively I expected pdf(k, (xs, ys)) to do the trick but it isn't supported.

Would it make sense to define pdf(k, (xs, ys)) to be [InterpKDE(k).itp(x, y) for (x, y) in zip(xs, ys)]?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions