
Calculate log-likelihood for Binomial-distributed data
Source:R/calc_log_likelihood_distributions.R
calc_log_likelihood_binomial.RdComputes the total log-likelihood for integer counts of successes under the Binomial distribution,
optionally weighting each observation via weights.
Arguments
- observed
Integer vector of observed successes (e.g., number of positives).
- estimated
Numeric vector of expected probabilities of success in (0, 1).
- trials
Integer vector of total trials (same length as
observed).- weights
Optional numeric vector of non-negative weights, same length as
observed. Default isNULL, which sets all weights to 1.- verbose
Logical; if
TRUE, prints total log-likelihood and checks for data consistency.