{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Exercises ##"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**1.** Let $X_1, X_2, \\ldots, X_n$ be i.i.d. Poisson $(\\mu)$ random variables. Find the maximum likelihood estimate of $\\mu$."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**2.** Let $X_1, X_2, \\ldots, X_n$ be i.i.d. uniform on $(0, \\theta)$. \n",
"\n",
"(a) Find the MLE of $\\theta$. [Don't leap into a calculation. Sketch a graph of the function you are trying to maximize, and be careful about its domain. You could start with a specific example, such as $n=3$ and observations 1.4, 17.8, and 12.3.]\n",
"\n",
"(b) Is the MLE unbiased? If not, use the MLE to construct an unbiased estimate of $\\theta$."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**3.** *Capture-recapture* methods are sometimes used to estimate population sizes. A standard image is that a pond contains $N$ fish for some fixed but unknown $N$, and that $G$ of the $N$ fish have been captured, tagged, and returned alive to the pond. \n",
"\n",
"In the recapture phase, assume that a simple random sample of $n$ fish is drawn from the $N$ fish in the pond (you might have to use some imagination to believe this assumption). We can observe $X$, the random number of tagged fish in the sample. \n",
"\n",
"The goal is to use the observation to estimate $N$.\n",
"\n",
"(a) For large $n$, the sample proportion $X/n$ is likely to be close to a constant. Identify the constant and hence construct an estimate of $N$ based on $X$. Later in this exercise you will see how your estimate is related to the MLE of $N$.\n",
"\n",
"(b) For $N \\ge n$, find the likelihood $lik(N)$. You can assume $n > G$. \n",
"\n",
"(c) Find the likelihood ratio $R(N) = \\frac{lik(N)}{lik(N-1)}$ for $N > n$. Simplify the answer as much as you can.\n",
"\n",
"(d) Find the maximum likelihood estimate of $N$ by comparing the likelihood ratios and 1. How does the MLE compare with your estimate in (a)?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**4.** A coin that has a uniform $(0, 1)$ probability of landing heads is tossed three times. That is, if $X$ has the uniform distribution on $(0, 1)$, then conditionally given $X=p$, the data are three i.i.d. Bernoulli $(p)$ random variables.\n",
"\n",
"(a) Prove or find the correct chance: The chance that the first toss lands heads is $1/2$.\n",
"\n",
"(b) Prove or find the correct chance: The chance that the second toss lands heads is $1/2$.\n",
"\n",
"(c) Prove or find the correct chance: The chance that all three tosses land heads is $(1/2)^3$.\n",
"\n",
"(d) Prove or disprove: The three tosses are independent of each other."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**5.** A coin lands heads with probability $X$ where the prior density of $X$ is uniform on the interval $(0, 1)$. The coin is tossed 100 times. Formally, for each $p \\in (0, 1)$, conditionally given $X=p$ the tosses are 100 i.i.d. Bernoulli $(p)$ random variables.\n",
"\n",
"Suppose there are 81 heads and 19 tails.\n",
"\n",
"(a) Given these data, what is the mode of the posterior distribution of $X$?\n",
"\n",
"(b) Given these data, what is the MAP estimate of the probability of heads?\n",
"\n",
"(c) Given these data, what is the mean of the posterior distribution of $X$?\n",
"\n",
"(d) Given these data, what is the chance that the 101st toss of this coin lands heads?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**6.** Let $X$ have an exponential distribution. In this exercise you will compare two scenarios: one where the rate of the exponential is a constant, and one where the rate is a random variable.\n",
"\n",
"(a) If $X$ has the exponential $(0.5)$ distribution, find the numerical value of $P(X > 4)$.\n",
"\n",
"(b) Now suppose $X$ has the exponential $(Y)$ distribution where $Y$ is a random variable with the gamma $(0.5, 1)$ distribution. That is, for each $y > 0$, let the conditional distribution of $X$ given $Y = y$ be exponential $(y)$. For each statement (i) and (ii), say whether is true or false. If it is true, prove it. If it is false, find the correct numerical value of the quantity involved.\n",
"\n",
"(i) $E(Y) = 0.5$.\n",
"\n",
"(ii) $P(X > 4)$ is equal to the answer in (a)."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}