Safe Haskell | Safe-Inferred |
---|
Numeric.Probability.Example.Diagnosis
Description
You take part in a screening test for a disease
that you have with a probability pDisease
.
The test can fail in two ways:
If you are ill,
the test says with probability pFalseNegative
that you are healthy.
If you are healthy,
it says with probability pFalsePositive
that you are ill.
Now consider the test is positive - what is the probability that you are indeed ill?
- type Probability = Rational
- type Dist a = T Probability a
- data State
- data Finding
- pDisease :: Probability
- pFalsePositive :: Probability
- pFalseNegative :: Probability
- dist :: Dist (State, Finding)
- distAlt :: Dist (State, Finding)
- p :: Probability