Bernoulli Log-Likelihood

log_lik_bern(x, prob = 0.5)

Arguments

x

A vector of 0s and 1s.

prob

A numeric vector of values between 0 and 1 of the probability of success.

Value

An numeric vector of the corresponding log-likelihoods.

Examples

log_lik_bern(c(TRUE, FALSE), 0.7)
#> [1] -0.3566749 -1.2039728