math
math copied to clipboard
log_mix(container, container) should check first argument is simplex
Description
The function log_mix taking two collections does not check that the first container is a simplex.
Expected Output
Rejection when the first argument is not a simplex, e.g.,
target += log_mix({0.5, 0.9}, {-1.2, -4.2});
Current Version:
v4.9.0
If I had to theorize as to why it does not, it seems like check_simplex might not have overloads for non-Eigen containers: https://github.com/stan-dev/math/blob/develop/stan/math/prim/err/check_simplex.hpp
So that's a good place to start