math
math copied to clipboard
A log_add_exp function that returns containers
It would be nice to have a function that works like log_sum_exp but elementwise, so the return was also a container.
I have a similar issue with
log_sum_expwhere I wanted it tovector[n] a = log_sum_exp(vector[n] b, vector[n] c)across each element, however it doesn't do this type of elementwise sum. Maybe if we had alog_add_expwhich I've seen in other languages.
Originally posted by @spinkney in https://github.com/stan-dev/docs/issues/832#issuecomment-2478728469
Hi, can I be assigned this issue?
Hi @MichaScant -- we don't really use the 'assign' feature of GitHub, but if you want to go ahead and tackle this, feel free!
@WardBrian we have a log_diff_exp. Should we also add a log_subtract_exp?
@spinkney if it would be useful, but probably easiest to have as a separate issue
Hello, I am in the middle of building the test file using log_sum_exp_test as an example and noticed you were passing in logSumExp into the test
Would I have to initialize an equivalent logAddExp and how would that occur? Or is there a substitute I can use? Thank you
The two arguments there are test group and test name, so you can just write the logAddExp without having to do any more code