Posts in Statistics (20 found)
DYNOMIGHT 1 months ago

Dear PendingKetchup

PendingKetchup comments on my recent post on what it means for something to be heritable : The article seems pretty good at math and thinking through unusual implications, but my armchair Substack eugenics alarm that I keep in the back of my brain is beeping. Saying that variance was “invented for the purpose of defining heritability” is technically correct, but that might not be the best kind of correct in this case, because it was invented by the founder of the University of Cambridge Eugenics Society who had decided, presumably to support that project, that he wanted to define something called “heritability”. His particular formula for heritability is presented in the article as if it has odd traits but is obviously basically a sound thing to want to calculate, despite the purpose it was designed for. The vigorous “educational attainment is 40% heritable, well OK maybe not but it’s a lot heritable, stop quibbling” hand waving sounds like a person who wants to show but can’t support a large figure. And that framing of education, as something “attained” by people, rather than something afforded to or invested in them, is almost completely backwards at least through college. The various examples about evil despots and unstoppable crabs highlight how heritability can look large or small independent of more straightforward biologically-mechanistic effects of DNA. But they still give the impression that those are the unusual or exceptional cases. In reality, there are in fact a lot of evil crabs, doing things like systematically carting away resources from Black children’s* schools, and then throwing them in jail. We should expect evil-crab-based explanations of differences between people to be the predominant ones. *Not to say that being Black “is genetic”. Things from accent to how you style your hair to how you dress to what country you happen to be standing in all contribute to racial judgements used for racism. But “heritability” may not be the right tool to disentangle those effects. Dear PendingKetchup, Thanks for complimenting my math (♡), for reading all the way to the evil crabs, and for not explicitly calling me a racist or eugenicist. I also appreciate that you chose sincerity over boring sarcasm and that you painted such a vibrant picture of what you were thinking while reading my post. I hope you won’t mind if I respond in the same spirit. To start, I’d like to admit something. When I wrote that post, I suspected some people might have reactions similar to yours. I don’t like that. I prefer positive feedback! But I’ve basically decided to just let reactions like yours happen, because I don’t know how to avoid them without compromising on other core goals. It sounds like my post gave you a weird feeling. Would it be fair to describe it as a feeling that I’m not being totally upfront about what I really think about race / history / intelligence / biological determinism / the ideal organization of society? Because if so, you’re right. It’s not supposed to be a secret, but it’s true. Why? Well, you may doubt this, but when I wrote that post, my goal was that people who read it would come away with a better understanding of the meaning of heritability and how weird it is. That’s it. Do I have some deeper and darker motivations? Probably. If I probe my subconscious, I find traces of various embarrassing things like “draw attention to myself” or “make people think I am smart” or “after I die, live forever in the world of ideas through my amazing invention of blue-eye-seeking / human-growth-hormone-injecting crabs.” What I don’t find are any goals related to eugenics, Ronald Fisher, the heritability of educational attainment, if “educational attainment” is good terminology, racism, oppression, schools, the justice system, or how society should be organized. These were all non-goals for basically two reasons: My views on those issues aren’t very interesting or notable. I didn’t think anyone would (or should) care about them. Surely, there is some place in the world for things that just try to explain what heritability really means? If that’s what’s promised, then it seems weird to drop in a surprise morality / politics lecture. At the same time, let me concede something else. The weird feeling you got as you read my post might be grounded in statistical truth. That is, it might be true that many people who blog about things like heritability have social views you wouldn’t like. And it might be true that some of them pretend at truth-seeking but are mostly just charlatans out to promote those unliked-by-you social views. You’re dead wrong to think that’s what I’m doing. All your theories of things I’m trying to suggest or imply are unequivocally false. But given the statistical realities, I guess I can’t blame you too much for having your suspicions. So you might ask—if my goal is just to explain heritability, why not make that explicit? Why not have a disclaimer that says, “OK I understand that heritability is fraught and blah blah blah, but I just want to focus on the technical meaning because…”? One reason is that I think that’s boring and condescending. I don’t think people need me to tell them that heritability is fraught. You clearly did not need me to tell you that. Also, I don’t think such disclaimers make you look neutral. Everyone knows that people with certain social views (likely similar to yours) are more likely to give such disclaimers. And they apply the same style of statistical reasoning you used to conclude I might be a eugenicist. I don’t want people who disagree with those social views to think they can’t trust me. Paradoxically, such disclaimers often seem to invite more objections from people who share the views they’re correlated with, too. Perhaps that’s because the more signals we get that someone is on “our” side, the more we tend to notice ideological violations. (I’d refer here to the narcissism of small differences , though I worry you may find that reference objectionable.) If you want to focus on the facts, the best strategy seems to be serene and spiky: to demonstrate by your actions that you are on no one’s side, that you don’t care about being on anyone’s side, and that your only loyalty is to readers who want to understand the facts and make up their own damned mind about everything else. I’m not offended by your comment. I do think it’s a little strange that you’d publicly suggest someone might be a eugenicist on the basis of such limited evidence. But no one is forcing me to write things and put them on the internet. The reason I’m writing to you is that you were polite and civil and seem well-intentioned. So I wanted you to know that your world model is inaccurate. You seem to think that because my post did not explicitly support your social views, it must have been written with the goal of undermining those views. And that is wrong. The truth is, I wrote that post without supporting your (or any) social views because I think mixing up facts and social views is bad. Partly, that’s just an aesthetic preference. But if I’m being fully upfront, I also think it’s bad in the consequentialist sense that it makes the world a worse place. Why do I think this? Well, recall that I pointed out that if there were crabs that injected blue-eyed babies with human growth hormone, that would increase the heritability of height. You suggest I had sinister motives for giving this example, as if I was trying to conceal the corollary that if the environment provided more resources to people with certain genes (e.g. skin color) that could increase the heritability of other things (e.g. educational attainment). Do you really think you’re the only reader to notice that corollary? The degree to which things are “heritable” depends on the nature of society. This is a fact. It’s a fact that many people are not aware of. It’s also a fact that—I guess—fits pretty well with your social views. I wanted people to understand that. Not out of loyalty to your social views, but because it is true. It seems that you’re annoyed that I didn’t phrase all my examples in terms of culture war. I could have done that. But I didn’t, because I think my examples are easier to understand, and because the degree to which changing society might change the heritability of some trait is a contentious empirical question. But OK. Imagine I had done that. And imagine all the examples were perfectly aligned with your social views. Do you think that would have made the post more or less effective in convincing people that the fact we’re talking about is true? I think the answer is: Far less effective. I’ll leave you with two questions: Question 1: Do you care about the facts? Do you believe the facts are on your side? Question 2: Did you really think I wrote that post with with the goal of promoting eugenics? If you really did think that, then great! I imagine you’ll be interested to learn that you were incorrect. But just as you had an alarm beeping in your head as you read my post, I had one beeping in my head as I read your comment. My alarm was that you were playing a bit of a game. It’s not that you really think I wanted to promote eugenics, but rather that you’re trying to enforce a norm that everyone must give constant screaming support to your social views and anyone who’s even slightly ambiguous should be ostracized. Of course, this might be a false alarm! But if that is what you’re doing, I have to tell you: I think that’s a dirty trick, and a perfect example of why mixing facts and social views is bad. You may disagree with all my motivations. That’s fine. ( I won’t assume that means you are a eugenicist.) All I ask is that you disapprove accurately. xox dynomight My views on those issues aren’t very interesting or notable. I didn’t think anyone would (or should) care about them. Surely, there is some place in the world for things that just try to explain what heritability really means? If that’s what’s promised, then it seems weird to drop in a surprise morality / politics lecture.

0 views
DYNOMIGHT 2 months ago

Futarchy’s fundamental flaw — the market — the blog post

