probability-0.2.2: Probabilistic Functional ProgrammingSource codeContentsIndex
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?

Synopsis
type Probability = Rational
type Dist a = T Probability a
data State
= Healthy
| Ill
data Finding
= Negative
| Positive
pFalseNegative :: Probability
pFalsePositive :: Probability
pDisease :: Probability
dist :: Dist (State, Finding)
distAlt :: Dist (State, Finding)
p :: Probability
Documentation
type Probability = RationalSource
type Dist a = T Probability aSource
data State Source
Constructors
Healthy
Ill
show/hide Instances
data Finding Source
Constructors
Negative
Positive
show/hide Instances
pFalseNegative :: ProbabilitySource
pFalsePositive :: ProbabilitySource
pDisease :: ProbabilitySource
dist :: Dist (State, Finding)Source
distAlt :: Dist (State, Finding)Source
Alternative way for computing the distribution. It is usually more efficient because we do not need to switch on the healthy state.
p :: ProbabilitySource
Produced by Haddock version 2.4.2