We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d7edcbd commit 4f53279Copy full SHA for 4f53279
1 file changed
stan/math/rev/fun/inv_Phi.hpp
@@ -3,6 +3,7 @@
3
4
#include <stan/math/rev/meta.hpp>
5
#include <stan/math/rev/core.hpp>
6
+#include <stan/math/prim/fun/exp.hpp>
7
#include <stan/math/prim/fun/inv_Phi.hpp>
8
#include <stan/math/prim/prob/std_normal_lpdf.hpp>
9
#include <stan/math/prim/functor/apply_scalar_binary.hpp>
@@ -38,7 +39,7 @@ inline auto inv_Phi(const T& p) {
38
39
const auto& arena_rtn = to_arena(inv_Phi(p.val()));
40
return make_callback_var(arena_rtn, [p, arena_rtn](auto& vi) mutable {
41
p.adj() += apply_scalar_binary(
- vi.adj(), arena_rtn.val(), [](const auto& adj, const auto& rtn_val) {
42
+ vi.adj(), arena_rtn.val(), [](const double adj, const double rtn_val) {
43
return adj * exp(-std_normal_lpdf(rtn_val));
44
});
45
0 commit comments