3
$\begingroup$

Suppose a function $f(x): \mathbb R^d \mapsto \mathbb R^D$, and its stochastic approximator, $g(x; W): \mathbb R^d \mapsto \mathbb R^D$. Here $W$ is some random variable. Then $g(x; W)$ is unbiased in the sense that $$\mathbb E_W [g(x;W)] = f(x),$$ for any $x$.

I think the following two are not equal, but how to prove it? $$\mathbb E_W\left[\frac{dg(x;W)}{dx}\right] \text{ vs. } \frac{df(x)}{dx}.$$

$\endgroup$
1
  • $\begingroup$ Do you want a counterexample, or do you want sufficient conditions for these two to be equal? $\endgroup$ Commented Dec 9, 2022 at 13:12

2 Answers 2

5
$\begingroup$

Indeed, the equality will not hold in general. For counterexamples, see this or this.

For sufficient conditions for the equality when $d=1$, see e.g. Folland, Theorem 2.27 or the more general Lemma 2.3. This immediately extends to any $d$ if the derivatives are understood in the Gateaux sense. As seen from the discussion of Theorem 2.27 in Folland, the extension to $d>1$ is somewhat more problematic if the derivatives are understood in the Fréchet sense. This answer may also be of interest to you.

$\endgroup$
4
  • $\begingroup$ thank you! This is really helpful! The counter example is not a continuous function. Would it be possible to construct a counter example that is a continuous function? $\endgroup$ Commented Dec 9, 2022 at 18:12
  • 1
    $\begingroup$ @JiajiHuang : I think it is possible, and I will have your question in mind. $\endgroup$ Commented Dec 9, 2022 at 18:25
  • $\begingroup$ @JiajiHuang : See an answer to your additional question, with $f$ continuous, at mathoverflow.net/a/436317/36721 $\endgroup$ Commented Dec 11, 2022 at 3:57
  • $\begingroup$ @losif I see your post and the answer there. Thank you! Also replied over there. $\endgroup$ Commented Dec 11, 2022 at 19:37
1
$\begingroup$

The two expressions are equal, because the operations of taking an expectation with respect to a random variable $W$ and taking a derivative with respect to a parameter $x$ commute: $$\mathbb E_W\left[\frac{dg(x;W)}{dx}\right] = \lim_{\delta\rightarrow 0}\delta^{-1}\bigl(\mathbb E_W[g(x+\delta;W)]-E_W[g(x;W)]\bigr)$$ $$=\lim_{\delta\rightarrow 0}\delta^{-1}\bigl(f(x+\delta)-f(x)\bigr)=\frac{d}{dx}f(x).$$

$\endgroup$
2
  • 1
    $\begingroup$ Taking the expectation and taking the derivative do not always commute. See the links to counterexamples in my answer on this page. $\endgroup$ Commented Dec 9, 2022 at 13:48
  • $\begingroup$ agreed with Iosif, this response is incorrect. Take g(x,1) to be nondifferentiable, and g(x,2) = - g(x,1), and let w take on values 1 or 2 with equal probability. Then f(x)=0 which is differentiable, but g isn't even differentiable. $\endgroup$
    – Stephen
    Commented Apr 12 at 22:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .