Skip to content

kde.evaluate for density plot #159

@chum1ngo

Description

@chum1ngo

Hello, I'm trying to display several distributions in the same plot. For that I need to estimate the kde of those distributions, and then evaluate each one of them in the same space. I ilustrated what I intended to do for 1 of those distributions in the first code section below with scipy.

import scipy.stats as st
kde = st.gaussian_kde(np.linspace(-10, 10, num=10000))
kde.pdf([1,2,3,4,5,6,7,8,9,10])

Then im trying to do the same with KDEpy, but then I'm getting an error: Every data point must be inside of the grid.

from KDEpy import FFTKDE
kde = FFTKDE(bw='silverman', kernel='gaussian').fit(np.linspace(-10, 10, num=10000))
kde([1,2,3,4,5,6,7,8,9,10])

I'm not sure if this is some kind of bug because the error doesn't make a lot of sense to me or I just missunderstood how to use the methods. Is it possible evaluate points in the kde like that?

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions