# Stein's Lemma for Multivariate Gaussians

Is there a version of Stein's lemma for multivariate Gaussians, I am attempting to solve integrals of the form:

$$\mathbb{E}(\mathbf{x} g(\mathbf{x})) =\int_{\mathbb{R}^p} \mathbf{x} g(\mathbf{x}) \mathcal{N}(\mathbf{x}| \mu, \Sigma) d\mathbf{x}$$

and

$$\mathbb{E}(\mathbf{x}^T\mathbf{x} g(\mathbf{x}))$$

where $\mathbf{x} \in \mathbb{R}^p$ is a Gaussian vector with mean $\mu$, and covariance matrix $\Sigma$ and $g: \mathbb{R}^p \to\mathbb{R}$

• Lemma 1 from Liu is probably what you want. – steveo'america Jun 11 '18 at 21:48

If $x\sim\mathcal{N}(\theta,1)$ and $f$ is continuous and a.e. differentiable, then $$\mathbb{E}_\theta[(x-\theta)f(x)] = \mathbb{E}_\theta[f'(x)].$$ Deduce that, if $x\sim \mathcal{N}_p(\theta,\Sigma)$, $\delta(x) = x+\Sigma\gamma(x)$, and $\mathrm{L}(\theta,\delta) = (\delta-\theta)^tQ(\delta-\theta)$, with $\gamma$ differentiable, then $$R(\theta,\delta) = \mathbb{E}_\theta\left[{\mathrm{tr}}(Q\Sigma)+2\,{\mathrm{tr}}(J_\gamma(x)Q^*)+ \gamma(x)^tQ^*\gamma(x)\right],$$ where ${\mathrm{tr}}(A)$ is the trace of $A$, $Q^* = \Sigma Q\Sigma$ and $J_\gamma(x)$ is the matrix with generic element ${\partial \over \partial x_i}\gamma_j(x)$.
which implies in particular that $$\mathbb{E}_\theta[(\mathbf{X}-\theta)^\text{T} g(\mathbf{X})] =\mathbb{E}_\theta[\nabla^\text{T} g(\mathbf{X})]$$ in the case of an identity covariance matrix.
• Shouldn't we have the covariance matrix somewhere in the expression? Also shouldn't the expectations in the last line be with respect to $X$ rather than $\theta$ ? – dimebucker91 Jan 24 '18 at 0:11
• The notation $\mathbb{E}_\theta$ means that the expectation depends on $\theta$, i.e., that the distribution of the rv $\mathbf{X}$ depends on $\theta$, not that $\theta$ is the random variable. – Xi'an Jan 24 '18 at 6:45
• I do not understand what role $R(\theta,\delta)$ and $L(\theta,\delta)$ play here, so it is hard for me to see how the exercise implies the given relation. – steveo'america Jun 11 '18 at 21:24