---
title: Von Mises Derivatives in vMF Models
url: https://www.emergentmind.com/topics/von-mises-derivatives
type: topic
---

# Von Mises Derivatives in vMF Models

The von Mises derivatives are the first and second derivatives of the mean-parameter log-normalizer for the $D$-dimensional von Mises-Fisher (vMF) distribution, expressed in terms of the mean parameter. These derivatives, denoted as $\psi'(r)$ and $\psi''(r)$ for $r = \|\mu\|$, play a central role in forming the variance function and are essential for efficient likelihood and natural parameter computations in the mean parametrization of vMF models [2404.07358]. Their characterization is tightly linked to the underlying geometry and Bessel-function structure of the vMF family.

## 1. Mean-Parameter Form and Log-Normalizer

The vMF distribution on the unit sphere $S^{D-1}$, with base measure $\nu$, possesses both a natural parameterization ($\eta$) and a mean parameterization ($\mu$), connected via the gradient of the log-normalizer. The mean parameter satisfies $\|\mu\|\leq 1$ and admits a radial log-normalizer, $\Psi(\mu)=\psi(r)$, where $r=\|\mu\|$. The density in mean parameters is
$$
p(x\mid \mu) = \exp\left(\nabla\Psi(\mu)^{\top}(x-\mu) + \Psi(\mu)\right),
$$
with $\Psi(\mu)$ as the Legendre dual of the natural-parameter log-normalizer.

## 2. Characterization Through a Second-Order ODE

A fundamental property is that the trace of the covariance of $X$ under the vMF is $1 - r^2$ (enforced by the hyperspherical support). The radial symmetry and exponential family structure lead to the following explicit scalar ODE for $\psi(r)$:
$$
\psi''(r) = \frac{\psi'(r)}{(1-r^2)\psi'(r) + (1-D)r}, \qquad r \in [0, 1).
$$
Boundary conditions are $\psi(0)$ given by the dual at zero, and $\psi'(0) = 0$.

## 3. Exact Solution via Modified Bessel Functions

An exact closed-form in terms of Bessel functions emerges by introducing
$$
\phi(\kappa) = \ln I_\nu(\kappa) - \nu \ln\kappa - \tfrac{D}{2}\ln(2\pi), \quad \nu = D/2-1
$$
with $I_\nu$ the modified Bessel function of the first kind. The first derivative, $\phi'(\kappa) = \frac{I_{\nu+1}(\kappa)}{I_\nu(\kappa)}$, is monotonic and invertible, yielding $\kappa(r)$ such that $\phi'(\kappa(r)) = r$.

The log-normalizer and its derivatives are then
$$
\psi'(r) = \kappa(r),
$$
$$
\psi(r) = -\phi(\kappa(r)) + \kappa(r) r + \nu\ln2 + \tfrac{D}{2}\ln(2\pi) + \ln\Gamma(D/2).
$$
The second derivative is
$$
\psi''(r) = \frac{1}{1 - r^2 - (D-1)r/\kappa(r)}.
$$
This formula coincides with the ODE's right-hand side.

## 4. Von Mises Derivative Formulas and Variance Function

The first and second von Mises derivatives, essential for variance calculations and parameter estimation, explicitly take the form:
- First: $\psi'(r) = \kappa(r)$.
- Second: $\psi''(r) = \left[\phi''(\kappa(r))\right]^{-1}$,
with $\phi''(\kappa) = 1 - [\phi'(\kappa)]^2 - (D-1)\,\phi'(\kappa)/\kappa$.

The mean-parameter variance function, or covariance of $X$ given $\mu$, is:
$$
V(\mu) = \text{Cov}[X|\mu] = \frac{r}{\psi'(r)} I_D + \left(\frac{1}{\psi''(r)} - \frac{r}{\psi'(r)}\right)\frac{\mu \mu^{\top}}{r^2}.
$$
The trace matches $1 - r^2$, as enforced by the geometry.

## 5. Approximations for High-Dimensional and Efficient Computation

For large $D$ or speed-critical scenarios, closed-form approximations to the von Mises derivatives improve computational tractability:

- **Banerjee et al. (2005) approximation**:
  $$
  \psi'_B(r) = \frac{r(D - r^2)}{1 - r^2}, \qquad \psi_B(r) = \tfrac{1}{2}r^2 + \tfrac{1-D}{2}\ln(1 - r^2)
  $$
  This yields absolute error $\lesssim 10^{-3}$ for $D \gtrsim 10$.

- **Refined rational approximation** ($\tilde\psi_1$):
  $$
  \tilde\psi_1'(r) = \frac{(1-D)[r^5 + (D-3)r^3 + D r]}{r^6 + (D-3)r^4 + r^2 + D - 1}
  $$
  $$
  \tilde\psi_1(r) = \frac{1-D}{2}\ln(1-r^2) + \frac{1-D}{4s}\left[\ln(v+r^2+s)-\ln(v+s)\right] \\
  - \frac{1-D}{4s}\left[\ln(v+r^2-s)-\ln(v-s)\right]
  $$
  with $v = D/2 - 1$, $s = \sqrt{v^2 - D}$. This offers absolute error $\lesssim 10^{-4}$ for $10 \leq D \leq 10^4$.

Empirically, these rational approximations are highly accurate except near $r \to 1$.

## 6. Implementation and Computational Methods

Approaches for evaluating von Mises derivatives include:

- **Direct ODE integration**: Numerically solves the second-order ODE for $\psi(r)$ from $r = \epsilon$ ($\epsilon \approx 10^{-4}$), using standard solvers.
- **Bessel-inversion**: Solves $\phi'(\kappa) = r$ for $\kappa = \kappa(r)$ by Newton–Raphson, leveraging continued-fraction expansions for the Bessel function ratio. Typically, 2–3 iterations suffice with $\sim 20$–$30$ flops per step.
- **Tabulation/interpolation**: Precompute $\psi(r)$ and derivatives on a grid, enabling rapid lookup.
- **Elementary rational approximations**: Enable evaluation using only basic arithmetic operations (10–30 flops per call), with no recourse to special functions.

These allow efficient computation for large-scale inference in vMF models.

## 7. Applications and Significance

Von Mises derivatives facilitate key operations in maximum-likelihood estimation, mixture modeling, and Bregman clustering with vMF distributions. Accurate and efficient computation of $\psi'(r)$ and $\psi''(r)$ supports the use of mean-parameterizations in high-dimensional directional statistics, topic modeling, and signal processing. The variance function's explicit dependence on von Mises derivatives also provides insight into the geometry of hyperspherical exponential families and the practical implementation of inference algorithms [2404.07358].

Source: https://www.emergentmind.com/topics/von-mises-derivatives