Skip to content

Generic cdf and icdf implementation for scalar TransformedDistributions.#1853

Merged
fehiepsi merged 1 commit intopyro-ppl:masterfrom
tillahoffmann:transformed-icdf
Aug 26, 2024
Merged

Generic cdf and icdf implementation for scalar TransformedDistributions.#1853
fehiepsi merged 1 commit intopyro-ppl:masterfrom
tillahoffmann:transformed-icdf

Conversation

@tillahoffmann
Copy link
Collaborator

@tillahoffmann tillahoffmann commented Aug 21, 2024

This PR

  • Adds a sign attribute to Transform which is the sign of the derivative for bijective scalar transforms. This matches the sign attribute of transforms in Pyro.
  • Implements cdf for TransformedDistribution by transforming from the domain of the transformed distribution to the domain of the base distribution and evaluating the cdf.
  • Implements icdf for TransformedDistribution by calling icdf of the base distribution and applying the transforms.

This means cdfs for LogNormal, InverseGamma, LogUniform, and Pareto do not require a custom implementation. As a side effect, this PR adds icdf support for LogNormal, InverseGamma, and LogUniform; it also adds cdf and icdf support for RelaxedBernoulliLogits.

…mplementation for `TransformedDistribution`s.
Copy link
Member

@fehiepsi fehiepsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful! Thanks, Till!

@fehiepsi fehiepsi merged commit d52209c into pyro-ppl:master Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants