Skip to content

Bug in ordered_logistic_lpmf derivative #1248

@t4c1

Description

@t4c1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions