Skip to content
class

LowRankMultivariateNormal

extendsDistribution
LowRankMultivariateNormal(loc: Tensor, cov_factor: Tensor, cov_diag: Tensor, validate_args: bool | None = None)

Multivariate Normal distribution with low-rank plus diagonal covariance.

Parameterises a DD-dimensional Gaussian whose covariance matrix has the structured form

Σ=WW⊤+diag⁡(d)\Sigma = W W^\top + \operatorname{diag}(d)

where W∈RD×mW \in \mathbb{R}^{D \times m} is the low-rank factor (cov_factor) and d∈R+Dd \in \mathbb{R}_+^D is the positive diagonal vector (cov_diag). Applying the Woodbury matrix identity and matrix determinant lemma reduces log-density evaluation and Cholesky solves on the m×mm \times m capacitance matrix C=Im+W⊤diag⁡(d)−1WC = I_m + W^\top \operatorname{diag}(d)^{-1} W from O(D3)\mathcal{O}(D^3) to O(Dm2+m3)\mathcal{O}(D m^2 + m^3).

Parameters

Mean vector μ∈RD\mu \in \mathbb{R}^D of shape (..., D).
cov_factorTensor
Low-rank factor WW of shape (..., D, m).
cov_diagTensor
Positive diagonal vector dd of shape (..., D).
validate_argsbool | None= None
If True, validate parameter constraints at construction time.

Used by 2

Constructors

1
dunder

__init__

→None
__init__(loc: Tensor, cov_factor: Tensor, cov_diag: Tensor, validate_args: bool | None = None)

Initialise a LowRankMultivariateNormal distribution.

Properties

2
prop

mean

→Tensor
mean: Tensor

Mean vector μ\mu of shape (*batch_shape, D).

prop

mode

→Tensor
mode: Tensor

Mode vector μ\mu of shape (*batch_shape, D).

Instance methods

8
fn

covariance_matrix

→Tensor
covariance_matrix()

Full covariance matrix Σ=WW⊤+diag⁡(d)\Sigma = W W^\top + \operatorname{diag}(d).

fn

entropy

→Tensor
entropy()

Differential entropy of the LowRankMultivariateNormal distribution.

fn

expand

→Self
expand(batch_shape: Sequence[int], _instance: Self | None = None)

Return a new LowRankMultivariateNormal instance expanded to batch_shape.

fn

log_prob

→Tensor
log_prob(value: Tensor)

Log-probability density evaluated via the Woodbury identity and determinant lemma.

fn

precision_matrix

→Tensor
precision_matrix()

Precision matrix Σ−1\Sigma^{-1} computed via the Woodbury identity.

fn

rsample

→Tensor
rsample(sample_shape: tuple[int, ...] = ())

Draw reparameterised samples μ+WεW+d⊙εD\mu + W \varepsilon_W + \sqrt{d} \odot \varepsilon_D.

fn

scale_tril

→Tensor
scale_tril()

Lower-triangular Cholesky factor LL of Σ=WW⊤+diag⁡(d)\Sigma = W W^\top + \operatorname{diag}(d).

fn

variance

→Tensor
variance()

Marginal variances diag⁡(WW⊤)+d\operatorname{diag}(W W^\top) + d.