Description Usage Arguments Details Value Author(s)
View source: R/LogBinomialPDF.R
LogBinomialPDF
1 | LogBinomialPDF(obs, prob, logFacs = NULL)
|
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. |
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.
vector
## Not run: LogBinomialPDF(obs, prob)Johan Gustafsson, Juan Inda, <inda@chalmers.se>
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.