I’m trying to use the cdf of a multivariate normal distribution using Distributions.jl.
While

d = Normal(0,1)
d2 = MvNormal([0.;0.], [1. 0.;0. 1.])
x = [1. ; 2.]
e1 = cdf(d,x[1])
e2 = cdf(d,x[2])

works (as long as the mean vector and the var-cov matrix for the multivariate normal are Floats ), I get an error whenever I write e3 = cdf(d2,x)
Here is the error message:

ERROR: MethodError: no method matching cdf(::Distributions.MvNormal{Float64,PDMats.PDMat{Float64,Array{Float64,2}},Array{Float64,1}}, ::Array{Float64,1})
Closest candidates are:
cdf(::Distributions.Distribution{Distributions.Univariate,S<:Distributions.ValueSupport}, ::AbstractArray{T,N}) at /Applications/JuliaPro-0.5.1.1.app/Contents/Resources/pkgs-0.5.1.1/v0.5/Distributions/src/univariates.jl:205

Does the cdf function support multivariate distributions? I couldn’t find anything on this in the documentation of Distributions.jl.

No, there is not a cdf for the multivariate normal. Generally, it is a slightly complicated computation. We have some code evaluating the bi- and trivariate case but it hasn’t been used for a long time. For some time, I’ve wanted a dedicated package for multivariate distributions that would be using StaticArrays for storage. The cdf code for fit well in such a package.

My interest is currently for 2D. I have no idea how higher dimensions are handled in Python right now but hopefully I’ll learn a little bit about it in the next few days.

If you are interested in spending a little time on it, we could probably get the 2D Julia version working again. If we do it with StaticArrays it will also be extremely fast.

Hello,
I am also interested in a julia version for the cdf for 2D normal. I might be able to spend a bit time on this, but where can I find the version that exists already? I am not familiar with StaticArrays though, but I can certainly give it a try.
Thanks!

I think it would be very helpful to have a CDF defined for MvNormal, analog to MATLAB’s mvncdf. It would definitely help when dealing with truncated Gaussian priors, etc.

I apologize if this is a necro-bump, but came across this thread as the first Google Search entry.

Has the CDF for Multivariate normals been implemented in Julia now? I essentially looking for an analogous to just sample the CDF of a normal distribution, maybe something akin to R’s pnorm.