When Differentiation and Expectation Cannot Be Interchanged
Summary
The document examines whether the derivative of an expectation with respect to a parameter equals the expectation of the derivative of the function inside it. It points out that when the random variable’s distribution depends on the parameter, the expectation changes through both the function and the probability law. In a density-based expression, differentiating the product of the function and its parameter-dependent density introduces an extra contribution from the changing density, so the proposed equality need not hold.
A simple counterexample takes the function to be the random variable itself, with no explicit parameter dependence: its pointwise derivative is zero, while its mean can still vary with the parameter. The answer illustrates this using a lognormal variable whose log has a parameter-dependent variance. This establishes that the interchange is false in general, but does not state sufficient regularity conditions under which differentiation under the integral is valid or develop a general formula for the distributional contribution.
Key ideas
- A parameter can affect an expectation through the distribution of the random variable as well as through the function.
- Differentiating a parameter-dependent density contributes a term that is absent from the expected pointwise derivative.
- A random variable with zero explicit derivative can still have a parameter-dependent mean.
- Interchange may require additional conditions, which the document does not specify.
Tags
Full text
# Derivation and expectation interchange
# Derivation and expectation interchange
I would like to know when it is allowed to interchange derivation and expectation. Suppose $X$ is some r.v whose dynamic is controlled by some parameter $\sigma$ and suppose $h$ is some smooth function of two variables. Is the following true: $$\frac{\partial \mathbb{E}\left[h(X,\sigma)\right]}{\partial \sigma} =\mathbb{E}\left[\frac{\partial h(X,\sigma)}{\partial \sigma} \right]$$
I think it's wrong (the expectation operator depends on $\sigma$ through the dynamics of $X$). If $d\mathbb{P}_X(x)=p_{X,\sigma}(x)dx$, then we would have $$\frac{\partial \mathbb{E}\left[h(X,\sigma)\right]}{\partial \sigma} =\int \frac{\partial}{\partial \sigma}\left[h(X,\sigma)p_{X,\sigma}(x)\right]dx$$ which is in general different from $$\mathbb{E}\left[\frac{\partial h(X,\sigma)}{\partial \sigma} \right] =\int \frac{\partial h(X,\sigma)}{\partial \sigma}p_{X,\sigma}(x)dx$$
Could somebondy confirm my reasoning ?
## Answer by dm63 (score 1)
https://quant.stackexchange.com/a/45117
Taking the simple case $ h(X,\sigma)= X $ ( thus no explicit dependence on $\sigma$, the RHS is immediately zero. The LHS is not zero if the expectation of $X$ depends on $\sigma$, which it easily could. For example , $\ln(X) $ is normal($\mu, \sigma$)gives an expected value of $\mu + 1/2 \sigma^2$. So I agree that the statement seems false in general.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.