This time I want to prove the stein equation for the 1D gaussian version which is stated below:
A random variable X follows the standard normal distribution (i.e x ~ N(0,1))
if and only E[f'(x) - xf(x) ]= 0 for all smooth function f
where f'(x) means the derivative of f
The proof for the left to the right direction is straightforward. The question is about the converse proof.
Following is my proof and I am stuck in some weird conclusion. Please check where the error is.
First, denote the distribution of x by p(x) i.e x~ p
1) let $f'(x) - xf(x) = g(x) - E_q[g(x)]$ for some function g(x) and some arbitrary distribution q
2) f can be obtained with a 1d differential equation by multiplying $e^{(-x^2/2)}$ to the both side when f has a proper zero-boundary condition.
Then $f(x) = e^{x^2/2}\int_{-\infty}^x(g(t) - E_q[g(t)])e^{-t^2/2}dt$
That is, I can get the proper function f when g(x) is given.
3) let $g(x) = 1(x<=x_0)$ where 1 means the indicator
Then, by the condition we have
$0 = E_p[f'(x) - xf(x)] = E_p[ g(x) - E_q[g(x)] ] = E_p[g(x)] - E_q[g(x)] = p(x<=x_0) - q(x<=x_0)$
4) Finally, we get $p(x) = q(x)$ because for any $x_0, p(x<=x_0) = q(x<=x_0)$ satisfies.
Then the conclusion is that the distribution of p is equivalent to any arbitrary distribution, not standard normal distribution.
I know it is unnatural to answer my question but I need some space for what I got.
At the second step, $f(x)$ should be a smooth function. That is, as x goes infinity f should not diverge.
Therefore, $\lim_{x->\infty}\int_{-\infty}^x[g(t) - E_q(g)]e^{-t^2/2}dt = 0$
Thus, $E[g(Z)] = E_q(g)$ for Z ~ N(0,1) and for any function g
Then pick up the function g to be step function
It gives that the distribution q should be a standard normal distribution.
i.e if q is not a standard normal distribution then f diverge as x goes infinity
when q is a standard normal then I think I can prove f converges to zero by L'hospital theorem
$\lim f(x) = \lim_{x->\infty} {\int_{-\infty}^x [g(t) - E_q(g)] e^{-t^2/2}dt \over e^{-x^2/2}} = \lim_{x->\infty} {[g(x)-E_q(g)]e^{-x^2/2} \over -xe^{-x^2/2}} = 0 $ for some bounded function g