Re: Convolution of a Gaussian Distribution and a discontinuous function
- To: mathgroup at smc.vnet.net
- Subject: [mg97118] Re: Convolution of a Gaussian Distribution and a discontinuous function
- From: dh <dh at metrohm.com>
- Date: Thu, 5 Mar 2009 04:58:37 -0500 (EST)
- References: <gogbv9$ofc$1@smc.vnet.net>
Hi Jens, take a step back and look at your "conv". It is a sum over Gaussians, the number of summands depends on ll. You have an expansions in Gaussians, what is not the worst thing to work with. Derivatives are a piece of cake. Integration will give error functions that are a bit more cumbersome. But they are built into Mathematica. If you still want another approximation, here is a rational approximation of your example: fun = conv /. vars /. xx -> x; x0 = 0.5; ap = MiniMaxApproximation[fun, {x, {-x0, x0}, 12, 12}][[2]] Plot[{fun, ap}, {x, -x0, x0}, PlotRange -> All] Plot[{fun - ap}, {x, -x0, x0}, PlotRange -> All] Plot[{ap}, {x, -1, 1}, PlotRange -> All] hope this helps, Daniel Dan629 wrote: > This is a repost of a reply on an earlier thread but I think it got > buried so I'm putting it up as a new topic with a more relevant > subject line. > ------- > I don't know if this is a forum where math questions are posted (as > opposed to strictly Mathematica questions), but I'll ask anyway. > > The PDF of the circular uniform distribution in one dimension has two > discontinuities at x = radius. This makes the required integration to > do a convolution fail, and it fails in Fourier space as well. If I do > a numeric convolution with ListConvolve, of course, I can easily get a > result. Alternatively I can use a summation and get a symbolic result > consisting of hundreds of summands. These work, but neither solution > can be readily integrated or differentiated when the other independent > variables are complicated as they are in my case. I'd really like to > get a closed form symbolic formula for the convolution. Am I dreaming > to think that Mathematica, with all it's rich complexity, can do > something like this? Or it is simply a fact of math that a > discontinuous function cannot be convolved with a Gaussian > Distribution and no trick (DiracDelta, HeavisideTheta) or > computational genius will make it work? > > Given a failed convolution, I can use the summation solution and then > fit the resulting curve. I've used the Taylor and polynomial > expansions along with FFTs, but I'm not able to get a close enough > approximation. The convolution is a beautiful, continuous curve based > on a sum of Gaussians and so intuitively it seems as though it would > be easy to fit, but I can't seem to get it. It seems that an > approximation of either the Gaussian Distribution or the circular > uniform distribution would make the integration possible, too. But I > struggle with getting suitable non-exponential approximations to > either of those. > > So, for the illustration, look at this: > > vars = { ll -> .27, mm -> 0, ss -> .06 }; > pdf1[ xx_ ] := PDF[ NormalDistribution[ mm, ss ], xx ]; > pdf2[ xx_ ] := > Piecewise[ > { { 1/(Pi * Sqrt[ ll^2 - xx^2 ]), Abs[ xx ] < ll } } > ]; > Plot[ { pdf1[ xx ], pdf2[ xx ] } /. vars, { xx, -.3, .3 } ] > conv = Sum[ > (pdf1[ xx - zz ] pdf2[ zz ]), { zz, -.6, .6, 0.02 } ] / 60; > Plot[ Evaluate[ conv /. vars ], { xx, -.5, .5 } ] > > I'm seeking a symbolic representation of the second curve. > > (All variables are real, and both ll and ss are always positive.) > > Please be kind Jens -- I'm admittedly an amateur! >