Here’s our story so far: Markets are a good way to know what people really think. When India and Pakistan started firing missiles at each other on May 7, I was concerned, what with them both having nuclear weapons. But then I looked at world market prices: See how it crashes on May 7? Me neither. I found that reassuring. But we care about lots of stuff that isn’t always reflected in stock prices, e.g. the outcomes of elections or drug trials. So why not create markets for those, too? If you create contracts that pay out $1 only if some drug trial succeeds, then the prices will reflect what people “really” think. In fact, why don’t we use markets to make decisions? Say you’ve invented two new drugs, but only have enough money to run one trial. Why don’t you create markets for both drugs, then run the trial on the drug that gets a higher price? Contracts for the “winning” drug are resolved based on the trial, while contracts in the other market are cancelled so everyone gets their money back. That’s the idea of Futarchy , which Robin Hanson proposed in 2007. Why don’t we? Well, maybe it won’t work. In 2022, I wrote a post arguing that when you cancel one of the markets, you screw up the incentives for how people should bid, meaning prices won’t reflect the causal impact of different choices. I suggested prices reflect “correlation” rather than causation, for basically the same reason this happens with observational statistics. This post, it was magnificent. It didn’t convince anyone. Years went by. I spent a lot of time reading Bourdieu and worrying about why I buy certain kinds of beer. Gradually I discovered that essentially the same point about futarchy had been made earlier by, e.g., Anders_H in 2015, abramdemski in 2017, and Luzka in 2021. In early 2025, I went to a conference and got into a bunch of (friendly) debates about this. I was astonished to find that verbally repeating the arguments from my post did not convince anyone. I even immodestly asked one person to read my post on the spot. (Bloggers: Do not do that.) That sort of worked. So, I decided to try again. I wrote another post called ” Futarky’s Futarchy’s fundamental flaw” . It made the same argument with more aggression, with clearer examples, and with a new impossibility theorem that showed there doesn’t even exist any alternate payout function that would incentivize people to bid according to their causal beliefs. That post… also didn’t convince anyone. In the discussion on LessWrong , many of my comments are upvoted for quality but downvoted for accuracy, which I think means, “nice try champ; have a head pat; nah.” Robin Hanson wrote a response , albeit without outward evidence of reading beyond the first paragraph. Even the people who agreed with me often seemed to interpret me as arguing that futarchy satisfies evidential decision theory rather than causal decision theory . Which was weird, given that I never mentioned either of those, don’t accept the premise the futarchy satisfies either of them, and don’t find the distinction helpful in this context. In my darkest moments, I started to wonder if I might fail to achieve worldwide consensus that futarchy doesn’t estimate causal effects. I figured I’d wait a few years and then launch another salvo. But then, legendary human Bolton Bailey decided to stop theorizing and take one of my thought experiments and turn it into an actual experiment. Thus, Futarchy’s fundamental flaw — the market was born. (You are now reading a blog post about that market.) I gave a thought experiment where there are two coins and the market is trying to pick the one that’s more likely to land heads. For one coin, the bias is known, while for the other coin there’s uncertainty. I claimed futarchy would select the worse / wrong coin, due to this extra uncertainty. Bolton formalized this as follows: There are two markets, one for coin A and one for coin B. Coin A is a normal coin that lands heads 60% of the time. Coin B is a trick coin that either always lands heads or always lands tails, we just don’t know which. There’s a 59% it’s an always-heads coin. Twenty-four hours before markets close, the true nature of coin B is revealed. After the markets closes, whichever coin has a higher price is flipped and contracts pay out $1 for heads and $0 for tails. The other market is cancelled so everyone gets their money back. Get that? Everyone knows that there’s a 60% chance coin A will land heads and a 59% chance coin B will land heads. But for coin A, that represents true “aleatoric” uncertainty, while for coin B that represents “epistemic” uncertainty due to a lack of knowledge. (See Bayes is not a phase for more on “aleatoric” vs. “epistemic” uncertainty.) Bolton created that market independently. At the time, we’d never communicated about this or anything else. To this day, I have no idea what he thinks about my argument or what he expected to happen. In the forum for the market, there was a lot of debate about “whalebait”. Here’s the concern: Say you’ve bought a lot of contracts for coin B, but it emerges that coin B is always-tails. If you have a lot of money, then you might go in at the last second and buy a ton of contracts on coin A to try to force the market price above coin B, so the coin B market is cancelled and you get your money back. The conversation seemed to converge towards the idea that this was whalebait. Though notice that if you’re buying contracts for coin A at any price above $0.60, you’re basically giving away free money. It could still work, but it’s dangerous and everyone else has an incentive to stop you. If I was betting in this market, I’d think that this was at least unlikely . Bolton posted about the market. When I first saw the rules, I thought it wasn’t a valid test of my theory and wasted a huge amount of Bolton’s time trying to propose other experiments that would “fix” it. Bolton was very patient, but I eventually realized that it was completely fine and there was nothing to fix. At the time, this is what the prices looked like: That is, at the time, both coins were priced at $0.60, which is not what I had predicted. Nevertheless, I publicly agreed that this was a valid test of my claims. I think this is a great test and look forward to seeing the results. Let me reiterate why I thought the markets were wrong and coin B deserved a higher price. There’s a 59% chance coin B would turns out to be all-heads. If that happened, then (absent whales being baited) I thought the coin B market would activate, so contracts are worth $1. So thats 59% × $1 = $0.59 of value. But if coin B turns out to be all-tails, I thought there is a good chance prices for coin B would drop below coin A, so the market is cancelled and you get your money back. So I thought a contract had to be worth more than $0.59. If you buy a contract for coin B for $0.70, then I think that’s worth Surely isn’t that low. So surely this is worth more than $0.59. More generally, say you buy a YES contract for coin B for $M. Then that contract would be worth It’s not hard to show that the breakeven price is Even if you thought was only 50%, then the breakeven price would still be $0.7421. Within a few hours, a few people bought contracts on coin B, driving up the price. Then, Quroe proposed creating derivative markets. In theory, if there was a market asking if coin A was going to resolve YES, NO, or N/A, supposedly people could arbitrage their bets accordingly and make this market calibrated. Same for a similar market on coin B. Thus, Futarchy’s Fundamental Fix - Coin A and Futarchy’s Fundamental Fix - Coin B came to be. These were markets in which people could bid on the probability that each coin would resolve YES, meaning the coin was flipped and landed heads, NO, meaning the coin was flipped and landed tails, or N/A, meaning the market was cancelled. Honestly, I didn’t understand this. I saw no reason that these derivative markets would make people bid their true beliefs. If they did, then my whole theory that markets reflect correlation rather than causation would be invalidated. Prices for coin B went up and down, but mostly up. Eventually, a few people created large limit orders, which caused things to stabilize. Here was the derivative market for coin A. And here it was market for coin B. During this period, not a whole hell of a lot happened. This brings us up to the moment of truth, when the true nature of coin B was to be revealed. At this point, coin B was at $0.90, even though everyone knows it only has a 59% chance of being heads. The nature of the coin was revealed. To show this was fair, Bolton did this by asking a bot to publicly generate a random number. Thus, coin B was determined to be always-heads. There were still 24 hours left to bid. At this point, a contract for coin B was guaranteed to pay out $1. The market quickly jumped to $1. I was right. Everyone knew coin A had a higher chance of being heads than coin B, but everyone bid the price of coin B way above coin A anyway. In the previous math box, we saw that the breakeven price should satisfy If you invert this and plug in M=$0.90, then you get I’ll now open the floor for questions. Isn’t this market unrealistic? Yes, but that’s kind of the point. I created the thought experiment because I wanted to make the problem maximally obvious, because it’s subtle and everyone is determined to deny that it exists. Isn’t this just a weird probability thing? Why does this show futarchy is flawed? The fact that this is possible is concerning. If this can happen, then futarchy does not work in general . If you want to claim that futarchy works, then you need to spell out exactly what extra assumptions you’re adding to guarantee that this kind of thing won’t happen. But prices did reflect causality when the market closed! Doesn’t that mean this isn’t a valid test? No. That’s just a quirk of the implementation. You can easily create situations that would have the same issue all the way through market close. Here’s one way you could do that: On average, this market will run for 30 days. (The length follows a geometric distribution ). Half the time, the market will close without the nature of coin B being revealed. Even when that happens, I claim the price for coin B will still be above coin A. If futarchy is flawed, shouldn’t you be able to show that without this weird step of “revealing” coin B? Yes. You should be able to do that, and I think you can. Here’s one way: First, have users generate public keys by running this command: Second, they should post the contents of the when asking for their bit. For example: Third, whoever is running the market should save that key as , pick a pit, and encrypt it like this: Users can then decrypt like this: Or you could use email… I think this market captures a dynamic that’s present in basically any use of futarchy: You have some information, but you know other information is out there. I claim that this market—will be weird. Say it just opened. If you didn’t get a bit, then as far as you know, the bias for coin B could be anywhere between 49% and 69%, with a mean of 59%. If you did get a bit, then it turns out that the posterior mean is 58.5% if you got a and 59.5% if you got a . So either way, your best guess is very close to 59%. However, the information for the true bias of coin B is out there! Surely coin B is more likely to end up with a higher price in situations where there are lots of bits. This means you should bid at least a little higher than your true belief, for the same reason as the main experiment—the market activating is correlated with the true bias of coin B. Of course, after the markets open, people will see each other’s bids and… something will happen. Initially, I think prices will be strongly biased for the above reasons. But as you get closer to market close, there’s less time for information to spread. If you are the last person to trade, and you know you’re the last person to trade, then you should do so based on your true beliefs. Except, everyone knows that there’s less time for information to spread. So while you are waiting till the last minute to reveal your true beliefs, everyone else will do the same thing. So maybe people sort of rush in at the last second? (It would be easier to think about this if implemented with batched auctions rather than a real-time market.) Anyway, while the game theory is vexing, I think there’s a mix of (1) people bidding higher than their true beliefs due to correlations between the final price and the true bias of coin B and (2) people “racing” to make the final bid before the markets close. Both of these seem in conflict with the idea of prediction markets making people share information and measuring collective beliefs. Why do you hate futarchy? I like futarchy. I think society doesn’t make decisions very well, and I think we should give much more attention to new ideas like futarchy that might help us do better. I just think we should be aware of its imperfections and consider variants (e.g. commiting to randomization ) that would resolve them. If I claim futarchy does reflect causal effects, and I reject this experiment as invalid, should I specify what restrictions I want to place on “valid” experiments (and thus make explicit the assumptions under which I claim futarchy works) since otherwise my claims are unfalsifiable? Markets are a good way to know what people really think. When India and Pakistan started firing missiles at each other on May 7, I was concerned, what with them both having nuclear weapons. But then I looked at world market prices: See how it crashes on May 7? Me neither. I found that reassuring. But we care about lots of stuff that isn’t always reflected in stock prices, e.g. the outcomes of elections or drug trials. So why not create markets for those, too? If you create contracts that pay out $1 only if some drug trial succeeds, then the prices will reflect what people “really” think. In fact, why don’t we use markets to make decisions? Say you’ve invented two new drugs, but only have enough money to run one trial. Why don’t you create markets for both drugs, then run the trial on the drug that gets a higher price? Contracts for the “winning” drug are resolved based on the trial, while contracts in the other market are cancelled so everyone gets their money back. That’s the idea of Futarchy , which Robin Hanson proposed in 2007. Why don’t we? Well, maybe it won’t work. In 2022, I wrote a post arguing that when you cancel one of the markets, you screw up the incentives for how people should bid, meaning prices won’t reflect the causal impact of different choices. I suggested prices reflect “correlation” rather than causation, for basically the same reason this happens with observational statistics. This post, it was magnificent. It didn’t convince anyone. Years went by. I spent a lot of time reading Bourdieu and worrying about why I buy certain kinds of beer. Gradually I discovered that essentially the same point about futarchy had been made earlier by, e.g., Anders_H in 2015, abramdemski in 2017, and Luzka in 2021. In early 2025, I went to a conference and got into a bunch of (friendly) debates about this. I was astonished to find that verbally repeating the arguments from my post did not convince anyone. I even immodestly asked one person to read my post on the spot. (Bloggers: Do not do that.) That sort of worked. So, I decided to try again. I wrote another post called ” Futarky’s Futarchy’s fundamental flaw” . It made the same argument with more aggression, with clearer examples, and with a new impossibility theorem that showed there doesn’t even exist any alternate payout function that would incentivize people to bid according to their causal beliefs. There are two markets, one for coin A and one for coin B. Coin A is a normal coin that lands heads 60% of the time. Coin B is a trick coin that either always lands heads or always lands tails, we just don’t know which. There’s a 59% it’s an always-heads coin. Twenty-four hours before markets close, the true nature of coin B is revealed. After the markets closes, whichever coin has a higher price is flipped and contracts pay out $1 for heads and $0 for tails. The other market is cancelled so everyone gets their money back. Let coin A be heads with probability 60%. This is public information. Let coin B be an ALWAYS HEADS coin with probability 59% and ALWAYS TAILS coin with probability 41%. This is a secret. Every day, generate a random integer between 1 and 30. If it’s 1, immediately resolve the markets. It it’s 2, reveal the nature of coin B. If it’s between 3 and 30, do nothing. Let coin A be heads with probability 60%. This is public information. Sample 20 random bits, e.g. . Let coin B be heads with probability (49+N)% where N is the number of bits. do not reveal these bits publicly. Secretly send these bits to the first 20 people who ask.

0 views
DYNOMIGHT 2 months ago

Heritability puzzlers

