TransformVariables.jl
TransformVariables.jl copied to clipboard
inverse should ensure finite output
Currently, transformations may return infinity at the edges. Eg
julia> inverse(as(Real, 0.5, 1.0), 0.5)
-Inf
The whole code should be reviewed, and each transformation should throw a DomainError.
I think TransformVariables shouldn't put such constrains on the arguments of inverse.
Clearly, non-finite values are not useful for frequentist or Bayesian estimation, but for pure evaluation of a model they may completely fine. For instance, in this example if the corresponding parameter domain of the model would be the closed interval [0.5, 1.0] and not just the open interval (0.5, 1.0), it seems fine to transform -Inf to 0.5 and evaluate the model with 0.5.