Automatic reparametrizations of distributions in Distributions.jl

Hi everyone,

I’m thinking about a potential feature for the Distributions.jl package that would be nice to have. Would it be possible to implement a function, let’s say reparametrize, that takes an existing distribution and a parameter transformation function to create a new distribution object?

For example, a common reparametrization is moving from the standard deviation to precision. We could define a transformation for a Normal(μ, σ) distribution to a new version parametrized by τ = 1/σ².

This would streamline our workflow and reduce the need for writing custom distribution types for common transformations. It feels like a powerful tool for building flexible statistical models.

What do you all think? Is this concept feasible, and has anything like it been proposed or implemented before?

What interface do you need for these reparametrizations? Eg, would adding a precision(d::Normal) = 1/σ^2 function would be enough?