I am not a student of statistics, but need to compute an expression for my work. This is what I have so far:
I have a r.v. $D$ (pdf: $f$, support: $[0,\infty]$), and a positive constant $q$. I have a function $g=\min(q,D)$. I calculated $E[\min(q,D)]$ by using:
$$\int_0^\infty g(x)f(x)dx=\int_0^q xf(x)dx+q[1-F_D(q)]$$
Now I need to calculate $\text{Var}(g)$, and I am quite confused how to do it. If I try to expand $g$ using CDF of $D$, I end up with $E(g)$, which cant be correct. I need variance of $g$. It is not equal to variance of expectation of $g$, right?
I found this formula for var of a function of r.v.
$$Var[g(D)]=[g'E(D)]^2 Var(D)$$
But how do I compute g'? Any help is appreciated. Thanks.
Define $Z:=\min\{q,D\}$.
Since $\text{Var}(Z)=E[Z^2]-(E[Z])^2, $ you only have yet to compute $E[Z^2]:$
$$E[Z^2]=\int_0^\infty \min\{x^2,q^2\}f(x)dx=\int_0^q x^2f(x)dx+ q^2(1-F(q)).$$