# Loglikelihood and unusual transformations with binary response models

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

$$l(\theta;x)=xP+(1-x)(1-P)$$

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

$$ll(\theta;x)=x\log(P)+(1-x)\log(1-P)$$

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?

-

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)$

-
Yep, that answers it. –  fsmart Jul 30 '14 at 13:06