Skip to content

Commit

Permalink
Use bessel identity to improve grad calc
Browse files Browse the repository at this point in the history
  • Loading branch information
andrjohns committed Jan 20, 2024
1 parent c26bd83 commit 1dd2dca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stan/math/prim/prob/von_mises_lpdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ return_type_t<T_y, T_loc, T_scale> von_mises_lpdf(T_y const& y, T_loc const& mu,
if (!is_constant_all<T_scale>::value) {
edge<2>(ops_partials).partials_
= cos_mu_minus_y
- modified_bessel_first_kind(-1, kappa_val)
- modified_bessel_first_kind(1, kappa_val)
/ modified_bessel_first_kind(0, kappa_val);
}

Expand Down

0 comments on commit 1dd2dca

Please sign in to comment.