Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#16 Add Beta Negative-binomial distribution

open
nobody
None
5
2012-09-01
2012-05-10
Joan Maspons
No

Something like this should work:

R code:

Rmpfr::pochMpfr()?

pochhammer<- function (x, n){
return (gamma(x+n)/gamma(x))
}

dbetanegbinom<- function(x, size, a, b){
res<- (pochhammer(a, size) * pochhammer(size, x) * pochhammer(b, x)
/ (factorial(x) * pochhammer(a + b, size)
* pochhammer(size + a + b, x)))
res[which(x<0)]<- 0
return (res)
}

If you are interested I can implement the distribution in c++

Discussion


Anonymous


Cancel   Add attachments