[SciPy-User] smoothing in scipy/matplotlib
Sat Jan 16 23:03:12 CST 2010
On Sat, Jan 16, 2010 at 11:37 PM, <email@example.com> wrote:
> On Sat, Jan 16, 2010 at 6:33 PM, <firstname.lastname@example.org> wrote:
>> On Sat, Jan 16, 2010 at 5:28 PM, per freem <email@example.com> wrote:
>>> hi all,
>>> i am using gaussian_kde to fit a gaussian kernel estimator to a bunch
>>> of data. the lines i get are often quite jaggy and very sensitive to
>>> fluctuations in the data. is there a way to "smooth" the estimate
>>> more? typically in gaussian kdes there is a smoothing parameter, but i
>>> do not see one in the documentation.
>>> is there a way to do this?
>> Not yet, I never committed the change, the cleanest way currently is
>> by subclassing kde_gaussian, the dirtier version is by monkey
>> patching. I can look for my example scripts for both later tonight,
>> there is also some information on the mailing list, e.g. a subclassing
>> example by Anne (maybe one and a half years ago)
>> I'm a bit surprised about undersmoothing, because I did the changes
>> for the case of oversmoothing by kde_gaussian.
> In the attachment is my subclass of stats.gaussian_kde. the main
> point I did was to allow to set or reset the smoothing factor to a
> float. It plots several examples
> Initially this was intended to be a continuation to this story, but I
> never got around to finishing it (my file is dated may, and I haven't
> looked at it in a long time)
> I hope this helps, ask if something is not clear.
> I don't find a ticket or mailinglist thread on my draft for the
> enhancement (keyword option for bandwith) to gausssian_kde, the
> initial monkey patch version is here
I just created http://projects.scipy.org/scipy/ticket/1092 so I don't
forget about it again.
I appreciate any comments about what changes would be useful for the
>>> SciPy-User mailing list
More information about the SciPy-User