Tina Memo No. 003-003 Internal Report Products and Convolutions o Gaussian Probability Density Functions P.A. Bromiley Last updated / 9 / 03 Imaging Science and Biomedical Engineering Division, Medical School, University o Manchester, Stopord Building, Oxord Road, Manchester, M3 9PT.
Products and Convolutions o Gaussian Probability Density Functions P. A. Bromiley Imaging Science and Biomedical Engineering Division Medical School, University o Manchester Manchester, M3 9PT, UK paul.bromiley@man.ac.uk Abstract It is well known that the product and the convolution o two Gaussian probability density unctions PDFs are also Gaussian. This memo provides derivations or the mean and standard deviation o the resulting Gaussians in both cases. These results are useul in calculating the eects o smoothing applied as an intermediate step in various algorithms. The Product o Two Gaussian PDFs We wish to ind the product o two Gaussian PDFs x µ x = e and gx = e x µg π πg g in the most general case i.e. non-identical means. The product gives Examining the term in the exponent xgx = x µ e π g x µ + x µ g g + x µg g we can expand the two quadratics and collect terms in powers o x to give + gx µ g +µ g x+µ g +µ g g 3 4 Dividing through by the coeicient o x gives x µ g +µg x+ µ g +µ g g 5 This is again a quadratic in x, and so Eq. is a Gaussian unction. Compare the terms in Eq. 5 to a the usual Gaussian orm Px = e x µ = e x µx+µ 6 π π Since we can add a term γ that is independent o x to complete the square in α, this is suicent to complete the proo in cases where the normalisation can be ignored. The product o two Gaussian PDFs is proportional to a Gaussian PDF with a mean that is hal the coeicient o x in Eq. 5 and a standard deviation that is the square root o hal o the denominator i.e. g = g and µ g = µ g +µ g 7
In general, the product is not itsel a PDF as, due to the presence o the scaling actor, it will not have the correct normalisation. We can now either write down the product xgx in the usual Gaussian orm directly, with an unknown scaling constant, or proceed rom Eq. 5 to obtain the scaling constant explicitly. Taking the latter route, suppose that γ is the term required to complete the square in α i.e. µ g +µg µ g +µg Adding this term to α gives γ = x x µ g +µg Ater some manipulation, this reduces to Substituting back into Eq. gives x µ g +µg g xgx = + = 0 8 g µ g +µg + g µ g +µ g µ g +µg + µ µ g + g = x µ g g + µ µ g + g [ [ exp x µ g π g g exp µ µ g + g 9 g Multiplying by g / g and rearranging gives [ = exp x µ g πg g π + g exp [ µ µ g + g Thereore, the product o two Gaussians PDFs x and gx is a scaled Gaussian PDF [ S xgx = exp x µ g πg g where g = g and µ g = µ g +µ g and the scaling actor S is itsel a Gaussian PDF on both µ and µ g with standard deviation [ S = exp µ µ g π + g + g 0 The Convolution o Two Gaussian PDFs We wish to ind the convolution o two Gaussian PDFs x µ x = e and gx = e x µg π πg g 3 in the most general case i.e. non-identical means. The convolution o two unctions t and gt over a inite range is deined as In practice, convolutions are more oten perormed over an ininite range x τgτdτ = g x 0 x τgτdτ = g 4 3
However, the usual approach is to use the convolution theorem [, where F is the Fourier transorm and F is the inverse Fourier transorm Using the transormation the Fourier transorm o x is given by Fx = Using Euler s ormula [, π we can split the term in e x to give F [FxFgx = x gx 5 Fx = F Fk = Fx = e πikµ π xe πikx dx 6 Fke πikx dk 7 x = x µ 8 e x e πikx µ dx = e πikµ π The term in sinx is odd and so its integral over all space will be zero, leaving This integral is given in standard orm in [ and so e x e πikx dx 9 e iθ = cosθ isinθ 0 Fx = e πikµ π 0 e x [cosπkx isinπkx dx e at cosxt dt = e x cosπkx dx π a e x a 3 Fx = e πikµ e π k 4 The second term in this expression is a Gaussian PDF in k: the Fourier transorm o a Gaussian PDF is another Gaussian PDF. The irst term is a phase term accounting or the mean o x i.e. its oset rom zero. The Fourier transorm o gx will give a similar expression, and so FxFgx = e πikµ e π k e πikµg e π g k = e πikµ +µ g e π k 5 Comparing Eq. 5 to Eq. 4, we can see that it is the Fourier transorm o a Gaussian PDF with mean and standard deviation µ g = µ +µ g and g = + g 6 and thereore, since the Fourier transorm is invertible, P g x = F [FxFgx = x µ +µg e 7 π + g It may be worth noting a general result at this point; the area under a convolution is equal to the product o the areas under the actors [ gdt = ugt udu dt [ = u gt udt du [ [ udu gtdt Thereore, the preservation o the normalisation when convolving PDFs i.e. the act that the convolution is also a PDF, normalised such that the area under the unction is equal to unity, is a special case rather than being true in general. 4
3 Summary It is well known that the product and the convolution o a pair o Gaussian PDFs are also Gaussian. However, the derivations are not commonly seen in the literature, particularly in the case o Gaussian PDFs with non-identical means. This document has provided both derivations. In the case o the product o two Gaussian PDFs, the result is proportional to a Gaussian PDF with mean and standard deviation µ g = µ g +µ g and g = g where µ and µ g are the means o the two original Gaussians and and g are their standard deviations. The constant o proportionality is itsel a Gaussian PDF on both µ and µ g with standard deviation + g [ S = exp µ µ g π + g + g It should be noted that this result is not the PDF o the product o two Gaussian random variates; in that case, the product normal distribution applies. In the case o the convolution o two Gaussian PDFs, the result is again a Gaussian PDF with mean and standard deviation µ g = µ +µ g and g = + g These results, particularly the second result, can be useul in calculating the eects o Gaussian smoothing applied as an intermadiate step in various machine vision algorithms. Reerences [ M Abramowitz and I A Stegun. Handbook o Mathematical Functions. National Bureau o Standards, Washington DC, 97. [ M L Boas. Mathematical Methods in the Physical Sciences. John Wiley and Sons Ltd., 983. 5