If marginal PDF is a piecewise function, then conditional expectation will be a piecewise function?

568 Views Asked by At

If marginal PDF is a piecewise function, then conditional expectation will be a piecewise function?

My logic is that if the marginal PDF is piecewise, then the conditional pdf, defined as $$ f_{Y\vert X}(y\vert x) = \frac{f_{X,Y}(x,y)}{f_X(x)} $$ will be piecewise, and therefore the conditional expectation will be piecewise (since $f_X(x)$ depends on what $x$ is).

Here is an example: Consider a triangle with vertices at $(-1,0),(1,0),(0,1)$ and $(X,Y)$ uniformly distributed over this triangle. Then $$ f_X(x) = \begin{cases} x+1 & \text{ if } -1\leq x <0\\ -x+1 & \text{ if } 0\leq x\leq 1 \end{cases} $$ and joint density $$ f_{X,Y}(x,y) = 1 $$ so the joint density is piecewise, and therefore in $$ E(Y\vert X=x) = \int_a^b y f_{Y\vert X}(y\vert x) dy $$ $f_{Y\vert X}(y\vert x)$ will be different depending on whether $-1\leq x <0$ or $0\leq x\leq 1$.

Edit: Assume both marginal pdfs are piecewise (the example is not like this), therefore both conditional pdfs are piecewise (and it doesn't matter which conditional expectation we are talking about).