Package for Multivariate (normal) Conditional Distribution

Hi! Is any package to get Multivariate (normal) Conditional Distribution?

Something like described here.

maybe other people jump in that know more, but this seems related:

in particular, also the last answer therein and reference to the conditional(P, A, B, xB) method from GaussianDistributions.jl which should do what you want.

essentially you could ā€œjustā€ calculate \mu_{1|2} and \Sigma_{1|2} yourself as described in your link and then sample from MvNormal(\mu_{1|2}, \Sigma_{1|2}) via Distributions.jl. Advantage of the above references may be a good numerical implementation for computing \mu_{1|2} and \Sigma_{1|2}.

1 Like

[Shameless propaganda] Just to inform you if you still care that now Copulas.jl does allow conditioning or multivariate random vectors. It has a generic AD-based Implementation, but for Gaussian’s and Student’s dependence structures, it does the smart parametric thing:

using Copulas, Distributions
rho = 0.7 # could be a full correlation matrix as well.
mu = [0, 1, -2]
sigma = [1, 1, 2]
S = SklarDist(GaussianCopula(3, rho), Normal.(mu, sigma)) # this is now a trivariate gaussian random vector.

D1 = condition(S, 2, 0.3)  # gives a bivariate random vector. 
D2 = condition(S, (1,2), (0.3, 0.4)) # gives a Normal() with correct mean and variance. 

see the docs there : Conditioning and Subsetting | Copulas.jl

1 Like