MobleyLab/benchmarkff

KDE smoothing of RMSD/TFD

vtlim opened this issue · 3 comments

vtlim commented

These metrics have a minimum of zero, but with smoothing, the curves go below zero. Other than plotting histograms, a potential solution is to (1) mirror data to negative side, (2) apply KDE, (3) take the distribution for x>=0 only.

vtlim commented

I don't think this is the solution, actually. See this simple example:
image

The array x2 has only positive values but applying symmetry before the kernel density estimate completely changes the shape, e.g., the ratio of (when x=2.5) to (when x=0).

vtlim commented

Setting the "clip" parameter is also not the answer. For example:

no clip:
ridge_tfd

with clip from 0.2 to max(data):
ridge_tfd

vtlim commented

messing with xlim is not helping either. the kde/facetgrid extends beyond the given limits.

    '''
    pos_only : Boolean
        affects how output after KDE is displayed, only show x-axis >= 0
    '''

    if pos_only:
        g.set_axis_labels(x_label, "").set(xlim=(0.05, df[x_label].max()))
        for ax in g.axes.flat:
            #ax.margins(0.05,0.15)
            ax.set_xlim(0.05,)

ridge_tfd

other references I tried: ref, ref, ref