# Exact form of pdf of maximum of normal random variables

$$z = max(x+b,y)$$ where x ~ N(m1,s1) and y~N(m2,s2), b is a contant

What's the pdf of z?

Or exact form of E(z)? (E is expectation operator)

To the best of my guessing from the literature it is related with Weibull (https://en.wikipedia.org/wiki/Weibull_distribution) but I can't derive the exact pdf of z or exact E(z).

If there is a formula for arbitrary number of variables and covariance matrix, then that will be even better.

=====================================

Should the answer be like the following?

$$P(z) = P_2(z) \int_{-\infty}^{z-b} P_1(x)dx\; + P_1(z-b) \int_{-\infty}^z P_2(y)dy\;$$

$$=\frac{1}{2\pi\sigma_{1}\sigma_{2}}\left[\exp\left(\frac{-(z-\mu_{2})^{2}}{2\sigma_{2}^{2}}\right)\int_{-\infty}^{z-b}\exp\left(\frac{-(x-\mu_{1})^{2}}{2\sigma_{1}^{2}}\right)dx+\exp\left(\frac{-(z-b-\mu_{1})^{2}}{2\sigma_{1}^{2}}\right)\int_{-\infty}^{z}\exp\left(\frac{-(y-\mu_{2})^{2}}{2\sigma_{2}^{2}}\right)dy\right]$$

$$=\frac{1}{2\pi\sigma_{1}\sigma_{2}}\left[\exp\left(\frac{-(z-\mu_{2})^{2}}{2\sigma_{2}^{2}}\right)\sigma_{1}\sqrt{\frac{\pi}{2}}\mathrm{erfc}\left(\frac{\mu_{1}-z+b}{\sigma_{1}\sqrt{2}}\right)+\exp\left(\frac{-(z-b-\mu_{1})^{2}}{2\sigma_{1}^{2}}\right)\sigma_{2}\sqrt{\frac{\pi}{2}}\mathrm{erfc}\left(\frac{\mu_{2}-z}{\sigma_{2}\sqrt{2}}\right)\right]$$

-

## migrated from mathoverflow.netJul 23 '13 at 1:40

This question came from our site for professional mathematicians.

Something may be wrong about me, but when reading the title of this post I was like "Exact form..." (ooh! differential geometry) "...of pd..." (ooh, differential equations) "...f of" (huh? pdf? doesn't this belong in tex.se or something?) and then read the rest for an "Ooh, I see...". I should probably parse tags first. – tomasz Jul 24 '13 at 15:07

I denote the pdf of $x$ by $P_1(x)$ and the pdf of $y$ by $P_2(y)$. Then the pdf $P(z)$ of $z=\max(x+b,y)$ is given by
$$P(z) = \int_{-\infty}^{\infty} dx \int_{x+b}^\infty dy\; P_1(x) P_2(y) \delta(z-y) + \int_{y-b}^\infty dx \int_{-\infty}^\infty dy\; P_1(x) P_2(y) \delta(z-x-b)$$ $$= P_2(z) \int_{-\infty}^{z-b} P_1(x)\;dx + P_1(z-b) \int_{-\infty}^z P_2(y)\;dy$$
For normal $P_1$ and $P_2$ the integrals evaluate to error functions.
for the delta function see: en.wikipedia.org/wiki/Dirac_delta_function --- and yes, the functions of $x$ and $y$ in the second line are to be integrated. – Carlo Beenakker Jul 23 '13 at 6:39