bayespy.inference.vmp.nodes.gamma.GammaDistribution.compute_gradient

GammaDistribution.compute_gradient(g, u, phi)[source]

Compute the moments and g(\phi).

\mathrm{d}\overline{\mathbf{u}} &=
\begin{bmatrix}
  - \frac{\mathrm{d}\phi_2} {phi_1} + \frac{\phi_2}{\phi_1^2} \mathrm{d}\phi_1
  \\
  \psi^{(1)}(\phi_2) \mathrm{d}\phi_2 - \frac{1}{\phi_1} \mathrm{d}\phi_1
\end{bmatrix}

Standard gradient given the gradient with respect to the moments, that is, given the Riemannian gradient \tilde{\nabla}:

\nabla =
\begin{bmatrix}
  \nabla_1 \frac{\phi_2}{\phi_1^2} - \nabla_2 \frac{1}{\phi_1}
  \\
  \nabla_2 \psi^{(1)}(\phi_2) - \nabla_1 \frac {1} {\phi_1}
\end{bmatrix}