JuliaGaussianProcesses / ParameterHandling.jl

Foundational tooling for handling collections of parameters in models
MIT License
72 stars 11 forks source link

[Feature request] `bounded` with equality (ie `[low, high]` rather than `(low, high)`) #71

Open theo-brown opened 7 months ago

theo-brown commented 7 months ago

It would be great to add an option to bounded so that it supports interval constraints with equality.

Current behaviour:

julia> bounded(0., 0., 1.)
ERROR: ArgumentError: Value, 0.0, outside of specified bounds (0.0, 1.0).
Stacktrace:
 [1] bounded(val::Float64, lower_bound::Float64, upper_bound::Float64)
   @ ParameterHandling ~/.julia/packages/ParameterHandling/QaqXk/src/parameters_scalar.jl:54
willtebbutt commented 7 months ago

This would be nice, but I'm not sure how you could achieve this in practice. Do you have any thoughts?

willtebbutt commented 7 months ago

(The reason that we only support open intervals at the minute is because the bijections that we use map the bounds to -Inf and Inf )

theo-brown commented 7 months ago

Agree - I've just had a look at the code for how it's currently implemented, and it's tricky to see how we'd adapt it to this. I'll have a think.