Combining two or more PDFs into one

123 Views Asked by At

I have a right triangle, with two sides with lengths $x$ and $y$ respectively. Their lengths are randomly taken from two different pdfs. Simple diagram of triangle

The sides of the triangle have the following pdfs (can be any other pdf):

$f_{X}(x) = -\frac{6}{a^{3}}x^{2} + \frac{6}{a^{2}}x $

$f_{Y}(y) = \frac{1}{a} $

Where $a$ is a constant that defines the maxima of the range (give it any number that you want). How can I get the pdf of the hypotenuse $h$.

$h = \sqrt{x^2+y^2}$

$f_{H}(h) = \ ? $

2

There are 2 best solutions below

0
On BEST ANSWER

You might be interested to read this section on Wikipedia. You can retrieve some of the formulas mentioned there without too much computation.

If $g$ is a borelian function,

$$\mathop{\mathsf{E}} g(h)=\mathop{\mathsf{E}} g\left(\sqrt{x^2+y^2}\right)=\int_0^a\int_0^a g\left(\sqrt{x^2+y^2}\right)f_X(x) f_Y(y) \mathop{dx} \mathop{dy}.$$

Now changing to polar coordinates:

$$\mathop{\mathsf{E}} g(h)=\int_0^a g(r) \left(\int_0^{2\pi}f_X(r\cos\varphi) f_Y(r\sin\varphi)\mathop{d\varphi} r\right)\mathop{dr}.$$

So by definition of the density function $f_H(h)=h\int_0^{2\pi}f_X(h\cos\varphi) f_Y(h\sin\varphi)\mathop{d\varphi}$. Computing this integral in your case is just a calculus exercise.

0
On

Continuing @md5's calculation, the support$$h\in[0,\,a\sqrt{2}],\,h\cos\varphi\in[0,\,a],\,h\sin\varphi\in[0,\,a]$$splits into $h\in[0,\,a],\,\varphi\in[0,\,\pi/2]$ and $h\in[a,\,a\sqrt{2}],\,\varphi\in[\arccos\tfrac{a}{h},\,\arcsin\tfrac{a}{h}]$. These respectively give $h$ the PDF$$\int_0^{\pi/2}\tfrac{6h^2}{a^3}\cos\varphi(1-\tfrac{h}{a}\cos\varphi)d\varphi=\tfrac{6h}{a^2}[\sin\varphi-\tfrac{h}{2a}(\varphi+\tfrac12\sin2\varphi)]_0^{\pi/2}=\tfrac{6h^2}{a^3}(1-\tfrac{h\pi}{4a})$$and$$\tfrac{6h^2}{a^3}[\sin\varphi-\tfrac{h}{2a}(\varphi+\tfrac12\sin2\varphi)]_{\pi/2-\arcsin\tfrac{a}{h}}^{\arcsin\tfrac{a}{h}}=\tfrac{6h^2}{a^3}\left(\tfrac{a}{h}-\sqrt{1-\tfrac{a^2}{h^2}}-\tfrac{h}{2a}(2\arcsin\tfrac{a}{h}-\tfrac{\pi}{2})\right).$$The case $a=1$ provides an instructive sanity check:$$\begin{align}\int_0^1(6x^2-\tfrac32x^3\pi)dx&=2-\tfrac38\pi,\\\int_1^\sqrt{2}(6x-6x^2\sqrt{1-1/x^2}-6x^3\arcsin\tfrac1x+\tfrac32x^3\pi)dx\\=\tfrac32[3x^2-\tfrac12\sqrt{1-1/x^2}x(5x^2-2)-\tfrac32x^4\arcsin\tfrac1x+\tfrac38\pi x^4]_1^\sqrt{2}&=\tfrac38\pi-1.\end{align}$$(I'll admit I cheated with that last part.)