# [SciPy-user] KDE question

David Cournapeau david@ar.media.kyoto-u.ac...
Thu Nov 15 21:44:17 CST 2007

Stefan van der Walt wrote:
> On Thu, Nov 15, 2007 at 11:46:53AM +0200, Stefan van der Walt wrote:
>>>> Sounds like the kind of problem that can be solved using marching
>>>> squares:
>>>>
>>>> http://www.polytech.unice.fr/~lingrand/MarchingCubes/algo.html
>>> This solves the already-matplotlib-solved problem of drawing the contours given
>>> a level. That still leaves finding the correct level. Or am I underestimating
>>> the potential to reformulate marching squares to solve the
>>> integration problem, too?
>> No, I don't think you are.  As for the line-search, since the
>> different components of the mixture are available, can't we evaluate
>> the integral (over each component) directly, rather than working with
>> a grid?
>
> No, since the relevant area depends on the *sum* of components, not
> the value of the component itself.
Yes, that's what I would have thought, too. As Robert said, I don't
think you can find an analytical version for the inverse cumulative
"function" of a mixture of Gaussian on an area of interest, and that's
what we need (matlab does not implement it, and I guess that if it was
possible, they would have put it with the pdf and cdf abilities of their
mixture object). For a component, the contour shape is easy to see
(ellipsoids), for mixtures, not so easy.

For kernel estimators, you assume each component is the same 'shape', (I
mean same covariance matrix) right ? Maybe this make the computation
feasible (find all the points such as sum_i{a_i f(x - \mu_i)} = cst) ?

David