Skip to content

Support transforming log density #13

Open

Description

@sethaxen

ChangesOfVariables.jl implements an interface for performing a transformation and getting the corresponding log-density adjustment needed. This is implemented by a number of packages, including TransformVariables.jl and Bijectors.jl.

It would be handy if the API in this package included API functions like the following:

has_constrained_parameters(density)
has_default_unconstraining_transformation(density)
default_unconstraining_transformation(density)

If the resulting transformation is required to implement the ChangesOfVariables API, then this would allow a function to generically transform a constrained density to an unconstrained one, e.g. for sampling or optimization (an enhancement to the ChangesOfVariables API is needed to "invert" the transformation).

Activity

  1. oschulz commented on Jan 27, 2022

    @oschulz
    Collaborator

    I'm afraid this get's a bit specific/opinionated for what DensityInterface is supposed to do. Sometimes you need a transformation to a unconstraint space, sometimes to a constraint space (e.g. the unit hypercube), etc. - this is beyond the scope of DensityInterface. Densities also don't necessarily have constrained parameters by themselves: In a Bayesian scenario, for example, a likelihood may be well-defined over an unconstraint space, but the problem may live on a constraint space due to the choice of prior.

    That doesn't mean that there shouldn't be interfaces for this: Default unconstrained transformations of distributions (and maybe measure in general in the future?) are the domain of Bijectors.jl, for example.

    I'm also preparing a package VariateTransformations.jl that breaks out generic distribution/variate transformation code from BAT.jl into a standalone package. This will give implicit access to space constraints as long as initial/prior distributions are known for the parameters, via transformation to both uniform and Gaussian spaces.

    In addition, the question of support/domain of functions (and their results?) is of course a very general one that extends beyond (log-)densities. I think there a several attempts to define interfaces in the ecosystem at the moment (@devmotion , do you have a list?), but no consensus yet, as far as I know.

    The idea behind DensityInterface is to have something really small, lightweight and non-opinionated, to facilitate wide adoption.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions