geomstats.distributions package#


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)

  • 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.


>>> 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)



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.


Generate samples for Euclidean Manifold.

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

Bases: object

LogNormal Distribution on manifold of SPD Matrices.


Generate samples for SPD manifold.

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

Generate symmetric matrices.

Module contents#