[SciPy-User] sample from kernel density estimate

josef.pktd at gmail.com josef.pktd at gmail.com
Tue Feb 2 10:52:07 EST 2010


On Tue, Feb 2, 2010 at 10:31 AM,  <josef.pktd at gmail.com> wrote:
> On Tue, Feb 2, 2010 at 10:23 AM, Alan G Isaac <aisaac at american.edu> wrote:
>> I have a kernel density estimate from scipy.stats.gaussian_kde.
>> What's the best way to sample from it?  (Not from the underlying data.)
>
> I think stats.kde.gaussian_kde.resample  does it.
> If I remember correctly, it samples from the underlying data and adds
> a normal noise. I think I read somewhere that that is equivalent to
> sampling from the kernel density directly.

drawing a sample and running kstest will make a nice test case, it's
still missing in the test suite.
I will put it on my todo list.

Josef


>
> Josef
>
>
>>
>> Thanks,
>> Alan Isaac
>> _______________________________________________
>> SciPy-User mailing list
>> SciPy-User at scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-user
>>
>



More information about the SciPy-User mailing list