PDF of list of points?

Open
#128 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
julia
Domain
data

Research direction

Start by reproducing the Julia example and inspecting the existing pdf methods and InterpKDE usage. A complete resolution should establish whether paired point evaluation is supported and, if changed, demonstrate that five paired points return a length-5 result.

Written by the indexing model from the issue text.

Description

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)]?

Dominant language
Julia
Stars
213
Forks
45
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from JuliaStats/KernelDensity.jl

All issues in JuliaStats/KernelDensity.jl

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.