There are three main paradigms of inference
Paradigms differ by evaluation criteria, not methods. So typical Bayesian methods evaluted by frequency standards are frequency techniques
To summarize the three paradigms answer: "What should I do?", "What should I believe?" and "What do the data say?" (see Royal 1997)
We'll mostly focus on frencuency statistics, the dominant paradigm
At the second collection, there were $X/N$ in the population marked from the first collection.
Under random sampling, $Z/Y$ should then be approximately $X/N$
Thus, $N \approx XY/Z$. Using sampling as an idea (plus other assumptions) we arrive at an estimate of the size of a population from a sample
498 * 110 / 20
2739.0
Simulation of the capture recapture experiment to estimate the population size
Final answer will be copied here
# code in the file part1_code.py
import part1_code
from part1_code import *
part1_code.myplot(x, y, t)
part1_code.myplot(x + t * 4, y, t)
myplot(x + t * 4, y - t * 4, t)
myplot(x + t * 6, y - t * 2, t)
part1_code.causal1()
part1_code.berkson_plot()
A set $Z$ satisfies the back door criterion with respect to nodes $X$ and $Y$ if
A path between two nodes is blocked by a set of nodes, $S$, if a mediator or confounder is included in $S$ or a collider and all of its descendants is excluded from $S$
part1_code.causal2()
Poured ⇩, guess ⇨ | Tea | Milk | Totals |
---|---|---|---|
Tea | 3 | 1 | 4 |
Milk | 1 | 3 | 4 |
Totals | 4 | 4 | 8 |
from scipy.stats import fisher_exact
p_value = fisher_exact([[3, 1], [1, 3]])
print(p_value)
(9.0, 0.48571428571428565)
Subject | Poured | Guess |
---|---|---|
1 | Tea | Tea |
2 | Tea | Tea |
3 | Tea | Tea |
4 | Tea | Milk |
5 | Milk | Tea |
6 | Milk | Milk |
7 | Milk | Milk |
8 | Milk | Milk |