Given two positive constants $c_1,c_2$ and two independent standard normal random variables $a,b$, how to calculate the following expected value $$ \mathbb{E}\left[\frac{a^2}{c_1a^2+c_2b^2}\right] $$ Thank you.
2 Answers
$\newcommand\E{\mathscr E}$The expectation in question is $I/c_1$, where $$I:=E\frac{a^2}{a^2+cb^2},\quad c:=c_2/c_1>0.$$ In turn, using polar coordinates, we get $$I=\frac1{2\pi}\int_0^{2\pi}\frac{\cos^2 t\, dt}{\cos^2 t+c\sin^2 t},\quad c:=c_2/c_1>0.$$ Further, writing $$I=\frac4{2\pi}J$$ for $$J:=\int_0^{\pi/2}\frac{\cos^2 t\, dt}{\cos^2 t+c\sin^2 t}$$ and using the standard substitution $t=\arctan u$, so that $\cos^2 t=1/(1+u^2)$ and $\sin^2 t=u^2/(1+u^2)$, we have $$J=\int_0^\infty\frac{du}{(1+cu^2)(1+u^2)}.$$ Using partial fraction decomposition to compute $J$ and collecting the pieces, we finally get that the expectation in question is $$\E(c_1,c_2):=\frac1{c_1+\sqrt{c_1c_2}}.$$
"Sanity" checks: (i) $\E(tc_1,tc_2)=\E(c_1,c_2)/t$ for all real $t>0$; (ii) $\E(1,0)=1$; (iii) $\E(1,1)=1/2$; (iv) $\E(c_1,c_2)\to\infty$ as $c_1\downarrow0$.
-
$\begingroup$ Thank you. Do you have maybe an idea how to calculate the expectation for the more general case $\frac{x_1^2}{\sum_{i=1}^{M}c_i x_i^2}$ where $c_i>0$ and $x_i\sim N(0,1)$ ? (or at least for $M=3$) $\endgroup$– EdwardCommented Sep 12, 2021 at 21:02
-
$\begingroup$ @Edward : I think the method of my other answer would work better in the general case. However, even for $M=3$, the corresponding integral, $\int_0^\infty du\, (1+2u)^{-3/2} (1+2cu)^{-1/2}(1+2\tilde cu)^{-1/2}$, apparently cannot be expressed in closed form; Mathematica cannot do anything with it. Closed form expressions are rare. $\endgroup$ Commented Sep 12, 2021 at 21:38
-
$\begingroup$ @Edward : Actually, for $M=3$ the integral can be expressed in terms of elliptic functions -- see the other answer of mine, updated. $\endgroup$ Commented Sep 13, 2021 at 13:36
In view of the identity $$\frac{c_1a^2}{c_1a^2+c_2b^2}=1-\frac{c_2b^2}{c_1a^2+c_2b^2}$$ and the exchangeability of $a$ and $b$, we may assume that $c_2\le c_1$.
The expectation in question is $I/c_1$, where $$I:=E\frac{a^2}{a^2+cb^2},\quad c:=\frac{c_2}{c_1}\in(0,1].$$ Using the identity $1/A=\int_0^\infty du\, e^{-Au}$ for real $A>0$ and the Fubini--Tonelli theorem, we have $$I=\int_0^\infty du\, Ea^2 e^{-(a^2+cb^2)u} =\int_0^\infty du\, Ea^2 e^{-u a^2}\, Ee^{-cu b^2}.$$ Next, for real $u>0$, $$Ee^{-u b^2}=(1+2u)^{-1/2}$$ and hence $$Ea^2 e^{-u a^2}=-((1+2u)^{-1/2})'=(1+2u)^{-3/2}.$$ So, $$I=\int_0^\infty du\, (1+2u)^{-3/2} (1+2cu)^{-1/2}.$$ Using now the substitution $u=(x^2-1)/2$, we get $$I=\frac1{\sqrt c}\int_1^\infty \frac{dx}{x^2\,\sqrt{x^2+r^2}},$$ where $r:=\sqrt{\dfrac{1-c}c}$. So, $I$ is easily found if $c=1$. If $c\in(0,1)$, use the standard substitution $x=r\tan t$ to find $I$. Collecting all the pieces, we get that the expectation in question is $$\frac1{c_1+\sqrt{c_1c_2}}.$$
Similarly and more generally, the calculation of $$E\frac{Z_1^2}{c_1^2Z_1^2+\cdots+c_k^2Z_k^2}$$ for any natural $k\ge2$ reduces to the calculation of $$I_k:=\int_1^\infty \frac{dx}{x^2\,\sqrt{x^2+R_2}\cdots\sqrt{x^2+R_k}}$$ for real $R_2,\dots,R_k>-1$.
For $k=3$, the integral $I_k$ can be expressed in terms of elliptic functions, as seen from the following image of a Mathematica notebook: