Description
I think there is a bug in ordered_logistic_lpmf() in calculation of derivative wrt c. On line 139 there is ops_partials.edge2_.partials_vec_[n](0) = d;. This overwrites any value that was calculated in previous iterations of the loop. I think there should be ops_partials.edge2_.partials_vec_[n](0) += d; (+= instead of =).
I found this while implementing a GLM for this distribution and derivatives did not match.
Can someone check, whether this line of thinking is correct?
Current Version:
v2.19.1
Description
I think there is a bug in
ordered_logistic_lpmf()in calculation of derivative wrtc. On line 139 there isops_partials.edge2_.partials_vec_[n](0) = d;. This overwrites any value that was calculated in previous iterations of the loop. I think there should beops_partials.edge2_.partials_vec_[n](0) += d;(+=instead of=).I found this while implementing a GLM for this distribution and derivatives did not match.
Can someone check, whether this line of thinking is correct?
Current Version:
v2.19.1