The heritability wars have been a-raging. Watching these, I couldn’t help but notice that there’s near-universal confusion about what “heritable” means. Partly, that’s because it’s a subtle concept. But it also seems relevant that almost all explanations of heritability are very, very confusing. For example, here’s Wikipedia’s definition : Any particular phenotype can be modeled as the sum of genetic and environmental effects: Phenotype ( P ) = Genotype ( G ) + Environment ( E ). Likewise the phenotypic variance in the trait – Var ( P ) – is the sum of effects as follows: Var( P ) = Var( G ) + Var( E ) + 2 Cov( G , E ). In a planned experiment Cov( G , E ) can be controlled and held at 0. In this case, heritability, H ², is defined as H ² = Var( G ) / Var( P ) H ² is the broad-sense heritability. Do you find that helpful? I hope not, because it’s a mishmash of undefined terminology, unnecessary equations, and borderline-false statements. If you’re in the mood for a mini-polemic: Reading this almost does more harm than good. While the final definition is correct, it never even attempts to explain what G and P are, it gives an incorrect condition for when the definition applies, and instead mostly devotes itself to an unnecessary digression about environmental effects. The rest of the page doesn’t get much better. Despite being 6700 words long, I think it would be impossible to understand heritability simply by reading it. Meanwhile, some people argue that heritability is meaningless for human traits like intelligence or income or personality. They claim that those traits are the product of complex interactions between genes and the environment and it’s impossible to disentangle the two. These arguments have always struck me as “suspiciously convenient”. I figured that the people making them couldn’t cope with the hard reality that genes are very important and have an enormous influence on what we are. But I increasingly feel that the skeptics have a point. While I think it’s a fact that most human traits are substantially heritable, it’s also true the technical definition of heritability is really weird, and simply does not mean what most people think it means. In this post, I will explain exactly what heritability is, while assuming no background. I will skip everything that can be skipped but—unlike most explanations—I will not skip things that can’t be skipped. Then I’ll go through a series of puzzles demonstrating just how strange heritability is. How tall you are depends on your genes, but also on what you eat, what diseases you got as a child, and how much gravity there is on your home planet. And all those things interact. How do you take all that complexity and reduce it to a single number, like “80% heritable”? The short answer is: Statistical brute force. The long answer is: Read the rest of this post. It turns out that the hard part of heritability isn’t heritability. Lurking in the background is a slippery concept known as a genotypic value . Discussions of heritability often skim past these. Quite possibly, just looking at the words “genotypic value”, you are thinking about skimming ahead right now. Resist that urge! Genotypic values are the core concept, and without them you cannot possibly understand heritability. For any trait, your genotypic value is the “typical” outcome if someone with your DNA were raised in many different random environments. In principle, if you wanted to know your genotypic height, you’d need to do this: Since you can’t / shouldn’t do that, you’ll never know your genotypic height. But that’s how it’s defined in principle—the average height someone with your DNA would grow to in a random environment. If you got lots of food and medical care as a child, your actual height is probably above your genotypic height. If you suffered from rickets, your actual height is probably lower than your genotypic height. Comfortable with genotypic values? OK. Then (broad-sense) heritability is easy. It’s the ratio Here, is the variance , basically just how much things vary in the population. Among all adults worldwide, is around 50 cm². (Incidentally, did you know that variance was invented for the purpose of defining heritability?) Meanwhile, is how much genotypic height varies in the population. That might seem hopeless to estimate, given that we don’t know anyone’s genotypic height. But it turns out that we can still estimate the variance using, e.g., pairs of adopted twins, and it’s thought to be around 40 cm². If we use those numbers, the heritability of height would be People often convert this to a percentage and say “height is 80% heritable”. I’m not sure I like that, since it masks heritability’s true nature as a ratio. But everyone does it, so I’ll do it too. People who really want to be intimidating might also say, “genes explain 80% of the variance in height”. Of course, basically the same definition works for any trait, like weight or income or fondness for pseudonymous existential angst science blogs. But instead of replacing “height” with “trait”, biologists have invented the ultra-fancy word “phenotype” and write The word “phenotype” suggests some magical concept that would take years of study to understand. But don’t be intimidated. It just means the actual observed value of some trait(s). You can measure your phenotypic height with a tape measure. Let me make two points before moving on. First, this definition of heritability assumes nothing. We are not assuming that genes are independent of the environment or that “genotypic effects” combine linearly with “environmental effects”. We are not assuming that genes are in Hardy-Weinberg equilibrium , whatever that is. No. I didn’t talk about that stuff because I don’t need to. There are no hidden assumptions. The above definition always works. Second, many normal English words have parallel technical meanings, such as “field” , “insulator” , “phase” , “measure” , “tree” , or “stack” . Those are all nice, because they’re evocative and it’s almost always clear from context which meaning is intended. But sometimes, scientists redefine existing words to mean something technical that overlaps but also contradicts the normal meaning, as in “salt” , “glass” , “normal” , “berry” , or “nut” . These all cause confusion, but “heritability” must be the most egregious case in all of science. Before you ever heard the technical definition of heritability, you surely had some fuzzy concept in your mind. Personally, I thought of heritability as meaning how many “points” you get from genes versus the environment. If charisma was 60% heritable, I pictured each person has having 10 total “charisma points”, 6 of which come from genes, and 4 from the environment: If you take nothing else from this post, please remember that the technical definition of heritability does not work like that . You might hope that if we add some plausible assumptions, the above ratio-based definition would simplify into something nice and natural, that aligns with what “heritability” means in normal English. But that does not happen. If that’s confusing, well, it’s not my fault. Not sure what’s happening here, but it seems relevant. So “heritability” is just the ratio of genotypic and phenotypic variance. Is that so bad? I think… maybe? How heritable is eye color? Close to 100%. This seems obvious, but let’s justify it using our definition that . Well, people have the same eye color, no matter what environment they are raised in. That means that genotypic eye color and phenotypic eye color are the same thing. So they have the same variance, and the ratio is 1. Nothing tricky here. How heritable is speaking Turkish? Close to 0%. Your native language is determined by your environment. If you grow up in a family that speaks Turkish, you speak Turkish. Genes don’t matter. Of course, there are lots of genes that are correlated with speaking Turkish, since Turks are not, genetically speaking, a random sample of the global population. But that doesn’t matter, because if you put Turkish babies in Korean households, they speak Korean. Genotypic values are defined by what happens in a random environment, which breaks the correlation between speaking Turkish and having Turkish genes. Since 1.1% of humans speak Turkish, the genotypic value for speaking Turkish is around 0.011 for everyone, no matter their DNA. Since that’s basically constant, the genotypic variance is near zero, and heritability is near zero. How heritable is speaking English? Perhaps 30%. Probably somewhere between 10% and 50%. Definitely more than zero. That’s right. Turkish isn’t heritable but English is. Yes it is . If you ask an LLM, it will tell you that the heritability of English is zero. But the LLM is wrong and I am right. Why? Let me first acknowledge that Turkish is a little bit heritable. For one thing, some people have genes that make them non-verbal. And there’s surely some genetic basis for being a crazy polyglot that learns many languages for fun. But speaking Turkish as a second language is quite rare , meaning that the genotypic value of speaking Turkish is close to 0.011 for almost everyone. English is different. While only 1 in 20 people in the world speak English as a first language, 1 in 7 learn it as a second language. And who does that? Educated people. Some argue the heritability of educational attainment is much lower. I’d like to avoid debating the exact numbers, but note that these lower numbers are usually estimates of “narrow-sense” heritability rather than “broad-sense” heritability as we’re talking about. So they should be lower. (I’ll explain the difference later.) It’s entirely possible that broad-sense heritability is lower than 40%, but everyone agrees it’s much larger than zero. So the heritability of English is surely much larger than zero, too. Say there’s an island where genes have no impact on height. How heritable is height among people on this island? There’s nothing tricky here. Say there’s an island where genes entirely determine height. How heritable is height? Again, nothing tricky. Say there’s an island where neither genes nor the environment influence height and everyone is exactly 165 cm tall. How heritable is height? It’s undefined. In this case, everyone has exactly the same phenotypic and genotypic height, namely 165 cm. Since those are both constant, their variance is zero and heritability is zero divided by zero. That’s meaningless. Say there’s an island where some people have genes that predispose them to be taller than others. But the island is ruled by a cruel despot who denies food to children with taller genes, so that on average, everyone is 165 ± 5 cm tall. How heritable is height? On this island, everyone has a genotypic height of 165 cm. So genotypic variance is zero, but phenotypic variance is positive, due to the ± 5 cm random variation. So heritability is zero divided by some positive number. Say there’s an island where some people have genes that predispose them to be tall and some have genes that predispose them to be short. But, the same genes that make you tall also make you semi-starve your children, so in practice everyone is exactly 165 cm tall. How heritable is height? ∞%. Not 100%, mind you, infinitely heritable. To see why, note that if babies with short/tall genes are adopted by parents with short/tall genes, there are four possible cases. If a baby with short genes is adopted into random families, they will be shorter on average than if a baby with tall genes. So genotypic height varies. However, in reality, everyone is the same height, so phenotypic height is constant. So genotypic variance is positive while phenotypic variance is zero. Thus, heritability is some positive number divided by zero, i.e. infinity. (Are you worried that humans are “diploid”, with two genes (alleles) at each locus, one from each biological parent? Or that when there are multiple parents, they all tend to have thoughts on the merits of semi-starvation? If so, please pretend people on this island reproduce asexually. Or, if you like, pretend that there’s strong assortative mating so that everyone either has all-short or all-tall genes and only breeds with similar people. Also, don’t fight the hypothetical.) Say there are two islands. They all live the same way and have the same gene pool, except people on island A have some gene that makes them grow to be 150 ± 5 cm tall, while on island B they have a gene that makes them grow to be 160 ± 5 cm tall. How heritable is height? It’s 0% for island A and 0% for island B, and 50% for the two islands together. Why? Well on island A, everyone has the same genotypic height, namely 150 cm. Since that’s constant, genotypic variance is zero. Meanwhile, phenotypic height varies a bit, so phenotypic variance is positive. Thus, heritability is zero. For similar reasons, heritability is zero on island B. But if you put the two islands together, half of people have a genotypic height of 150 cm and half have a genotypic height of 160 cm, so suddenly (via math) genotypic variance is 25 cm². There’s some extra random variation so (via more math) phenotypic variance turns out to be 50 cm². So heritability is 25 / 50 = 50%. If you combine the populations, then genotypic variance is Meanwhile phenotypic variance is Say there’s an island where neither genes nor the environment influence height. Except, some people have a gene that makes them inject their babies with human growth hormone, which makes them 5 cm taller. How heritable is height? True, people with that gene will tend be taller. And the gene is causing them to be taller. But if babies are adopted into random families, it’s the genes of the parents that determine if they get injected or not. So everyone has the same genotypic height, genotypic variance is zero, and heritability is zero. Suppose there’s an island where neither genes nor the environment influence height. Except, some people have a gene that makes them, as babies, talk their parents into injecting them with human growth hormone. The babies are very persuasive. How heritable is height? We’re back to 100%. The difference with the previous scenario is that now babies with that gene get injected with human growth hormone no matter who their parents are. Since nothing else influences height, genotype and phenotype are the same, have the same variance, and heritability is 100%. Suppose there’s an island where neither genes nor the environment influence height. Except, there are crabs that seek out blue-eyed babies and inject them with human growth hormone. The crabs, they are unstoppable. How heritable is height? Again, 100%. Babies with DNA for blue eyes get injected. Babies without DNA for blue eyes don’t. Since nothing else influences height, genotype and phenotype are the same and heritability is 100%. Note that if the crabs were seeking out parents with blue eyes and then injecting their babies, then height would be 0% heritable. It doesn’t matter that human growth hormone is weird thing that’s coming from outside the baby. It doesn’t matter if we think crabs should be semantically classified as part of “the environment”. It doesn’t matter that heritability would drop to zero if you killed all the crabs, or that the direct causal effect of the relevant genes has nothing to do with height. Heritability is a ratio and doesn’t care. So heritability can be high even when genes have no direct causal effect on the trait in question. It can be low even when there is a strong direct effect. It changes when the environment changes. It even changes based on how you group people together. It can be larger than 100% or even undefined. Even so, I’m worried people might interpret this post as a long way of saying heritability is dumb and bad, trolololol . So I thought I’d mention that this is not my view. Say a bunch of companies create different LLMs and train them on different datasets. Some of the resulting LLMs are better at writing fiction than others. Now I ask you, “What percentage of the difference in fiction writing performance is due to the base model code, rather than the datasets or the GPUs or the learning rate schedules?” That’s a natural question. But if you put it to an AI expert, I bet you’ll get a funny look. You need code and data and GPUs to make an LLM. None of those things can write fiction by themselves. Experts would prefer to think about one change at a time: Given this model, changing the dataset in this way changes fiction writing performance this much. Similarly, for humans, I think what we really care about is interventions. If we changed this gene, could we eliminate a disease? If we educate children differently, can we make them healthier and happier? No single number can possibly contain all that information. But heritability is something . I think of it as saying how much hope we have to find an intervention by looking at changes in current genes or current environments. If heritability is high, then given current typical genes , you can’t influence the trait much through current typical environmental changes . If you only knew that eye color was 100% heritable, that means you won’t change your kid’s eye color by reading to them, or putting them on a vegetarian diet, or moving to higher altitude. But it’s conceivable you could do it by putting electromagnets under their bed or forcing them to communicate in interpretive dance. If heritability is high, that also means that given current typical environments you can influence the trait through current typical genes . If the world was ruled by an evil despot who forced red-haired people to take pancreatic cancer pills, then pancreatic cancer would be highly heritable. And you could change the odds someone gets pancreatic cancer by swapping in existing genes for black hair. If heritability is low, that means that given current typical environments , you can’t cause much difference through current typical genetic changes . If we only knew that speaking Turkish was ~0% heritable, that means that doing embryo selection won’t much change the odds that your kid speaks Turkish. If heritability is low, that also means that given current typical genes , you might be able change the trait through current typical environmental changes . If we only know that speaking Turkish was 0% heritable, then that means there might be something you could do to change the odds your kid speaks Turkish, e.g. moving to Turkey. Or, it’s conceivable that it’s just random and moving to Turkey wouldn’t do anything. But be careful. Just because heritability is high doesn’t mean that changing genes is easy. And just because heritability is low doesn’t mean that changing the environment is easy. And heritability doesn’t say anything about non-typical environments or non-typical genes. If an evil despot is giving all the red-haired people cancer pills, perhaps we could solve that by intervening on the despot. And if you want your kid to speak Turkish, it’s possible that there’s some crazy genetic modifications that would turn them into unstoppable Turkish learning machine. Heritability has no idea about any of that, because it’s just an observational statistic based on the world as it exists today. Heritability: Five Battles by Steven Byrnes. Covers similar issues in way that’s more connected to the world and less shy about making empirical claims. A molecular genetics perspective on the heritability of human behavior and group differences by Alexander Gusev. I find the quantitative genetics literature to be incredibly sloppy about notation and definitions and math. (Is this why LLMs are so bad at it?) This is the only source I’ve found that didn’t drive me completely insane. This post focused on “broad-sense” heritability. But there a second heritability out there, called “narrow-sense”. Like broad-sense heritability, we can define the narrow-sense heritability of height as a ratio: The difference is that rather than having height in the numerator, we now have “additive height”. To define that, imagine doing the following for each of your genes, one at a time: For example, say overall average human height is 150 cm, but when you insert gene #4023 from yourself into random embryos, their average height is 149.8 cm. Then the additive effect of your gene #4023 is -0.2 cm. Your “additive height” is average human height plus the sum of additive effects for each of your genes. If the average human height is 150 cm, you have one gene with a -0.2 cm additive effect, another gene with a +0.3 cm additive effect and the rest of your genes have no additive effect, then your “additive height” is 150 cm - 0.2 cm + 0.3 cm = 150.1 cm. Note: This terminology of “additive height” is non-standard. People usually define narrow-sense heritability using “additive effects ”, which are the same thing but without including the mean. This doesn’t change anything since adding a constant doesn’t change the variance. But it’s easier to say “your additive height is 150.1 cm” rather than “the additive effect of your genes on height is +0.1 cm” so I’ll do that. Honestly, I don’t think the distinction between “broad-sense” and “narrow-sense” heritability is that important. We’ve already seen that broad-sense heritability is weird, and narrow-sense heritability is similar but different. So it won’t surprise you to learn that narrow-sense heritability is differently -weird. But if you really want to understand the difference, I can offer you some more puzzles. Say there’s an island where people have two genes, each of which is equally likely to be A or B. People are 100 cm tall if they have an AA genotype, 150 cm tall if they have an AB or BA genotype, and 200 cm tall if they have a BB genotype. How heritable is height? Both broad and narrow-sense heritability are 100%. The explanation for broad-sense heritability is like many we’ve seen already. Genes entirely determine someone’s height, and so genotypic and phenotypic height are the same. For narrow-sense heritability, we need to calculate some additive heights. The overall mean is 150 cm, each A gene has an additive effect of -25 cm, and each B gene has an additive effect of +25 cm. But wait! Let’s work out the additive height for all four cases: Since additive height is also the same as phenotypic height, narrow-sense heritability is also 100%. In this case, the two heritabilities were the same. At a high level, that’s because the genes act independently. When there are “gene-gene” interactions, you tend to get different numbers. Say there’s an island where people have two genes, each of which is equally likely to be A or B. People with AA or BB genomes are 100 cm, while people with AB or BA genomes are 200 cm. How heritable is height? Broad-sense heritability is 100%, while narrow-sense heritability is 0%. You know the story for broad-sense heritability by now. For narrow-sense heritability, we need to do a little math. So everyone has an additive height of 150 cm, no matter their genes. That’s constant, so narrow-sense heritability is zero. I think basically for two reasons: First, for some types of data (twin studies) it’s much easier to estimate broad-sense heritability. For other types of data (GWAS) it’s much easier to estimate narrow-sense heritability. So we take what we can get. Second, they’re useful for different things. Broad-sense heritability is defined by looking at what all your genes do together. That’s nice, since you are the product of all your genes working together. But combinations of genes are not well-preserved by reproduction. If you have a kid, then they breed with someone, their kids breed with other people, and so on. Generations later, any special combination of genes you might have is gone. So if you’re interested in the long-term impact of you having another kid, narrow-sense heritability might be the way to go. (Sexual reproduction doesn’t really allow for preserving the genetics that make you uniquely “you”. Remember, almost all your genes are shared by lots of other people. If you have any unique genes, that’s almost certainly because they have deleterious de-novo mutations. From the perspective of evolution, your life just amounts to a tiny increase or decrease in the per-locus population frequencies of your individual genes. The participants in the game of evolution are genes. Living creatures like you are part of the playing field. Food for thought.) Phenotype ( P ) is never defined. This is a minor issue, since it just means “trait”. Genotype ( G ) is never defined. This is a huge issue, since it’s very tricky and heritability makes no sense without it. Environment ( E ) is never defined. This is worse than it seems, since in heritability, different people use “environment” and E to refer to different things. When we write P = G + E , are we assuming some kind of linear interaction? The text implies not, but why? What does this equation mean? If this equation is always true, then why do people often add other stuff like G × E on the right? The text states that if you do a planned experiment (how?) and make Cov( G , E ) = 0, then heritability is Var( G ) / Var( P ). But in fact, heritability is always defined that way. You don’t need a planned experiment and it’s fine if Cov( G , E ) ≠ 0. And—wait a second—that definition doesn’t refer to environmental effects at all. So what was the point of introducing them? What was the point of writing P = G + E ? What are we doing? Create a million embryonic clones of yourself. Implant them in the wombs of randomly chosen women around the world who were about to get pregnant on their own. Convince them to raise those babies exactly like a baby of their own. Wait 25 years, find all your clones and take their average height. If heritability is high, then given current typical genes , you can’t influence the trait much through current typical environmental changes . If you only knew that eye color was 100% heritable, that means you won’t change your kid’s eye color by reading to them, or putting them on a vegetarian diet, or moving to higher altitude. But it’s conceivable you could do it by putting electromagnets under their bed or forcing them to communicate in interpretive dance. If heritability is high, that also means that given current typical environments you can influence the trait through current typical genes . If the world was ruled by an evil despot who forced red-haired people to take pancreatic cancer pills, then pancreatic cancer would be highly heritable. And you could change the odds someone gets pancreatic cancer by swapping in existing genes for black hair. If heritability is low, that means that given current typical environments , you can’t cause much difference through current typical genetic changes . If we only knew that speaking Turkish was ~0% heritable, that means that doing embryo selection won’t much change the odds that your kid speaks Turkish. If heritability is low, that also means that given current typical genes , you might be able change the trait through current typical environmental changes . If we only know that speaking Turkish was 0% heritable, then that means there might be something you could do to change the odds your kid speaks Turkish, e.g. moving to Turkey. Or, it’s conceivable that it’s just random and moving to Turkey wouldn’t do anything. Heritability: Five Battles by Steven Byrnes. Covers similar issues in way that’s more connected to the world and less shy about making empirical claims. A molecular genetics perspective on the heritability of human behavior and group differences by Alexander Gusev. I find the quantitative genetics literature to be incredibly sloppy about notation and definitions and math. (Is this why LLMs are so bad at it?) This is the only source I’ve found that didn’t drive me completely insane. Find a million random women in the world who just became pregnant. For each of them, take your gene and insert it into the embryo, replacing whatever was already at that gene’s locus. Convince everyone to raise those babies exactly like a baby of their own. Wait 25 years, find all the resulting people, and take the difference of their average height from overall average height. The overall mean height is 150 cm. If you take a random embryo and replace one gene with A, then the there’s a 50% chance the other gene is A, so they’re 100 cm, and there’s a 50% chance the other gene is B, so they’re 200 cm, for an average of 150 cm. Since that’s the same as the overall mean, the additive effect of an A gene is +0 cm. By similar logic, the additive effect of a B gene is also +0 cm.

