snotskie / EpistemicNetworkAnalysis.jl

Native implementation of Epistemic Network Analysis written in the Julia programming language. Based on rENA 0.2.0.1.
https://snotskie.github.io/EpistemicNetworkAnalysis.jl/
GNU General Public License v3.0
6 stars 2 forks source link

Replace ellipse CIs with KDE-based CIs #62

Open snotskie opened 7 months ago

snotskie commented 7 months ago

In https://github.com/snotskie/EpistemicNetworkAnalysis.jl/issues/58, I tested out ellipse confidence intervals.

Ellipses (and boxes) work best to give a sense of "where" the "stuff" of a normal distribution is.

However, ENA plotted points are commonly non-normal. (This is why we use non-parametric tests by default.) Moreover, the plotted points can come from multi-modal distributions. This makes finding the "where" of the distribution tricky when you want to go beyond the box around the mean.

For example, here is a KDE plot showing how, for one group in the data (High Chal.), the data could be illustrated by an ellipse fairly well, but the other group (Low Chal.) might be better described by multiple ellipses.

image

This can be done by using KDEs to draw a single level to approximate a non-normal 95% CI

https://stackoverflow.com/questions/35225307/set-confidence-levels-in-seaborn-kdeplot

snotskie commented 5 months ago

a snippet for how to implement this:

using KernelDensity

plot!(p,
  kde((xvalues, yvalues)),
  levels=[1], # this can be floats; by sending an array, its a list of which levels to show, not how many to show
  color=groupColor,
  cbar=false
)

maybe try 1/0.95 for the level value, trial and error it seems like a good amount to start with

snotskie commented 5 months ago

some test images:

image

image

image

image

snotskie commented 5 months ago

staged in https://github.com/snotskie/EpistemicNetworkAnalysis.jl/commit/428de48deebb1d6c67941090f0be4e5e771da5a6