0% found this document useful (0 votes)
36 views61 pages

Course Overview: - Tuesday Lecture - Thursday Computer Lab

- Tuesday lectures involve students not presenting turning in a paper review, while Thursday is a computer lab where students turn in a write up from the previous lab along with being warned some methods may take computational time. - Maximum likelihood methods find the parameters most likely to produce the observed data given a specific model. Markov chain Monte Carlo (MCMC) methods are commonly used to estimate likelihoods by repeatedly updating parameter values. - Models can be compared using the likelihood ratio test, where a significantly higher likelihood ratio statistic compared to the chi-square distribution indicates a better fit. Bayes' theorem allows calculating posterior probabilities from likelihoods.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views61 pages

Course Overview: - Tuesday Lecture - Thursday Computer Lab

- Tuesday lectures involve students not presenting turning in a paper review, while Thursday is a computer lab where students turn in a write up from the previous lab along with being warned some methods may take computational time. - Maximum likelihood methods find the parameters most likely to produce the observed data given a specific model. Markov chain Monte Carlo (MCMC) methods are commonly used to estimate likelihoods by repeatedly updating parameter values. - Models can be compared using the likelihood ratio test, where a significantly higher likelihood ratio statistic compared to the chi-square distribution indicates a better fit. Bayes' theorem allows calculating posterior probabilities from likelihoods.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 61

Courseoverview

Tuesdaylecture
Thosenotpresentingturninshortreviewofa
paperusingthemethodbeingdiscussed

Thursdaycomputerlab
Turninshortwriteupfrompreviouscomputer
lab.
Somemethodstakesomecomputationaltime,
sobringsomethingelsealong.

MaximumLikelihood,MCMC,
andBayesTheorem
PopQuiz

MaximumLikelihood,MCMC,
andBayesTheorem

Maximum likelihood
methods find the parameters
most likely to produce the
data observed given a
specific model.

Maximum likelihood
methods find the parameters
most likely to produce the
data observed given a
specific model.
Thelikelihood(L)istheprobabilityofthedatagiven
thehypothesis(orparametervalue).
L=P(data|hypothesis)

WewilluseMLforvarietyof
calculations
WhatistheMLestimateofdN/dSfora
codonalignment?
Whatparametersoptimizeconservedversus
neutralregions?
Whatnumberofpopulationsmaximizesthe
likelihood?

Whatismaximumlikelihood?
Comparisontoprobabilitytheory:
Probability of # heads in 5 coin tosses
Heads
0
1
2
3
4
5

Prob.
.03
.16
.31
.31
.16
.03

P(x) = (n!/(n-x)!)pxqn-x

Samecalculationforcoinswithdifferentbias.

Bias
.1
.59
.33
.07
.01
.00
.00

Heads
0
1
2
3
4
5

of coin towards Heads


.3
.5 .7
.9
.17 .03 .00 .00
.36 .16 .03 .00
.31 .31 .13 .01
.13 .31 .31 .07
.03 .16 .36 .33
.00 .03 .17 .59

Samecalculationforcoinswithdifferentbias.

Bias of coin towards Heads


Heads
.1 .3
.5 .7
.9
0
.59 .17 .03 .00 .00
1
.33 .36 .16 .03 .00
2
.07 .31 .31 .13 .01
3
.01 .13 .31 .31 .07
4
.00 .03 .16 .36 .33
5
.00 .00 .03 .17 .59
Probabilitiessumto1

Samecalculationforcoinswithdifferentbias.
Observe1headin5cointosses,whatisthe
Maximumlikelihoodestimateforcoinbias?
Bias of coin towards Heads
Wantto
Heads
.1 .3
.5 .7
.9
determine
0
.59 .17 .03 .00 .00
biasfrom
1
.33 .36 .16 .03 .00
observed
2
.07 .31 .31 .13 .01
#heads
3
.01 .13 .31 .31 .07
4
.00 .03 .16 .36 .33
5
.00 .00 .03 .17 .59
Probabilitiessumto1
Thelikelihood(L)istheprobabilityofthedatagiven
thehypothesis(orparametervalue).

