# Difference between maxima of random variables

Given four independent, identically distributed Gaussian random variables with zero mean and unit variance $x_1$, $x_2$, $y_1$, $y_2$, consider

\begin{equation} u \equiv \max(x_1+C\, y_1, x_2+C \, y_2) - \max(x_1-C \, y_1, x_2-C \, y_2), \end{equation}

where $C$ is a real number.

Do you know how to compute the PDF of $u$, or a least its variance?

Using $\max(a,b) = \dfrac{a+b}{2} + \left| \dfrac{a-b}{2}\right|$, write $u = w_1 + |w_2| - |w_3|$ where \eqalign{ w_1 &= C (y_1 + y_2) \cr w_2 &= \dfrac{1}{2} (x_2 - x_1 + C (y_2 - y_1))\cr w_3 &= \dfrac{1}{2} (x_2 - x_1 - C (y_2 - y_1))\cr} are jointly normal with mean $0$ and covariance matrix $$V = \pmatrix{2 C^2 & 0 & 0 \cr 0 & (1+C^2)/2 & (1-C^2)/2\cr 0 & (1-C^2)/2 & (1+C^2)/2\cr}$$ In particular, $w_1$ is independent of $w_2$ and $w_3$. Thus $\text{Cov}(w_1, |w_2|) = 0$ and $\text{Cov}(w_1, |w_3|) = 0$. The only nontrivial computation is $\text{Cov}(|w_2|, |w_3|)$. If $|C| < 1$ get \eqalign{ {\mathbb E} [|w_2| |w_3|] &= \dfrac{1-C^2}{\pi} \arctan\left(\frac{2|C|}{C^2-1}\right) + \dfrac{1-C^2}{2} + 2 \frac{|C|}{\pi}\cr {\mathbb E}|w_2| &= {\mathbb E} |w_3| = \sqrt{\dfrac{C^2+1}{\pi}}\cr \text{Cov}(|w_2|,|w_3|) &= \dfrac{1-C^2}{\pi} \arctan\left(\frac{2|C|}{C^2-1}\right) + \dfrac{1-C^2}{2} - \dfrac{(1-|C|)^2}{\pi} } and then $$\text{Var}(w_1 + |w_2| - |w_3|) = 2\dfrac{C^2-1}{\pi} \arctan\left(\frac{2|C|}{C^2-1}\right) + 4 C^2 - \frac{4|C|}{\pi}$$

EDIT: That formula was only for $|C|<1$ because of branch problems with the arctan. Here's one that should work for all $C \ne 0$:

$$\text{Var}(w_1 + |w_2| - |w_3|) = 2 \dfrac{C^2-1}{\pi} \arctan \left(\frac{1-C^2}{2|C|}\right) + 3 C^2 - \frac{4|C|}{\pi} + 1$$

• Are you sure? $\mathtt{NExpectation[(Max[x + 2 y, u + 2 v] - Max[x - 2 y, u - 2 v])^2,}$ $\mathtt{\{x \approx NormalDistribution[], y \approx NormalDistribution[],}$ $\mathtt{u \approx NormalDistribution[], v \approx NormalDistribution[]\}]}$ gives 9.22454 while $\mathtt{ N[(c^2 - 1) (2/Pi) ArcTan[2 Abs[c]/(c^2 - 1)] + 4 c^2 - 4 Abs[c]/Pi] /. c -> 2}$ gives 15.2245. So it looks like there is a difference of at least 6.
– user44143
Mar 1, 2016 at 3:38
• You're taking $C = 2$, my formula was for $|C|<1$. They are different (due to the branch cut of arctan). Mar 1, 2016 at 3:55
• That works! It'd be helpful to put the limitation at the front of the answer.
– user44143
Mar 1, 2016 at 4:03

Using capital letters for random variables, let $V_{i}^{\pm} = X_{i} \pm CY_{i} \sim \mathcal{N}(0,1\pm C^{2})$, for $i=1,2$. Define matrix $A_{\pm} = \begin{bmatrix} 1 & \pm C & 0 & 0\\ 0 & 0 & 1 & \pm C\end{bmatrix}$, notice that $\begin{pmatrix}V_{1}^{\pm}\\V_{2}^{\pm}\end{pmatrix} = A_{\pm}\begin{pmatrix}X_{1}\\Y_{1}\\X_{2}\\Y_{2}\end{pmatrix}$, and that $A_{\pm}A_{\pm}^{\top} = \begin{pmatrix}1\pm C^{2} & 0\\0 & 1\pm C^{2}\end{pmatrix}$ is diagonal, meaning the components $V_{1}^{\pm}$ and $V_{2}^{\pm}$ are respectively (for the same sign) independent (see here). Quantity of interest is $U = U^{+} - U^{-}$, where, by the independence argument, the random variables $U^{\pm} = \max(V_{1}^{\pm},V_{2}^{\pm})$ has respective CDF $F_{\pm}(x) = \Phi^{2}\left(\frac{x}{\sqrt{1\pm C^{2}}}\right)$, where $\Phi(.)$ is the standard normal CDF. From this, you may be able to compute the CDF and PDF of the difference. I will try to come back to the explicit calculation later.