Bayesian vs Frequentist - Indico · Srivastava, Rahul (Ific, Valencia) Taken from xkcd. Different...

17
Bayesian vs Frequentist Xia, Ziqing (Purple Mountain Observatory) Duan, Kaikai(Purple Montain Observatory) Centelles Chuliá, Salvador (Ific, valencia) Srivastava,Rahul(Ific, Valencia)

Transcript of Bayesian vs Frequentist - Indico · Srivastava, Rahul (Ific, Valencia) Taken from xkcd. Different...

Page 1: Bayesian vs Frequentist - Indico · Srivastava, Rahul (Ific, Valencia) Taken from xkcd. Different Statistical Questions The Frequentistlikelihood and the Bayesian posterior ask two

BayesianvsFrequentist

Xia,Ziqing (PurpleMountainObservatory)Duan,Kaikai (PurpleMontainObservatory)Centelles Chuliá,Salvador(Ific,valencia)

Srivastava,Rahul(Ific,Valencia)

Page 2: Bayesian vs Frequentist - Indico · Srivastava, Rahul (Ific, Valencia) Taken from xkcd. Different Statistical Questions The Frequentistlikelihood and the Bayesian posterior ask two

Taken from xkcd

Page 3: Bayesian vs Frequentist - Indico · Srivastava, Rahul (Ific, Valencia) Taken from xkcd. Different Statistical Questions The Frequentistlikelihood and the Bayesian posterior ask two

DifferentStatisticalQuestions

TheFrequentist likelihoodandtheBayesianposteriorasktwodifferentstatisticalquestionsofthedata:

Regionsofhighqualityoffit

Giventhepriorandthedata,extractthepdfoftheparameters.

Page 4: Bayesian vs Frequentist - Indico · Srivastava, Rahul (Ific, Valencia) Taken from xkcd. Different Statistical Questions The Frequentistlikelihood and the Bayesian posterior ask two

Thenotionofprobability- Frequentist

• If thenumberoftrialsapproachesinfinity, therelativefrequencywillconverge exactly tothetrueprobability.

• Repeatabilityofanexperimentisthekeyconcept.

The number of trials where the event X occurred

The total number of trials

• TheMaximumLikelihoodEstimator:

Page 5: Bayesian vs Frequentist - Indico · Srivastava, Rahul (Ific, Valencia) Taken from xkcd. Different Statistical Questions The Frequentistlikelihood and the Bayesian posterior ask two

Thenotionofprobability- Bayesian

Posterior

Marginal likelihood

PriorLikelihood function

It is a direct consequence of the Bayes theorem :

• Bayestheoremrelatestheposteriorprobability(whatweknowabouttheparameterafterseeingthedata)tothelikelihood (derivedfroma statisticalmodel fortheobserveddata) andtheprior (whatweknewabouttheparameterbeforewesawthedata).

• A generalruletoupdateourknowledgefromtheprior tothe posterior.

Page 6: Bayesian vs Frequentist - Indico · Srivastava, Rahul (Ific, Valencia) Taken from xkcd. Different Statistical Questions The Frequentistlikelihood and the Bayesian posterior ask two

A SimpleProblem:PhotonCounts• Imaginethatweobservethelightcomingfromasinglestar.We assumethatthestar’struefluxisconstantwithtime.

• Giventhe measurementsanderrors,whatisthebestestimateofthetrueflux?

• we usePythontogeneratesometoydata ( Poissondistribution)

Page 7: Bayesian vs Frequentist - Indico · Srivastava, Rahul (Ific, Valencia) Taken from xkcd. Different Statistical Questions The Frequentistlikelihood and the Bayesian posterior ask two

Frequentist ApproachtoSimplePhotonCounts• Theprobabilitydistributionofthemeasurement:

• constructthe likelihoodfunctionbycomputingtheproductoftheprobabilitiesforeachdatapoint:

• Thebestestimate:

Page 8: Bayesian vs Frequentist - Indico · Srivastava, Rahul (Ific, Valencia) Taken from xkcd. Different Statistical Questions The Frequentistlikelihood and the Bayesian posterior ask two

BayesianApproachtoSimplePhotonCounts• Theposteriorprobability:

• Themodelprior: a standardchoiceistotakeauniformprior.

• TheBayesianprobabilityismaximizedatpreciselythesamevalueasthefrequentist result! InthecaseofaGaussian

