Non-integers in binomial_lpmf()?


Is it possible to allow non-integers ‘n’ and ‘N’ in binomial_logit_lpmf (ints n | ints N, reals alpha)?


Nope. You’d have write your own binom_lpdf like so

real binom_lpdf(real n, real N, real p){
     real ldens = lchoose(N, n) + n*log(p) + (N-n)*log1m(p);

Got it! Thanks. A follow-up question: May I drop the constant, lchoose(N,n)?

Depends on what you want to do. But it’s usually fine to drop the normalising constant, yes.