LogBinomialPDF: LogBinomialPDF

Description Usage Arguments Details Value Author(s)

View source: R/LogBinomialPDF.R

Description

LogBinomialPDF

Usage

1
LogBinomialPDF(obs, prob, logFacs = NULL)

Arguments

obs

numeric, observed values

prob

numeric, probabilities

logFacs

(optional) Precalculated vertical vector of log factorials, created using the function GetLogFactorials(n), where n is at least the sum of all observations.

Details

Calculates the probability density function for a vector of observations for a binomial distribution. The idea with this function is that it is not easy to calculate the PDF of a binomial if n is large, since we cannot practically calculate n! of a large number. The logarithm of the pdf is fine to calculate however, since log(n!) = log(n) + log(n-1) + ... + log(1). So we cannot use the built-in function for the pdf and afterwards log it, but need to implement the function ourselves instead.

Value

vector

## Not run: LogBinomialPDF(obs, prob)

Author(s)

Johan Gustafsson, Juan Inda, <inda@chalmers.se>


SysBioChalmers/DSAVE-R documentation built on Oct. 19, 2021, 11:37 p.m.