
54 Data Analysis and Statistics for Geography, Environmental Science, and Engineering
2.12.9 application: bayes’ theoreM
As an example of integrating several of the tools learned, consider Bayes’ rule for two events A
(contaminated water) and B (uncontaminated water), and a water quality test with C (test negative)
and D (test positive).
PAC
PAC
PC
PCAPA
PCAPAPCBPB
[]
[]
[]
[][]
[][] []
|
|
==
+
Suppose we know P[A] = 0.2 and want to explore how P[A|C] varies as we change the probabilities
of false negative P[C|A] and false positive P[D|B]. The following script automates the calculation
and produces graphical output (Figure 2.30).
# pA =contamination p[A] ...