# Maximum Likelihood Estimator

1. Mar 15, 2014

### ianrice

1. The problem statement, all variables and given/known data
1. An experiment consists of giving a sequences of patients a risky treatment until two have died, and then recording N, the number who survived. If p is the proportion killed by the treatment, then the distribution of N is:
P(N=n)=(n+1)(1-p)n p2

1)Find a general formula for the MLE for p:
2)the experiment is done in 8 hospitals and the observed values of N are 3,0,4,2,3,5,1,3. Compute the estimate for the p derived in part 1

2. Relevant equations
2. I know I have to start by finding a general form of ∏(ni+1)(1-p)ni p2 with ni where i goes from 1 to m.

3. The attempt at a solution
3. So I get hung up on how to handle the (ni+1) term.

2. Mar 15, 2014

### Ray Vickson

What is preventing you from computing P(N1=3,N2=0,N3=4,...,N8=3)?

3. Mar 15, 2014

### ianrice

The question asks for the general form of the MLE of p. then to compute P(N1,N2...N8). I need help with the general form

4. Mar 15, 2014

### D H

Staff Emeritus

There's a typo in your post. Witness that hanging .

I suspect you meant $\Pi_{i=1}^m (n_i+1)(1-p)^{n_i} p^2$

This isn't that hard. Let's start with m=1, i.e., one observation. Then that product is simply $(n_1+1)(1-p)^{n_1}p^2$. With m=2, the product becomes $(n_1+1)(1-p)^{n_1}p^2\,(n_2+1)(1-p)^{n_2}p^2$. Try collecting terms. You should get something of the form $A (1-p)^B p^C$, where A, B, and C are related to the observed values. Now generalize to m observations.

Where does this reach a maximum?

5. Mar 15, 2014

### Ray Vickson

Start with simple cases, by writing the formula for the likelihood function of P(n1,n2) and maybe P(n1,n2,n3). This will show you the pattern that applies as well to larger problems.

6. Mar 15, 2014

### ianrice

So I've collected terms for m=3 and get the following:

(n1+1)(n2+1)(n3+1)(1-p)n1(1-p)n2(1-p)n3p2p2p2

I think B=∑ni
C=2n
A is where I'm still stuck. Am I missing something completely I can't seem to figure out how to reduced (n1+1)(n2+1)(n3+1)

And to find the maximum I need to set the derivative to 0 and find p the parameter the question ask for.

7. Mar 15, 2014

### D H

Staff Emeritus
What are $(1-p)^{n_1}(1-p)^{n_2}(1-p)^{n_3}$ and $p^2p^2p^2$? Surely you can reduce these to a simpler form!

8. Mar 15, 2014

### ianrice

I got those:

$(1-p)^{n_1}(1-p)^{n_2}(1-p)^{n_3}$ = (1-p)∑ni

$p^2p^2p^2$ = p2n

9. Mar 15, 2014

### Ray Vickson

Why would you care about reducing $(n_1+1) (n_2+1) \cdots (n_m+1)$? It has no effect whatsoever on the optimal value of p. In other words, the p that maximizes f(p) is the same p that maximizes 1000*f(p) or (1/100)*f(p) or any K*f(p) for constant K.

10. Mar 15, 2014

### ianrice

Ok right I understand. I was confused.

So am I correct with the following next steps:

L(p)= ∏(ni+1)(1-p)∑nip2n

Then in the next take is to find l(p) which is l(p)=Ln(L(p))

So I end up with:

l(p)= Ln(∏(ni+1))+∑niLn(1-p)+2n*Ln(p)

Then taking the derivative of dl(p)/dp and setting that to zer
dl(p)/dp= 0+ $\frac{∑n}{1-p}$ +$\frac{2n}{p}$

11. Mar 15, 2014

### Ray Vickson

Almost OK, but $d \ln(1-p) /dp = -1/(1-p)$, not $+1/(1-p)$. The thing you wrote could never = 0 for any p between 0 and 1.