0 views
DHH 3 months ago

Linux crosses magic market share threshold in US

According to Statcounter, Linux has claimed 5% market share of desktop computing in the US. That's double of where it was just three years ago. Really impressive. Windows is still dominant at 63%, and Apple sit at 26%. But for the latter, it's quite a drop from their peak of 33% in June 2023

0 views
DYNOMIGHT 4 months ago

Futarchy’s fundamental flaw

Say you’re Robyn Denholm , chair of Tesla’s board. And say you’re thinking about firing Elon Musk. One way to make up your mind would be to have people bet on Tesla’s stock price six months from now in a market where all bets get cancelled unless Musk is fired . Also, run a second market where bets are cancelled unless Musk stays CEO . If people bet on higher stock prices in Musk-fired world, maybe you should fire him. That’s basically Futarchy : Use conditional prediction markets to make decisions. People often argue about fancy aspects of Futarchy. Are stock prices all you care about? Could Musk use his wealth to bias the market? What if Denholm makes different bets in the two markets, and then fires Musk (or not) to make sure she wins? Are human values and beliefs somehow inseparable? My objection is more basic: It doesn’t work. You can’t use conditional predictions markets to make decisions like this, because conditional prediction markets reveal probabilistic relationships, not causal relationships. The whole concept is faulty. There are solutions—ways to force markets to give you causal relationships. But those solutions are painful and I get the shakes when I see everyone acting like you can use prediction markets to conjure causal relationships from thin air, almost for free. I wrote about this back in 2022 , but my argument was kind of sprawling and it seems to have failed to convince approximately everyone. So thought I’d give it another try, with more aggression. In prediction markets, people trade contracts that pay out if some event happens. There might be a market for “Dynomight comes out against aspartame by 2027” contracts that pay out $1 if that happens and $0 if it doesn’t. People often worry about things like market manipulation, liquidity, or herding. Those worries are fair but boring, so let’s ignore them. If a market settles at $0.04, let’s assume that means the “true probability” of the event is 4%. (I pause here in recognition of those who need to yell about Borel spaces or von Mises axioms or Dutch book theorems or whatever. Get it all out. I value you.) Right. Conditional prediction markets are the same, except they get cancelled unless some other event happens. For example, the “Dynomight comes out against aspartame by 2027” market might be conditional on “Dynomight de-pseudonymizes”. If you buy a contract for $0.12 then: Let’s again assume that if a conditional prediction market settles at $0.12, that means the “true” conditional probability is 12%. But hold on. If we assume that conditional prediction markets give flawless conditional probabilities, then what’s left to complain about? Simple. Conditional probabilities are the wrong thing. If P(A|B)=0.9, that means that if you observe B, then there’s a 90% chance of A. That doesn’t mean anything about the chances of A if you do B. In the context of statistics, everyone knows that correlation does not imply causation . That’s a basic law of science. But really, it’s just another way of saying that conditional probabilities are not what you need to make decisions . And that’s true no matter where the conditional probabilities come from. For example, people with high vitamin D levels are only ~56% as likely to die in a given year as people with low vitamin D levels. Does that mean taking vitamin D halves your risk of death? No, because those people are also thinner, richer, less likely to be diabetic, less likely to smoke, more likely to exercise, etc. To make sure we’re seeing the effects of vitamin D itself, we run randomized trials. Those suggest it might reduce the risk of death a little. (I take it.) Futarchy has the same flaw. Even if you think vitamin D does nothing, if there’s a prediction market for if some random person dies, you should pay much less if the market is conditioned on them having high vitamin D. But you should do that mostly because they’re more likely to be rich and thin and healthy, not because of vitamin D itself. If you like math, conditional prediction markets give you P(A|B). But P(A|B) doesn’t tell you what will happen if you do B. That’s a completely different number with a different notation , namely P(A|do(B)). Generations of people have studied the relationship between P(A|B) and P(A|do(B)). We should pay attention to them. Say people bet for a lower Tesla stock price when you condition on Musk being fired. Does that mean they think that firing Musk would hurt the stock price? No, because there could be reverse causality—the stock price dropping might cause him to be fired. You can try to fight this using the fact that things in the future can’t cause things in the past. That is, you can condition on Musk being fired next week and bet on the stock price six months from now. That surely helps, but you still face other problems. Here’s another example of how lower prices in Musk-fired world may not indicate that firing Musk hurts the stock price. Suppose: You think Musk is a mildly crappy CEO. If he’s fired, he’ll be replaced with someone slightly better, which would slightly increase Tesla’s stock price. You’ve heard rumors that Robyn Denholm has recently decided that she hates Musk and wants to dedicate her life to destroying him. Or maybe not, who knows. If Denholm fired Musk, that would suggest the rumors are true. So she might try to do other things to hurt him, such as trying to destroy Tesla to erase his wealth. So in this situation, Musk being fired leads to lower stock prices even though firing Musk itself would increase the stock price. Or suppose you run prediction markets for the risk of nuclear war, conditional on Trump sending the US military to enforce a no-fly zone over Ukraine (or not). When betting in these markets, people would surely consider the risk that direct combat between the US and Russian militaries could escalate into nuclear war. That’s good (the considering), but people would also consider that no one really knows exactly what Trump is thinking. If he declared a no-fly zone, that would suggest that he’s feeling feisty and might do other things that could also lead to nuclear war. The markets wouldn’t reflect the causal impact of a no-fly zone alone, because conditional probabilities are not causal. So far nothing has worked. But what if we let the markets determine what action is taken? If we pre-commit that Musk will be fired (or not) based on market prices, you might hope that something nice happens and magically we get causal probabilities. I’m pro-hope, but no such magical nice thing happens. Thought experiment . Imagine there’s a bent coin that you guess has a 40% chance of landing heads. And suppose I offer to sell you a contract. If you buy it, we’ll flip the coin and you get $1 if it’s heads and $0 otherwise. Assume I’m not doing anything tricky like 3D printing weird-looking coins. If you want, assume I haven’t even seen the coin. You’d pay something like $0.40 for that contract, right? (Actually, knowing my readers, I’m pretty sure you’re all gleefully formulating other edge cases. But I’m also sure you see the point that I’m trying to make. If you need to put the $0.40 in escrow and have the coin-flip performed by a Cenobitic monk, that’s fine.) Now imagine a variant of that thought experiment . It’s the same setup, except if you buy the contract, then I’ll have the coin laser-scanned and ask a supercomputer to simulate millions of coin flips. If more than half of those simulated flips are heads, the bet goes ahead. Otherwise, you get your money back. Now you should pay at least $0.50 for the contract, even though you only think there’s a 40% chance the coin will land heads. Why? This is a bit subtle, but you should pay more because you don’t know the true bias of the coin. Your mean estimate is 40%. But it could be 20%, or 60%. After the coin is laser-scanned, the bet only activates if there’s at least a 50% chance of heads. So the contract is worth at least $0.50, and strictly more as long as you think it’s possible the coin has a bias above 50%. Suppose b is the true bias of the coin (which the supercomputer will compute). Then your expected return in this game is 𝔼[max(b, 0.50)] = 0.50 + 𝔼[max(b-0.50, 0)] , where the expectations reflect your beliefs over the true bias of the coin. Since 𝔼[max(b-0.50, 0)] is never less than zero, the contract is always worth at least $0.50. If you think there’s any chance the bias is above 50%, then the contract is worth strictly more than $0.50. To connect to prediction markets, let’s do one last thought experiment , replacing the supercomputer with a market. If you buy the contract, then I’ll have lots of other people bid on similar contracts for a while. If the price settles above $0.50, your bet goes ahead. Otherwise, you get your money back. You should still bid more than $0.40, even though you only think there’s a 40% chance the coin will land heads. Because the market acts like a (worse) laser-scanner plus supercomputer. Assuming prediction markets are good, the market is smarter than you, so it’s more likely to activate if the true bias of the coin is 60% rather than 20%. This changes your incentives, so you won’t bet your true beliefs. I hope you now agree that conditional prediction markets are non-causal, and choosing actions based on the market doesn’t magically make that problem go away. But you still might have hope! Maybe the order is still preserved? Maybe you’ll at least always pay more for coins that have a higher probability of coming up heads? Maybe if you run a market with a bunch of coins, the best one will always earn the highest price? Maybe it all works out? Suppose there’s a conditional prediction market for two coins. After a week of bidding, the markets will close, whichever coin had contracts trading for more money will be flipped and $1 paid to contract-holders for head. The other market is cancelled. Suppose you’re sure that coin A , has a bias of 60%. If you flip it lots of times, 60% of the flips will be heads. But you’re convinced coin B , is a trick coin. You think there’s a 59% chance it always lands heads, and a 41% chance it always lands tails. You’re just not sure which. We want you to pay more for a contract for coin A, since that’s the coin you think is more likely to be heads (60% vs 59%). But if you like money, you’ll pay more for a contract on coin B. You’ll do that because other people might figure out if it’s an always-heads coin or an always-tails coin. If it’s always heads, great, they’ll bid up the market, it will activate, and you’ll make money. If it’s always tails, they’ll bid down the market, and you’ll get your money back. You’ll pay more for coin B contracts, even though you think coin A is better in expectation. Order is not preserved. Things do not work out. Naive conditional prediction markets aren’t causal. Using time doesn’t solve the problem. Having the market choose actions doesn’t solve the problem. But maybe there’s still hope? Maybe it’s possible to solve the problem by screwing around with the payouts? Theorem. Nope. You can’t solve the problem by screwing around with the payouts. There does not exist a payout function that will make you always bid your true beliefs. Suppose you run a market where if you pay x and the final market price is y and z happens, then you get a payout of f(x,y,z) dollars. The payout function can be anything, subject only to the constraint that if the final market price is below some constant c , then bets are cancelled, i.e. f(x,y,z)=x for y < c . Now, take any two distributions ℙ₁ and ℙ₂ . Assume that: Then the expected return under ℙ₁ and ℙ₂ is the same. That is, 𝔼₁[f(x,Y,Z)]    = x ℙ₁[Y<c] + ℙ₁[Y≥c] 𝔼₁[f(x,Y,Z) | Y≥c]    = x ℙ₂[Y<c] + ℙ₂[Y≥c] 𝔼₂[f(x,Y,Z) | Y≥c]    = 𝔼₂[f(x,Y,Z)] . Thus, you would be willing to pay the same amount for a contract under both distributions. Meanwhile, the difference in expected values is 𝔼₁[Z] - 𝔼₂[Z]    = ℙ₁[Y<c] 𝔼₁[Z | Y<c] - ℙ₂[Y<c] 𝔼₂[Z | Y<c]      + ℙ₁[Y≥c] 𝔼₁[Z | Y≥c] - ℙ₂[Y≥c] 𝔼₂[Z | Y≥c]    = ℙ₁[Y<c] (𝔼₁[Z | Y<c] - 𝔼₂[Z | Y<c])    ≠ 0 . The last line uses our assumptions that ℙ₁[Y<c] > 0 and 𝔼₁[Z | Y<c] ≠ 𝔼₂[Z | Y<c] . Thus, we have simultaneously that 𝔼₁[f(x,Y,Z)] = 𝔼₂[f(x,Y,Z)] , 𝔼₁[Z] ≠ 𝔼₂[Z] . This means that you should pay the same amount for a contract if you believe ℙ₁ or ℙ₂ , even though these entail different beliefs about how likely Z is to happen. Since we haven’t assumed anything about the payout function f(x,y,z) , this means that no working payout function can exist. This is bad. Just because conditional prediction markets are non-causal does not mean they are worthless. On the contrary, I think we should do more of them! But they should be treated like observational statistics—just one piece of information to consider skeptically when you make decisions. Also, while I think these issues are neglected, they’re not completely unrecognized. For example, in 2013, Robin Hanson pointed out that confounding variables can be a problem: Also, advisory decision market prices can be seriously distorted when decision makers might know things that market speculators do not. In such cases, the fact that a certain decision is made can indicate hidden info held by decision makers. Market estimates of outcomes conditional on a decision then become estimates of outcomes given this hidden info, instead of estimates of the effect of the decision on outcomes. This post from Anders_H in 2015 is the first I’m aware of that points out the problem in full generality. Finally, the flaw can be fixed. In statistics, there’s a whole category of techniques to get causal estimates out of data. Many of these methods have analogies as alternative prediction market designs. I’ll talk about those next time. But here’s a preview: None are free. If Dynomight is still pseudonymous at the end of 2027, you’ll get your $0.12 back. If Dynomight is non-pseudonymous, then you get $1 if Dynomight came out against aspartame and $0 if not. You think Musk is a mildly crappy CEO. If he’s fired, he’ll be replaced with someone slightly better, which would slightly increase Tesla’s stock price. You’ve heard rumors that Robyn Denholm has recently decided that she hates Musk and wants to dedicate her life to destroying him. Or maybe not, who knows. ℙ₁[Y<c] = ℙ₂[Y<c] > 0 ℙ₁[Y≥c] = ℙ₂[Y≥c] 𝔼₁[Z | Y≥c] = 𝔼₂[Z | Y≥c] ℙ₁[(Y,Z) | Y≥c] = ℙ₂[(Y,Z) | Y≥c] (h/t Baram Sosis) 𝔼₁[Z | Y<c] ≠ 𝔼₂[Z | Y<c]

