Bayesian inference

912 views

Thanks!

In: Mathematics

Anonymous 0 Comments

Let’s say you want to know how long it takes to get to your new office. You ask me how likely I think it is that it will take more than 15 minutes, and I say “25%”. This is called a “prior” — you haven’t tried getting to work yet so you have no data, right now you believe 25% of the time it will take longer than 15 minutes.

The first day you go to work, it takes 25 minutes. It could be a fluke, it could be normal — but maybe you think there’s a 50% chance now.

The second day you go to work it takes 70 minutes, but there was a bad accident and you don’t imagine those happen often, so you don’t really change your expectation — still 50%.

The third day you go to work it takes 10 minutes.

The fourth day it takes 13 minutes.

At the end of this you probably think that about 30-40% of the time it will take more than 15 minutes to get to work. You’ve just kinda done bayesian inference and didn’t know it.

Bayesian inference is a class of techniques for making inferences (informed guesses) about things based on prior information (your initial belief about the thing) and data that you collect. Bayes’ law is the foundational equation enabling many of these techniques when dealing with probabilities. It lets you formally calculate how you should update your belief about a hypothesis (i.e. that it takes longer than 15 minutes to get to work) given your prior belief, some evidence, the likelihood of that evidence, and the likelihood of your hypothesis given that belief. Note how your estimate of how often you’d take more than 15 minutes didn’t increase much with a bad accident — because that evidence was very unlikely to happen. This is key component of bayesian inference — it lets you take into account that some things are just less likely than others, and you don’t want those to necessarily change your overall expectations as much in most cases.

Bayesian inference as a topic extends into much more complex models than this, but they all boil down to that same basic intuition — you start from a belief, and then slowly get better based on evidence, that evidence’s likelihood, and the structure of your problem. Contrast this to, for example, many standard regression techniques which don’t allow you to include a “prior belief” — there’s no natural way to handle very small amounts of data so that you can anchor yourself on something reasonable.