Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
N. Salamin
Sept 2007
Lecture outline
Bayesian setting
Definition
Simple example
September, 2007
c
N. Salamin
Sept 2007
Lecture outline
Lecture outline
Bayesian setting
Definition
Simple example
Bayesian setting
Definition
Simple example
c
N. Salamin
Sept 2007
Bayesian methods
Lecture outline
Bayesian setting
Definition The likelihood calculation is used as well by Bayesian methods.
Simple example
However, another component is added to the method: the prior
MCMC
Normalizing constant distributions.
MCMC in practice
Proposal distribution
Prior distribution Before observing any data, each parameter will be assigned a
Posterior
probabilities prior distribution
Application of
Bayesian methods
• topologies
Demo: McRobot
(P. Lewis) • branch lengths
• each parameter of the model of evolution
The prior distributions are then combined with the likelihood of the
data to give the posterior distribution.
Bayesian setting
Definition
Simple example
Demo: McRobot
(P. Lewis)
where Prob(T ∪ D) = Prob(T )Prob(D|T )
so that
Prob(T )Prob(D|T )
Prob(T |D) =
Prob(D)
c
N. Salamin
Sept 2007
Normalizing constant
Lecture outline
Bayesian setting
Definition
Simple example
The denominator Prob(D) is the sum of the numerator
MCMC Prob(T )Prob(D|T ) over all possible trees T .
Normalizing constant
MCMC in practice
Proposal distribution This quantity is needed to normalize the probabilities of all T so
Prior distribution
Posterior that they add up to 1.
probabilities
Application of
Bayesian methods
This leads to
Demo: McRobot
(P. Lewis)
Prob(T )Prob(D|T )
Prob(T |D) = P
T Prob(T )Prob(D|T )
In words:
prior probability × likelihood
posterior probability =
normalizing constant
c
N. Salamin
Sept 2007
Odds ratio
Lecture outline
Bayesian setting
Definition
Simple example
MCMC Bayes theorem can be put in the form of odds-ratio, which is the
Normalizing constant
MCMC in practice
odds favoring one hypothesis over another
Proposal distribution
Prior distribution
• odds a person has initially (the prior odds)
Posterior
probabilities • multiplied by likelihood ratio under the data
Application of
Bayesian methods
Demo: McRobot
(P. Lewis)
• suppose we favor, in advance, T1 over T2 with odds 3 : 2
• some data gives Prob(D|T1 )/Prob(D|T2 ) = 1/2
• data say that T1 is half as probable than T2
• posterior odds ratio (3/2) × (1/2) = 3/4
c
N. Salamin
Sept 2007
Coin toss
Lecture outline
Bayesian setting
Definition
Simple example
Bayesian setting
10 tosses
Definition
Simple example
MCMC
Normalizing constant
MCMC in practice
Proposal distribution
Prior distribution
Posterior
probabilities
Application of
Bayesian methods
Demo: McRobot
(P. Lewis) Likelihood 10 coins Posterior 10 coins
c
N. Salamin Exponential prior
Sept 2007
Exponential prior
Lecture outline
Bayesian setting
1000 tosses
Definition
Simple example
MCMC
Normalizing constant
MCMC in practice
Proposal distribution
Prior distribution
Posterior
probabilities
Application of
Bayesian methods
Demo: McRobot
(P. Lewis) Likelihood 1000 coins Posterior 1000 coins
c
N. Salamin Exponential prior
Sept 2007
Flat prior
Lecture outline
Bayesian setting
10 tosses
Definition
Simple example
MCMC
Normalizing constant
MCMC in practice
Proposal distribution
Prior distribution
Posterior
probabilities
Application of
Bayesian methods
Demo: McRobot
(P. Lewis) Likelihood 10 coins Posterior 10 coins
c
N. Salamin Exponential prior
Sept 2007
Flat prior
Lecture outline
Bayesian setting
1000 tosses
Definition
Simple example
MCMC
Normalizing constant
MCMC in practice
Proposal distribution
Prior distribution
Posterior
probabilities
Application of
Bayesian methods
Demo: McRobot
(P. Lewis) Likelihood 1000 coins Posterior 1000 coins
c
N. Salamin
Sept 2007
Lecture outline
Lecture outline
Bayesian setting
Definition
Simple example
c
N. Salamin
Sept 2007
Estimating normalizing constant
Lecture outline
Bayesian setting
Definition
Simple example
MCMC Posterior
P distribution expression has a denominator, i.e.
T Prob(T )Prob(D|T ), that is often impossible to compute.
Normalizing constant
MCMC in practice
Proposal distribution
Prior distribution
Posterior
probabilities
Application of
Fortunately, samples from the posterior distribution can be drawn
Bayesian methods
using a Markov chain that does not need to know the denominator
Demo: McRobot
(P. Lewis)
Bayesian setting
Definition
Simple example
MCMC
Idea: to wander randomly through tree space by sampling trees
Normalizing constant
MCMC in practice
until we settle down into an equilibrium distribution of trees that
Proposal distribution has the desired distribution, i.e. posterior distribution.
Prior distribution
Posterior
probabilities
Application of
Bayesian methods
• Markov chain: the new proposed tree will depend only on the
Demo: McRobot previous one
(P. Lewis)
c
N. Salamin
Sept 2007
MCMC in practice
Lecture outline
Bayesian setting
Definition Metropolis algorithm
Simple example
Prob(Tj )Prob(D|Tj )
R=
Prob(Ti )Prob(D|Ti )
• if R ≥ 1, accept Tj
• if R < 1, draw a random number n between [0, 1] and accept
Tj if R > n, otherwise keep Ti
c
N. Salamin
Sept 2007
How to propose a new tree
Lecture outline
Bayesian setting
Definition
Simple example
We could invent any type of proposal distribution to wander
MCMC
Normalizing constant through the tree space
MCMC in practice
Proposal distribution • e.g. NNI by selecting a node at random
Prior distribution
Posterior
probabilities
• erase part of the tree and propose new branch lengths
Application of
Bayesian methods • should be able to reach all trees from any starting tree
Demo: McRobot
(P. Lewis) • at least after “sufficient” running, but impossible to know how
much running is enough
c
N. Salamin
Sept 2007
Type of prior distributions
Lecture outline
Bayesian setting
Definition
Simple example
Prior distributions for topologies have been proposed
MCMC
Normalizing constant • stochastic process of random speciation and extinction
MCMC in practice
Proposal distribution • uniform distribution of all possible rooted trees
Prior distribution
Posterior
probabilities
Application of
Bayesian methods Prior distributions on branch lengths
Demo: McRobot
(P. Lewis) • exponential distribution
• uniform distribution
Bayesian setting
Definition
Simple example
MCMC
Normalizing constant
MCMC in practice
Proposal distribution As shown before, we have to be careful with prior because they
Prior distribution
Posterior
can exclude possible estimated values.
probabilities
Application of
Bayesian methods
Demo: McRobot
(P. Lewis)
Other problematic aspects:
• universality of priors
• use of “uninformative” flat priors
• issues of scale
• unbounded quantities
c
N. Salamin
Sept 2007
Jukes-Cantor model
Lecture outline
figures from Felsenstein 2004
Bayesian setting
Definition
Simple example
MCMC
Normalizing constant
MCMC in practice
Proposal distribution
Prior distribution Sequence disimilarity and branch length under this model:
Posterior
probabilities
Application of 3 4
Bayesian methods p= (1 − e− 3 t )
Demo: McRobot 4
(P. Lewis)
Bayesian setting
Definition
Simple example What is the posterior probability of each tree?
MCMC
Normalizing constant
• do we take branch length into account?
MCMC in practice
Proposal distribution • if noise in data, no single tree will have high probability
Prior distribution
Posterior • what if only part of the tree is supported?
probabilities
Application of
Bayesian methods
c
N. Salamin
Sept 2007
What can we do with Bayesian
Lecture outline
Bayesian setting
Definition
Simple example
Bayesian setting
Definition
Simple example