0 views
DYNOMIGHT 4 months ago

Optimizing tea: An N=4 experiment

Tea is a little-known beverage, consumed for flavor or sometimes for conjectured effects as a stimulant. It’s made by submerging the leaves of C. Sinensis in hot water. But how hot should the water be? To resolve this, I brewed the same tea at four different temperatures, brought them all to a uniform serving temperature, and then had four subjects rate them along four dimensions. Subject A is an experienced tea drinker, exclusively of black tea w/ lots of milk and sugar. Subject B is also an experienced tea drinker, mostly of black tea w/ lots of milk and sugar. In recent years, Subject B has been pressured by Subject D to try other teas. Subject B likes fancy black tea and claims to like fancy oolong, but will not drink green tea. Subject C is similar to Subject A. Subject D likes all kinds of tea, derives a large fraction of their joy in life from tea, and is world’s preeminent existential angst + science blogger. For a tea that was as “normal” as possible, I used pyramidal bags of PG Tips tea (Lipton Teas and Infusions, Trafford Park Rd., Trafford Park, Stretford, Manchester M17 1NH, UK). I brewed it according to the instructions on the box, by submerging one bag in 250ml of water for 2.5 minutes. I did four brews with water at temperatures ranging from 79°C to 100°C (174.2°F to 212°F). To keep the temperature roughly constant while brewing, I did it in a Pyrex measuring cup (Corning Inc., 1 Riverfront Plaza, Corning, New York, 14831, USA) sitting in a pan of hot water on the stove. After brewing, I poured the tea into four identical mugs with the brew temperature written on the bottom with a Sharpie Pro marker (Newell Brands, 5 Concourse Pkwy Atlanta, GA 30328, USA). Readers interested in replicating this experiment may note that those written temperatures still persist on the mugs today, three months later. The cups were dark red, making it impossible to see any difference in the teas. After brewing, I put all the mugs in a pan of hot water until they converged to 80°C, so they were served at the same temperature. I shuffled the mugs and placed them on a table in a random order. I then asked the subjects to taste from each mug and rate the teas for: Each rating was to be on a 1-5 scale, with 1=bad and 5=good. Subjects A, B, and C had no knowledge of how the different teas were brewed. Subject D was aware, but was blinded as to which tea was in which mug. During taste evaluation, Subjects A and C remorselessly pestered Subject D with questions about how a tea strength can be “good” or “bad”. Subject D rejected these questions on the grounds that “good” cannot be meaningfully reduced to other words and urged Subjects A and C to review Wittgenstein’s concept of meaning as use , etc. Subject B questioned the value of these discussions. After ratings were complete, I poured tea out of all the cups until 100 ml remained in each, added around 1 gram (1/4 tsp) of sugar, and heated them back up to 80°C. I then re-shuffled the cups and presented them for a second round of ratings. For a single summary, I somewhat arbitrarily combined the four ratings into a “quality” score, defined as (Quality) = 0.1 × (Aroma) + 0.3 × (Flavor) + 0.1 × (Strength) + 0.5 × (Goodness). Here is the data for Subject A, along with a linear fit for quality as a function of brewing temperature. Broadly speaking, A liked everything, but showed weak evidence of any trend. And here is the same for Subject B, who apparently hated everything. Here is the same for Subject C, who liked everything, but showed very weak evidence of any trend. And here is the same for Subject D. This shows extremely strong evidence of a negative trend. But, again, while blinded to the order, this subject was aware of the brewing protocol. Finally, here are the results combining data from all subjects. This shows a mild trend, driven mostly by Subject D. This experiment provides very weak evidence that you might be brewing your tea too hot. Mostly, it just proves that Subject D thinks lower-middle tier black tea tastes better when brewed cooler. I already knew that. There are a lot of other dimensions to explore, such as the type of tea, the brew time, the amount of tea, and the serving temperature. I think that ideally, I’d randomize all those dimensions, gather a large sample, and then fit some kind of regression. Creating dozens of different brews and then serving them all blinded at different serving temperatures sounds like way too much work. Maybe there’s an easier way to go about this? Can someone build me a robot? If you thirst to see Subject C’s raw aroma scores or whatever, you can download the data or click on one of the entries in this table: Subject D was really good at this; why can’t everyone be like Subject D? This experiment provides very weak evidence that you might be brewing your tea too hot. Mostly, it just proves that Subject D thinks lower-middle tier black tea tastes better when brewed cooler. I already knew that. There are a lot of other dimensions to explore, such as the type of tea, the brew time, the amount of tea, and the serving temperature. I think that ideally, I’d randomize all those dimensions, gather a large sample, and then fit some kind of regression. Creating dozens of different brews and then serving them all blinded at different serving temperatures sounds like way too much work. Maybe there’s an easier way to go about this? Can someone build me a robot? If you thirst to see Subject C’s raw aroma scores or whatever, you can download the data or click on one of the entries in this table: Subject Aroma Flavor Strength Goodness Quality A x x x x x B x x x x x C x x x x x D x x x x x All x x x x x Subject D was really good at this; why can’t everyone be like Subject D?

