torch.distributions.LowRankMultivariateNormal
class LowRankMultivariateNormal extends Distributionnew LowRankMultivariateNormal(loc: number[] | Tensor, cov_factor: number[][] | Tensor, cov_diag: number[] | Tensor, options?: DistributionOptions)
- readonly
loc(Tensor) - – Mean of the distribution.
- readonly
cov_factor(Tensor) - – Low-rank factor W such that covariance = W @ W.T + D.
- readonly
cov_diag(Tensor) - – Diagonal of D in the covariance decomposition.
- readonly
arg_constraints(unknown) - readonly
support(unknown) - readonly
has_rsample(unknown) - readonly
covariance_matrix(Tensor) - – Full covariance matrix: W @ W.T + D.
- readonly
precision_matrix(Tensor) - – Precision matrix (inverse of covariance). Uses Woodbury identity for efficient computation.
- readonly
mean(Tensor) - readonly
mode(Tensor) - readonly
variance(Tensor)
Low Rank Multivariate Normal distribution: multivariate normal with efficient low-rank covariance.
Essential for:
- High-dimensional Gaussian processes (rank-reduced approximations)
- Scalable Bayesian models with covariance structure
- Matrix-normal variational inference
- Structured covariance modeling
Covariance matrix of low-rank plus diagonal form: Σ = W @ W.T + D where W is a (d x r) low-rank factor and D is a diagonal matrix.
This parametrization is useful for high-dimensional distributions where a full covariance would be too expensive to store/compute.
Examples
const m = new LowRankMultivariateNormal(
torch.tensor([0.0, 0.0, 0.0]), // mean
torch.tensor([[1.0], [0.5], [0.2]]), // cov_factor (d x r)
torch.tensor([0.1, 0.1, 0.1]) // cov_diag (d,)
);
m.sample(); // sample from the distribution