why permutedims?

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

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
julia

Research direction

Start at src/bivariate.jl line 21 and reproduce the Julia example using KernelDensity and Plots. Compare the density matrix orientation with the x and y coordinates, then determine the intended convention and make the result consistent with direct plotting or clearly document the required transformation.】【。} ڪا? Wait malformed extra? Need valid JSON and no weird. Ensure final exact.arlutik 天天中彩票中.

Written by the indexing model from the issue text.

Description

https://github.com/JuliaStats/KernelDensity.jl/blob/ae70f461b6ac54c6d3d5e870deb140d21a8a8153/src/bivariate.jl#L21

Why do we carry this permutedims? This requires that StatsPlots explicitly perform the inverse transformation to plot a kde correctly, and it makes Plots default functions to plot the kde incorrectly with the most simple interpretation of the result:

julia> using Plots, KernelDensity

julia> x =  vcat(randn(1000), 10 .+ randn(1000));

julia> y = randn(2000);

julia> d = kde((x,y));

julia> heatmap(d.x, d.y, d.density)

julia> scatter!(Tuple.(zip(x,y))

produces:

image

for the records,

julia> heatmap(d.x, d.y, permutedims(d.density))

will produce the correct plot.

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.