Permalink

Please
sign in to comment.

Showing
with

**74 additions**and**8 deletions**.- +3 −8 BDA 3.10.4.ipynb
- +71 −0 BDA 3.10.7.ipynb

@@ -0,0 +1,71 @@ | |||

{ | |||

"cells": [ | |||

{ | |||

"cell_type": "markdown", | |||

"metadata": {}, | |||

"source": [ | |||

"Problem 3.10.7\n", | |||

"\n", | |||

"Poisson and binomial distributions: a student sits on a street corner for an hour and records the number of bicycles $ b $ and the number of other vehicles $v$ that go by. Two models are considered: \n", | |||

"\n", | |||

"* The outcomes $b$ and $v$ have independent Poisson distributions, with unknown means $\\theta_b$ and $\\theta_v$ . \n", | |||

"\n", | |||

"* The outcome $b$ has a binomial distribution, with unknown probability $p$ and sample size $b + v$. \n", | |||

"\n", | |||

"Show that the two models have the same likelihood if we define $p = \\theta_b/( \\theta_b +\\theta_v)$.\n", | |||

"\n", | |||

"Gelman, Andrew; Carlin, John B.; Stern, Hal S.; Dunson, David B.; Vehtari, Aki; Rubin, Donald B.. Bayesian Data Analysis, Third Edition (Chapman & Hall/CRC Texts in Statistical Science) (Page 81). CRC Press. Kindle Edition. " | |||

] | |||

}, | |||

{ | |||

"cell_type": "markdown", | |||

"metadata": {}, | |||

"source": [ | |||

"This problem has no computational element, it's a fact about poisson distributions. In the first case we have\n", | |||

"$$\n", | |||

"P(b=b_0)=\\frac{\\theta_b^{b_0}e^{-\\theta_b)}}{b_0!}\n", | |||

"$$\n", | |||

"and\n", | |||

"$$\n", | |||

"P(v=v_0)=\\frac{\\theta_v^{v_0}e^{-\\theta_v)}}{v_0!}\n", | |||

"$$\n", | |||

"It's also a fact that the sum of two poisson variables with rates $\\theta_v$ and $\\theta_b$ is poisson with \n", | |||

"rate $\\theta_v+\\theta_b$. \n", | |||

"\n", | |||

"A direct calculation gives \n", | |||

"$$\n", | |||

"P(b=b_0,v=v_0|b_0+v_0=N)=\\binom{N}{b_0}\\frac{\\theta_b^{b_0}\\theta_v^{N-b_0}}{(\\theta_b+\\theta_v)^{N}}\n", | |||

"$$\n", | |||

"which is what we're supposed to show." | |||

] | |||

}, | |||

{ | |||

"cell_type": "code", | |||

"execution_count": null, | |||

"metadata": {}, | |||

"outputs": [], | |||

"source": [] | |||

} | |||

], | |||

"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.6.4" | |||

} | |||

}, | |||

"nbformat": 4, | |||

"nbformat_minor": 2 | |||

} |

## 0 comments on commit

`8b47394`