MobleyLab / benchmarkff

Compare optimized geometries and energies from various force fields with respect to a QM reference.
MIT License
13 stars 8 forks source link

KDE smoothing of RMSD/TFD #6

Open vtlim opened 4 years ago

vtlim commented 4 years ago

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 4 years ago

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 4 years ago

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 4 years ago

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