0 views
Weakty 4 months ago

Countin' Bikes

Today I took part in something called the Pedal Poll, which is a countrywide initiative to count how many people are biking, walking, driving, or using a motorized vehicle across a specific time and place. I counted 993 cyclists in the span of 2 hours. I think I would have gotten that other 7 to get over 1000 if I hadn't accidentally closed the app and had to restart it.

0 views
DYNOMIGHT 5 months ago

My more-hardcore theanine self-experiment

Theanine is an amino acid that occurs naturally in tea. Many people take it as a supplement for stress or anxiety. It’s mechanistically plausible, but the scientific literature hasn’t been able to find much of a benefit. So I ran a 16-month blinded self-experiment in the hopes of showing it worked. It did not work . At the end of the post, I put out a challenge: If you think theanine works, prove it. Run a blinded self-experiment. After all, if it works, then what are you afraid of? Well, it turns out that Luis Costigan had already run a self-experiment . Here was his protocol: He repeated this for 20 days. His mean anxiety after theanine was 4.2 and after placebo it was 5.0. A simple Bayesian analysis said there was an 82.6% chance theanine reduced anxiety. A sample size of 20 just doesn’t have enough statistical power to have a good chance of finding a statistically significant result. If you assume the mean under placebo is 5.0, the mean under theanine is 4.2, and the standard deviation is 2.0, then you’d only have a 22.6% chance of getting a result with p<0.05. I think this experiment was good, both the experiment and the analysis. It doesn’t prove theanine works, but it was enough to make me wonder: Maybe theanine does work, but I somehow failed to bring out the effect? What would give theanine the best possible chance of working? Theanine is widely reported to help with anxiety from caffeine. While I didn’t explicitly take caffeine as part of my previous experiment, I drink tea almost every day, so I figured that if theanine helps, it should have shown up. But most people (and Luis) take theanine with coffee , not tea. I find that coffee makes me much more nervous than tea. For this reason, I sort of hate coffee and rarely drink it. Maybe the tiny amounts of natural theanine in tea masked the effects of the supplements? Or maybe you need to take theanine and caffeine at the same time? Or maybe for some strange reason theanine works for coffee (or coffee-tier anxiety) but not tea? So fine. To hell with my mental health. I decided to take theanine (or placebo) together with coffee on an empty stomach first thing in the day. And I decided to double the dose of theanine from 200 mg to 400 mg. Coffee. I used one of those pod machines which are incredibly uncool but presumably deliver a consistent amount of caffeine. Measurements. Each day I recorded my stress levels on a subjective 1-5 scale before I took the capsules. An hour later, I recorded my end stress levels, and my percentage prediction that what I took was actually theanine. Blinding. I have capsules that either contain 200 mg of theanine or 25 mcg of vitamin D. These are exactly the same size. I struggled for a while to see how to take two pills of the same type while being blind to the results. In the end, I put two pills of each type in identical looking cups and shuffled the cups. Then I shut my eyes, took a sip of coffee (to make sure I couldn’t taste any difference), swallowed the pills on one cup, and put the others into a numbered envelope. Here’s a picture of the envelopes, to prove I actually did this and/or invite sympathy for all the coffee I had to endure: After 37 days I ran out of capsules. I’m going to try something new. As I write these words, I have not yet opened the envelopes, so I don’t know the results. I’m going to register some thoughts. My main thought is: I have no idea what the results will show. It really felt like on some days I got the normal spike of anxiety I expect from coffee and on other days it was almost completely gone. But in my previous experiment I often felt the same thing and was proven wrong. It wouldn’t surprise me if the results show a strong effect, or if it’s all completely random. I’ll also pre-register (sort of) the statistical analyses I intend to do: Please hold while I open all the envelopes and do the analyses. Here’s a painting . Here are the raw stress levels. Each line shows one trial, with the start marked with a small horizontal bar. Remember, this measures the effect of coffee and the supplement. So even though stress tends to go up, this would still show a benefit if it went up less with theanine. Here is the difference in stress levels. If Δ Stress is negative, that means stress went down. Here are the start vs. end stress levels, ignoring time. The dotted line shows equal stress levels, so anything below that line means stress went down. And finally, here are my percentage predictions of if what I had taken was actually theanine: So…. nothing jumps out so far. So I did the analysis in my pre-registered plan above. In the process, I realized I wanted to show some extra stuff. It’s all simple and I think unobjectionable. But if you’re the kind of paranoid person who only trusts pre-registered things, I love and respect you and I will mark those with “✔️”. The first thing we’ll look at is the final stress levels, one hour after taking theanine or vitamin D. First up, regular-old frequentist statistics. If the difference is less than zero, that would suggest theanine was better. It looks like there might be a small difference, but it’s nowhere near statistically significant. Next up, Bayes! In this analysis, there are latent variables for the mean and standard deviation of end stress (after one hour) with theanine and also for vitamin D. Following Luis’s analysis, these each have a Gaussian prior with a mean and standard deviation based on the overall mean in the data. The results are extremely similar to the frequentist analysis. This says there’s an 80% chance theanine is better. Next up, let’s look at the difference in stress levels defined as Δ = (end - start). Since this measures an increase in stress, we’d like it to be as small as possible. So again, if the difference is negative, that would suggest theanine is better. Here are the good-old frequentist statistics. And here’s the Bayesian analysis. It’s just like the first one except we have latent variables for the difference in stress levels (end-start). If the difference of that difference was less than zero, that would again suggest theanine was better. In retrospect, this percentage prediction analysis is crazy, and I suggest you ignore it. The issue is that even though Δ stress is usually positive (coffee bad) it’s near zero and can be negative. Computing (T-D)/D when D can be negative is stupid and I think makes the whole calculation meaningless. I regret pre-registering this. The absolute difference is fine. It’s very close (almost suspiciously close) to zero. Finally, let’s look at my percentage prediction that what I took was theanine. It really felt like I could detect a difference. But could I? Here we’d hope that I’d give a higher prediction that I’d taken theanine when I’d actually taken theanine. So a positive difference would suggest theanine is better, or at least different. And here’s the corresponding Bayesian analysis. This is just like the first two, except with latent variables for my percentage prediction under theanine and vitamin D. Taking a percentage difference of a quantity that is itself a percentage difference is really weird, but fine. This is the most annoying possible outcome. A clear effect would have made me happy. Clear evidence of no effect would also have made me happy. Instead, some analyses say there might be a small effect, and others suggest nothing. Ugh. But I’ll say this: If there is any effect, it’s small. I know many people say theanine is life-changing, and I know why: It’s insanely easy to fool yourself. Even after running a previous 18-month trial and finding no effect, I still often felt like I could feel the effects in this experiment. I still thought I might open up all the envelopes and find that I had been under -confident in my guesses. Instead, I barely did better than chance. So I maintain my previous rule. If you claim that theanine has huge effects for you, blind experiment or GTFO. Edit: Data here . Each morning, take 200 mg theanine or placebo (blinded) along with a small iced coffee. Wait 90 minutes. Record anxiety on a subjective scale of 0-10. I’ll plot the data. I’ll repeat Luis’s Bayesian analysis , which looks at end stress levels only. I’ll repeat that again, but looking at the change in stress levels. I’ll repeat that again, but looking at my percentage prediction that what I actually took was theanine vs. placebo. I’ll compute regular-old confidence intervals and p-values for end stress, change in stress, and my percentage prediction that what I actually took was theanine vs. placebo. Intermission

