geomstats.distributions package#

Submodules#

geomstats.distributions.lognormal module#

LogNormal Distribution.

class geomstats.distributions.lognormal.LogNormal(space, mean, cov=None)[source]#

Bases: object

LogNormal Distribution on manifold of SPD Matrices and Euclidean Spaces.

(1) For Euclidean Spaces, if X is distributed as Normal(mean, cov), then exp(X) is distributed as LogNormal(mean, cov).

  1. For SPDMatrices, there are different distributions based on metric

    a)LogEuclidean Metric : With this metric, LogNormal distribution is defined by transforming the mean – an SPD matrix – into a symmetric matrix through the Matrix logarithm, which gives the element “log-mean” that now belongs to a vector space. This log-mean and given cov are used to parametrize a Normal Distribution.

    b)AffineInvariant Metric : X is distributed as LogNormal(mean, cov) if exp(mean^{1/2}.X.mean^{1/2}) is distributed as Normal(0, cov)

Parameters:
  • space (Manifold obj, {Euclidean(n), SPDMatrices(n)}) – Manifold to sample over. Manifold should be instance of Euclidean or SPDMatrices.

  • mean (array-like,) – shape=[dim] if space is Euclidean Space

    shape=[n, n] if space is SPD Manifold

    Mean of the distribution.

  • cov (array-like,) – shape=[dim, dim] if space is Euclidean Space

    shape=[n*(n+1)/2, n*(n+1)/2] if space is SPD Manifold

    Covariance of the distribution.

Example

>>> import geomstats.backend as gs
>>> from geomstats.geometry.spd_matrices import SPDMatrices
>>> from geomstats.distributions.lognormal import LogNormal
>>> mean = 2 * gs.eye(3)
>>> cov  = gs.eye(6)
>>> SPDManifold = SPDMatrices(3, metric=SPDAffineMetric(3))
>>> LogNormalSampler = LogNormal(SPDManifold, mean, cov)
>>> data = LogNormalSampler.sample(5)

References

[LNGASPD2016]

A. Schwartzman, “LogNormal distributions and” “Geometric Averages of Symmetric Positive Definite Matrices.”, International Statistical Review 84.3 (2016): 456-486.

class geomstats.distributions.lognormal.LogNormalEuclidean(space, mean, cov)[source]#

Bases: object

LogNormal Distribution on Euclidean Space.

sample(n_samples)[source]#

Generate samples for Euclidean Manifold.

class geomstats.distributions.lognormal.LogNormalSPD(space, mean, cov)[source]#

Bases: object

LogNormal Distribution on manifold of SPD Matrices.

sample(n_samples)[source]#

Generate samples for SPD manifold.

samples_sym(mean_vec, cov, n_samples)[source]#

Generate symmetric matrices.

Module contents#