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
) – Pythonbool
, defaultFalse
. WhenTrue
, distribution parameters are checked for validity despite possibly degrading runtime performance. WhenFalse
, invalid inputs may silently render incorrect outputs. (default:False
)allow_nan_stats (
bool
) – Pythonbool
, defaultTrue
. WhenTrue
, statistics (e.g., mean, mode, variance) use the valueNaN
to indicate the result is undefined. WhenFalse
, an exception is raised if one or more of the statistic’s batch members are undefined. (default:True
)name (
str
) – Pythonstr
, name prefixed toOps
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 inrank
andlog_pdet
, if they are computed by the class. Also used insample()
. (default:1e-06
)
Notes
If they are not provided as arguments,
rank
andlog_pdet
are computed based on the eigenvalues of the precision matrixprec
. 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.
Eigenvalues and eigenvectors of the distribution's precision matrices.
Log-pseudo-determinants of the distribution's precision matrices.
Ranks of the distribution's precision matrices.