View source: R/LogisticRegression.R
loglik_lr | R Documentation |
Log-likelihood of the Bernoulli distribution, commonly used in optimisation procedures for maximisation.
loglik_lr(theta, x, y)
theta |
parameters relating to |
x |
explanatory variables in model matrix |
y |
binary response variable |
The log-likelihood is written
\sum_{i=1}^n y \log(\sigma(X\beta)) + (1-y) \log(1-\sigma(X\beta))
single value, the log-likelihood of the Bernoulli distribution with fixed x
and y
theta = c(1, 0.1)
X = matrix(rnorm(4), 50, 2)
y = sample(0:1, 50, replace=TRUE)
loglik_lr(theta, X, y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.