Download - Mol evol jc.151216-amb.bayesianstats-teaser
![Page 1: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/1.jpg)
BayesianStatistics
MadeSimple
ÁlvaroMartínezBarrio,PhD
[email protected]/in/ambarrio@ambarrio
!Uppsala,Dec16th2015
![Page 2: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/2.jpg)
2
Think Bayes
Bayesian Statistics Made Simple
Version 1.0.3
Allen B. Downey
Green Tea PressNeedham, Massachusetts
![Page 3: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/3.jpg)
Notation:Probability
3
• p(A):theprobabilitythatAoccurs!
• p(A|B):theprobabilitythatAoccurs,giventhatBhasoccurred!
• p(AandB)=p(A)p(B|A):Conjointprobability
![Page 4: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/4.jpg)
Introduction:Bayes’Theorem
4
• Bydefinitionofconjointprobabilityandthatconjunctioniscommutative:p(AandB)=p(A)p(B|A)=(1)p(BandA)=p(B)p(A|B)
• p(A)p(B|A)=p(B)p(A|B)(2)• p(A|B)=p(A)p(B|A)/p(B)(3)
![Page 5: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/5.jpg)
Thecookieproblem
5
Supposetherearetwobowlsofcookies.Bowl1contains30vanillacookiesand10chocolatecookies.Bowl2contains20ofeach.Nowsupposeyouchooseoneofthebowlsatrandomand,withoutlooking,selectacookieatrandom.Thecookieisvanilla.Whatisthe
probabilitythatitcamefromBowl1?
![Page 6: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/6.jpg)
Thecookieproblem
6
Supposetherearetwobowlsofcookies.Bowl1contains30vanillacookiesand10chocolatecookies.Bowl2contains20ofeach.Nowsupposeyouchooseoneofthebowlsatrandomand,withoutlooking,selectacookieatrandom.Thecookieisvanilla.Whatisthe
probabilitythatitcamefromBowl1?
p(B1|V)=p(B1)p(V|B1)/p(V)
![Page 7: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/7.jpg)
Thecookieproblem
7
Supposetherearetwobowlsofcookies.Bowl1contains30vanillacookiesand10chocolatecookies.Bowl2contains20ofeach.Nowsupposeyouchooseoneofthebowlsatrandomand,withoutlooking,selectacookieatrandom.Thecookieisvanilla.Whatisthe
probabilitythatitcamefromBowl1?
p(B1|V)=p(B1)p(V|B1)/p(V)
p(B1|V)=(1/2)(3/4)/5/8
![Page 8: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/8.jpg)
History:Bayes’Theorem
8
ThomasBayes,
(b.1702,London-d.1761,
TunbridgeWells,Kent)
Intheearly18thcentury,themathematiciansofthetimeknewhowtofindtheprobabilitythat,say,4peopleaged50dieinagivenyearoutofasampleof60iftheprobabilityofanyoneofthemdyingwasknown.
Buttheydidnotknowhowtofindtheprobabilityofone50-yearolddyingbasedontheobservationthat4haddiedoutof60.
![Page 9: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/9.jpg)
History:Bayes’Theorem
9
ThomasBayes,
(b.1702,London-d.1761,
TunbridgeWells,Kent)
Intheearly18thcentury,themathematiciansofthetimeknewhowtofindtheprobabilitythat,say,4peopleaged50dieinagivenyearoutofasampleof60iftheprobabilityofanyoneofthemdyingwasknown.
Buttheydidnotknowhowtofindtheprobabilityofone50-yearolddyingbasedontheobservationthat4haddiedoutof60.
thequestionofinverseprobability
![Page 10: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/10.jpg)
The“diachronic”interpretation
10
ThomasBayes,
(b.1702,London-d.1761,
TunbridgeWells,Kent)
p(H|D)=p(H)p(D|H)/p(D)
• p(H)istheprobabilityofthehypothesisbeforeweseethedata,calledthepriorprobability,orjustprior.
• p(H|D)iswhatwewanttocompute,theprobabilityofthehypothesisa\erweseethedata,calledtheposterior.
• p(D|H)istheprobabilityofthedataunderthehypothesis,calledthelikelihood.
• p(D)istheprobabilityofthedataunderanyhypothesis,calledthenormalizingconstant.
![Page 11: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/11.jpg)
History:Syllogism
11
4thcenturyBC
!!
• Majorpremise!!
• Minorpremise!!
• Conclusion
Arhetoricalsyllogism(a3-partdeductiveargument)usedinoratorialpractice.
![Page 12: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/12.jpg)
History:Syllogism
12
4thcenturyBC
• Majorpremise:“Allhumansaremortal”!!
• Minorpremise:“AllGreeksarehuman”!
• Conclusion:“AllGreeksaremortal”
![Page 13: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/13.jpg)
History:Syllogism
13
4thcenturyBC
• Majorpremise:“Allmortalsdie”!!
• Minorpremise:“Allmenaremortals”!
• Conclusion:“Allmendie”
![Page 14: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/14.jpg)
History:Enthymeme
14
4thcenturyBC
!• “Socratesismortalbecausehe’s
human”
!• Majorpremise(unstated):“Allhumansaremortal.”!
• Minorpremise(stated):“Socratesishuman.”!
• Conclusion(stated):“Therefore,Socratesismortal.”
![Page 15: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/15.jpg)
History:Enthymeme
15
4thcenturyBC
!• "Heisill,sincehehasacough.”
!!
• “Sinceshehasachild,shehas
givenbirth."
![Page 16: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/16.jpg)
History:Enthymeme
16
4thcenturyBC
• Hestartedtoproposethatenthymemesarebasedonprobabilities(eikos),examples,tekmêria(i.e.,proofs,evidences),andsigns(sêmeia).
![Page 17: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/17.jpg)
History:Enthymeme
17
4thcenturyBC
• CarolPosterarguesthatenthymemesastruncatedsyllogismswasinventedbyBritishrhetoricians(suchasRichardWhately)intheXVIIIcentury.
Poster,Carol(2003)."Theology,Canonicity,andAbbreviatedEnthymemes".RhetoricSocietyQuarterly33(1):67–103.
![Page 18: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/18.jpg)
Chapter1:Bayes’Theorem
• Mutuallyexclusive:Atmostonehypothesisinthesetcanbetrue!
• Collectivelyexhaustive:Therearenootherpossibilities;atleastoneofthehypotheseshastobetrue
![Page 19: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/19.jpg)
Chapter1:Bayes’Theorem
• Mutuallyexclusive:Atmostonehypothesisinthesetcanbetrue!
• Collectivelyexhaustive:Therearenootherpossibilities;atleastoneofthehypotheseshastobetrue
p(D)=p(B1)p(D|B1)+p(B2)p(D|B2)
![Page 20: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/20.jpg)
Chapter1:Bayes’Theorem
• Mutuallyexclusive:Atmostonehypothesisinthesetcanbetrue!
• Collectivelyexhaustive:Therearenootherpossibilities;atleastoneofthehypotheseshastobetrue
p(D)=p(B1)p(D|B1)+p(B2)p(D|B2)
p(D)=(1/2)(3/4)+(1/2)(1/2)=5/8
![Page 21: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/21.jpg)
Chapter1:Bayes’Theorem
• Mutuallyexclusive:Atmostonehypothesisinthesetcanbetrue!
• Collectivelyexhaustive:Therearenootherpossibilities;atleastoneofthehypotheseshastobetrue
p(D)=p(B1)p(D|B1)+p(B2)p(D|B2)
p(D)=(1/2)(3/4)+(1/2)(1/2)=5/8
Ifp(A|B)ishardtocompute,orhardtomeasureexperimentally,checkwhetherit
mightbeeasiertocomputetheothertermsinBayes’stheorem,p(B|A),p(A)andp(B).
![Page 22: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/22.jpg)
Chapter2:ComputationalStatistics
• Distribution:
![Page 23: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/23.jpg)
Chapter2:ComputationalStatistics
• Distribution:setofvaluesandtheircorrespondingprobabilities.
![Page 24: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/24.jpg)
Chapter2:ComputationalStatistics
• Distribution:setofvaluesandtheircorrespondingprobabilities.• Probabilitymassfunction:waytorepresentadistributionmathematically.
![Page 25: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/25.jpg)
Chapter2:ComputationalStatistics
• Distribution:setofvaluesandtheircorrespondingprobabilities.• Probabilitymassfunction:waytorepresentadistributionmathematically.
• Whentalkingaboutprobabilities,youneedtonormalise(theyshouldaddupto1)
![Page 26: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/26.jpg)
Chapter2:ComputationalStatistics
• Distribution:setofvaluesandtheircorrespondingprobabilities.• Probabilitymassfunction:waytorepresentadistributionmathematically.
• Whentalkingaboutprobabilities,youneedtonormalise(theyshouldaddupto1)
• Thisdistribution,whichcontainsthepriorsforeachhypothesis,iscalled(waitforit)thepriordistribution.
• Toupdatethedistributionbasedonnewdata(avanillacookie!),wemultiplyeachpriorbythecorrespondinglikelihood.
• Thedistributionisnolongernormalized,youneedtorenormalize• Theresultisadistributionthatcontainstheposteriorprobabilityforeachhypothesis,whichiscalled(waitagain!)theposteriordistribution.
![Page 27: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/27.jpg)
Chapter2:ComputationalStatistics
• Distribution:setofvaluesandtheircorrespondingprobabilities.• Probabilitymassfunction:waytorepresentadistributionmathematically.
• Whentalkingaboutprobabilities,youneedtonormalise(theyshouldaddupto1)
• Thisdistribution,whichcontainsthepriorsforeachhypothesis,iscalled(waitforit)thepriordistribution.
• Toupdatethedistributionbasedonnewdata(avanillacookie!),wemultiplyeachpriorbythecorrespondinglikelihood.
• Thedistributionisnolongernormalized,youneedtorenormalize• Theresultisadistributionthatcontainstheposteriorprobabilityforeachhypothesis,whichiscalled(waitagain!)theposteriordistribution.
Terminologyanddesignpatternsofpythonprogramsthatyoucanuseduringtherest
ofthecourse
![Page 28: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/28.jpg)
Chapter3:Estimation
SupposeIhaveaboxofdicethatcontainsa4-sideddie,a6-sideddie,an8-sideddie,a12-sideddie,anda20-sideddie.IfyouhaveeverplayedDungeons&Dragons,youknowwhatIamtalkingabout.SupposeIselectadiefromtheboxatrandom,rollit,andgeta6.WhatistheprobabilitythatIrolledeachdie?
![Page 29: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/29.jpg)
Chapter3:Estimation
SupposeIhaveaboxofdicethatcontainsa4-sideddie,a6-sideddie,an8-sideddie,a12-sideddie,anda20-sideddie.IfyouhaveeverplayedDungeons&Dragons,youknowwhatIamtalkingabout.SupposeIselectadiefromtheboxatrandom,rollit,andgeta6.WhatistheprobabilitythatIrolledeachdie?
Letmesuggestathree-stepstrategyforapproachingaproblemlikethis:1.Choosearepresentationforthehypotheses. 2.Choosearepresentationforthedata. 3.Writethelikelihoodfunction.
![Page 30: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/30.jpg)
Chapter3:Estimation
Mosteller’sFiftyChallengingProblemsinProbabilitywithSolutions
“Arailroadnumbersitslocomotivesinorder1..N.Onedayyouseealocomotivewiththenumber60.Estimatehowmanylocomotives
therailroadhas.”
![Page 31: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/31.jpg)
Chapter3:Estimation
PartIofStatisticalInference.
“Arailroadnumbersitslocomotivesinorder1..N.Onedayyouseealocomotivewiththenumber60.Estimatehowmanylocomotives
therailroadhas.”
![Page 32: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/32.jpg)
Chapter3:Estimation
PartIofStatisticalInference.
“Arailroadnumbersitslocomotivesinorder1..N.Onedayyouseealocomotivewiththenumber60.Estimatehowmanylocomotives
therailroadhas.”
![Page 33: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/33.jpg)
Chapter3:Estimation
PartIofStatisticalInference.
“Arailroadnumbersitslocomotivesinorder1..N.Onedayyouseealocomotivewiththenumber60.Estimatehowmanylocomotives
therailroadhas.”
![Page 34: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/34.jpg)
Chapter3:Estimation
PartIofStatisticalInference.
“Arailroadnumbersitslocomotivesinorder1..N.Onedayyouseealocomotivewiththenumber60.Estimatehowmanylocomotives
therailroadhas.”
Therearetwowaystoproceed:!
•Getmoredata. •Getmorebackgroundinformation.
![Page 35: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/35.jpg)
Chapter3:Estimation
PartIofStatisticalInference.
“Arailroadnumbersitslocomotivesinorder1..N.Onedayyouseealocomotivewiththenumber60.Estimatehowmanylocomotives
therailroadhas.”
Therearetwowaystoproceed:!
•Getmoredata. •Getmorebackgroundinformation.
![Page 36: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/36.jpg)
Chapter3:Estimation
PartIofStatisticalInference.
“Arailroadnumbersitslocomotivesinorder1..N.Onedayyouseealocomotivewiththenumber60.Estimatehowmanylocomotives
therailroadhas.”
Therearetwowaystoproceed:!
•Getmoredata. •Getmorebackgroundinformation.
![Page 37: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/37.jpg)
Chapter3:Estimation
PartIofStatisticalInference.
“Arailroadnumbersitslocomotivesinorder1..N.Onedayyouseealocomotivewiththenumber60.Estimatehowmanylocomotives
therailroadhas.”
Therearetwowaystoproceed:!
•Getmoredata. •Getmorebackgroundinformation.
![Page 38: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/38.jpg)
Chapter3:Estimation
PartIofStatisticalInference.
“Arailroadnumbersitslocomotivesinorder1..N.Onedayyouseealocomotivewiththenumber60.Estimatehowmanylocomotives
therailroadhas.”
Therearetwowaystoproceed:!
•Getmoredata. •Getmorebackgroundinformation.
![Page 39: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/39.jpg)
Chapter3:Estimation
• Credibleinterval:Forintervalsweusuallyreporttwovaluescomputedsothatthereisa90%chancethattheunknownvaluefallsbetweenthem(oranyotherprobability).
• Thewidthofthisintervalsuggestshowuncertainweareabouttheconclusionbasedinourunknownvalue.
• Therearetwoapproachestochoosingpriordistributions:• i)informative:bestrepresentsbackgroundinformation• ii)uninformative:intendedtobeasunrestrictedaspossible
![Page 40: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/40.jpg)
Chapter3:Estimation
• Credibleinterval:Forintervalsweusuallyreporttwovaluescomputedsothatthereisa90%chancethattheunknownvaluefallsbetweenthem(oranyotherprobability).
• Thewidthofthisintervalsuggestshowuncertainweareabouttheconclusionbasedinourunknownvalue.
• Therearetwoapproachestochoosingpriordistributions:• i)informative:bestrepresentsbackgroundinformation• ii)uninformative:intendedtobeasunrestrictedaspossible
Inrealworldyouhavetwowaystoproceed:!
Ifyouhavealotofdata,thechoiceofthepriordoesn’tmatterverymuch;informativeanduninformativepriorsyieldalmostthesameresults.
!Ifyoudon’thavemuchdata,usingrelevantbackgroundinformationmakesabig
difference.
![Page 41: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/41.jpg)
DifferencesbetweenBayesiansandNon-Bayesians
AccordingtoJeffGill(CenterforAppliedStatistics,WashU)
![Page 42: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/42.jpg)
DifferencesbetweenBayesiansandNon-Bayesians
AccordingtoJeffGill(CenterforAppliedStatistics,WashU)
ACCP 37th Annual Meeting, Philadelphia, PA [2]
Differences Between Bayesians and Non-BayesiansAccording to my friend Jeff Gill
Typical Bayesian Typical Non-BayesianTypicalBayesian
![Page 43: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/43.jpg)
DifferencesbetweenBayesiansandNon-Bayesians
ACCP 37th Annual Meeting, Philadelphia, PA [2]
Differences Between Bayesians and Non-BayesiansAccording to my friend Jeff Gill
Typical Bayesian Typical Non-BayesianTypicalBayesian
ACCP 37th Annual Meeting, Philadelphia, PA [2]
Differences Between Bayesians and Non-BayesiansAccording to my friend Jeff Gill
Typical Bayesian Typical Non-BayesianTypicalNon-Bayesian
AccordingtoJeffGill(CenterforAppliedStatistics,WashU)
![Page 44: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/44.jpg)
Conclusions
• Importanceofmodelling• Followadiscreteapproach:correctfirst,andexpandlater
![Page 45: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/45.jpg)
GeneralApproach
1.Startwithsimplemodelsandimplementtheminclear,readableanddemonstrablycorrectcode.Focusshouldbeongoodmodellingdecisions,notoptimisation
![Page 46: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/46.jpg)
GeneralApproach
1.Startwithsimplemodelsandimplementtheminclear,readableanddemonstrablycorrectcode.Focusshouldbeongoodmodellingdecisions,notoptimisation2.Identifythebiggestsourcesoferror.Perhapsincreasethenumberofvaluesinadiscreteapproximation,increasethenumberofiterationsinaMCsimulation,oradddetailstothemodel
![Page 47: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/47.jpg)
GeneralApproach
1.Startwithsimplemodelsandimplementtheminclear,readableanddemonstrablycorrectcode.Focusshouldbeongoodmodellingdecisions,notoptimisation2.Identifythebiggestsourcesoferror.Perhapsincreasethenumberofvaluesinadiscreteapproximation,increasethenumberofiterationsinaMCsimulation,oradddetailstothemodel3.Isperformancegood?Ifnot,tryoptimisingthen
![Page 48: Mol evol jc.151216-amb.bayesianstats-teaser](https://reader031.vdocuments.pub/reader031/viewer/2022021506/589ad9721a28abc93a8b6c99/html5/thumbnails/48.jpg)
REFERENCES
• PyContutorials(byAllenDowney)https://sites.google.com/site/simplebayes/!• “ProbablyOverthinkingIt”(byAllenDowney)http://allendowney.blogspot.se/!
• MarkA.Beaumont&BruceRannala(2004)NatureRevGenetics
MonumenttomembersoftheBayesandCottonfamilies,includingThomasBayesandhisfatherJoshua,inBunhillFieldsburialground