JuliaStats / Distributions.jl

A Julia package for probability distributions and associated functions.
Other
1.08k stars 410 forks source link

[Feature request] `gradlogpdf` on arrays #1784

Open Vilin97 opened 9 months ago

Vilin97 commented 9 months ago

I would like this to work on 2d arrays and other dimensions if possible


using Distributions, LinearAlgebra
dist = MvNormal(I(3))
u = ones(3,4)
gradlogpdf(dist, u) # intenteded behvavior is reshape(hcat([gradlogpdf(dist, @view u[:,i]) for i in axes(u, 2)]...), size(u))```