0 views
Gregory Gundersen 7 months ago

De Moivre–Laplace Theorem

As I understand it, the de Moivre–Laplace theorem is the earliest version of the central limit theorem (CLT). In his book The Doctrine of Chances (De Moivre, 1738) , Abraham de Moivre proved that the probability mass function of the binomial distribution asymptotically approximates the probability density function of a particular normal distribution as its parameter n n n grows arbitrarily large. Today, we know that the CLT generalizes this result, and we might say this is a special case of the CLT for the binomial distribution. To introduce notation, we say that X n X_n X n ​ is a binomial random variable with parameters n n n and p p p if P ( X n = k ) = ( n k ) p k q n − k , p ∈ [ 0 , 1 ] ,       q : = 1 − p ,       n ∈ N . (1) \mathbb{P}(X_n = k) = {n \choose k} p^k q^{n-k}, \qquad p \in [0, 1],\;\;q := 1-p,\;\;n \in \mathbb{N}. \tag{1} P ( X n ​ = k ) = ( k n ​ ) p k q n − k , p ∈ [ 0 , 1 ] , q : = 1 − p , n ∈ N . ( 1 ) Typically, we view X n X_n X n ​ as the the sum of n n n Bernoulli random variables, each with parameter p p p . Intuitively, if we flip n n n coins each with bias p p p , Equation 1 1 1 gives the probability of k k k successes. This is clearly related to the CLT, which loosely states that the properly normalized sum of random variables asymptotically approaches the normal distribution. If we let Y i Y_i Y i ​ denote these Bernoulli random variables, we can express this idea as ∣ Y 1 + Y 2 + ⋯ + Y n ⏞ X n    ≃    N  ⁣ ( n p , n p q ) , (2) \overbrace{\vphantom{\Big|} Y_1 + Y_2 + \dots + Y_n}^{X_n} \;\simeq\; \mathcal{N}\!\left(np, npq\right), \tag{2} ∣ ∣ ∣ ∣ ​ Y 1 ​ + Y 2 ​ + ⋯ + Y n ​ ​ X n ​ ​ ≃ N ( n p , n p q ) , ( 2 ) where ≃ \simeq ≃ denotes asymptotic equivalence as n → ∞ n \rightarrow \infty n → ∞ . This is probably the most intuitive form of the CLT because if we simply plot the probability mass function (PMF) for the binomial distribution for increasing values of n n n , we get a discrete distribution which nearly immediately looks a lot like the normal distribution even for relatively small n n n (Figure 1 1 1 ). In contrast, I think the CLT is much less obvious feeling if I were to claim (correctly) that the properly normalized sum of skew normal random variables is also normally distributed! A modern version of de Moivre’s proof is tedious, but it’s not actually that hard to follow. This post is simply my notes on that proof. To start, let’s rewrite the binomial coefficient without the factorial using Stirling’s approximation : n ! ≃ 2 π n ( n e ) n . (3) n! \simeq \sqrt{2\pi n} \left(\frac{n}{e}\right)^n. \tag{3} n ! ≃ 2 π n ​ ( e n ​ ) n . ( 3 ) As a historical aside, note that while Stirling is credited with this approximation, it was actually de Moivre who discovered an early version of it while working on these ideas. So de Moivre has been robbed twice, once for this approximation and once for the normal distribution sometimes being called the “Gaussian” rather than the “de Moivrian”. Anyway, using Stirling’s approximation, we can rewrite the binomial coefficient as ( n k ) ≃ 2 π n ( 2 π k ) ( 2 π ( n − k ) ) ( n e ) n ( k e ) − k ( n − k e ) k − n = n 2 π k ( n − k ) ) ( n n k k ( n − k ) n − k ) . (4) \begin{aligned} {n \choose k} & \simeq \sqrt{\frac{2\pi n}{(2\pi k)(2\pi (n-k))}} \left(\frac{n}{e}\right)^n \left(\frac{k}{e}\right)^{-k} \left(\frac{n-k}{e}\right)^{k-n} \\ &= \sqrt{\frac{n}{2\pi k (n-k))}} \left(\frac{n^n}{k^k (n-k)^{n-k}}\right). \end{aligned} \tag{4} ( k n ​ ) ​ ≃ ( 2 π k ) ( 2 π ( n − k ) ) 2 π n ​ ​ ( e n ​ ) n ( e k ​ ) − k ( e n − k ​ ) k − n = 2 π k ( n − k ) ) n ​ ​ ( k k ( n − k ) n − k n n ​ ) . ​ ( 4 ) If we multiply this term by the “raw probabilities” p k q n − k p^k q^{n-k} p k q n − k and group the terms raised to the powers k k k and n − k n-k n − k , we get: ( n k ) p k q n − k ≃ n 2 π k ( n − k ) ) ( n n k k ( n − k ) n − k ) p k q n − k = n 2 π k ( n − k ) ) ( n p k ) k ( n q n − k ) n − k . (5) \begin{aligned} {n \choose k} p^k q^{n-k} &\simeq \sqrt{\frac{n}{2\pi k (n-k))}} \left(\frac{n^n}{k^k (n-k)^{n-k}}\right) p^k q^{n-k} \\ &= \sqrt{\frac{n}{2\pi k (n-k))}} \left( \frac{np}{k} \right)^k \left( \frac{nq}{n-k} \right)^{n-k}. \end{aligned} \tag{5} ( k n ​ ) p k q n − k ​ ≃ 2 π k ( n − k ) ) n ​ ​ ( k k ( n − k ) n − k n n ​ ) p k q n − k = 2 π k ( n − k ) ) n ​ ​ ( k n p ​ ) k ( n − k n q ​ ) n − k . ​ ( 5 ) My understanding as to the motivation for the next two steps is that we want to “push” n n n into the denominator, which is often nice in asymptotics because it makes terms vanish as n n n gets larger. Let’s tackle the normalizing term (square root) and the probabilities separately. First, the square root. Note that by the law of large numbers , as n n n gets very large, k / n k/n k / n arbitrarily approaches the true probability of success p p p . So let’s rewrite the the square root in terms of k / n k/n k / n and then write k / n k/n k / n in terms of p p p : ( n k ) ≃ n 2 π k ( n − k ) ) = 1 2 π k n n ( 1 − k n ) ) ≃ 1 2 π n p q . (6) {n \choose k} \simeq \sqrt{\frac{n}{2\pi k (n-k))}} = \sqrt{\frac{1}{2\pi \frac{k}{n} n (1 - \frac{k}{n}))}} \simeq \frac{1}{\sqrt{2\pi n p q}}. \tag{6} ( k n ​ ) ≃ 2 π k ( n − k ) ) n ​ ​ = 2 π n k ​ n ( 1 − n k ​ ) ) 1 ​ ​ ≃ 2 π n p q ​ 1 ​ . ( 6 ) If you were already familiar with the normal distribution, this term should look suspiciously like the normalizing constant! Second, the probabilities. The next step is a fairly standard trick, which is to convert a product into a sum by taking the exp-log of the product. Looking only at the terms raised to k k k and n − k n-k n − k in Equation 5 5 5 , we get: ( n p k ) k ( n q n − k ) n − k = exp ⁡ { log ⁡ ( n p k ) k + log ⁡ ( n q n − k ) n − k } = exp ⁡ { − k log ⁡ ( k n p ) + ( k − n ) log ⁡ ( n − k n q ) } . (7) \begin{aligned} \left( \frac{np}{k} \right)^k \left( \frac{nq}{n-k} \right)^{n-k} &= \exp \left\{ \log \left( \frac{np}{k} \right)^k + \log \left( \frac{nq}{n-k} \right)^{n-k} \right\} \\ &= \exp \left\{ - k \log \left( \frac{k}{np} \right) + (k-n) \log \left( \frac{n-k}{nq} \right) \right\}. \end{aligned} \tag{7} ( k n p ​ ) k ( n − k n q ​ ) n − k ​ = exp { lo g ( k n p ​ ) k + lo g ( n − k n q ​ ) n − k } = exp { − k lo g ( n p k ​ ) + ( k − n ) lo g ( n q n − k ​ ) } . ​ ( 7 ) The next trick is express k k k in terms of a standardized binomial random variable z z z . Notice that X n X_n X n ​ is the sum of n n n independent Bernoulli random variables. By the linearity of expectation and the linearity of variance under independence, we have: E [ X n ] = ∑ i = 1 n E [ Y i ] = n p , V [ X n ] = ∑ i = 1 n V [ Y i ] = n p q . (8) \begin{aligned} \mathbb{E}[X_n] &= \sum_{i=1}^n \mathbb{E}[Y_i] = np, \\ \mathbb{V}[X_n] &= \sum_{i=1}^n \mathbb{V}[Y_i] = npq. \end{aligned} \tag{8} E [ X n ​ ] V [ X n ​ ] ​ = i = 1 ∑ n ​ E [ Y i ​ ] = n p , = i = 1 ∑ n ​ V [ Y i ​ ] = n p q . ​ ( 8 ) Since the mean of X n X_n X n ​ is n p np n p and its variance is n p q npq n p q , a standardized binomial random variable is z : = k − E [ k ] V [ k ] = k − n p n p q . (9) z := \frac{k - \mathbb{E}[k]}{\sqrt{\mathbb{V}[k]}} = \frac{k - np}{\sqrt{npq}}. \tag{9} z : = V [ k ] ​ k − E [ k ] ​ = n p q ​ k − n p ​ . ( 9 ) And we can write this in terms of k k k as k = n p + z n p q . (10) k = np + z \sqrt{npq}. \tag{10} k = n p + z n p q ​ . ( 1 0 ) Putting this definition of k k k into the formula above—the point here is to express k k k in terms of n n n , which is the term we want to pay attention to as it increases—, we get: exp ⁡ { − k log ⁡ ( k n p ) + ( k − n ) log ⁡ ( n − k n q ) } = exp ⁡ { − k log ⁡ ( n p + z n p q n p ) + ( k − n ) log ⁡ ( n − n p − z n p q n q ) } = exp ⁡ { − k log ⁡ ( 1 + z q n p ) + ( k − n ) log ⁡ ( 1 − z p n q ) } . (11) \begin{aligned} &\exp \left\{ - k \log \left( \frac{k}{np} \right) + (k-n) \log \left( \frac{n-k}{nq} \right) \right\} \\ &= \exp \left\{ - k \log \left( \frac{np + z \sqrt{npq}}{np} \right) + (k-n) \log \left( \frac{n-np - z \sqrt{npq}}{nq} \right) \right\} \\ &= \exp \left\{ - k \log \left( 1 + z \sqrt{\frac{q}{np}} \right) + (k-n) \log \left( 1 - z \sqrt{\frac{p}{nq}} \right) \right\}. \end{aligned} \tag{11} ​ exp { − k lo g ( n p k ​ ) + ( k − n ) lo g ( n q n − k ​ ) } = exp { − k lo g ( n p n p + z n p q ​ ​ ) + ( k − n ) lo g ( n q n − n p − z n p q ​ ​ ) } = exp { − k lo g ( 1 + z n p q ​ ​ ) + ( k − n ) lo g ( 1 − z n q p ​ ​ ) } . ​ ( 1 1 ) In my mind, the final step is the least obvious, but it’s lovely when you see it. Recall that the Maclaurin series of log ⁡ ( 1 + x ) \log(1+x) lo g ( 1 + x ) is log ⁡ ( 1 + x ) = x − x 2 2 + x 3 3 − … (12) \log(1+x) = x - \frac{x^2}{2} + \frac{x^3}{3} - \dots \tag{12} lo g ( 1 + x ) = x − 2 x 2 ​ + 3 x 3 ​ − … ( 1 2 ) This is a fairly standard result, and it’s worth just writing out yourself if you’ve never done it. Anyway, we can plug in these two definitions of x x x , x : = z q n p , x : = − z p n q , (13) x := z \sqrt{\frac{q}{np}}, \qquad x := -z \sqrt{\frac{p}{nq}}, \tag{13} x : = z n p q ​ ​ , x : = − z n q p ​ ​ , ( 1 3 ) into Equation 12 12 1 2 above, and use that to expand the logs in Equation 11 11 1 1 into infinite sums. Why are we doing this? The key idea that we’ll see is that nearly every term in each sum will be a fraction with n n n in the denominator. So as n n n grows larger, these terms will become arbitrarily small. In the limit, they vanish. All that will be left is the normal distribution’s kernel, exp ⁡ { − 0.5 z 2 } \exp\{-0.5 z^2\} exp { − 0 . 5 z 2 } . Let’s do this. First, let’s just look at one of the log terms. We can write the left one as: − k log ⁡ ( 1 + z q n p ) = − ( n p + z n p q ) [ z ( q n p ) 1 / 2 − 1 2 z 2 q n p + 1 3 z 3 ( q n p ) 3 / 2 + …   ] . (14) \begin{aligned} &-k \log \left( 1 + z \sqrt{\frac{q}{np}} \right) \\ &= -(np + z\sqrt{npq})\left[z \left(\frac{q}{np}\right)^{1/2} - \frac{1}{2} z^2 \frac{q}{np} + \frac{1}{3} z^3 \left(\frac{q}{np}\right)^{3/2} + \dots \right]. \end{aligned} \tag{14} ​ − k lo g ( 1 + z n p q ​ ​ ) = − ( n p + z n p q ​ ) [ z ( n p q ​ ) 1 / 2 − 2 1 ​ z 2 n p q ​ + 3 1 ​ z 3 ( n p q ​ ) 3 / 2 + … ] . ​ ( 1 4 ) The key thing to see is that for most terms in the sum, after we multiply it by n n n or n \sqrt{n} n ​ , we still have n n n in the denominator. And these terms vanish since for some constant c c c , the ratio c / n c/n c / n goes to zero as n → ∞ n \rightarrow \infty n → ∞ . So multiplying the terms in Equation 14 14 1 4 , we get [ − z n p q + 1 2 z 2 q − 1 3 z 3 q 3 / 2 n p + …   ] + [ − z 2 q + 1 2 z 3 q 3 / 2 n p − 1 3 z 4 q 2 n p + …   ] = − z n p q + 1 2 z 2 q − z 2 q = − z n p q − 1 2 z 2 q . (15) \begin{aligned} &\left[ - z\sqrt{npq} + \frac{1}{2} z^2 q - \frac{1}{3} z^3 \frac{q^{3/2}}{\sqrt{np}} + \dots \right] + \left[ - z^2 q + \frac{1}{2} z^3 \frac{q^{3/2}}{\sqrt{np}} - \frac{1}{3} z^4 \frac{q^2}{np} + \dots \right] \\ &= -z\sqrt{npq} + \frac{1}{2} z^2 q - z^2 q \\ &= -z\sqrt{npq} - \frac{1}{2} z^2 q. \end{aligned} \tag{15} ​ [ − z n p q ​ + 2 1 ​ z 2 q − 3 1 ​ z 3 n p ​ q 3 / 2 ​ + … ] + [ − z 2 q + 2 1 ​ z 3 n p ​ q 3 / 2 ​ − 3 1 ​ z 4 n p q 2 ​ + … ] = − z n p q ​ + 2 1 ​ z 2 q − z 2 q = − z n p q ​ − 2 1 ​ z 2 q . ​ ( 1 5 ) That’s the basic idea. If we do the expansion for the other term in Equation 11 11 1 1 , we’ll see that it’s equal to: ( k − n ) log ⁡ ( 1 − z p n q ) = z n p q + 1 2 z 2 p − z 2 p + … ≃ z n p q − 1 2 z 2 p . (16) \begin{aligned} (k-n) \log \left( 1 - z \sqrt{\frac{p}{nq}} \right) &= z\sqrt{npq} + \frac{1}{2} z^2 p - z^2 p + \dots \\ &\simeq z\sqrt{npq} - \frac{1}{2} z^2 p. \end{aligned} \tag{16} ( k − n ) lo g ( 1 − z n q p ​ ​ ) ​ = z n p q ​ + 2 1 ​ z 2 p − z 2 p + … ≃ z n p q ​ − 2 1 ​ z 2 p . ​ ( 1 6 ) Putting these two terms together, we can see that the exponent term is equal to: exp ⁡ { − k log ⁡ ( 1 + z q n p ) + ( k − n ) log ⁡ ( 1 − z p n q ) } ≃ exp ⁡ { − z n p q − 1 2 z 2 q + z n p q − 1 2 z 2 p } = exp ⁡ { − 1 2 z 2 p − 1 2 z 2 q } = exp ⁡ { − 1 2 z 2 ( p + q ) } = exp ⁡ { − 1 2 z 2 } . (17) \begin{aligned} &\exp \left\{ - k \log \left( 1 + z \sqrt{\frac{q}{np}} \right) + (k-n) \log \left( 1 - z \sqrt{\frac{p}{nq}} \right) \right\} \\ &\simeq \exp\left\{ -z\sqrt{npq} - \frac{1}{2} z^2 q + z\sqrt{npq} - \frac{1}{2} z^2 p \right\} \\ &= \exp\left\{ - \frac{1}{2} z^2 p - \frac{1}{2} z^2 q \right\} \\ &= \exp\left\{ - \frac{1}{2} z^2 (p + q) \right\} \\ &= \exp\left\{ - \frac{1}{2} z^2 \right\}. \end{aligned} \tag{17} ​ exp { − k lo g ( 1 + z n p q ​ ​ ) + ( k − n ) lo g ( 1 − z n q p ​ ​ ) } ≃ exp { − z n p q ​ − 2 1 ​ z 2 q + z n p q ​ − 2 1 ​ z 2 p } = exp { − 2 1 ​ z 2 p − 2 1 ​ z 2 q } = exp { − 2 1 ​ z 2 ( p + q ) } = exp { − 2 1 ​ z 2 } . ​ ( 1 7 ) And this is the normal distribution’s kernel! Putting this together with the normalizing term in Equation 6 6 6 and then using the definition of the standardized variable z z z in Equation 9 9 9 , we get: ( n k ) p k q n − k    ≃    1 2 π n p q exp ⁡ { − 1 2 ( k − n p n p q ) 2 } . (18) {n \choose k} p^k q^{n-k} \;\simeq\; \frac{1}{\sqrt{2\pi n p q}} \exp\left\{ - \frac{1}{2} \left( \frac{k - np}{\sqrt{npq}} \right)^2 \right\}. \tag{18} ( k n ​ ) p k q n − k ≃ 2 π n p q ​ 1 ​ exp { − 2 1 ​ ( n p q ​ k − n p ​ ) 2 } . ( 1 8 ) And we’re done! This is quite elegant, because we have expressed this asymptotic distribution in terms of the mean and variance of X n X_n X n ​ . This is remarkable! I still remember the first time I saw this derived and realized precisely why the normal distribution was so pervasive. The normal distribution is everywhere because if you take a bunch of random noise and smash it together, the result is most likely normally distributed! Note that the more general CLT does not require that the random variables in the sum be Bernoulli distributed. For example, if X n X_n X n ​ is the sum of n n n independent skew normal random variables, X n X_n X n ​ itself is still normally distributed! See Figure 2 2 2 for a numerical experiment demonstrating this. The de Moivre–Laplace Theorem was the first hint that this more general result, the central limit theorem, was actually true.

