# Lecture_9
Author: Zheyuan Wu
Date: 2023-02-06

#### Zheyuan Wu

#### 2023-02-06

## Bayes’ Rule

- Describe the probability of an event, based on prior knowledge of conditions that might be related to the event.

- Can be used to update belief, given some evidence

Example: patient with positive test

+= positive diagnose, D= Disease, \(D^c\)=Normal, \(+^c\)=negative diagnose

Given, the sensitivity of the test is: \(P(+|D)=0.99\),\(P(-|D^c)=0.95\) And the doctor said \(P(D)=0.001\)

Goal:\(P(D|+)={P(D\cap +)\over{P(+)}}\) (The positive of having cancer given positive test result.)

\[ \begin{align} P(D|+)&={P(D\cap +)\over{P(+)}}\\ &={P(D)\times P(+|D)\over{P(+|D)+P(+|D^c)}}\\ &={0.00099\over{0.00099+0.04995}}\\ &=0.0194 \end{align} \]

### Baye’s Rule (Inverse Conditional Probability)

\[ P(B|A)={P(A|B)P(B)\over{P(A|B)P(B)+P(A|B^c)P(B^c)}} \]

First partition the sample space by B, and partition again by A.

\[ P(A|B)\neq 1-P(A|B^c) \]

Because they don’t add up to one, and they are not compliment of each other.