Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was just doing some thought on the transformation for likelihoods to log likelihoods for binary response models and I realized what I am sure many people have realized before that the transformation is non-standard.

For instance, given a response pattern $x \in 0,1$ and a parameter set $\theta$ with $P$ defined as the probability $x=1$, the likelihood of a binary response is given as


It is fairly straightforward to break the above separately as $l(\theta;x=1)=P$ and $l(\theta;x=0)=(1-P)$. The next step people take for various reasons is to take the log likelihood


Which we can easily see is equivalent to taking the log of $l(\theta;x)$ observing that x can only be $1$ or $0$. However, this is a non-standard transformation ($\log(ab + cd) \ne a\log(b) + c\log(d)$ generally) and only achieved through reasoning (which I do not have a problem with). I am just wondering if there is some law, rule, or lemma in which the above transformation falls into?

share|improve this question
up vote 4 down vote accepted

The likelihood function is actually:

$l(\theta;x) = P^x(1-P)^{1-x}$

So if $x=0$ it reduces to:

$l(\theta;x=0) = P^0(1-P)^{1-0} = (1-P)$

if $x=1$ it reduces to:

$l(\theta;x=1) = P^1(1-P)^{1-1} = P$

Taking the logarithm of the likelyhood function results in:

$\ln(l(\theta;x)) = \ln(P^x(1-P)^{1-x}) = x \ln(P) + (1-x) \ln(1-P)$

share|improve this answer
Yep, that answers it. – fsmart Jul 30 '14 at 13:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.