likelihoodanduniformprior,theposteriorpdfandtheprofilelikelihoodareidenticalandthusthe

questionofwhichtochoosedoesnotarise.

Page 9: Bayesian vs Frequentist - Indico · Srivastava, Rahul (Ific, Valencia) Taken from xkcd. Different Statistical Questions The Frequentistlikelihood and the Bayesian posterior ask two

BayesianApproachtoSimplePhotonCounts

• Theposteriorprobability:

Page 10: Bayesian vs Frequentist - Indico · Srivastava, Rahul (Ific, Valencia) Taken from xkcd. Different Statistical Questions The Frequentistlikelihood and the Bayesian posterior ask two

TheBayesianBilliardGame

• AliceandBobcan’tseethebilliardtable.• Carolrollsaballdownthetable,andmarkswhereitlands.Oncethismarkisinplace,Carolbeginsrollingnewballsdownthetable.

• Iftheballlandstotheleftofthemark,Alicegetsapoint;ifitlandstotherightofthemark,Bobgetsapoint.

• Thefirstpersontoreach sixpointswinsthegame.• NowsaythatAliceisleadingwith5pointsandBobhas3points.WhatcanbesaidaboutthechancesofBobtowinthegame?

Page 11: Bayesian vs Frequentist - Indico · Srivastava, Rahul (Ific, Valencia) Taken from xkcd. Different Statistical Questions The Frequentistlikelihood and the Bayesian posterior ask two

Frequentist (naive) ApproachtoTheBilliardGame• FiveballsoutofeightfellonAlice'ssideofthemarker• Maximumlikelihoodestimateof pthatanygivenrolllandsinAlice'sfavor.

• Assumingthismaximumlikelihoodprobability,wecancomputetheprobabilitythatBobwillwin,whichisgivenby:

Frequentist ProbabilityofBobWinning:0.05

Page 12: Bayesian vs Frequentist - Indico · Srivastava, Rahul (Ific, Valencia) Taken from xkcd. Different Statistical Questions The Frequentistlikelihood and the Bayesian posterior ask two

BayesianApproachtoTheBilliardGame

• Theposteriorprobability:

PosteriorProbabilityofBobWinning:0.09?!

UniformPrior

Page 13: Bayesian vs Frequentist - Indico · Srivastava, Rahul (Ific, Valencia) Taken from xkcd. Different Statistical Questions The Frequentistlikelihood and the Bayesian posterior ask two

MonteCarloApproachtoTheBilliardGame

• UseaMonteCarlosimulationtodeterminethecorrectanswer.

The correct ProbabilityofBobWinning:0.09!Bayesianwin!!!

Page 14: Bayesian vs Frequentist - Indico · Srivastava, Rahul (Ific, Valencia) Taken from xkcd. Different Statistical Questions The Frequentistlikelihood and the Bayesian posterior ask two
Page 15: Bayesian vs Frequentist - Indico · Srivastava, Rahul (Ific, Valencia) Taken from xkcd. Different Statistical Questions The Frequentistlikelihood and the Bayesian posterior ask two

Conclusions

• The Bayesian vs Frequentist debate has a long history and the battleis still going on

• People oftenmake statements claiming one to be better than other• In our opinion, it is not accurate to say that one is inherently superiorto other

• Both approaches can give poor results if not done carefully• However, frompractical point of view, Bayesian seems to bettersuited to handle “dirty” data

• Situation similar to classical numerical integration techniques vsMonte Carlo integration techniques

Page 16: Bayesian vs Frequentist - Indico · Srivastava, Rahul (Ific, Valencia) Taken from xkcd. Different Statistical Questions The Frequentistlikelihood and the Bayesian posterior ask two

Open questions

• How to knowwhen to use one approach or the other?• What defines a good prior?• Is there another approach (the third one) can resolve this case?

References:[1] RobertoTrotta: BayesianMethodsinCosmology. arXiv: 1701.01467[2]JakeVanderPlas: Frequentism andBayesianism:APython-drivenPrimer.

arXiv: 1411.5018

Page 17: Bayesian vs Frequentist - Indico · Srivastava, Rahul (Ific, Valencia) Taken from xkcd. Different Statistical Questions The Frequentistlikelihood and the Bayesian posterior ask two

Thankyou!