Read a paper on Zero-Shot (Zero-Shot Adaptation of Behavioral Foundation Models to Unseen Dynamics)
In it, different latent representations are used for RL tasks and RL dynamics
Using the dynamics latent h vector as a cluster center, and sampling task latent vectors z around it, one can obtain a clustered distribution of z vectors for different dynamics in task space
As shown in the figure below
The latent space here uses a normalized hypersphere, and a vMF distribution is used on the sphere as the sampling distribution for z
This note is a study note on the vMF distribution
From Gaussian Distribution to the vMF Distribution
Directional statistics studies data that lies on the unit sphere—compass readings, the direction of incident light, normalized word vectors, torsion angles of protein backbones, and so on. Such data cannot be modeled directly with an ordinary Gaussian, because the Gaussian is defined over the entire
01 · One-Dimensional Gaussian Distribution
Let's start from the density function of a one-dimensional Gaussian distribution:
Expand the square in the exponent:
The last term is independent of
The linear term
determines the location of the distribution; the quadratic term determines its shape. But on the sphere there is no place for a quadratic term — this is exactly why the vMF is simpler than the Gaussian.
One-Dimensional Gaussian (density curve + real-time sampling)
02 · Multivariate Isotropic Gaussian
Replace the scalar
Expand the squared Euclidean distance:
Substitute back into the exponential part:
Thus the density can be written compactly as:
KeyPoint
03 · Normalizing the Distribution onto the Unit Sphere
Now impose the constraint: all data points lie on the unit sphere, i.e.,
Substituting
The constant can be absorbed into the normalization factor. Thus only the linear term remains:
Decompose the mean vector into direction and magnitude:
Physical meaning of the two parameters
is called the concentration parameter — the smaller the variance and the longer the mean, the more the distribution concentrates around .
is the mean direction, lying on the unit sphere.
At this point we have "guessed" the functional form of the vMF:
Only one task remains: compute the normalization constant.
04 · The von Mises–Fisher Distribution
Let
The normalization constant is given by the modified Bessel function
Why this form?
The core is computing this integral. Taking
where
Taking the reciprocal gives
The most common special case:
The 3-dimensional sphere
Substituting into
Thus the vMF density on the 3-dimensional sphere is very clean:
Limiting behavior
As, , so — exactly the uniform distribution on the sphere.
As, the density collapses to a Dirac function located at .
The vMF distribution on
05 · Projecting a Normal Distribution onto the Sphere
We now know the definitions of the Gaussian and vMF distributions. So how exactly are they connected?
The answer: normalize Gaussian samples to unit length. Let
Then the distribution followed by
Expanding the norm, the dependence on
In the isotropic case (covariance
Core conclusion
Radially normalizing an isotropic Gaussian yields exactly the vMF distribution. Conversely, vMF can also be viewed as "an isotropic Gaussian defined on the sphere." Two seemingly unrelated distributions differ only by a single normalization.
Geometric intuition
Imagine a Gaussian cloud in
The thinner the cloud (smaller
Continuous transition from Gaussian to vMF
06 · Sampling: Wood's Algorithm
To generate points on the sphere following a vMF distribution, the key is to exploit rotational invariance: first sample along the
Step 1: Sample the polar angle cosine
On
Let
Numerical stability
Whenis large, computing directly will overflow. The expression above rewrites the exponential as , which automatically degenerates to when , with no overflow throughout.
Step 2: Sample the azimuth and assemble
Take
Step 3: Rotate to
Construct an orthonormal basis
07 · Key Properties and Estimation
Mean Resultant Vector Length
The expectation of the vMF has a very concise form—the direction is simply
When
It grows monotonically from
Parameter Summary
| Parameter | Value | Meaning |
|---|---|---|
|
|
|
mean direction, unit vector |
|
|
|
concentration; larger means more concentrated |
|
|
— | uniform distribution on the sphere |
|
|
— | degenerates to the point
|
|
|
— | circular vM distribution,
|
|
|
— |
|
Maximum Likelihood Estimation
Given samples
Differentiating with respect to
And
08 · Summary
The isotropic Gaussian (projected normal) on the sphere and the vMF are equivalent. Because for points on the sphere,
This also explains why the vMF is the undisputed "Gaussian" of directional statistics: it is simple, unimodal, has a conjugate prior, has efficient sampling algorithms, and at the two extremes of
