How large is that number in the Law of Large Numbers?
thepalindrome.org
thepalindrome.org
The number of samples you need is very difficult to calculate correctly, requiring deep analysis of standard deviations and variances.
But surprisingly, you can simply know you've reached large number status when over 10 items exist in each category.
---------
Ex: when doing a heads vs tails coin flip experiment, you likely have a large number once you have over 10 heads and over 10 tails. No matter how biased the coin is.
Or in this 'Lotto ticket' example, you have a large number of samples after gathering enough data to find over 10 Jackpot winners.
I think you can justify it by approximating each category as an independent Poisson distribution. Then for each such processes the variance equals the mean. So once you have 10 successes in a bin, you have evidence of a probably good estimate for the arrival rate of that category. The book "The Probabilistic Method" calls a related idea "the Poisson paradigm."
(10 a nice round number where the standard deviation is below the mean)
In the case of six-sided dice, there are precisely six categories, ideally with even odds of occurrence. With the lottery jackpot given, there are eight categories, with highly asymmetric probabilities and values.
In real-world cases, you might be trying to distinguish two cases (treatment and control in a medical experiment), between multiple particles or isotopes (say, with physics or chemistry), amongst different political divisions (countries, states or provinces, counties, cities, or other), between political parties or candidates (which raises interesting questions over which and/or how many to include in consideration, in turn dependent on voting procedures, overall popularity, and impacts of non-winning candidates or parties on others), on multiple products, or on different behavioural characteristics in some domain (e.g., highly-active, occasionally-active, and lurking participants in online fora).
There are times when categories are well and unambiguously defined. Others in which where you choose to draw divisions (say, in generational groups, or wealth or income brackets) is highly arbitrary. Even where there are a large number of potential categories, choosing some limited number for specific analysis (2, 3, 5, 10, etc.) and lumping the remaining into "other" may provide clearer insights and fewer distractions than choosing a large number of divisions.[1] In other cases, a very small number of individuals may account for an overwhelming majority of activity or outcome. I'd strongly argue that in this case, the analysis might be somewhat poorly focused, and that activities and outcomes rather than individuals are of greater interest.[2]
What's key is to match your sampling and sample sizes to the phenomenon being studied.
________________________________
Notes:
1. Power law distribution / Zipf functions often mean that a very small number of participants has highly disproportionate impact or significance.
2. This is often the flip side of power law distributions. If we look at all book titles, there are a huge number of individual items to consider; there are roughly 300k annual English-language "traditional" publications, and over 1 million "nontraditional" (self-published, or publish-on-demand) titles. But if your focus is instead titles by percentage of revenue or number of sales, a top-n analysis (5, 10, 20, etc.) often captures much of the activity, frequently well over half. This is typical of any informational good: music, cinema, blogs, social media posts, etc.
Am I mistaken?
You gotta draw the line somewhere. At high-school statistics level, its basically universally drawn at the 95% confidence level. If you wanna draw new lines elsewhere, you gotta make new rules yourself and recalculate all the rules of thumb.
[1] For example as described by Feynman in Cargo Cult Science.
1. p=0.05 means that one result in 20 is going to be the result of chance.
2. It's generally pretty easy (especially in psychology) to do 20 experiments, cherry-pick -- and publish! -- the p=0.05 result, and throw away the others.
The result is that published p=0.05 results are much more likely than 1 in 20 to be the result of chance.
These problems are solved problems in the scientific community. Just announce that regular meta-studies will be done, expectations for authors to be normally distributed is published, and publicly show off the meta-study.
-------------
In any case, the discussion point you're making is well beyond the high-school level needed for a general education. If someone needs to run their own experiment (A/B testing upon their website) and cannot afford a proper set of tests/statistics, they should instead rely upon high-school level heuristics to design their personal studies.
This isn't a level of study about analyzing other people's results and finding flaws in other people's (possibly maliciously seeded) results. This is a heuristic about how to run your own experiments and how to prove something to yourself at a 95% confidence level. If you want to get published in the scientific community, the level of rigor is much higher of course, but no one tries to publish a scientific paper on just a high school education (which is where I was aiming my original comment at).
[1] https://theconversation.com/profiles/louis-liebenberg-122680...
Am I smarter than them? Nope. Do I know as many fancy big words as them? Nope. Do I care about results and communicating complex topics to normal people? Yep. Do I care more about making the company money than chasing some bug-bear to go on my resume? Yep.
I fucking hate school and have no desire to ever go back. I can't put up with the bullshit, so I dropped out; I just never stopped studying and I don't need a piece of paper to affirm that fact.
> I remember my high school AP Psychology teacher mocking p=0.05 as practically meaningless.
and trying to explain why the OP's teacher was probably right.
Second:
> So run a meta-study upon the results published by a set of authors and double-check to make sure that their results are normally distributed across the p-values associated with their studies.
That won't work, especially if you only run the meta-study on published results because it is all but impossible to get negative results published. Authors don't need to cherry-pick, the peer-review system does it for them.
> These problems are solved problems in the scientific community.
No, they aren't. These are social and political problems, not mathematical ones. And the scientific community is pretty bad at solving those.
> the discussion point you're making is well beyond the high-school level needed for a general education
I strongly disagree. I think everyone needs to understand this so they can approach scientific claims with an appropriate level of skepticism. Understanding how the sausage is made is essential to understanding science.
And BTW, I am not some crazy anti-vaxxer climate-change denialist flat-earther. I was an academic researcher for 15 years -- in a STEM field, not psychology, and even that was sufficiently screwed up to make me change my career. I have advocated for science and the scientific method for decades. It's not science that's broken, it's the academic peer-review system, which is essentially unchanged since it was invented in the 19th century. That is what needs to change. And that has nothing to do with math and everything to do with politics and economics.
In my experience, it's not even this. Rather, it is that outside of STEM, very, very few people truly understand hypothesis testing.
At least in my experience, even basic concepts, as "falsify the null-hypothesis" is surprisingly hard, even with presumably intelligent people, such as MD's in PHd programmes.
They will still tend to believe that a "significant" result is proof of an effect, and often even believe it proves that the effect is causal with the direction they prefer.
At some point, stats just becomes a set of arcane conjurations for an entire field. At that point, the field as a whole tends to lose their ability to follow the scientific method and turns into something resembling a cult or clergy.
What I was arguing was that there are almost nobody with this understanding in many fields outside stem.
As for your case, I don't know exactly what "probability theory" meant at your college. But in principle, but if it's teaching about probability density functions and how to do integration on them to calculate various probabilities, you're a long way towards a basic understanding of stats surpassing many "stats" courses taught to social science students.
I myself only took a single "stats" course before graduating, which was mostly calculus applied to probability theory, without applications such as hypothesis testing baked in. Then I went on to do a lot of physics that was essentially applied probability theory (statistical mechanics and quantum mechanics).
Around that time, my GF (who was a bit older than me) was teaching a course in scientific methodology to a class of MD students who wanted to become "real" doctors (PhD programme for Medical Doctors), and the math and logic part was kind of hard for her (physicians may not learn a lot of stats until this level, but most of the MD PhD students are quite smart). Anyway, with a proper STEM background, picking up these applications was really easy.
Since then, I've had many encounters with people from various backgrounds that try to grapple with stats or adjacant spaces (data mining, machine learning, etc), and it seems that those who do not have a Math or Physics background, or at least a quite theoretical/mathematical Computer Science or Economics background, struggle quite hard.
Especially if they have to deal with a problem that is not covered by the set of conjurations they've been taught in their basic stats classes, since they only learned to "how" but not the "why".
What is the distribution of a set of results over a set of p-values?
If you mean that you should check to make sure that the p-values themselves are normally distributed... wouldn't that be wrong? Assuming all hypotheses are false, p-values should be uniformly distributed. Assuming some hypotheses can sometimes be true, there's not a lot you can say about the appropriate distribution of p-values - it would depend on how often hypotheses are correct, and how strong the effects are.
You made the same mistake most people make here: you turned the arrow of the implication. It is not "successful experiment implies chance (probability 5%)" but "chance implies successful experiment (probability 5%)".
What does that mean in practice? Imagine a hypothetical scientist that is fundamentally confused about something important, so all hypotheses they generate are false. Yet, using p=0.05, 5% of those hypotheses will be "confirmed experimentally". In that case, it is not 5% of the "experimentally confirmed" hypotheses that are wrong -- it is full 100%. Even without any cherry-picking.
The problem is not that p=0.05 is too high. The problem is, it doesn't actually mean what most people believe it means.
p=0.05 means that one POSITIVE result in 20 is going to be the result of chance and not causality
In other words: if I have some kind of intervention or treatment, and that intervention or treatment produces some result in a test group relative to a control group with p=0.05, then the odds of getting that result simply by chance and not because the treatment or intervention actually had an effect are 5%.The practical effect of this is that there are two different ways of getting a p=0.05 result:
1. Find a treatment or intervention that actually works or
2. Test ~20 different (useless) interventions. Or test one useless intervention ~20 times.
A single p=0.05 result in isolation is useless because there is no way to know which of the two methods produced it.
This is why replication is so important. The odds of getting a p=0.05 result by chance is 5%. But the odds of getting TWO of them in sequential trials is 0.25%, and the odds of a positive result being the result of pure chance decrease exponentially with each subsequent replication.
> p=0.05 means that one POSITIVE result in 20 is going to be the result of chance and not causality
No, you still didn't get it. In the example above, a full 100% of positive results, 20 out of every 20, are the result of chance and not causality.
Your followup discussion is better, but your statement at the top doesn't work.
(Note also that there is an interaction between p-threshold and sample size which guarantees that, if you're investigating an effect that your sample size is not large enough to detect, any statistically significant result that you get will be several times stronger than the actual effect. They're also quite likely to have the wrong sign.)
Yep, you're right. I do think I understand this, but rendering it into words is turning out to be surprisingly challenging.
Let me try this one more time: p=0.05 means that there is a 5% chance that any one particular positive result is due to chance. If you test a false hypothesis repeatedly, or test multiple false hypotheses, then 5% of the time you will get false positives (at p=0.05).
However...
> Imagine a hypothetical scientist that is fundamentally confused about something important, so all hypotheses they generate are false. Yet, using p=0.05, 5% of those hypotheses will be "confirmed experimentally". In that case, it is not 5% of the "experimentally confirmed" hypotheses that are wrong -- it is full 100%.
This is not wrong, but it's a little misleading because you are presuming that all of the hypotheses being tested are false. If we're testing a hypothesis it's generally because we don't know whether or not it's true; we're trying to find out. That's why it's important to think of a positive result not as "confirmed experimentally" but rather as "not ruled out by this particular experimental result". It is only after failing to rule something out by multiple experiments that we can start to call it "confirmed". And nothing is ever 100% confirmed -- at best it is "not ruled out by the evidence so far".
In a purely random world, 5% of experiments are false positives, at p=0.05. None are true positives.
In a well ordered world with brilliant hypotheses, there are no false positives.
If more than 5% of experiments show positive results at p=0.05, some of them are probably true, so you can try to replicate them with lower p.
p=0.05 is a filter for "worth trying to replicate" (but even that is modulated by cost of replication vs value of result).
The crisis in science is largely that people confuse "publishable" with "probably true". Anything "probably better then random guessing" is publishable to help other researchers, but that doesn't mean it's probably true.
Yes, I think that is an excellent way to put it.
> The crisis in science is largely that people confuse "publishable" with "probably true".
I would put it slightly differently: people conflate "published in a top-tier peer-reviewed journal" with "true beyond reasonable dispute". They also conflate "not published in a top-tier peer-reviewed journal" with "almost certainly false."
But I think we're in substantial agreement here.
A p-value of .05 means that, under the assumption that the null hypothesis you specified is true, you just observed a result which lies at the 5th percentile of the outcome space, sorted along some metric (usually "extremity of outcome"). That is to say, out of all possible outcomes, only 5% of them are as "extreme" as, or more "extreme" than, the outcome you observed.
It doesn't tell you anything about the odds that any result is due to chance. It tells you how often the null hypothesis gives you a result that is "similar", by some definition, to the result you observed.
But I don't really see the relevance to this discussion?
Suppose you nail down a null hypothesis, define a similarity metric for data, run an experiment, and get some data. The p-value you calculate theoretically tells you this:
If the above-mentioned hypothesis is true, then X% of all data looks like your data
It doesn't tell you this:
If you have data that looks like your data, then there is an X% chance that the above-mentioned hypothesis is true
Those are two unrelated claims; one is not informative -- at all -- as to the other. The direction of implication is reversed between them.
Imagine that you're considering three hypotheses. You collect your data and make this calculation:
1. Hypothesis A says that data looks like what I collected 20% of the time.
2. Hypothesis B says that data looks like what I collected 45% of the time.
3. Hypothesis C says that data looks like what I collected 100% of the time.
Based only on this information, what are the odds that hypothesis A is correct? What are the odds that hypothesis C is correct? What are the odds that none of the three is correct?
> Hypothesis C says that data looks like what I collected 100% of the time.
What this tells you depends entirely on what hypothesis C actually is. For example, if C is "There is an invisible pink unicorn in the room, but everyone will deny seeing it because it's invisible" then you learn nothing by observing that everyone denies seeing the unicorn despite the fact that this is exactly what the theory predicts.
On the other hand, if C is a tweak to the Standard Model or GR that explains observations currently attributed to dark matter, that would be a very different situation.
But if you were able to do that, you wouldn't need to test the hypotheses. You'd already know they were good.
I'm intrigued as to why you picked those two examples. They differ in aesthetics without differing in implications, but you seem to want to highlight them as being different in an important way!
Well, let's start with the obvious: there is actual evidence for the existence of dark matter -- that's the entire reason that dark matter is discussed at all. There is no evidence for the existence of invisible pink unicorns. Not only is there no evidence for IPU's, the IPU hypothesis is specifically designed so that there cannot possibly be any. The IPU hypothesis is unfalsifiable by design. That's the whole point.
If the MOND hypothesis was true, what about the world would be different?
The whole reason we have a constant supply of theories attempting to explain observations currently attributed to dark matter in terms other than "dark matter" is that people feel the dark matter theory is stupid. There's nothing else to it. I assume you feel the same way about unicorns. What's the difference supposed to be?
> There is no evidence for the existence of invisible pink unicorns.
You need to be careful here too. The fact that a theory is false does not mean there is no evidence for that theory.
No, that's not true. The reason we have a "constant supply" of dark matter theories is that all of the extant theories have been falsified by observations, including MOND. If this were not the case, dark matter would be a solved problem and would no longer be in the news.
> The fact that a theory is false does not mean there is no evidence for that theory.
What makes you think the IPU theory is false? The whole point of the IPU hypothesis is that it is unfalsifiable.
This is the same thing, but with probabilities: "if A, then 5% chance of B" and "if B, then 5% chance of A". Those are two very different things.
p=0.05 means "if hypothesis is wrong, then 5% chance of published research". It does not mean "if published research, then 5% chance of wrong hypothesis"; but most people believe it does, including probably most scientists.
I would say "5% chance of positive result nonetheless" but yes, I do get this. I'm just having inordinate trouble rendering it into words.
Well, that's example is also introducing dependence, which is a tricky thing of course whenever we talk about chance and stats.
But there's also another issue - a statement like "5% of positive published results are by chance since we have a p<=0.05 standard" treats every set of results as if p=0.05, whereas some of them are considerably lower anyway. Though the point of bad actors cherry-picking to screw up the data also comes into play here.
(And of course, fully independent things in life are much harder to find than one might think at first.)
Imagine that a scientist is making experiments of the form: Does observable variable A correlate with observable variable B? Now imagine that there are billions of observable variables and almost all of them are not correlated. And imagine that there is no better way to come up with plausible correlations to test than randomly picking variables. Then it will take a very long time and a very large number of experiments to find a pair that is truly correlated. It will be inevitable that most positive results are bogus.
NHST testing inverts the probability logic, makes the 5% holy, and skims over the high probability of finding something that is not equal to a specific value. That procedure is then used for theory confirmation, while it was (in another form) meant for falsification. Everything is wrong about it, even if the experimental method is flawless. Hence the reproducibility crisis.
It takes a little bit of work to colour in equations but I hope more people start doing it (including me, I'd forgotten about it for a while)
I am kind of wondering if a semantic highlighting makes sense as well. You often end up with some implicit assignment of lowercase latin, uppercase latin, lowercase greek letters and such for certain meanings. Kinematic - xyzt for position in time, T_i(I_i) for the quaternion or transformation representing a certain joint of a robot.
But there's already such complex and varied typography in math I wonder if it would be kind of redundant. E.g. you don't need matching parentheses to be colored when they already come in different sets of matching heights.
In reality, it depends on your actual distribution, but the OP from this thread here is unreasonably conservative for something described as a "rule of thumb". Almost always, if you have at least 10 of every category, you can already discover every interesting thing that a rule of thumb will allow. And you probably could go with less. But if you want precision, you can't get it with rules of thumb.
The exponential bit applies to the probability densities as a function of the bounds themselves, i.e. how likely you are to fall x units away from the mean typically decreases exponentially with (some polynomial in) x.
Of course, this is all assuming a whole bunch of standard conditions on the data you're looking at (independence, identically distributed, bounded variance, etc.) and may not hold if these are violated.
What I'm asking about, I know I'm wrong about - I just want to know how I can derive that for myself.
However to answer your question more directly, the expected value is just another name for the average or mean of a random variable. In this case, the variable is your profit. Assume we’re betting a dollar per toss on coin flips and I win if it’s heads (everyone knows heads always wins, right?). The expected value is probability of heads * 1 - probability of tails * 1. If the coin is fair, the probabilities are the same so the expected value is zero.
Aside: sequences of random variables that are “fair bets” are called martingales and are incredibly useful. It’s a fair bet because, given all prior knowledge of the value of the variable thus far, the expected value of the next value you witness is the current value of the variable. You could imagine looking at a history of stock values. Given all that information, it’s a martingale (and thus a fair bet) if given that information your expected profit from investing is 0.
That skips over the distinction between "average" and "probability distribution", but those are nuances are probably better left for a proof of the central limit theorem.
See this https://stats.stackexchange.com/questions/416204/why-is-a-mi...
The Law of Large Numbers is about the average, so it's not relevant here (an average of +1 would mean you got heads every single time, which is extremely unlikely for large n).
If you are looking at the sum, then the value depends on whether the number of trials (n) is even or odd. If n is odd, you would indeed get two peaks at 1 and -1, and you would never get exactly 0. If n is even, you would get a peak at 0 and you would never get exactly 1 or -1.
The expected value (aka average) is a number, not a distribution. The expected value for the sum is 0 even when n is odd and you can't get exactly 0 -- that's just how the expected value works (in the same way that the "expected value" for the number of children in a family can be 2.5 even though a family can't have half a child). If you look at the probability density function for a single trial, then it does have two peaks at 1 and -1 (and is zero everywhere else).
The curve you refer to might be the normal approximation (https://en.wikipedia.org/wiki/Binomial_distribution#Normal_a...). It's true that the normal approximation for the distribution of the sum in your gambling game has a peak at 0 even when n is odd and the sum can't be exactly 0. That's because the normal approximation is a continuous approximation and it doesn't capture the discrete nature of the underlying distribution.
> Always keep the speed of convergence in mind when applying the law of large numbers.
Any ‘application’ of the LLN basically amounts to replacing some probalistic number derived from a bunch of random samples with the expected value of that number… and tacking on ‘for sufficiently large n’ as a caveat to your subsequent conclusions.
Figuring out whether, in practical cases, you will have a sufficiently large n that the conclusion is valid is a necessary step in the analysis.
The econometrics textbook I studied has more words “asymptotic” in it than there are pages. Oftentimes it’s impractical or even theoretically intractable to derive finite sample properties (and thus to answer when n is really large enough).
This is "as close" in an absolute sense, right?
If I take into account that the lottery value is 20x larger, and I'm targeting relative accuracy, then I need 2.5 million times as many samples?
- Your odds calculation is likely wrong. You assumed from the word "odds" that "odds ratio" was meant, (Odds=3 meaning "odds 3:1 against" corresponding to p=25%) but the phrase is "approximate odds 1 in X" (Odds=3 meaning "odds of 1 in 3 to win" meaning 33%) and recalculating results in the remarkably exact expected value of $80 which seems intentional?
- You phrase things in terms of variances, people will think more in terms of standard deviations. So 3.5 ± 1.7 vs $80 ± $12,526.
- Note that you try to make a direct comparison between those two but the two are in fact incomparable. The most direct comparison might be to subtract 1 from the die roll and multiply by $32, so that you have a 1/6 chance of winning $0, 1/6 of winning $32, ... 1/6 of winning $160. So then we have $80 ± $55 vs $80 ± $12,526. Then instead of saying you'd need 50 million more lottery tickets you'd actually say you need about 50 thousand more. This is closer to the "right ballpark" where you can tell that the whole lottery is expected to sell about 10,200,000 tickets on a good day.
- But where an article like this should really go is, "what are you using the numbers for?". In the case of the Texas lottery this is actually a strong constraint, they have to make sure that they make a "profit" (like, it's not a real profit, it probably goes to schools or something) on most lotteries, so you're actually trying to ensure that 5 sigma or so is less than the bias. So you've got a competition between $20 · n and 5 · $12,526 · √(n), or √(n) = 12526/4, n = 9.8 million. So that's what the Texas Lottery is targeting, right? So then we would calculate that the equivalent number of people that should play in the "roll a die linear lottery" we've constructed is 187, call it an even 200, if 200 people pay $100 for a lottery ticket on the linear lottery then we can pretty much always pay out even on a really bad day.
- So the 50,000x number that is actually correct is basically just saying that we can run a much smaller lottery, 50,000 times smaller, with that payoff structure. And there's something nice about phrasing it this way.
- To really get "law of large numbers" we should actually probably be looking at how much these distributions deviate from Gaussian, rather than complaining that the Gaussian is too wide? You can account for a wide Gaussian in a number of ways. But probably we want to take the cube root of the 3d cumulant, for example, try to argue when it "vanishes"? Except given the symmetry the 3rd cumulant for the die is probably 0 so you might need to go out to the 4th cumulant for the die -- and this might give a better explanation for the die converging more rapidly in "shape" to the mean, it doesn't just come close faster, it also becomes a Gaussian significantly faster because the payoff structure is symmetric about the mean.
(No, just joking. Actually 42 plus or minus.)