How to decompose this conditional expectation?

211 Views Asked by At

I have an expectation over a function $f(x)$ of a scalar random variable $X$ with probability density function $p(X=x)$ which is in the following form:

$\mathbb{E}_{x}[f(x)]$

Is it correct to say:

$\mathbb{E}_{X}[f(X)]=\mathbb{E}_{X}[f(X)|X\geq 0]P(X\geq 0)+\mathbb{E}_{X}[f(X)|X< 0]P(X< 0)$

where $P(X< 0)=1-P(X\geq 0)=\int_{-\infty}^0 p(x) dx$

Is anything wrong with this decomposition?

Thanks for any comments!