zenna / Omega.jl

Causal, Higher-Order, Probabilistic Programming
MIT License
163 stars 17 forks source link

multivariate distributions #192

Closed ga72kud closed 2 years ago

ga72kud commented 2 years ago

I am wondering if there are also possibilities to use multivariate distributions. Something like that:

μ=[1.;.1]
Σ=[1. 0.; 0. 1.]
N=MvNormal(μ, Σ)

μₐ=[2.;.4]
Σₐ=[1. 0.; 0. 1.]
Nₐ=MvNormal(μ, Σ)

Omega.replace(N, μ=>Nₐ)

My second questions is Omega.jl only valid for singlevariate normal distributions:

a=Distributions.Categorical([.8, .2])
rand(a)
N=Normal(μ₁, σ₁)
Omega.replace(N, μ₁=>a)

I could find something like that. and use the replacement command for a and b. It could also work for Sigma, if each value in the covariance matrix is sampled by a Normal distribution

a=Normal(.1, .1)
b=Normal(.2, .1)
μ=[mean(a);mean(b)]
Σ=[1. 0.; 0. 1.]
N=MvNormal(μ, Σ)