Using exponential family to find the derivate of the partition function

37 Views Asked by At

Distributions that follow the exponential family have the following form \begin{equation} p(x) = h(x)\exp \left[\theta^T T(x) - H(\theta)\right] \end{equation} and $\frac{\partial}{\partial \theta}H(\theta) = \mathbb E_p[T(X)]$.

I have the following function \begin{equation} H(\theta) = \log \int_z \exp \left[\log P(y|z) - \frac{z^2}{2v} + \frac{mz}{2v}\right] \end{equation}

I want to find $\frac{\partial}{\partial m}H(\theta)$. For this define $T(z) = \begin{bmatrix} 1 & z/v & z^2 \end{bmatrix}^T$ and $\theta = \begin{bmatrix} \log P(y|z) & m & -1/2v \end{bmatrix}^T$. Is it correct that $\frac{\partial}{\partial m}H(\theta) = \mathbb E[T_2(z)|\theta] = \mathbb E[\frac{z}{v}|\theta]$?

1

There are 1 best solutions below

1
On BEST ANSWER

It sounds like $$ H(\theta) = \log \int \exp \left[\log P(y|z) - \frac{z^2}{2v} + \frac{mz}{2v}\right]dz $$ where the integration is over a range in which $z$ is defined. Let's write this more shortly as $$ H(\theta) = \log G(\theta) $$ with an obvious definition of $G(\theta)$. The answer to your question is \begin{align} \frac{\partial}{\partial m}H(\theta)&=\frac{\frac{\partial}{\partial m}G(\theta)}{G(\theta)}\,. \end{align} Since \begin{align} \frac{\partial}{\partial m}G(\theta)&=\int\frac{\partial}{\partial m}\exp \left[\log P(y|z) - \frac{z^2}{2v} + \frac{mz}{2v}\right]dz\\ &=G(\theta)\int \frac{z}{2v}dz \end{align} we get $$ \frac{\partial}{\partial m}H(\theta)=\int \frac{z}{2v}dz. $$