The probability simplex
Manifolds.FisherRaoMetric
— TypeFisherRaoMetric <: Metric
The Fisher-Rao metric or Fisher information metric is a particular Riemannian metric which can be defined on a smooth statistical manifold, i.e., a smooth manifold whose points are probability measures defined on a common probability space.
See for example the ProbabilitySimplex
.
Manifolds.ProbabilitySimplex
— TypeProbabilitySimplex{n} <: AbstractEmbeddedManifold{ℝ,DefaultEmbeddingType}
The (relative interior of) the probability simplex is the set
where $\mathbb{1}=(1,…,1)^{\mathrm{T}}∈ ℝ^{n+1}$ denotes the vector containing only ones.
This set is also called the unit simplex or standard simplex.
The tangent space is given by
The manifold is implemented assuming the Fisher-Rao metric for the multinomial distribution, which is equivalent to the induced metric from isometrically embedding the probability simplex in the $n$-sphere of radius 2. The corresponding diffeomorphism $\varphi: \mathbb Δ^n → \mathcal N$, where $\mathcal N \subset 2𝕊^n$ is given by $\varphi(p) = 2\sqrt{p}$.
This implementation follows the notation in [ÅströmPetraSchmitzerSchnörr2017].
Manifolds.SoftmaxInverseRetraction
— TypeSoftmaxInverseRetraction <: AbstractInverseRetractionMethod
Describes an inverse retraction that is based on the softmax function.
Manifolds.SoftmaxRetraction
— TypeSoftmaxRetraction <: AbstractRetractionMethod
Describes a retraction that is based on the softmax function.
Base.exp
— Methodexp(M::ProbabilitySimplex,p,X)
Compute the exponential map on the probability simplex.
where $X_p = \frac{X}{\sqrt{p}}$, with its division meant elementwise, as well as for the operations $X_p^2$ and $\sqrt{p}$.
Base.log
— Methodlog(M::ProbabilitySimplex, p, q)
Compute the logarithmic map of p
and q
on the ProbabilitySimplex
M
.
where $pq$ and $\sqrt{p}$ is meant elementwise.
ManifoldsBase.check_manifold_point
— Methodcheck_manifold_point(M::ProbabilitySimplex, p; kwargs...)
Check whether p
is a valid point on the ProbabilitySimplex
M
, i.e. is a point in the embedding with positive entries that sum to one The tolerance for the last test can be set using the kwargs...
.
ManifoldsBase.check_tangent_vector
— Methodcheck_tangent_vector(M::ProbabilitySimplex, p, X; check_base_point = true, kwargs... )
Check whether X
is a tangent vector to p
on the ProbabilitySimplex
M
, i.e. after check_manifold_point
(M,p)
, X
has to be of same dimension as p
and its elements have to sum to one. The optional parameter check_base_point
indicates, whether to call check_manifold_point
for p
or not. The tolerance for the last test can be set using the kwargs...
.
ManifoldsBase.distance
— Methoddistance(M,p,q)
Compute the distance between two points on the ProbabilitySimplex
M
. The formula reads
ManifoldsBase.injectivity_radius
— Methodinjectivity_radius(M,p)
compute the injectivity radius on the ProbabilitySimplex
M
at the point p
, i.e. the distanceradius to a point near/on the boundary, that could be reached by following the geodesic.
ManifoldsBase.inner
— Methodinner(M::ProbabilitySimplex,p,X,Y)
Compute the inner product of two tangent vectors X
, Y
from the tangent space $T_pΔ^n$ at p
. The formula reads
ManifoldsBase.inverse_retract
— Methodinverse_retract(M::ProbabilitySimplex, p, q, ::SoftmaxInverseRetraction)
Compute a first order approximation by projection. The formula reads
where $\mathbb{1}^{m,n}$ is the size (m,n)
matrix containing ones, and $\log$ is applied elementwise.
ManifoldsBase.manifold_dimension
— Methodmanifold_dimension(M::ProbabilitySimplex{n})
Returns the manifold dimension of the probability simplex in $ℝ^{n+1}$, i.e.
ManifoldsBase.project
— Methodproject(M::ProbabilitySimplex, p, Y)
project Y
from the embedding onto the tangent space at p
on the ProbabilitySimplex
M
. The formula reads
ManifoldsBase.representation_size
— Methodrepresentation_size(::ProbabilitySimplex{n})
return the representation size of points in the $n$-dimensional probability simplex, i.e. an array size of (n+1,)
.
ManifoldsBase.retract
— Methodretract(M::ProbabilitySimplex, p, X, ::SoftmaxRetraction)
Compute a first order approximation by applying the softmax function. The formula reads
where multiplication, exponentiation and division are meant elementwise.
ManifoldsBase.zero_tangent_vector
— Methodzero_tangent_vector(M::ProbabilitySimplex,p)
returns the zero tangent vector in the tangent space of the point p
from the ProbabilitySimplex
M
, i.e. its representation by the zero vector in the embedding.
Statistics.mean
— Methodmean(
M::ProbabilitySimplex,
x::AbstractVector,
[w::AbstractWeights,]
method = GeodesicInterpolation();
kwargs...,
)
Compute the Riemannian mean
of x
using GeodesicInterpolation
.
Literature
- ÅströmPetraSchmitzerSchnörr2017
F. Åström, S. Petra, B. Schmitzer, C. Schnörr: “Image Labeling by Assignment”, Journal of Mathematical Imaging and Vision, 58(2), pp. 221–238, 2017. doi: 10.1007/s10851-016-0702-4 arxiv: 1603.05285.