MAP estimate of coin flipping

280 Views Asked by At

A coin has unknown probability of $\theta$ to result in head. We believe that the coin is likely a fair coin. The prior PDF of the model is:

$$ f_\Theta (\theta )=\left\{\begin{matrix} 4\theta & 0< \theta\leq \frac{1}{2}\\ 4-4\theta & \frac{1}{2}< \theta\leq 1\\ 0 & otherwise \end{matrix}\right. $$

We now toss the coin twice. On both occasions, we observe a head. Find the Maximum A Posteriori (MAP) Estimation.

My major question is related to the equation setup for $f_{\Theta|X} (\theta|k=1)$. I am a bit confused on whenever I need to multiply 2C1. (Although multiplying 2C1 also gives the same answer, which one is correct?)

My attempt: We let $X=k$ to be the number of heads observed. Firstly, we use the Bayes' rule to find the posterior PDF of $_\Theta$:

$$f_{\Theta|X} (\theta|k) \propto f_\Theta(\theta)P_{x|\theta}(k|\theta)$$

$f_{\theta|x}(\theta|k=1)$ has two range:

For $0< \theta\leq \frac{1}{2}$, We have $c(4\theta )(\theta )(1-\theta )^{2-1}=c(4\theta ^2-4\theta^3)$

For $\frac{1}{2}< \theta\leq 1$, We have $c(4-4\theta)(\theta )(1-\theta )^{2-1}=c(4\theta -8\theta^2+4\theta^3)$

Now we find the derivative of both answer and set it to 0.

For $0< \theta\leq \frac{1}{2}$, $\theta=0, 2/3$.

For $\frac{1}{2}< \theta\leq 1$, $\theta=1, 1/3$.

Finally we put the $\theta$ value into the respective $f_{\theta|x}(\theta|k=1)$ that gives the maximum posterior. We check $\theta=2/3, \theta = 1, \theta = 1/3$. The MAP estimate should be 2/3 because it gives highest value.

1

There are 1 best solutions below

1
On BEST ANSWER

I'm a little confused. You say that you observed heads on both occasions, so that is $X = 2$ for $n = 2$ coin tosses. This is represented by the binomial probability $$\Pr[X = 2 \mid \theta] = \binom{2}{2} \theta^2 (1-\theta)^{2-2} = \theta^2.$$

Consequently, the posterior distribution for $\theta$ given $X = 2$ is $$f_{\Theta \mid X}(\theta \mid X = 2) \propto \begin{cases}4\theta^3, & 0 \le \theta \le 1/2 \\ 4\theta^2 (1-\theta), & 1/2 < \theta \le 1. \end{cases}$$

The maximum of this function occurs at $\theta = 2/3$.

Regarding your question about the binomial coefficient, the answer is that it doesn't matter: the maximum of the posterior still occurs at the same value of $\theta$ because any multiplicative constants with respect to the parameter are just scaling factors for the likelihood. For example, the maximum of the functions $$g(x) = x(1-x), \quad h(x) = 100x(1-x)$$ both occur when $x = 1/2$. The maximum values attained are different ($g(1/2) = 1/4$ but $h(1/2) = 25$); but the $x$-value at which they occur is the same.