MultivariateNormalDegenerate#

class liesel.distributions.mvn_degen.MultivariateNormalDegenerate(loc, prec, rank=None, log_pdet=None, validate_args=False, allow_nan_stats=True, name='MultivariateNormalDegenerate', tol=1e-06)[source]#

Bases: Distribution

A potentially degenerate multivariate normal distribution.

Provides the alternative constructor from_penalty().

Parameters:
  • loc (Any) – The location (= mean) vector.

  • prec (Any) – The precision matrix (= a pseudo-inverse of the variance-covariance matrix).

  • rank (Union[Any, int, None]) – The rank of the precision matrix. Optional. (default: None)

  • log_pdet (Union[Any, float, None]) – The log-pseudo-determinant of the precision matrix. Optional. (default: None)

  • validate_args (bool) – Python bool, default False. When True, distribution parameters are checked for validity despite possibly degrading runtime performance. When False, invalid inputs may silently render incorrect outputs. (default: False)

  • allow_nan_stats (bool) – Python bool, default True. When True, statistics (e.g., mean, mode, variance) use the value NaN to indicate the result is undefined. When False, an exception is raised if one or more of the statistic’s batch members are undefined. (default: True)

  • name (str) – Python str, name prefixed to Ops created by this class. (default: 'MultivariateNormalDegenerate')

  • tol (float) – Numerical tolerance for determining which eigenvalues of the distribution’s precision matrices should be treated as zeros. Used in rank and log_pdet, if they are computed by the class. Also used in sample(). (default: 1e-06)

Notes

  • If they are not provided as arguments, rank and log_pdet are computed based on the eigenvalues of the precision matrix prec. This is an expensive operation and can be avoided by specifying the corresponding arguments.

  • When you draw samples from the distribution via sample(), it is always necessary to compute the eigendecomposition of the distribution’s precision matrices once and cache it, because sampling requires both the eigenvalues and eigenvectors.

Methods

This has only inherited attributes from another library. Please refer to the original documentation.

from_penalty(loc, var, pen[, rank, ...])

Alternative constructor based on a penalty matrix and an inverse smoothing parameter.

Attributes

This section is empty if this class has only inherited attributes.

eig

Eigenvalues and eigenvectors of the distribution's precision matrices.

log_pdet

Log-pseudo-determinants of the distribution's precision matrices.

rank

Ranks of the distribution's precision matrices.