This package allows to use PDMats
with singular covariance matrices.
For instance:
Σ = covariance_from([1; 0;;])
Then:
Matrix(Σ)
gives
2×2 Matrix{Int64}:
1 0
0 0
The random variable with this covariance can be sampled as follows. With
rng = Random.default_rng()
sample(rng, Σ)
gives samples with the singular covariance above, that is, the second component is guaranteed to be zero.