L=P(data|hypothesis)

Samecalculationforcoinswithdifferentbias.
Heads
0
1
2
3
4
5

Bias
.1
.59
.33
.07
.01
.00
.00

of coin towards Heads


.3
.5 .7
.9
Wantto
.17 .03 .00 .00
determine
.36 .16 .03 .00
biasfrom
.31 .31 .13 .01
observed
.13 .31 .31 .07
#heads
.03 .16 .36 .33
.00 .03 .17 .59

Likelihoodsdonotsumto1.Maximumisparameterthat
bestfitstheobserveddata.
Thelikelihood(L)istheprobabilityofthedatagiven
thehypothesis(orparametervalue).
L=P(data|hypothesis)

Samecalculationforcoinswithdifferentbias.
Bias
.1
.59
.33
.07
.01
.00
.00

Heads
0
1
2
3
4
5

of coin towards Heads


.3
.5 .7
.9
Wantto
.17 .03 .00 .00
determine
.36 .16 .03 .00
biasfrom
.31 .31 .13 .01
observed
.13 .31 .31 .07
#heads
.03 .16 .36 .33
L=P(data|bias)
.00 .03 .17 .59

Likelihoodsusuallyrepresentedasln(L),
Solookingforleastnegativevalue.
Ln(0.33)=1.1
ln(0.36)=1.02
Ln(0.16)=1.8

Oneuseofmaximumlikelihoodforphylogenyinference.

Thelikelihood(L)ofatreeistheprobabilityofthedatagiven
thetreeandmodel(hypothesisorparametervalue).
L=P(data|tree)
ProblemisthatthereareLOTSofpossibletrees(hypotheses).

Howdowecalculate/estimate
likelihoods?

Onewaytogetthelikelihoodisto
estimatethem
usingMarkovChainMonteCarlo
(MCMC)methods.
analogytowalkinguphill.

Likelihood

Parameterestimationismadebychangingvalues,
estimatinglikelihood,andrepeatinguntilthe
functionhasbeenmaximized.

Parameterestimate

GraphsfromJohnHuelsenbeck

MarkovChainMonteCarlo
Startwithproposedstate
Perturboldstateandcalculateprobabilityofnew
state
Testifnewstateisbetterthanoldstate,acceptif
ratioofnewtooldisgreaterthanarandomly
drawnnumberbetween0and1.
Movetonewstateifaccepted,ifnotstayatold
state
Startover

MarkovChainMonteCarlo
Startwithproposedstate
Perturboldstateandcalculateprobabilityofnew
state
Testifnewstateisbetterthanoldstate,acceptif
ratioofnewtooldisgreaterthanarandomly
drawnnumberbetween0and1.
Movetonewstateifaccepted,ifnotstayatold
state
Startover

MarkovChainMonteCarlo
Startwithproposedstate
Perturboldstateandcalculateprobabilityofnew
state
Testifnewstateisbetterthanoldstate,acceptif
ratioofnewtooldisgreaterthanarandomly
drawnnumberbetween0and1.
Movetonewstateifaccepted,ifnotstayatold
state
Startover

MarkovChainMonteCarlo
Startwithproposedstate
Perturboldstateandcalculateprobabilityofnew
state
Testifnewstateisbetterthanoldstate,acceptif
ratioofnewtooldisgreaterthanarandomly
drawnnumberbetween0and1.
Movetonewstateifaccepted,ifnotstayatold
state
Startover

MarkovChainMonteCarlo
Startwithproposedstate
Perturboldstateandcalculateprobabilityofnew
state
Testifnewstateisbetterthanoldstate,acceptif
ratioofnewtooldisgreaterthanarandomly
drawnnumberbetween0and1.
Movetonewstateifaccepted,ifnotstayatold
state
Startover

Circlerepresentsamountofpotentialproposedchange.

Repeatstepsuntilyoufindthepeak.

Whatistheanswer

Peak=maximumlikelihood
Mean
Mode
Median
Credibleset(iewithconfidenceinterval)

Howdoyouknowifyoureached
thepeak(maximumlikelihood)?

