Caution
Section omitted to comply with the Honor Code
Bayesian Statistics: From Concept to Data Analysis
Oren Bochman
Distributions, Homework
Section omitted to comply with the Honor Code
---
title: "Frequentist MLE - M2L3HW1"
subtitle: "Bayesian Statistics: From Concept to Data Analysis"
categories:
- Bayesian Statistics
keywords:
- Distributions
- Homework
---
::::: {.content-visible unless-profile="HC"}
::: {.callout-caution}
Section omitted to comply with the Honor Code
:::
:::::
::::: {.content-hidden unless-profile="HC"}
[**100 coin flips**]{.column-margin}
For Questions (@exr-freq-MLE-1 --- @exr-freq-MLE-3), consider the following scenario:
In the example from Lesson 4.1 of flipping a coin 100 times, suppose instead that you observe 47 heads and 53 tails.
::: {#exr-freq-MLE-1}
[**100 coin flips**]{.column-margin}
Report the value of $\hat p$, the MLE (Maximum Likelihood Estimate) of the probability of obtaining heads.
:::
::: {.solution .callout-tip collapse="true"}
#### Solution:
$.47$
This is simply ${47 \over 100}$, the number of successes normalized by the number of trials.
:::
::: {#exr-freq-MLE-2}
[**100 coin flips**]{.column-margin}
Using the [central limit theorem](A08.qmd) as an approximation, and following the example of [Lesson 4.1](C1-L04.qmd), construct a 95% confidence interval for p, the probability of obtaining heads.
Report the lower end of this interval.
:::
::: {.solution .callout-tip collapse="true"}
#### Solution:
$.37$
We have $\hat{p} - 1.96\sqrt{\hat{p}(1-\hat{p})/n} =.47 - 1.96\sqrt{(.47)(.53)/100} = .372$, which is the lower end of a 95% confidence interval for p.
:::
::: {#exr-freq-MLE-3}
[**100 coin flips**]{.column-margin}
Report the upper end of this interval and round your answer to two decimal places.
:::
::: {.solution .callout-tip collapse="true"}
#### Solution:
$.57$
We have $\hat{p} + 1.96\sqrt{\hat{p}(1-\hat{p})/n} =.47 + 1.96\sqrt{(.47)(.53)/100} = .568$, which is the upper end of a 95% confidence interval for p.
:::
::: {#exr-freq-MLE-4}
[**likelihood function**]{.column-margin}
The likelihood function for parameter $\theta$ with data y is based on which of the following?
- [ ] $\mathbb{P}r(\theta∣y)$
- [ ] $\mathbb{P}r(y∣\theta)$
- [ ] $\mathbb{P}r(\theta)$
- [ ] $\mathbb{P}r(y)$
- [ ] None of the above.
:::
::: {.solution .callout-tip collapse="true"}
#### Solution:
The likelihood is based on the sampling distribution of the data, given the parameter. Note that although the likelihood has the same functional form as $\mathbb{P}r(y\mid\theta)$, it is considered a function of $\theta$.
:::
::: {#exr-freq-MLE-5}
[**Mean MLE**]{.column-margin}
Recall from Lesson 4.4 that if $X_1,\ldots,X_n \stackrel {IID} \sim Exponential(\lambda)$ (IID means independent and identically distributed), then the MLE for $\lambda$ is $\frac{1}{\bar x}$ where $\bar x$ is the sample mean. Suppose we observe the following data: $X1=2.0, X2=2.5, X3=4.1, X4=1.8, X5=4.0.$
Calculate the MLE for λ. Round your answer to two decimal places.
:::
::: {.solution .callout-tip collapse="true"}
#### Solution:
$0.35$
The sample mean is $\bar x = 2.88$.
:::
::: {#exr-freq-MLE-6}
[**Exp MLE**]{.column-margin}
It turns out that the sample mean $\bar x$ is involved in the MLE calculation for several models.
In fact, if the data are independent and identically distributed from a $Bernoulli(p)$, $Poisson(λ)$, or $Normal(μ, σ^2)$, then $\bar x$ is the MLE for $p$, $\lambda$, and $μ$ respectively.
Suppose we observe $n=4$ data points from a normal distribution with unknown mean $\mu$. The data are $x=\{−1.2,0.5,0.8,−0.3\}$.
What is the MLE for $μ$ ?
:::
::: {.solution .callout-tip collapse="true"}
#### Solution:
$-0.05$
This is $(−1.2+0.5+0.8−0.3)/4$.
:::
:::::