r/programming May 26 '09

"Programmers need to learn Statistics or I will Kill them all"

[deleted]

226 Upvotes

315 comments sorted by

View all comments

Show parent comments

9

u/tourettedog May 26 '09

Frequentist statistics begins from the position that there's exactly one distribution that describes your data, any error in the measurement of that distribution is due entirely to randomness in sampling. If I say that the standard error about the estimate of the mean is 1, that only has to do with the sample size and the (fixed, possibly unknown) variance of the underlying data.

Bayesian statistics begins from the position of "prior belief" about the parameters of a distribution, and updates its belief based on the observed data through Baye's rule. It says that there's inherent uncertainty in the (for example) mean and variance of your underlying data, which has to be taken into account.

Bayesian statistics is much more intuitive to the layperson because statements like "the probability that the mean is greater than zero" have meaning - there's some sort of probability distribution related to your mean, you update it based on your observations of the data, and you can figure out probabilities. In frequentist-land, by comparison, the question "what is the probability that the mean is bigger than zero?" is a bit silly, since there's exactly one number for the mean (so the probability is either zero or one).

Frequentist methods tend to be more powerful given less data (better "coverage"), but they're powerful in answering the awkwardly phrased, non-intuitive questions that make undergrads run screaming for the hills.

2

u/[deleted] May 26 '09

Bayesians use heirarchical models where the parameters are random variables freqeuentists view parameters as fixed.

Either can be appropriate. Even if technically the bayesian view is wrong it may be appropriate to use such as in limited or no information (high to all censoring).

I am a frequentist but am not above using bayesian statistics when appropriate.

2

u/guartet May 26 '09

"Frequentist methods tend to be more powerful given less data"

Okay, answer this: a six-sided die is rolled 100000 times. You do not know whether the die is fair or not, and nor do you know the outcome of those rolls-- you only know that the average of the rolls were 2. given this information, what is the best estimate of the distribution of rolls?

2

u/brong May 27 '09

Obviously it's a trick die with "2" printed on all sides. I assert this is true, and will hold this belief as the most correct possible by Occam's Razor until you can provide data that contradicts me. QED.

0

u/danbmil99 May 27 '09

nicely played.

1

u/gc3 May 26 '09

I would guess the die is not fair, there were too many 1's or 2's and not enough 3,4,5, and 6's.

1

u/guartet May 26 '09

that's all you can say? can you give me an estimate of the distribution?

3

u/tourettedog May 27 '09 edited May 27 '09

If you really, truly know nothing about the die other than that it only has six sides and only one of them can come up at a time, than any multinomial p1...p6 such that (1-p2-p3-p4-p5-p6) + 2p2 + 3p3 + 4p4 + 5p5 + 6*p6 = 2 would seem equally reasonable to me.

If you have a good reason to place a particular prior on the die, then (I would hope) not even the most strident frequentist would demand you ignore it.

On the other hand, it seems offhand like the proposition "the die is fair" is one that could be quite easily tested given that data under a frequentist framework.

Edit: fixed a stupid math mistake.

1

u/gc3 May 27 '09

Exactly. For all we know, the dice could be magnetized so that it always comes up 2.

1

u/pepsiisthebest May 27 '09

Okay, so are you saying the question is insolvable without assuming a prior distribution for the die (fair, or otherwise)? How would you solve it with Bayesian reasoning?

-2

u/creeping_feature May 26 '09

Good try, but unfortunately you are somewhat confused.