Open andrjohns opened 1 month ago
I believe we still need signatures in the serializer/deserializer in the Stan repo, no?
I believe we still need signatures in the serializer/deserializer in the Stan repo, no?
Ah good point, will do now
@WardBrian having some troubles adding a single tuple overload for read_free_lub
, since it results in an ambiguous signature where the first element of the Sizes...
is treated as the upper bound.
Would it be safe to add a separate read_free_lub_tuple
signature instead (same for write and constrain)?
Need to think about the implementation a bit. Might be worth starting in stanc3 and seeing which is more natural:
auto temp__ = lub;
then calling the normal read_free_lub(sizes, get<0>(lub), get<1>(lub))
(this means the function just added to Stan-Math isn't necessary). I think my preference would be number 1, but happy to discuss either.
No worries! I don't really have a preference either way, so I'm happy with whichever option would be easiest on the implementation side
With the merge of stan-dev/math#3087, the
lub_*
constrain and free functions now support a single tuple of bounds. It would be great to add thelower_upper
bounds type so that both bounds can be specified in a single function call.Example pseudo-stan:
This would be great for situations where parameter bounds depend on functions of other parameters, and there is some non-trivial computation shared by both bounds