Skip to content

laplace_marginal: inconsistency between doc and math for built-in bernoulli_logit likelihood #3353

Description

@charlesm93

This concerns laplace_marginal_bernoulli_logit and related functions.

Our current doc (https://mc-stan.org/docs/functions-reference/embedded_laplace.html) indicates that users should pass y, a vector of binary observations and y_index, an array which indicates to which group each y belongs to (i.e., which element of theta y_i corresponds to).

However the C++ code in stan/math/mix/prob/laplace_marginal_bernoulli_logit_lpmf.hpp uses a different implementation which requires users to pass the sum of all observations, $\sum_{i \in g(i)} y_i$ for each group and the number of elements in each group, $\sum_{i \in g(i)} 1$, which are sufficient statistics for the likelihood.

The implementation in C++ corresponds to what I had originally built for the prototype embedded Laplace approximation. However, we decided to move to the signature in the doc and we've done this correctly for the Poisson and NegativeBinomial likelhoods, but it looks like Bernoulli_logit slipped through the cracks....

This should be a straightforward fix.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions