numpyro icon indicating copy to clipboard operation
numpyro copied to clipboard

Best practices to use one distribution to define another distribution

Open Qazalbash opened this issue 1 year ago • 0 comments

I have defined some distributions as child classes of Distribution. They are very closely linked, and one is used in another definition. I made a mistake not testing them. Upon testing, I ran into issues which are below,

  1. For example, I have used DoublyTruncatedPowerLaw to define PowerLawPrimaryMassRatio like this. The following test code passes out of the bound values to the distribution. It expects UserWarning but the problem is those out-of-the-bound values are used to construct another distribution. When that distribution gets invalid input values it throws a ValueError.

https://github.com/pyro-ppl/numpyro/blob/3cde93d0f25490b9b90c1c423816c6cfd9ea23ed/test/test_distributions.py#L2170-L2175

[!NOTE] This list might get new entries.

Qazalbash avatar Sep 21 '24 21:09 Qazalbash