{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Exercise 1\n",
"\n",
"**Using the football dataset, estimate the following conditional probabilities in two different ways (one through relative frequencies and one using an approximated distribution):**\n",
"\n",
"- P1: Pr(Favorite wins | point spread = 8)\n",
"- P2: Pr(Favorite wins by at least 8 points | point spread = 8)\n",
"- P3: Pr(Favorite wins by at least 8 points | point spread = 8 and favorite wins)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Exercise 2\n",
"\n",
"A random sample of n students is drawn from a large population, and their weights are measured. The average weight of the n sampled students is $y^{mean} = 70$ Kg. We assume that the weights in the population are normally distributed with unknown mean $\\theta$, and known standard deviation 10 Kg. Suppose your prior distribution for $\\theta$ is normal with mean 80 Kg and standard deviation 15 Kg.\n",
"\n",
"**1) Give the posterior distribution of $\\theta$ (the answer will be a function of n).**\n",
"\n",
"**2) For n=10, and n=100, give a 95% posterior interval for $\\theta$.**"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Exercise 3\n",
"\n",
"Suppose your prior distribution for $\\theta$, the proportion of Californians who support the death penalty, is Beta with mean 0.6 and standard deviation 0.3.\n",
"\n",
"**1) Determine the parameters $\\alpha$ and $\\beta$ of your prior distribution and plot it.**\n",
"\n",
"**2) A random sample of 1000 Californians is taken, 65% support the death peanlty. What are your posterior mean and variance ? Plot the posterior density function.**\n",
"\n",
"**3) Examine the impact of the prior parameters on the posterior distribution through different statistics (i.e mean, median, 95% posterior interval).**"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Exercise 4\n",
"\n",
"**1) Which of the expressions below correspond to the statement: *the probability of rain on Monday* ?**\n",
"\n",
"- Pr(rain)\n",
"- Pr(rain|Monday)\n",
"- Pr(Monday|rain)\n",
"- Pr(rain, Monday) / Pr(Monday)\n",
"\n",
"\n",
"**2) Which of the following statements corresponds to the expression: *Pr(Monday|rain)* ?**\n",
"\n",
"- The probability of rain on Monday.\n",
"- The probability of rain, given that it is Monday.\n",
"- The probability that it is Monday, given that it is raining.\n",
"- The probability that it is Monday and it is raining.\n",
"\n",
"\n",
"**3) Which of the expressions below correspond to the statement: *the probability that it is Monday, given that it is raining* ?**\n",
"\n",
"- Pr(Monday|rain)\n",
"- Pr(rain|Monday)\n",
"- Pr(rain | Monday)Pr(Monday)\n",
"- Pr(rain | Monday)Pr(Monday)/Pr(rain)\n",
"- Pr(Monday|rain)Pr(rain)/Pr(Monday)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Exercise 5\n",
"\n",
"Suppose there are two species of panda bear. Both are equally common in the wild and live in the same places. They look exactly alike and eat the same food, and there is yet no genetic assay capable of telling them appart. They differ however in their family sizes. Species A gives birth to twins 10% of the time, otherwise birthing a single infant. Species B births twins 20% of the time, otherwise birthing singleton infants. Assume these numbers are known with certainty, from many years of field research. Now suppose you are managing a captive panda breeding program. You have a new female panda of unknown species, and she has just given birth to twins. \n",
"\n",
"**What is the probability that her next birth will also be twins ?**"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.15"
}
},
"nbformat": 4,
"nbformat_minor": 2
}