0 views
Alex Molas 1 years ago

You need more than p-values

Explore the critical considerations and potential pitfalls of relying solely on A/B testing in making business decisions. While A/B testing is a valuable tool, this post challenges the assumption of exchangeability between past and future data, emphasizing the dynamic nature of the business environment. I propose two solutions (1) validating the exchangeability assumption through holdback groups and (2) advocating for a holistic decision-making approach that goes beyond statistical tests. Executives are urged not to blindly trust p-values, emphasizing the importance of intuition, market understanding, and forecasting in shaping successful business strategies. In conclusion, the post encourages a balanced approach, combining statistical rigor with real-world insights for effective decision-making.

0 views
Alex Molas 1 years ago

Conditioning is grouping by

This insightful exploration draws parallels between mathematical formulations and practical implementations, showcasing how understanding conditioning as grouping can elevate your statistical insights. Discover the parallels between conditional expectations like $\mathbb{E}(y | X=x)$ and popular grouping techniques found in data analysis tools like pandas. Uncover the hidden synergy that exists between statistical conditioning and groupby operations, demystifying complex mathematical concepts with real-world applications. Whether you're a seasoned data scientist or a curious learner, this journey into the interconnected world of conditioning and grouping promises newfound clarity. Elevate your statistical understanding with practical examples, bridging the gap between theory and application. Embark on this enlightening exploration today and revolutionize your approach to statistical modeling. Uncover the simplicity behind complex conditional expressions through the power of grouping, transforming your data analysis skills along the way.

0 views
Alex Molas 2 years ago

Expected $k$ highest value from $n$ Gaussian draws.

In this short note I compare Bilalic and Blom approximations to compute the k-th order statistics from a gaussian distribution.

0 views