Borrow some ideas from GetDist Python package
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
The issue names no repository files or tests. Start by reproducing the linked comparison with KernelDensity.jl, the GetDist Python package, and the cited paper; the requested implementation and completion criteria still need to be defined.
Written by the indexing model from the issue text.
Description
Generally I find the GetDist Python package based on this paper does a much better job producing accurate contours than this one, in particular for close-to-Gaussian distributions and especialy with boundaries. E.g. here's a comparison for 100 samples from a unit normal distribution (top row) or a unit normal truncated below 0 (bottom row; code at the end of this post):


I don't know if there's any motivation here from anyone to borrow / implement some ideas from that paper, but I figured I'd put it out there, it would be very nice to have a pure-Julia version.
using PyCall, PyPlot, KernelDensityEstimate, KernelDensity, Distributions, Random
getdist = pyimport("getdist")
getdist.chains.print_load_details = false;
## no boundary
Random.seed!(0)
samples = randn(100);
xs = range(-4,4,length=100);
figure(figsize=(10,4))
ax = nothing
for (i,(label, Pxs)) in enumerate([
("KernelDensity.jl", KernelDensity.pdf(KernelDensity.kde(samples), xs)),
("KernelDensityEstimate.jl", KernelDensityEstimate.evaluateDualTree(KernelDensityEstimate.kde!(samples), xs)),
("GetDist.py", getdist.MCSamples(;samples, weights=nothing, names=["x"]).get1DDensity(0).normalize("integral")(xs))
])
ax = subplot(1,3,i, sharex=ax, sharey=ax)
plot(xs, pdf.(Normal(), xs),c="k", ls="--", alpha=0.6, label="truth")
hist(samples, color="k", alpha=0.2, density=true)
plot(xs, Pxs)
title(label)
end
## with boundary
Random.seed!(0)
samples = filter(>(0), randn(200))
xs = range(-4,4,length=100)
figure(figsize=(10,4))
ax = nothing
for (i,(label, Pxs)) in enumerate([
("KernelDensity.jl", KernelDensity.pdf(KernelDensity.kde(samples, boundary=(0,10)), xs)),
("KernelDensityEstimate.jl", KernelDensityEstimate.evaluateDualTree(KernelDensityEstimate.kde!(samples), xs)),
("GetDist.py", getdist.MCSamples(;samples, weights=nothing, names=["x"], ranges=Dict("x"=>(0,nothing))).get1DDensity(0).normalize("integral")(xs))
])
ax = subplot(1,3,i, sharex=ax, sharey=ax)
plot(xs, pdf.(TruncatedNormal(0,1,0,Inf), xs),c="k", ls="--", alpha=0.4, label="truth")
hist(samples, color="k", alpha=0.2, density=true)
plot(xs, Pxs)
title(label)
end
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from JuliaStats/KernelDensity.jl
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
JuliaStats/KernelDensity.jl#139 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
JuliaStats/KernelDensity.jl#129 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
JuliaStats/KernelDensity.jl#128 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
JuliaStats/KernelDensity.jl#126 · 7 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
JuliaStats/KernelDensity.jl#125 · 5 comments ·
All issues in JuliaStats/KernelDensity.jl
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
JuliaParallel/Hwloc.jl#93 ·
-
Affine transformations of `JohnsonSU` could return a `JohnsonSU`Possibly taken @devmotion claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
JuliaStats/Distributions.jl#2117 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
TomerAberbach/profiler-md#970 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
grame-cncm/faust#1409 ·
Maintainers usually reply within 1 day