R/binom.continuous.R

#' #' Extension of the binomial distribution to allow real values for size and x
#' #'
#' #' @param x
#' #' @param size
#' #' @param prob
#' #'
#' #' @return
#' #' @export
#' #'
#' #' @examples
#' dbinomc <- function(x, size, prob){
#'   if(x>size) stop("x greater than size")
#'   if(x<0) stop("x must be positive")
#' 
#'   A <- x*log(prob) + (size-x)*log(1-prob)
#'   B <- lgamma(size+1)-lgamma(x+1)-lgamma(size-x+1)
#' 
#'   logdens <- A+B
#'   return(exp(logdens))
#' 
#' }

Try the StudyPrior package in your browser

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

StudyPrior documentation built on May 2, 2019, 5:54 p.m.