Convergence=testedalloflikelihoodsurfaceandfound
maximum
examplewhichdidnotconverge(chaincaughtinlocaloptima)

Convergence=testedalloflikelihoodsurfaceandfoundmaximum

Checkconvergenceby
startingdifferentinitialestimates
increasetheamountvaluesalteredforparameteroptimization
reruntheanalysisseveraltimes
runforverylongtime

MCRobotdemo:

Anyothermethodstoexploreparameterspace?

Heatedchains
Heatingreferstopoweringtheacceptance
rejectionformula(newheight/oldheight).
Ifgreaterthan1,alwaysaccept
If<1andcoldchainacceptwithp=0.25,
twiceashotchainwouldacceptwithp1/2=0.5

Coldchain

HotChainnoticepeakslower

Swapbetweenchains

MCRobotdemo

Nowwhattodowithlikelihoods
Comparemodels
Likelihoodratiotest(LRT)
IsthedN/dSratioforgeneAsignificantly
differentfrom1?
Doesaselectionmodelfitbetterthana
neutralmodel

Computeposteriorprobabilities
BayesTheorem
Determineconfidence

Comparetwonestedmodels
(LRT)
Foreachadditionalparameteradded,the
likelihoodshouldalwaysimprove
Howdoyoudetermineifimprovementis
significant?

Comparetwonestedmodels
Freeestimate(H1).EstimateofdN/dS()fromalignment.
1parameterestimated
lnL=100

Nullmodel(H0).FixdN/dS()tobe1.
0parametersestimated(allfixed)
lnL=90

Comparetwonestedmodels
Freeestimate(H1).EstimateofdN/dS()fromalignment.
1parameterestimated
lnL=100

Nullmodel(H0).FixdN/dS()tobe1.
0parametersestimated(allfixed)
lnL=90

LRTstatisticis2[lnL(H1)lnL(H0)]
Degreesoffreedom=difference#parameters
Compareto2distribution

Chisquaretable:
Significancelevel
DF0.99500.97500.90000.50000.10000.05000.01000.0010
10.00000.00100.01580.45492.70553.84156.634910.8276
20.01000.05060.21071.38634.60525.99159.210313.8155
30.07170.21580.58442.36606.25147.814711.344916.2662
40.20700.48441.06363.35677.77949.487713.276718.4668
50.41170.83121.61034.35159.236411.070515.086320.5150

Isitreallysosimple?

M7istheNullmodel(H0).
M8isthealternate(H1)
With2additionalparameters

Whatotherinformationcanyou
getfromMCMCmethods?

Bayesstheoremandposteriorprobability:
ExamplefromBox3,Lewis2001
UrnAcontains40%blackmarbles
UrnBcontains80%blackmarbles
Whatisthelikelihoodthatablackmarblecamefrom
UrnA?UrnB?
Whatistheposteriorprobabilitythatablackmarble
camefromUrnA?UrnB?

Asswithlikelihoods,thisisdifficulttocalculate.
CanweuseMCMC?

Foranappropriatelyconstructed
andadequatelyrunMarkov
chain,theproportionofthetime
anyparametervalueisvisitedisa
validapproximationofthe
posteriorprobabilityofthat
parameter(=Bayes)

lnL

Reddots=burninperiod.

generations

Reddots=burninperiod.

lnL

Burninperiod

generations

AdvantagesBayesianperspective
Givesprobabilityofhypothesisofinterest
Likelihoodprobabilitydatagivenhypothesis

Comparetobootstrap
Disadvantageissubjectivityofprior

TwotypeofBayesinferencewe
willsee
NaveEmpiricalBayes(NEB)
Assumesparameterestimatesfromlikelihood
areexact

BayesEmpiricalBayes(BEB)
Takesintoaccounterrorinlikelihoodestimates
ofparameters

Somethingstoconsiderwhen
runningMCMCanalyses

Numberofgenerations
Numberofchains
Burninperiod
Convergence

SomeusesofMCMC

Phylogeny
Modelsofcodonevolution(PAMLApril6)
Conservedregions(ShadowingApril13)
Mutationrates
Migrationrates
Populationstructure(StructureApril20)

You might also like