Hi, I’ve been having trouble with a hypergeometric model, and I narrowed the problem down to this:
The function hypergeometric_lpmf(int n | int N, int a, int b)
stops when n=N
claiming that it should be n<N
strictly. However, the case of sampling n=N successes in N trials should be valid.
Reproducible Steps:
library(rstan)
code <- "
functions {
real log_dhyper(int n, int N, int a, int b) {
real lp;
lp = hypergeometric_lpmf(n | N, a, b);
return lp;
}
}
"
expose_stan_functions(stanc(model_code = code))
log_dhyper(10, 10, 50, 50)
#> Error in log_dhyper(10, 10, 50, 50): Exception: hypergeometric_lpmf: Draws parameter is 10, but must be greater than 10 (in 'unknown file name' at line 5)
Created on 2018-10-17 by the reprex package (v0.2.1)
I opened an issue in GH. But then I saw that you are using the forums to report possible bugs. I’m sorry, I don’t know which venue is more convenient for you.