Implement transforms and logp for "MvNormal", "Pareto", "Triangular" distributions
Distributions are currently raising exception when logp is called. Transform need to be implemented on all.
https://github.com/pymc-devs/pymc4/blob/master/pymc4/tests/test_random_variables.py#L95
This should probably be an issue with TFP. Do you they have e.g. a stick-breaking bijector?
It doesn't look like it from the docs below but this definitely needs to be an issue with in pymc4 as well because we have code that needs to change, independent of what TFP is or isnt. :)
https://www.tensorflow.org/probability/api_docs/python/tfp/bijectors/Bijector
Stick breaking bijector issue in TFP for reference https://github.com/tensorflow/probability/issues/6
FWIW, we also do have a SoftmaxCentered bijector, which also constrains/unconstrains the same regions (R^n -> unit simplex in R^{n+1}), but can lead to different optimization landscapes / HMC trajectories than the Stick breaking one.
Are there any other transforms you will need?
I think we can definitely move ahead with the SoftmaxCentered bijector for now.
Nice to have would also be a
- OrderedTransform: https://github.com/pymc-devs/pymc3/blob/c73f97da71657ab7d9f4bb77a205b5bd49471657/pymc3/distributions/transforms.py#L298
- Cholesky: https://github.com/pymc-devs/pymc3/blob/c73f97da71657ab7d9f4bb77a205b5bd49471657/pymc3/distributions/transforms.py#L436 (I'm not sure we need this one as the implementation in TFP might handle this differently).
- Circular: https://github.com/pymc-devs/pymc3/blob/c73f97da71657ab7d9f4bb77a205b5bd49471657/pymc3/distributions/transforms.py#L416
Ordered should be here: https://www.tensorflow.org/probability/api_docs/python/tfp/bijectors/Ordered
For Cholesky, I'm not sure what is exactly going on here, but we do have https://www.tensorflow.org/probability/api_docs/python/tfp/bijectors/TransformDiagonal which should help.
Circular is something we are missing, and we can definitely add that.
I'm not sure about Circular; it's not injective, and not even finitely non-injective like Square/Abs.
How is it used by pymc?
This should be true for (0, 1) -> S^1 (or more generally for an interval (a, b), there's an injective map to S^1, which scales (a, b) and then applies (cos(.), sin(.))