stan-dev/math

Add overload for `lub_constrain`/`lub_free` for single tuple of bounds

andrjohns opened this issue · 3 comments

Description

Requiring separate arguments when specifying upper and lower bounds can lead to redundant computation. By taking a single tuple containing the upper/lower bounds, models can reuse quantities as much as possible

Example

This would be great for copula with discrete marginals, where the linear predictor term is used to specify bounds

Current Version:

v4.9.0

This would also require a new keyword for the constraint though, @WardBrian what do you think?

I’d want to see an example, but if my first guess is correct it seems reasonable to have a lower_upper=(,) keyword

I’d want to see an example, but if my first guess is correct it seems reasonable to have a lower_upper=(,) keyword

Brill! An alternative would also be to allow using transformed parameters in parameter bounds, but I have no idea how complex that might be on the backend