# Loo: High Pareto k diagnostic values for beta binomial regression

**URL:** <https://discourse.mc-stan.org/t/loo-high-pareto-k-diagnostic-values-for-beta-binomial-regression/3579>\
**Category:** General\
**Tags:** loo\
**Created:** [March 16, 2018, 12:46pm UTC](https://discourse.mc-stan.org/t/loo-high-pareto-k-diagnostic-values-for-beta-binomial-regression/3579 "2018-03-16T12:46:54Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![avehtari](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/avehtari/32/5935_2.png) [@avehtari](https://discourse.mc-stan.org/u/avehtari)\
**Post date:** [March 17, 2018, 10:57am UTC](https://discourse.mc-stan.org/t/loo-high-pareto-k-diagnostic-values-for-beta-binomial-regression/3579/2 "2018-03-17T10:57:11Z")

</div>

> [@Guido\_Biele](#):
>
> log\_lik[n] = beta\_binomial\_lpmf(Y | 22, p[n] \* phi, (1-p[n]) \* phi);

should be

```no-highlight
log_lik[n] = beta_binomial_lpmf(Y[n] | 22, p[n] * phi, (1-p[n]) * phi);

```

The way I figured where the problem is that I checked the log\_lik values. For discrete model with uniform probability for 22 categories lpmf would be \log(1/22)\approx -3.1, but lpmf’s from your code were around -461, so the were clear two orders of magnitude error in log scale! With the fixed code mean lpmf is about -2.3\>-3.1, ie the model is beating the uniform distribution. loo works fine.

---

_[View the full topic](https://discourse.mc-stan.org/t/loo-high-pareto-k-diagnostic-values-for-beta-binomial-regression/3579)._
