Rethink2m3

probability
bayes
rethink-chap2
string
Published

November 8, 2023

Aufgabe

This question is taken from McElreath, R. (2020). Statistical rethinking: A Bayesian course with examples in R and Stan (2. Ed.). Taylor and Francis, CRC Press.

2M3. Suppose there are two globes, one for Earth and one for Mars. The Earth globe is 70% covered in water. The Mars globe is 100% land. Further suppose that one of these globes—you don’t know which—was tossed in the air and produced a “land” observatiion. Assume that each globe was equally likely to be tossed. Show that the posterior probability that the globe was the Earth, conditional on seeing “land” (Pr(Earth|land)), is 0.23.











Lösung

Man kann die Aufgabe entweder mit einer Bayes-Box lösen oder durch die Formel des Bayes’ Theorem.

Bayes-Box

Hyp Prior L Po-unstand Po-stand
E 1 .3 .3 3/13
M 1 1 1 10/13

Bayes-Theorem

Zur Erinnerung:

\[\begin{aligned} Pr(A) &= Pr(A \cap B) + Pr(A \cap B^C) \qquad \text{| totale Wskt, bei disjunkten Ereignissen}\\ Pr(A \cap B) &= Pr(A|B) \cdot Pr(B)\\ Pr(A \cap B^C) &= Pr(A|B^C) \cdot Pr(B^C) \end{aligned}\]

Wobei \(A^C\) das komlementäre Ereignis zu \(A\) meint.

The solution is taken from this source.

# probability of land, given Earth:
p_le <- 0.3

# probability of land, given Mars:
p_lm <- 1.0

# probability of Earth:
p_e <- 0.5

# prob. of Mars:
p_m <- 0.5

# probability of land:
# totale Wahrscheinlichkeit für Land
p_l <- (p_e * p_le) + (p_m * p_lm)
p_l
[1] 0.65

Dann gilt also:

# probability of Earth, given land (using Bayes' Theorem):
p_el <- (p_le * p_e) / p_l
p_el
[1] 0.2307692

Einfacher als die Rechnung ist vielleicht ein Baumdiagramm:


Categories:

  • probability
  • bayes
  • rethink-chap2
  • string