R/dpolya.R

Defines functions dpolya

Documented in dpolya

dpolya <-
function(x=NA,alpha=NA){
  nfac<-factorial(sum(x))
  pnfac<-prod(factorial(x))
  term1<-nfac / pnfac
  sumAlpha<-sum(alpha)
  term2<-factorial(sumAlpha - 1) / factorial(sum(x) + sumAlpha - 1)
  term3<-prod(factorial(x + alpha - 1) / factorial(alpha - 1))
  prob<-term1 * term2 * term3
  return(prob)
}

Try the bayespref package in your browser

Any scripts or data that you put into this service are public.

bayespref documentation built on May 30, 2017, 3 a.m.