probability-0.2.5.2: Probabilistic Functional Programming

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

# Documentation

data State Source #

Constructors

 Healthy Ill
Instances
 Source # Instance detailsDefined in Numeric.Probability.Example.Diagnosis Methodssucc :: State -> State #pred :: State -> State #toEnum :: Int -> State #enumFrom :: State -> [State] #enumFromThen :: State -> State -> [State] #enumFromTo :: State -> State -> [State] #enumFromThenTo :: State -> State -> State -> [State] # Source # Instance detailsDefined in Numeric.Probability.Example.Diagnosis Methods(==) :: State -> State -> Bool #(/=) :: State -> State -> Bool # Source # Instance detailsDefined in Numeric.Probability.Example.Diagnosis Methods(<) :: State -> State -> Bool #(<=) :: State -> State -> Bool #(>) :: State -> State -> Bool #(>=) :: State -> State -> Bool #max :: State -> State -> State #min :: State -> State -> State # Source # Instance detailsDefined in Numeric.Probability.Example.Diagnosis MethodsshowsPrec :: Int -> State -> ShowS #show :: State -> String #showList :: [State] -> ShowS #

data Finding Source #

Constructors

 Negative Positive
Instances
 Source # Instance detailsDefined in Numeric.Probability.Example.Diagnosis MethodsenumFrom :: Finding -> [Finding] #enumFromThen :: Finding -> Finding -> [Finding] #enumFromTo :: Finding -> Finding -> [Finding] #enumFromThenTo :: Finding -> Finding -> Finding -> [Finding] # Source # Instance detailsDefined in Numeric.Probability.Example.Diagnosis Methods(==) :: Finding -> Finding -> Bool #(/=) :: Finding -> Finding -> Bool # Source # Instance detailsDefined in Numeric.Probability.Example.Diagnosis Methods(<) :: Finding -> Finding -> Bool #(<=) :: Finding -> Finding -> Bool #(>) :: Finding -> Finding -> Bool #(>=) :: Finding -> Finding -> Bool # Source # Instance detailsDefined in Numeric.Probability.Example.Diagnosis MethodsshowList :: [Finding] -> ShowS #

Alternative way for computing the distribution. It is usually more efficient because we do not need to switch on the healthy state.