Finding Variance of Piecewise Function of Two Random Variables

677 Views Asked by At

I have a piecewise function of two random variables: $$h(X,Y) = \left\{ \begin{array}{ll} kXY \qquad \text{if } X\geq a\\ kaY \qquad \text{ if } X < a\\ \end{array} \right.$$ where $X$~$f_X(x)$, $Y$~$f_Y(y)$ are independent and $a,k$ are constants. I got the expectation of $h(X,Y)$: $$E[h(X,Y)] = k\big(aF_x(a)+\int_a^\infty xf_X(x)dx\big)E[Y],$$ but I'm not sure how to calculate the variance of $h(X,Y)$. Could anyone help with $Var(h(X,Y))$? Many thanks!

1

There are 1 best solutions below

0
On

In general: $$Var(h(X,Y)) = E[h(X,Y)^2] - E[h(X,Y)]^2$$ so it remains to compute $E[h(X,Y)^2]$.

Here are three ways and you can fill in the details for each way:

1. Basic formula:

$$E[h(X,Y)^2] = \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} h(x,y)^2 f_{X,Y}(x,y)dxdy$$ and use $f_{X,Y}(x,y) = f_X(x)f_Y(y)$.

2. Law of total expectation:

$$ E[h(X,Y)^2] = \int_{-\infty}^{\infty} E[h(X,Y)^2|X=x]f_X(x)dx$$

3. Observing a product structure:

You can observe $h(X,Y) = g(X)Y$ for some function $g(X)$ and so by independence $$ E[h(X,Y)] = E[g(X)]E[Y]$$ and so on for $E[h(X,Y)^2]$.