Docsity

Bayes' Theorem - Computational Concepts in Biological Sciences - Lecture Note, Lecture notes of Computer Science

Toggle sidebar
bg1
we can measure empirical probabilities
we can compute theoretical probabilities based upon a uniform
distribution assumption (all elements equi-probable)
we can simulate experiments in Perl based upon uniform distribution
assumptions using rand (which generates a uniform distribution).
So far,
Bayes' theorem
Saturda y, October 30, 2010
4:09 PM
Bayes Page 1
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16

Partial preview of the text

Download Bayes' Theorem - Computational Concepts in Biological Sciences - Lecture Note and more Lecture notes Computer Science in PDF only on Docsity!

we can measure empirical probabilities we can compute theoretical probabilities based upon a uniform distribution assumption (all elements equi-probable) we can simulate experiments in Perl based upon uniform distribution assumptions using rand (which generates a uniform distribution). So far, Bayes' theorem Saturday, October 30, 2010 4:09 PM Docsity.com

I have few idols, but one of them is E. T. Jaynes,

A renegade look at statistics

Based upon an open world assumption,

With the goal of stating all assumptions,

Starting with the idea of logic and plausibility.

Incredibly controversial: probabilists either love the book or hate it.

Free electronic copy: http://bayes.wustl.edu/etj/prob/book.pdf

author of Probability Theory: the Logic of Science

Aside: E. T. Jaynes Sunday, October 31, 2010 3:32 PM Docsity.com

An interesting idea from Jaynes A → B, A proves B (MP) A → B, ¬B proves ¬A (MT) We know modus ponendo ponens and modus tollendo tollens. A → B, B makes A more plausible. A → B, ¬A makes B less plausible. Jaynes generalizes these: p(A^B)=p(A)p(B|A)=p(B)p(A|B) And he points out that the multiplicative law: leads to: p(B|A) = [p(B)/p(A)]p(A|B) Plausibility increases as p(A) decreases. Plausibility increases as p(B) increases. where p(B|A) measures how likely it is that A → B Jaynes on logic and probability Sunday, October 31, 2010 3:38 PM Docsity.com

A probability P(A|B) determines how plausible A is

given that B has happened.

But it does not imply that B causes A.

A third Jaynes idea: plausibility is not causality

A third Jaynes idea

Sunday, October 31, 2010 4:07 PM Docsity.com

In logical terms, there is a well-defined notion of the

probability of a statement being true, which is to think of

the statement as representing a set of outcomes.

Restating in logical terms, for A and B propositions ,

A and B are mutually exclusive if p(A ˄ B)=

(i.e., A ˄ B is always false)

p(A ˅ B) = p(A)+p(B)-p(A ˄ B)

A and B are independent if p(B|A)=p(B)

p(A ˄ B) = p(A)p(B|A)

If p(A)==0, A is false.

If p(A)==1, A is true.

Otherwise we don't know.

This is the basis of so-called "fuzzy logic".

Or in logical terms

Saturday, October 30, 2010 4:18 PM Docsity.com

these rules are all we need to compute probabilities.

With a good working knowledge of our problem,

We often have partial information.

We must reason from what we have.

(This is where Jaynes starts)

But life is usually not so simple

But life is usually not so simple

Saturday, October 30, 2010 4:12 PM Docsity.com

p(F)=probability of selecting the first box = 1/ p(F)=probability of selecting the second box = 1/ p(E|F)=probability of red, from the first box=3/ p(E|F)=probability of red, from the second box=1/ 3/5 * 1/ p(F|E) = ---------------------------- = 3/ 3/51/2 + 1/51/ So p(F)=1/2 but p(F|E)=3/4, because there are many more red balls in first box than in the second box. The fact that we know that E is true changes the probability of F = p(F|E). Bayes' Theorem Saturday, October 30, 2010 5:06 PM Docsity.com

p(F|E)p(E)=p(E∩F)=p(E|F)p(F)

So

p(F|E)=P(E|F)p(F)/p(E)

and

E = E ∩ (F U F) = (E ∩ F) U (E ∩ F)

and the latter two are disjoint, so that

p(E) = p((E ∩ F) U (E ∩ F)) = p(E ∩ F) + p(E ∩ F)

= P(E|F)P(F) + P(E|F)P(F)

Substituting p(E) in p(F|E)=P(E|F)p(F)/p(E),

we get Bayes' theorem.

Proof of Bayes' theorem

Saturday, October 30, 2010 6:11 PM Docsity.com

Suppose we want to detect spam in a message. By looking at 10000 spam messages, we determine that "Rolex" occurs in 30% of them. By looking at 10000 non-spam messages, we determine that "Rolex" occurs in 5% of these. Roughly 3/4 of all email messages are spam! We know that the term "Rolex" sometimes indicates spam. What is the probability that a message is spam, given that it contains "Rolex"? E = message contains "Rolex". F = message is spam. p(E) = (10000.30 + 10000.05)/20000=0. p(F) = 3/4 = 0. p(E|F) =. p(E|F) =. p(E|F)p(F) p(F|E)= -------------------------------- p(E|F)p(F) + p(E|F)p(F) .3. = ------------------------------ .3.75 + .05*. = .225/.2375 = 0. Example: Bayesian Learning Saturday, October 30, 2010 5:28 PM Docsity.com

This is an example of supervised statistical learning.

We have a training set of messages that we know are

spam, and messages we know are not.

For each word in the training set, we compute the

probability that it appears in a message, given that the

message is (or is not) spam.

Then we do the calculation on the previous page for each

word that appears commonly in spam.

Then we combine results , by computing the probability

that a message is spam, given that it contains several

words identified as commonly occuring in spam.

How spam filters work

Saturday, October 30, 2010 5:38 PM Docsity.com

(not in the book)

What happens is not determined by what happened

before.

So far, we have adopted a stateless model of probability

What happens depends upon current state.

States change to others with some probabilities.

But many real systems obey a stateful model

Stateless and stateful probabilities

Sunday, October 31, 2010 4:09 PM Docsity.com

Every throw is independent of every other.

No prior information can help predict the next throw.

Example of a stateless model: a die

Example of a stateful model of the stock market:

http://en.wikipedia.org/wiki/Markov_chain

probability of a transition.

Each arrow is labeled with the

The sum of all arrows exiting a state is 1.

Stateless and stateful models Sunday, October 31, 2010 4:11 PM Docsity.com

The transitions between states are a square matrix

p 11 … p1n

p 21 p2n

pn1 … pnn

Where pij is the probability of a transition from state i to

state j.

Markov transition matrices

Sunday, October 31, 2010 4:21 PM Docsity.com

Example of a Markov transition matrix: Let bull=state 0 Let bear=state 1 Let recession=state 2 bull bear recession bull 0.9 0.075 0. bear 0.15 0.8 0. recession 0.25 0.25 0. rows sum to 1 and describe one state. columns describe options Notes: Example of a Markov matrix Sunday, October 31, 2010 4:24 PM Docsity.com