Multivariate Student's T distribution?

Does there exist any active implementations of a multivariate Student’s T distribution? I need one for a model I am implementing but the only information I could find was from a multi year old issue on the Distributions.jl package that had no follow up:

Seems, that the code exists but is not exported?

The code does not exist in that package, it looks like. An “abstract” type is not something you can instantiate.

In a pinch, you could use PyCall.jl or PythonCall.jl to call the scipy implementation: scipy.stats.multivariate_t — SciPy v1.14.1 Manual

1 Like

Which functionality specifically do you need, pdf, cdf, rand? How large, just two and three dimensional or larger?

I mostly need to be able to sample from the distribution so rand and evaluate the ‘pdf’ / ‘logpdf’ . The size of the distribution could be quite large, though unlikely. I would expect most applications to be less than 10 dimensions though can’t necessarily say a priori.

here is a few examples of something I could potentially want the distribution for:

It seems like what is in Distributions.jl/src/multivariate/mvtdist.jl at b219803a0d03a7c75d7aef7c0bab6cd0d79997dc · JuliaStats/Distributions.jl · GitHub covers what you need but unfortunately it is not documented. You can do

julia> X = MvTDist(4.5, Matrix{Float64}(I, 3, 3))
Distributions.GenericMvTDist{Float64, PDMats.PDMat{Float64, Matrix{Float64}}, FillArrays.Zeros{Float64, 1, Tuple{Base.OneTo{Int64}}}}(
df: 4.5
dim: 3
μ: Zeros(3)
Σ: [1.0 0.0 0.0; 0.0 1.0 0.0; 0.0 0.0 1.0]
)


julia> pdf(X, rand(X))
0.0104628664698684

though.

1 Like

Ah great! Cheers, thank you!