Fork me on GitHub
#data-science
<
2019-11-21
>
val_waeselynck15:11:48

Does anyone here know of a tool for plotting 'confidence regions' of 2D probability distributions?

val_waeselynck15:11:53

More precisely, I'd like to draw (posterior) probability densities as 2D heat maps, with 'contour lines' delineating regions of probability mass 95%, 99% etc.

val_waeselynck15:11:54

Does that make sense, and does it have a name?

ben15:11:27

I think you can achieve something similar with ggplot2: https://ggplot2.tidyverse.org/reference/geom_contour.html

ben15:11:17

Might need to do something with stat_contour to get the specific regions you’re interested in. No idea about clj, I’m afraid

val_waeselynck16:11:57

Thanks. Thinking out loud, I guess I could also find the appropriate density levels, either by numerical integration + dichotomic search, or by filling a 2D array with densities, sorting the values and searching for quantiles. Then draw the contours at the appropriate level lines.

val_waeselynck16:11:45

I'm also wondering about the relevance of this approach for data analysis - are there alternative approaches to choosing / viewing 2D confidence regions that make this one uninteresting?