Hugo speaks with JD Long, agricultural economist, quant, and stochastic modeler, about decision making under uncertainty and how we can use our knowledge of risk, uncertainty, probabilistic thinking, causal inference, and more to help us use data science and machine learning to make better decisions in an uncertain world. This is part 2 of a two part conversation in which we delve into decision making under uncertainty. Feel free to check out part 1 here (https://vanishinggradients.fireside.fm/15) but this episode should also stand alone. Why am I speaking to JD about all of this? Because not only is he a wild conversationalist with a real knack for explaining hard to grok concepts with illustrative examples and useful stories, but he has worked for many years in re-insurance, that’s right, not insurance but re-insurance - these are the people who insure the insurers so if anyone can actually tell us about risk and uncertainty in decision making, it’s him! In part 1, we discussed risk, uncertainty, probabilistic thinking, and simulation, all with a view towards improving decision making. In this, part 2, we discuss the ins and outs of decision making under uncertainty, including How data science can be more tightly coupled with the decision function in organisations; Some common mistakes and failure modes of making decisions under uncertainty; Heuristics for principled decision-making in data science; The intersection of model building, storytelling, and cognitive biases to keep in mind; As JD says, and I paraphrase, “You may think you train your models, but your models are really training you.” Links Vanishing Gradients' new YouTube channel! (https://www.youtube.com/channel/UC_NafIo-Ku2loOLrzm45ABA) JD on twitter (https://twitter.com/CMastication) Executive Data Science, episode 5 of Vanishing Gradients, in which Jim Savage and Hugo talk through decision making and why you should always be integrating your loss function over your posterior (https://vanishinggradients.fireside.fm/5) Fooled by Randomness by Nassim Taleb (https://en.wikipedia.org/wiki/Fooled_by_Randomness) Superforecasting: The Art and Science of Prediction Philip E. Tetlock and Dan Gardner (https://en.wikipedia.org/wiki/Superforecasting:_The_Art_and_Science_of_Prediction) Thinking in Bets by Annie Duke (https://www.penguin.com.au/books/thinking-in-bets-9780735216372) The Signal and the Noise: Why So Many Predictions Fail by Nate Silver (https://en.wikipedia.org/wiki/The_Signal_and_the_Noise) Thinking, Fast and Slow by Daniel Kahneman (https://en.wikipedia.org/wiki/Thinking,_Fast_and_Slow) Get full access to Vanishing Gradients at hugobowne.substack.com/subscribe
Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.
Transcript
From the show. Tap a time to play from there.
Hey there, Hugo Bowne-Anderson here, your friendly neighbourhood podcast host.
SPEAKER_03Today, I'm super stoked to be speaking with James J.D. Long. J.D. is an agricultural economist, quant, and stochastic modeler, in addition to being an avid user of Python, R, AWS, along with colourful metaphors. He is also the co-author of the R cookbook and a born raconteur. So this is part two of a two-part conversation in which JD and I delve into decision-making under uncertainty and how we can use our knowledge of risk, uncertainty, probabilistic thinking, causal inference, and more to help us use data science and machine learning to
make better decisions
SPEAKER_03in an uncertain world. Feel free to check out part one, which I've linked to in the show notes, but this episode should stand alone also. So why am I speaking with JD about all of this? Well, because not only is he a wild conversationalist with a real knack for explaining hard to grok concepts with illustrative examples and useful stories, but JD has worked for many years in reinsurance. That's right, not insurance, but re-insurance. These are the people who insure the insurers. So if anyone can actually tell us about risk and uncertainty in
decision-making,
SPEAKER_03it better be him. So in part one, we discussed risk, uncertainty, probabilistic thinking, and simulation, all with a view towards improving decision-making. In this part two, we discussed the ins and outs of decision-making under uncertainty, including how data science can be more tightly coupled with the decision function in organizations. some common mistakes and failure modes of making decisions under uncertainty, heuristics for principled decision-making and data science, and the intersection of model building, storytelling, and cognitive biases to keep in mind.
SPEAKER_03As JD says, and I paraphrase, you may think you train your models, but your models are really training you. So a bit of bookkeeping before we jump in. I'd love to hear from you about what resonates with you in the show, what doesn't, and anybody you'd like to hear me speak with, along with topics you'd like to hear more about. The best way to let me know currently is on Twitter. At Vanishing Data is the podcast handle and I'm at Hugo Bowne. It would be great if you could subscribe to the show on your app of choice. And if you like it, do write us a review on iTunes and or anywhere else. Also, this episode was the first that we recorded as a YouTube live
stream. So when we occasionally refer to people commenting in the chat, that's what we're on about. We plan to have more such live streams and you can subscribe to our channel to keep up to date.
SPEAKER_03The links in the show notes. I'm your host, Hugo Bound-Anderson, and welcome to Vanishing Gradients.
Brr.
SPEAKER_03So to get into decision-making now, which is very, very exciting, I think we're bringing it, really bringing it now to one of the big reasons we're here. I do want to start off by mentioning how it can relate to probabilistic thinking as well. And I actually want to reference what you know is a podcast episode, which I'll share in the chat right now. It's... An episode with Jim Savage from Schmidt Futures. Jim is one of the smartest and sharpest thinkers I know, which is one of the reasons I had him on the podcast. But his... I don't know if it's still the case.
SPEAKER_03I think it is. His Twitter handle is AbelFoip. Correct. It still is. Which... which is an acronym for always be integrating your loss function over your posterior. Now, I mean, what on earth does that mean?
SPEAKER_00That's clearly impenetrable on the surface.
SPEAKER_03Anything we're talking about, right? And already I'm thinking Bayesian inference. But I want to just talk through a brief example, which can help us start thinking about decision-making under uncertainty. So an example Jim gives is a new type of chemotherapy drug where you run an RCT and get a causal estimate of the effect. right now the intervention will be costly to implement it will be both expensive and painful the effect has diminishing returns on on welfare reduces probability of death in next six months but no long-range effect on mortality at the expected at the point estimate effect size it seems to make sense okay so
what that means is
SPEAKER_03that your loss function looks pretty good at that effect size okay Now, but that doesn't tell you much about the distribution of possible outcomes, right? So how do you get the distribution of possible outcomes? What you do is look at the probability distribution of the effect size after you incorporate all your modeling and data into it. Now, that's called the posterior. distribution once we've incorporated our modeling and data into everything we get this posterior distribution and we want to convolve that in some sense so look at that at each point in the distribution multiply that by the
loss function or the cost and figure out then what the integral of all that is essentially so for those who don't know a lot of calculus essentially what we're doing there is at each point we're multiplying them and adding it all together to essentially get the
SPEAKER_03average right of the estimate weighted instead of just looking at the average of the estimate we're weighting it by all the possible effect sizes in order to make a decision and i'll link to it well i have given the episode of the podcast in the youtube chat i'll link to it in the show notes for those listening to the podcast itself but i think this is a nice way to start thinking about decision making and under uncertainty. But I do think this would be a nice point to speak to Mike Smith's question,
SPEAKER_03because we are talking about making decisions. We're talking about decision makers who may not be technical or computational. Mike asked, how do you communicate model outcomes and predictions to decision making? And then Mike says, because the danger is that they will hear computer says no.
SPEAKER_00Right. So let me tell you just like hand wavy how a lot of professional risk taking organizations think about this. Now, what I'm not going to do, and we'll get a lot of comments in the podcast and people will crap at me on Twitter or whatever. I'm not going to do that anyway, man. Exactly. That's what I'm there for. But this is going to have some holes in some of this. But conceptually, let's start with this as a simplified framework, knowing that it's a limited framework. So what a lot of risk-taking organizations do in order...
SPEAKER_00Well, first of all, if we have a financial organization where the outcomes are financial, the integration over the posterior with the loss function becomes easy. And the reason it's easy is they're just numbers. We don't have to do something like turn suckiness of life experience into a metric, right? We just have negative $100 million. It's really easy, right? So this is much easier in a financial trading shop. So I'm gonna kind of use that example. So we take the losses and then you have the probability
distribution and you can
SPEAKER_00get a probability distribution of losses. So when we integrate our posterior distribution with our loss function, we get a posterior distribution that is in dollars. And we can say, okay, we have a 5% chance of losing $100 million. We have a 20% chance of losing $10 million. We have a 30% chance of, you know, and we can do the whole distribution, right? I need not go through the full example.
SPEAKER_00And we have some mean expected. return that's the average well the in the world of finance they do a thing called risk adjusted return on capital rayrock it's even got a catchy name and what we can basically do there is say okay well take your loss at some point in the bad tail So in your organization can say, okay, let's take the one in 20, the 95th percentile, and we're just going to get a ratio when we decide what that
potential loss is
SPEAKER_00divided by the expected profit. And there we have a measure of our mean relative to a static point in the tail. And we can compare two deals, ones with a higher mean and a higher loss in the tail, the other one with a lower mean but a lower loss in the tail. Well, how do those compare? That ratio between that mean expected profit and the loss out in the tail can begin to help you triangulate on how to think about those two deals relative to each other because we're trying to compare the expected to some downside,
SPEAKER_00right? Right. This operation is like covered in undergrad textbooks. Right. In finance. Great place to start. Right. And then you can do interesting stuff like say, oh, what's our return on risk adjusted return on capital for all of our positions? That's our main portfolio. We've got a new deal we want to do. Oh, economists are all fetishized the margin, right? Making decisions on the margin. Well, we can say, what's the return on capital of this portfolio by itself?
SPEAKER_00And then we can take this deal, put it in there and say, what's the risk adjusted return on capital after adding that deal in? Ta-da, marginal. risk adjusted return on capital for a single deal, marginal Rayrock. And that will give you some, then you have some potential set of deals you might put in that portfolio. Well, you can calculate the marginal Rayrock for those to understand how they might fit. in that deal, right? And so that's one way, if you're in financial land,
SPEAKER_00you can, if you turn everything into dollar losses, you figure out which point in your tail is interesting to you. There's a big set of assumptions, right? I'm hand-waving by which point do you put, that sort of thing. But you can compare your expected to some point in the tail and have some sophistication when you think about adding things to your portfolio or adding risk to the portfolio.
SPEAKER_03Yeah. And of course, in the financial world, there's an obvious metric to use. And part of the challenge is figuring out like what the cost function actually is for any of the work and decisions we're making. So let's jump in to making decisions under uncertainty. What type of mistakes? What are the failure modes of decision making in an uncertain world?
SPEAKER_00Yeah, so my favorite mistake is the low frequency decision and drawing conclusions on the outcome. So an example of this might be, you know, my father who used to farm and before he retired, and he would hedge his corn crop on the Chicago Board of Trade. and sometimes prices would move you know in such a way that his hedge made a lot of money and sometimes they would move in such a way that they
didn't and he would draw conclusions on whether he should or shouldn't have hedged that year based on whether or not the hedge make money right that is not a sound way of making that
SPEAKER_00decision right just whether or not the outcome is favorable It's called outcome bias saying this was a good decision. Or resulting, right? Or resulting, right? So yeah, now we're in the world of gambling and we're going to steal some gambling words, right? So the next bit of this conversation is going to become like an Annie Duke love fest because Hugo and I both are huge fan of Annie Dukes. And she wrote a book called Thinking in Bets. And she introduced me to this term resulting in that book, which is where gamblers decide whether or not they make a good
bet on the outcome
SPEAKER_00of the bet. Well, that's not the right measurement, right? So if I went to Hugo and said, I have this coin, it's 75% of the time comes up heads, 25% of the time comes up tails. It's an even bet, which side you want, heads or tails, right? He's gonna say the side that has 75% probability. Well, that may flip it and it comes up the other. Did he make a bad bet? No, that was the right bet. It just went against him, right? And anytime you're dealing with uncertain outcomes,
SPEAKER_00you may not get the outcome that makes you money. That doesn't mean that your bet was wrong or ill-informed. It was the right bet, wrong outcome. And if you had to make that bet 100 times, you should make that exact bet every 100 times.
SPEAKER_03And something I've just linked to an essay, you know, that I wrote near the start of COVID around decision-making in a time of crisis and types of things we're talking about. I do mention one thing in there, Alan Downey. I wonder if I can find this. He, yeah, he said, if you think the outcome, well, we're talking about prediction in this case, and it can be a similar thing. If you think the outcome means a prediction is wrong, it really means you're treating a prediction as deterministic, not probabilistic.
SPEAKER_00Correct. And this is so common. This is built into human nature. We're horrible at thinking probabilistically, aren't we? We really are. So, you know, my wife has been married to, or she's been at least romantically involved with a professional risk manager for 20 years now.
SPEAKER_03And she's also married to you.
SPEAKER_00And she... Simultaneously, right? It turns out, right? And still, sometimes we have had to discuss decisions we were making. And I would observe she was second guessing a decision because it didn't all work out the way she had hoped. And I'm like, well, if you had to go back and make the decision again, what would you do? I'm like, now, wait a second. You're saying that because you saw the outcome. what did you,
SPEAKER_00and I'll ask questions like, what did you know, have any of that information at the time? And she'll be like, no, no, I mean, I couldn't have known that. And like, yeah, let's go back over what information did we have at the time? And we'll review the decision-making and we'll come to the conclusion of, given the information that was available to us that we had or any that we could get, we made the optimal decision. Sometimes it just doesn't turn out right. Let me tell you a story real quick of one that did turn out great. And it was the exact opposite of this. Oh, not the opposite. It was one where I didn't have any information.
SPEAKER_00So in 2019, we elected to leave New York City. We were living in New Jersey, just across the Hudson from Manhattan. And we moved back to Richmond, Virginia. The reason we moved back is... We had some family issues with my mother-in-law needing a little more help. We didn't really like the school options for our kid where we were. It was going to be really difficult to get her in the type of middle school and high school that we wanted. That was easy in Richmond, Virginia. My mother-in-law was here in Richmond, Virginia. So we worked it out with my work and we moved back to Richmond, Virginia.
SPEAKER_00And then the pandemic hit. I knew that I would be working one or two days a week remote when we bought our house. So I bought a house with the nicest home office I have ever had. And we had no way of knowing right around the corner was COVID and I would be effectively living in that office. And I'd be working in there full time. And in New York, New Jersey, we were living in a small condo. and because we moved into the suburbs of virginia we had a much bigger house with
uh you know a basketball hoop in the driveway for the kid to play basketball and it was a much better situation for us to write out coven oh in addition the condo facility we left it turned out like the month after we left they discovered structural problems in the parking garage and assessed everybody thousands of
SPEAKER_00dollars right right decision Great decision, JD. Freaking brilliant. No, it was absolute luck, right? Like the only thing in this whole process of decision making that we could have said we did well is after we had enough information to know it's time to make a decision, we made a decision. That's the only thing we did well. And it broke our way. And we ended up riding out COVID in a much better situation than if we had still been in the New York area. Absolutely had nothing to do about whether that was the right
decision or not.
SPEAKER_00It was just happy, positive luck.
SPEAKER_03Amazing. And I also was going to ask, I mean, as your wife and yourself have been romantically involved for so long, I thought maybe you moved there because, as we all know, Virginia is for lovers.
SPEAKER_00I can't reach it with my headset on. I got my Virginia is for lover cap right over there.
SPEAKER_03And I actually used a photo of it to promote this, of you in that hat, to promote this event as well. I love it.
SPEAKER_00at our wedding, we gave out, we had a very small family wedding at the Jefferson hotel here in Richmond, Virginia. So we were married here in Richmond and we gave out coffee mugs and pencils and something else at all the place settings at dinner that had the Virginia is for lovers logo on them. Cause that was like the tourism logo for Virginia for years and years. So those were our, our things we passed out. So that's how I ended up with that hat still is my wife saw it and got it for me and, Amazing. I don't think it's the tourism logo anymore,
SPEAKER_00but it has stuck around for so long because it's so appealing.
SPEAKER_03Totally. And of course, Kim Cressman just wrote, I thought you wanted to be closer to Kentucky bourbon, which is probably also at least partially true. That's true as well. So that was an example from your personal life, which I think is very illustrative. But you and I are both aware, and Annie Duke is as well. I mean, she, in thinking bets, I'm just reading verbatim, she asked business executives to write down their best and worst decisions of the past year, and they invariably wrote down the best and worst outcomes.
SPEAKER_00Absolutely.
SPEAKER_03Have you seen this play out in business?
SPEAKER_00Yeah, let me give you an anti-example of this. I actually watched this play out in real time right after I read Thinking in Bets. So in retrospect, this must have been 2017, 2018 is when I was living in New York and I listened to a number of earnings calls. in my industry and recommend others do likewise, right? You can learn a lot about your industry by listening to the earnings calls where the executives talk about what's going on. And what was interesting is, I think it was 2018,
SPEAKER_00because 2017, it had a bunch of wildfires in the western part of the US, like in California. And this must have been the end of 2018 because an analyst asked a CEO of a reinsurance company said, 2017 was a bad year for wildfires and you all took losses again in 2018. Do you think it was a bad decision to stay in that market? Was the question the stock analyst asked the CEO.
SPEAKER_00And I was like, oh man, we're about to find out a of resulting right and that ceo responded on that earnings call said no it wasn't a bad decision our playbook in these situations is we look at the science if the science and the conditions around the risk have not changed and all that changed was a bad outcome We have seen disproportionate opportunities in the past to stay in markets and
often have higher returns because other participants pull out after bad events. We stay in if the conditions and the science haven't changed because we don't think
SPEAKER_00the underlying risk distribution has changed materially. We stay in and we typically make increased profits by staying in those markets when everybody else pulls out. And I was like, oh, wow, like that is the anti-resulting, right? That is saying we don't think the distribution literally said something to the effect of we don't think the underlying distribution or risk has changed. Therefore, we liked it before. We should like it now at a higher price, right? A higher price on risk. And I thought that was so telling because the analyst really
was setting them up for
SPEAKER_00for outcome bias. Like the way the question was asked and everything was sort of just like, I'm going to softball. Don't you think you should have done something different? And the CEO was like, no. Given the information we had, this was the right decision. Now, he went on to say, we need to do that analysis again to see if we think there might be things that have changed that we couldn't see last year. And now that we've had two years of losses, what did we miss? And we will do that analysis.
SPEAKER_00Right. So didn't commit to stay in like I'm not just blindly staying into this. I have a metric for what I'm going to stay, which markets I'm going to stay in. And we're going to analyze and see if we fit that metric. And if so, we'll stay in that market. And I thought that was so interesting because it was just not, I think, the way. Well, clearly, based on Andy Dukes research, it's not the way most people, even business executives think.
SPEAKER_03Totally. And I do want to move into what should we be taking into account when making decisions under uncertainty. But I do want to split it. I mean, the example you just gave, there was a bunch of uncertainty, right? As well as risk. Whereas where I mean, any one of the reasons we look to people like Annie Duke, not only because she's fantastic and sharp, but also she was like a stellar poker player, right? Yeah, I think she was top four women in professional poker in terms of earnings, life earnings. Exactly.
SPEAKER_00So she hadn't even played in 10 years.
SPEAKER_03Exactly. And so but in poker, of course, you know, there are a bunch of cultural human dynamics at play, which I don't even claim to understand. But in poker, you can write down the tables. So it's all risk. There's no uncertainty. Right. Right. I suppose, what type of ways do you think about making decisions under uncertainty, under risk, and how should we be thinking about all of these things? So let me throw one little, let me push back just slightly on the poker thing.
SPEAKER_00There is a modicum of uncertainty, and that is your fellow players. you aren't playing a blind game that's completely driven by the cards you're playing a game that's partially the cards and partially how the other people at the table are playing those cards that piece is uncertain and i just recently listened to an interview with Stephen Levitt of Freakonomics and Annie Duke. And it was the people I mostly admire is the podcast.
SPEAKER_00That's Levitt's podcast. And one of the things that Annie Duke went through in that podcast was the way other players would react to her and how she would effectively take advantage of them because of their biased decision making. A lot of it having to do with machismo. I'm going to bully this woman around. And she's like, anytime they play with basically any objective other than to respond to the cards,
SPEAKER_00I can take advantage of them by being calm and understanding their bias. yeah and she'd eat their lunch right because she would understand that they weren't making the rational play they were making a play that was in order to try to bully her around or try to intimidate her or whatever right and she's like i would just use that as opportunity to play against them and take advantage of their bias they would be just be introducing bias right i thought that was great now let's go so there's a modicum of uncertainty now what she did was she was
good and skilled at
SPEAKER_00figuring out what was going on with the individuals to turn that uncertainty into understanding about risk, right? Now, to me or you, it would probably be just randomness. I couldn't interpret what somebody else is doing at a table, right? And how it's impacting their play.
SPEAKER_03And so, but let's be clear, and this is something I hope to get to soon. She's essentially building a model, a mental model, right?
SPEAKER_00She's absolutely building a mental model.
SPEAKER_03And she has assumptions in there and there's data coming in.
SPEAKER_00And she's updating it with more information, right?
SPEAKER_03Exactly.
SPEAKER_00All right. Now, where were we going from there? I got myself all sidetracked. Heuristics or rules of thumb or ways to think about making decisions under uncertainty. Oof. Oof. Good set of questions. Okay. So... When I think about, okay, the problem with the whole outcome bias thing is typically like we look at one risky decision and one outcome and we start drawing conclusions, right? So we've got what I always call square root end problem in that our confidence bands collapse with the square root of our sample size.
So we've got a sample size of one, so we don't have very good collapsing error bars around that.
SPEAKER_00So we can't tell much from one about the the decision making process but we can tell a few things we can ask ourselves or other people or our partner did we integrate all the information we had and so were we filtering information and not letting it into the decision making process that's basically saying did we have information we didn't respond to that's one was there information that we could have gotten and should have known to get but we didn't
SPEAKER_00And so that's like step two. And now what we're going to talk about is, well, how do we build a framework for decision or a system for decision making under uncertainty? And I think about it like, what did we know? What could we have known that we couldn't have access to? But we've got to be careful with those because we can just have hindsight bias. so if we had 30 points of information pointing in one direction and one piece of information that we didn't think was reliable pointing another and it turned out
that was the more reliable information well don't do hindsight bias and say that well we should always value aunt bessie's premonitions because aunt bessie had a
SPEAKER_00premonition about this decision No, that's still not good information, even if it happened to be right one time in hindsight. So we got to be careful with this evaluation. One of the things I like to do, and I do this at work by design, is I make notes and log notes when we make decisions. tremendously valuable to know what was I thinking and what pieces of information did I have at the decision point. And it allows you to go back and evaluate, right?
SPEAKER_00And so I'm going back and evaluating and realizing like in one situation, there was a piece of information I actually knew and I didn't put it in the notes. So I wasn't thinking about it at the time and it burned me. And all right, note to self. And I also actually shared it with a team of, I think I overlooked this piece of information. We should learn from this. This is an important piece of information in these type of decisions. So having a decision-making log,
SPEAKER_00of some kind. My wife laughs at me because occasionally I will write her an email saying, OK, here's the set of decision we were doing and what we're thinking. What I'm doing is I'm writing her an underwriting note. And that's what we would call it in my day job. The underwriting note explaining the decision making, what went into it, why, what our thoughts were. But I'll do it more as a conversation email to her more so we can remind ourselves what we were thinking at a given time. Incredibly, incredibly useful. So And then we try to get more larger in.
So we make more decisions over time and we continue this evaluation process.
SPEAKER_00And eventually, we don't have... all decisions that go our way, but we can create a system that produces systematically good decisions. Now, this brings me to my joke about luck versus skill. And it's, I'm not sure if I heard this in the underwriting context or the gambling context, but Hugo, do you know what the difference is between money you make by luck and money you make by skill?
SPEAKER_03Not much.
SPEAKER_00And none. There's no difference between the two. They spend exactly the same. Now, that hides the difference between a system that operates on luck and a system that operates on skill in decision making, right? In any one... situation, the outcome based on luck, if it goes your way is fine. If it's based on skill and it still goes your way, that's fine too. And so once again, that's the square root end problem. So if we think about many decisions over time, you want a system that's biased towards being skillful in decisions.
SPEAKER_00And So the kind of what I outlined about reviewing decisions after action report, if you will, or post decision analysis helps us give feedback into our decision making process to create a system and hopefully a team of people who make better decisions over time. That requires a bunch of stuff that's easy to hand wave. And I'll go ahead and call a few of these out. In order to have a team of people that can evaluate decisions together, you got to have psychological safety,
SPEAKER_00right? I've got to not think you're going to throw me under the bus when I say, sugar, Hugo, we had this piece of information and I was not thinking of that at the decision-making time. I got to make sure we can learn from that and not... you give me a crappy review so your bonus is better, right? We've got to be able to have the trust to basically be like, wow, okay, we're going to work together to make sure when we have information like that,
SPEAKER_00it feeds into the decision-making better. So we can, over time, build teams of people that make good decisions, wide-eyed, able to look bad decisions in the eye, able to do after-action reports without blaming people, blameless postmortems, you will, and able to get less fragile in their decision making. So coming back to the lab, now we're talking about a system of people that is anti-fragile. So it gets more robust as it makes more decisions. And as there's more and more feedback,
it makes better and better decisions, hopefully.
SPEAKER_00That's really what we're after. And we can't evaluate any of this on any one single outcome of one single decision. It's got to be a series of decisions over time, each one with review, with feedback, understanding what we knew, what we didn't know, understanding what we did well, what we'll do better next time. And you got to be able to grow over time. If you do that, you can create a system that produces better outcomes. Are there still going to be Things that are going to go against you?
SPEAKER_00Absolutely, right? Like, because once again, we're not turning a probabilistic system into a deterministic one. We're trying to figure out how to get the most of the probabilistic information we have into our decision making to make a probabilistically sound, but not deterministic decision.
SPEAKER_03Exactly. And so to reflect one of the key points in there, I think we want to look at the long run frequency of decision making and hopefully see that improve over time in terms of good decisions being made.
SPEAKER_00But not necessarily good outcomes, right? So a good decision is evaluated by the inclusion of the information, not the outcome that came from that. Because if we're talking about decisions where you've only, like you're making the decision 60%, 40%, you're still going to have lots and lots of 40% of the time that's going to go against you.
SPEAKER_03Absolutely. I think my point was that if you evaluate the outcome over long run frequencies, good decision makers will result in good outcomes more often. That seems fair. In a long run probabilistic.
SPEAKER_00If you get enough in, right. Exactly.
SPEAKER_03Exactly. And this is a point that I'll direct people to Philip Tetlock's Good Judgment Project and his book, Super Forecasting, when he goes through a lot of ways to heuristics, making robust predictions and type of characteristics of people who can do that as well. And constant updating is one of them. But he makes clear that when judging predictive power, you really want to be looking at long run frequencies of predictors and that a lot of the predictions we see in media for example there's a
misalignment of incentives right so people will be more heard get more clicks get more revenue even pre-clicks get more airtime based on being very strongly opinionated and perhaps being wrong after the fact but then they move on to the next prediction as opposed to having
SPEAKER_03being let's say more humble or expressing more uncertainty around their prediction. And thinking about incentives of talking about predictions is fascinating. I have heard, once again, this may be apocryphal, that let's say the meteorologists see that it's 50-50 chance of rain tomorrow. That on average, they'll actually say it's a 60% chance of rain because they don't want to seem like they're sitting on the fence. No one believes you if you're sitting on the fence. And they've seen that people will be happier if they think there's a slightly larger chance of rain and then they see a sunny day.
SPEAKER_00Yeah. So I got to be careful here because I literally sit in an office with a whole bunch of meteorologists sitting right around the corner from me. Amazing. They will toilet paper my cubicle if I am not respectful. My understanding is like National Weather Service is real stable on theirs, but my understanding is television... That's actually what I meant. Meteorologists have a slight bias towards calling for rain because it's really twofold. One is people like it if it doesn't, if they're pleasantly surprised, right?
SPEAKER_00This is psychological fact. The other thing is what they think the question people are really asking is, should I take my umbrella and my coat? They think that's what people are really asking. So if you bias just a little heavier towards rain, then you have fewer days where people don't take their umbrella in a coat and they wish they had. So you sort of, in a way, they're integrating over the posterior, but without anybody's permission. Exactly. They really are. It's not how they're thinking about it. Yeah, they are, right? Fascinating.
SPEAKER_00That's not how they would describe it, but that's what they're doing. They're saying, you're going to regret not taking your code more than you regret taking it and not needing it. We know that, so we're going to put our thumb on the scale as a result of our integrating your loss function over the posterior.
SPEAKER_03Exactly. And thank you for that generous correction on your behalf. I definitely did mean weather people, not meteorologists as well. I feel like this conversation about weather reporting wouldn't be complete without mentioning an episode of Curb Your Enthusiasm in which the weather human, the weatherman predicts rain with great certainty and Larry's supposed to play golf the next day. And he's like, bugger it. I'm going to go and play golf anywhere. Beautiful day. No one's on the course except for the weatherman. And he goes up to the women and says, I'm on to you.
SPEAKER_03You're predicting rain so you can have the golf course to yourself. That's funny.
SPEAKER_00I like that.
SPEAKER_03Yeah. I also just want to talk about risk friendliness and risk aversion. We're talking about decision-making as though based on given the same information, you and I may make the same decision, right? There are lots of variables at play. We've talked about the probability or likelihood of certain events occurring. There's also impact, like if the downside and upside risk can be disastrous or not, right? So one example that I've discussed with you and I wrote in that essay that I've linked to Early on in COVID, my parents were high risk with respect to COVID.
And I had a negative test and my friends were like, oh, you can go and visit.
SPEAKER_03And I was like, well, let's just be careful. There's a false negative rate, which I should take into account. And it's low likelihood that I have COVID now. But think about the impact. It could be fatal. And this was early days in COVID, right? So thinking about... not just the likelihood of events but the impact once again we're doing some form of integration over the posterior but before that we're thinking about some sort of risk matrix is what they call in business right where we have likelihood impact and then thinking through risk friendliness and risk aversion all
of these should be
SPEAKER_03taken to an account when making decisions right
SPEAKER_00Yeah, so I found myself in a very similar situation during COVID. My wife has really severe asthma. It's under control, but she medicates twice a day to keep her asthma under control. And so it's severe asthma. It's fortunately controlled. we were very concerned well and beyond that my parents and my mother-in-law would all be high risk as well so we were very concerned and we were very concerned about transmission into our household and so that meant for me and also choice to keep our daughter out of school a little longer than everyone else
did those were all driven because we felt our that was not that we felt our risk was higher that
SPEAKER_00wasn't really risk aversion we just felt like our risk function was higher. Other people felt like maybe their immediate household wasn't at under quite the threat that we felt my wife's health would be if she contracted COVID. So if you had two healthy 40-somethings, your risk is significantly lower than our situation. So we felt we had a different risk profile. Now, on top of that, there's this idea of risk aversion, which makes me go back to, I got to make up I got to make one of my earlier assertions more sophisticated.
Because earlier I talked about how everything's simple in my world in financial
SPEAKER_00services because I turn everything into dollars. And so my integrated posterior distribution is all in dollars. And so I guess we're multiplying the risk times the dollars of loss. So I can say dollars of loss at every probability point. Well, all of this kind of assumes that losing dollars and gaining dollars of the same amount are offsetting. And what we know about psychology and behavioral economics is that may not be the case.
SPEAKER_00A windfall of $10,000 does not make me as happy as a shortfall of 10,000 makes me sad.
SPEAKER_01Absolutely.
SPEAKER_00In effect, it's not symmetrical. So downside has more negativity than the upside has positive. So the way that, let me tell you how this manifests itself in my personal life. Since I'm confiding in you, all of these secrets of my personal household, I actually over withhold my taxes. which seems nuts for somebody who's an economist to do, right? I'm giving the government a free loan. No, that's not how I think about it.
I underheld and I saw the stress that caused my wife when we had a taxes due at the
SPEAKER_00end of the year. And I'm basically like, I don't want that stress in our collective life again. So I always make sure we get a little refund, right? at the end of the year. Is that financially sound? Is that the best like optimizing dollars? No, but what I'm doing is I'm eliminating the possibility of us having a shortfall and that causing stress in our life because that stresses my wife out. She knows this, right? She knows I do this. This is not a secret revelation to her. And she's like, yeah, that's a good idea. Because she knows that to her,
that negative downside is way more painful than whatever dollars we're saving by
SPEAKER_00trying to nail it exactly or whatever, right? So sometimes we discover that the payoff is not symmetrical or that the dollars of loss are not equal to dollar gain. A bunch of that behavioral economics looks into this. This is really simply risk aversion. And yeah, if we integrate under our posterior, distribution properly, if we integrate our loss function on the posterior properly, it really wouldn't be just dollars. It would be something like the amorphous units of happiness
that economists use called utility. And I would have more negative utility for negative $10,000 than I would have
SPEAKER_00positive utility for positive $10,000, right? One would be worse than the other would be good. That's how we might try to capture it. That's hard to do. It's hard to do in practice. But we do see that different individuals have different loss functions in terms of their utility response to loss versus gain. Some people really love gain so much that they're willing to take a lot of loss to get that dopamine hit from the upside, right?
SPEAKER_01Absolutely. Some sort of something like that in the brain helps with driving addiction to gambling.
SPEAKER_03Yeah. I wonder if most recent former president of the United States is such an example. I do want to say with the behavioral economic stuff and the risk aversion, a lot of the biases we've been talking around, Thinking Fast and Slow by Daniel Kahneman and Sversky is a wonderful reference. Beautiful book on such things. Mark Rieker has also written in the chat with respect to incentives and hot takes. That Nate Silver's book, The Signal and the Noise, references a study that actually finds a negative association between pundit takes
SPEAKER_03and outcomes. I had not remembered that. And I definitely checked that book out for a lot of things we're talking around as well. I actually think about this when hiring also. I mean, part of the hiring flow is trying to find signal on performance and the types of things that usually attract us to other humans... I think can be anti-correlated or at least uncorrelated, but a lot of the time anti-correlated with the types of things we really want to find signal on as well.
SPEAKER_00Yeah, we could do a whole other podcast on hiring analysts. I have lots of thoughts, probably shouldn't get into that here, but it's a really rich topic for discussion of decision-making, heuristics, criteria.
SPEAKER_03Well, we'll definitely have to have you back on the show for that. I am interested when you do hire people, all these things we've been talking about seem essential to people's work and the people that you hire, the people you work with. Do you hire people who know everything we're talking about or do you have conversations with them on the job? How do you even think about developing a team and a workplace where people know how to judge decisions and make decisions and do analysis and that type of stuff? So if we were hiring more senior people,
one could imagine you would filter for a lot of this. A lot of my hiring is with relatively junior, so five years or less of experience. And I do not expect any of these things you and I have talked about to be mature in
SPEAKER_00their thinking. I might ask a question to see if they just by luck had happened to think about any of this, but my expectation would not be that they had. What I'm really looking for and what I think a lot about is filtering for demonstrated ability to learn and do things and curiosity question asking questions. If somebody comes into, and I kind of liked the interviews over video chat, and somebody's got board games on the wall,
SPEAKER_00I'm going to ask a lot of questions about board games because that may be indicative. It may be indicative of this, they're in their childhood bedroom, or it may be indicative of something really interesting in their thinking that they really enjoy problem solving. They really enjoy doing things in groups, problem solving in groups, right? If they tell me they're a dungeon master, I'm going to have lots of interesting conversation, right? That's an interesting area. And I'm way over, I would way rather over solve for curiosity and problem solving
ability than
SPEAKER_00with a kind of minimal technical threshold. I mean, we've not talked any about programming languages, statistic tools and all that. I've got a bar about here for that. I want some evidence of it, some evidence of having learned some tool. But in terms of exactly the tools I'm using and the way I'm using them, no, I'm not solving for that on a relatively inexperienced hire. That syntax, if they know how to Google and they know kind of the concept, they can find the answer of how to do that in Pandas or how to
do that in R,
SPEAKER_00right? They can figure that out. So I'm way more interested in curiosity and problem-solving that sort of thing awesome so i do want to get to some tools maybe when we wrap up but i am something we haven't really talked about talked a lot about probability
SPEAKER_03decision making we haven't talked about causal inference and i know your backgrounds in agricultural economics as everyone does that does now but when when thinking about decision making we are reasoning through causality already right like we're thinking i do this these things may happen so what's the role of causality and causal inference in thinking through decision making and making robust decision making? Yeah, so what's interesting here is a whole bunch of the stuff that I deal with.
SPEAKER_00My day-to-day application, I'm not super worried about exactly what causing which range of outcomes as much as I am concerned about what is the range of outcomes. And then often I have very weak And I do know I want... If I'm discussing an insurance company that may go... Their reinsurance program may go into our portfolio that we have.
SPEAKER_00As I think about that, you want basic... You want to understand the underlying product because you know that will cause losses that will flow into our portfolio, right? Like that's determined that that's the causality. And we often don't have to think too much about some of the more interesting aspects of causality, such as confounders. Like we're seeing an outcome, but we're not sure what thing actually caused, if it was the thing we're modeling or a,
SPEAKER_00you know, secret third thing that isn't being modeled, actually causing it. And those are the interesting aspects of causality. So in a lot of the bread and butter stuff that I do, causality is fairly straightforward. And we're pretty fortunate in that. And the when causality starts mattering is when we start like taking apart insurance programs and asking why did they behave a certain way? Why did we have certain losses?
SPEAKER_00And we uncover things we didn't expect, or we Let me tell a story actually about causality and non-linearity from my earlier career when I worked in primary insurance briefly. I had the president of the company come to our risk team and say, we are seeing declination rates vary pretty wildly from his point of view week to week.
SPEAKER_00And at times, the declaration rates are quite high. The policy applicants who were being declined insurance. And this was a health-related insurance product. And he said, basically, is this a quality issue with my underwriters? Or is this something else? How can we tell? And I'm like, aha, actually, I know how to think about this. I'll build a logistic regression. And I'll look at the applicant properties,
SPEAKER_00things like age, do they smoke, do they have a heart condition, stuff that's captured in our underwriting system. And I'll calculate the probability of them being declined. And then we'll look at a group of them. And also, I'll build this as a logistic regression. And I can put, based on my regression, come back into some confidence bands. And we'll say a given week cohort should have this declination rate based on
SPEAKER_00averaging out the declination of all the, or summing together the probability of all of them and putting a confidence band around it. And we'll plot each week with its confidence band and plot then the actual declination and see, does the actual declination ever get outside of the confidence band of my logistic regression that I built? And I didn't have just age and add like five or six variables in there. And what we found was one time the actual declination rate was
outside of those error bands.
SPEAKER_00We had roughly, I forget, like a year of data And my confidence bands were 95th percentile. Well, hell, we're doing great, right? I would have expected that we would have had one in 20. So at least a couple over the course of 52 weeks would have been outside of those error bands just based on random noise, right? So it's kind of like, you know, my conclusion was there's no evidence that the underwriting process is unstable so that means that but we
also saw the expected move up and down which means the characteristics of the underlying cohort from week to week were changing dramatically enough that our expectation of the declination rate was moving around and i went looked at it and unshockingly what it
SPEAKER_00is is the declination rate function relate to age is exponential. So the probability of being declined at age 80 is more than double at being age 40, right? At 40, you almost can't be declined. And at 80, you almost can't be written, right? It's the probability of declination goes up exponentially. That blows our intuition. So we could have things like a handful of very old people in a given week, and that slams the expected,
SPEAKER_00or I guess increases the expected declination rate. So that move was not intuitive to someone just looking at like the average age. Once again, it's that story of averages versus first moment versus second moment versus third moment. The head of the president of the organization had looked at the first moment, but the average age is hardly changing. And we're like, yeah, well, those few young people don't make up for those few really old people that you get in a certain week. Because the difference between a 20-year-old and a 40-year-old is almost
SPEAKER_00indistinguishable in terms of declination rate. Both of them are really low. And then you get a handful of really old people and it blows everything up. And there's kind of two stories here. One is that story about how that non-linearity blows up our intuition. That was the causal factor causing these numbers to move around. And actually, what's joyous about this at this point in my life that wasn't joyous at the time is nobody listened to me. And the reason nobody listened to me is I made a fundamental analyst error.
SPEAKER_00I had a variable in my regression that wasn't very important, but I left it in there and I didn't understand it. And when I explained it, the president of the company was like, I don't think that's what that variable means. And he calls up the head of underwriting, puts him on speakerphone with me in there presenting this. And he's like, tell me what this factor in your database means. And it wasn't exactly what I said. And basically, it was an ad hominem fallacy where he's like, well, you're full of shit about this variable. Probably your old analysis is full of shit and effectively kind
of wrapped up the
SPEAKER_00meeting with generally disregarding the work I did. Well, that was a little disappointing at young me. Old me relishes in telling the story because I learned an important lesson about basically make sure you understand absolutely everything in your regression or in your model before you start sharing about it because you do not want to learn that you're wrong when it really matters so any whoever owns in the business every metric that you have in any model make sure you sit down with them one-on-one and go through your
results and and explain your understanding of what these different fields or different metrics means and ask them to confirm whether you're right or wrong right that was a huge career lesson for me sucked at the time but i learned something
SPEAKER_00pretty important right Non-linear functions, they're important. Also understanding every variable in your model and discussing it with the business owner before you start drawing conclusions, also very valuable.
SPEAKER_03Yeah, and this also, I think, builds trust and credibility. And back to a question, something we discussed earlier, is when communicating decisions or communicating modeling outputs to decision makers, the fact that you've incorporated their knowledge and domain expertise into it is incredibly important, both culturally and in terms of the information you need and have. I appreciate that insight into how you think about causality more generally. I think it's probably worth mentioning, as you and I have discussed before, us humans seem too good at thinking causally where we think
causation is happening where it isn't at all and horrible at thinking probabilistically in a lot of ways. And there are evolutionary arguments going back to the Savannah or wherever we were
SPEAKER_03where we didn't really need to think probabilistically, but causation happened. was super important. But something I thought to mention here, because we are talking about probability and causation, is something that Edwin Jaynes wrote in his paper, Clearing Up Mysteries, The Original Goal. I'm actually going to include this In the show notes and in the YouTube chat. And this was actually one of Bayes' – I'm actually going to read you. You know this, JD. I haven't announced this publicly, but I'm actually working on a book currently on Bayesian inference and probabilistic programming with my good friend and colleague,
SPEAKER_03Eric Ma, who people may know. But this is from a chapter we're working on in this book is one of Bayes' keen insights in answering the inverse problem. So this is going from the probability of A given B to the probability of B given A. such as the probability of a model or an estimate given data to the probability of data given an estimate. But one of Bayes' keen insights was actually to decouple probability and causation. So until Bayes came on the scene and made sense to talk of P of E1 given E2,
SPEAKER_03the probability of an event E1 occurring, knowing that E2 occurred only if E1 occurred after E2. But Bayes' solution to the inverse problem now meant that it makes sense to talk about the other way around, independent of both temporal and causal order. So you can actually talk about conditional probabilities when temporal and causal order are unimportant. Now, Edwin Jaynes in all his genius came up with a wonderfully simple example. He said, you have an urn in this paper. You have an urn containing five red balls and five white balls randomly mixed.
SPEAKER_03You take out one ball, B1, and it's white. You take out a second ball, B2. What is the probability that B2 is white? Now, a few fractions and probabilities will tell you it's four over nine or whatever it is. Because we know there are four white balls and five red balls in the urn before you draw B2. Okay, now he then asks a second related but distinct question. You have an urn containing five red balls, five white balls, randomly mixed.
SPEAKER_03You take out one ball, B1, and do not look at it. You take out a second ball, B2, and it is white. What is the probability that the first ball is white? OK, so this scene still seems counterintuitive to me. How can the color of the second ball impact the color of the first ball? It makes no sense at all because there's no temporal or causal relationship between it. And so we know the color of B2 cannot causally impact the color of B1. But the color of B2 does provide information about the
distribution of colors across the other balls and then does tell us something about the color of B1.
SPEAKER_03And this is Monty Hall in another way.
SPEAKER_00I'm just going to say, this is just the Monty Hall, right? Which I had had lots of creative ways to try to explain the Monty Hall problem. And... buddy of mine and that i work with in bermuda trevor leash looks at me and he's like basically you're making this too hard think about the extreme case imagine you had a hundred doors and you've already made your choice and we're gonna open 99 of those and so there's only or 97 of those or whatever so there's two left the one you picked or two others do you switch now
And it's so much more obvious that there's information flow when you pick an
SPEAKER_00extreme, when you make it very extreme, when you take out a whole bunch of options. That gets lost in the subtlety of the Monty Hall problem or the Monty Hall game. And similarly here, the reason we know it's a Monty Hall problem is we say to ourselves or those of us who think about these classes of problems, you say to yourself, is information revealed? that impacts what i know and there's a difference between what i know versus what is causal or what's causing right and that's the distinction
you drew out there which i think is really cool and a neat way to illustrate that yeah absolutely so there are two final things i'd like to discuss do you have a hard stop on the hour or can we go slightly over no let's party all right let's go all night line of
SPEAKER_03richie exactly So the two things I want to talk about, we'll get to tools because I just think thinking through what type of tools you use and how you even evaluate tools and the surface area of the tooling space is pretty wild and fractalesque at the moment. But before we get there, something we've been talking around a lot is modeling. And I want to be explicit. So a huge part of decision making just involves modeling the real world, right?
SPEAKER_00Right. Either explicitly or implicitly. Exactly. Everybody makes models in their heads. That's what we do. And there's strong evidence that From what I can tell reading the literature, that basically that's one of the things that makes humans humans is the sophistication of our mental modeling of the world around us. We could almost be homo modelicus as opposed to homo economicus, right? The animals that make models and predictive models at that in our heads. And then some of us explicitly make those models outside of our
head rather than
SPEAKER_00just using the implicit ones.
SPEAKER_03And so there are a lot of things that go. And that's one of the reasons I like Bayesian analysis and say I'm probably a Bayesian.
SPEAKER_00You can never be sure, though, can you?
SPEAKER_03Well, right. If you are, you're not Bayesian. That's the Creighton Bayesian paradox or something, the probabilistic Bayesian paradox. But because when I do Bayesian inference, I have to make my assumptions explicit and I think that's worthwhile. What are the most important parts of building models and that we kind of need to check ourselves on as well?
SPEAKER_00Yeah. So the biggest mistake I see is complexity. Too much. There's a ridiculous amount of problems that can be solved. You know, the economist in me wants to make this all sophisticated sounding. We need a parsimonious model. Like really what we're saying is make a simple model. And a biggest mistake I see over and over is comparing a sophisticated model to no model at all. And that's a huge bullshit red flag.
SPEAKER_00And the reason it's a bullshit red flag is we never have no model. We have some model, right? Like even weather forecasting, I can take, say just today's weather is going to be like yesterday. That's a model, right? It's a lag one day model. And someone comes along and they's like, oh, well, our model is so much better than having no model at all. Like, well, does it beat today's weather is going to be like yesterday? Well, what about today's weather is going to be like this date averaged over history, right? So that'd be a climatological model saying the weather today is
the average, right? And so you've got to compare what's your lift or your improvement over the stupid,
SPEAKER_00basic model that has no sophistication, right? And if you're going to introduce something that's complicated, complex, you maybe even can't explain how it works, it sure as hell better give you a lot of lift over the stupid model like the average or the look back one time period model, these stupid models. You better be able to dramatically outperform them in order to pay for the care and feeding of your sophisticated model. And that mistake is the one I see being made the most, right?
SPEAKER_00Yeah.
SPEAKER_03Absolutely. And something I'm also hearing in there is, once again, my Bayesian mind is going, Jaynes, among others, very sophisticated Bayesians in the 20th century, made it very apparent that part of the formulation of Bayesian inference is that all probabilities are conditional. on some form of information you have. So when I've said that to people, they've said, oh, what about when I flip a coin? It's 50% chance heads, 50 tails. That's not conditional on anything. And I mean, how do you develop that model that that will be the case? It's not only through empirical observation, although it could be,
SPEAKER_03It's actually through thinking through the physics of the situation, that when you flip a coin, that the weight is symmetric on both sides, something about the wind, something about how it lands, these types of things. So there is all types of information and assumptions you're saying to even come out with a probability, I think.
SPEAKER_00Just a whole bunch of time, we kind of can assume those away, right? Because they practically don't matter. And this is like where when I have conversations with philosophers, I often just am like, that was interesting, right? That was an interesting set of mental gymnastics we just did. How does one use that? Because I am so applied in my thinking, frustratingly so, to people who want to spend a lot of time with minutiae on details. And I'm like, but, you know, I've got to make these kind of gross decisions that aren't fine
cutting with a
SPEAKER_00scalpel. And this is like where I got, I probably... put too little weight on Kaggle competitions to being informative to skill because of my experience with those. I did one. The first one I did had something to do with insurance. And I got to... I was like absolute middle of the pack. And I looked at it and I'm like, okay, the spread between me and the perfect person is so small that the thing we're trying to decide that wouldn't have like $100 difference in an insurance company.
SPEAKER_00We're done. This project was done four iterations ago. This is absolutely zero marginal value for applied decision-making, yet we're going to carry on acting like all of these people whose scores are different in the third and fourth decimal point. This means something when this is absolutely immaterial and complete noise and I don't give a shit. That was the last time I looked at Kaggle. I probably wrote it off to... quickly but it was this problem with separating what's a
meaningful distinction not just a measurable distinction because i'm very big on give me a meaningful decision not totally measurable distinction and i think in the example i just gave it a meaningful distinction which i mean it's partially a joke but i think will speak to your practical concerns which are very important if you have a weighted coin right which the joke is there are no bias coins so why do we keep giving this this example the one bias coin you'd think of would be a weighted coin and there that's when a model assumption breaks down and you can make poor
predictions based on it
SPEAKER_03so we need to check our all our assumptions right totally brilliant
SPEAKER_00Right? Absolutely. We mentioned we invoked Taleb earlier, right? This was the thing that his character, I think it's Fat Tony, in his Fooled by Randomness and Black Swan, the thing Fat Tony would figure out that the eggheads wouldn't is like if he's playing the street game and it goes against him two or three times, he doesn't have near enough Bayesian inference to change his opinion, but he's going to flip the table over and be like, you're hustling me.
SPEAKER_02Yeah.
SPEAKER_00Because he knows know kind of intuitively when the fix is in right and so what we're really talking about is a little bit of that that street smart yeah of oh we can always assume that the coin is fair until it's not
SPEAKER_03So let's talk tools. You're one of my friends who works in R and Python and AWS, of course, and you're author of the second edition of the R cookbook. Did I get that? Correct.
SPEAKER_00That's correct. Yep. Second edition. Paul Tudor did the first edition. And when we did the rewrite to make it tidy using the tidy verse, I did the rewrite and he's my co-author then did all the review on it. So yeah. Awesome. Deep into R and Python. so yeah tell us about the tools you use what you're excited about and how you think about even there are so many new tools coming on on the scene how you think about it like evaluating them is more than a full-time job as well oh geez yeah and advice for people what tools to use there are 10 i've done the
worst job the one
SPEAKER_03thing you don't do as an interview ask 10 questions at once so the whole interviewer shtick is ask one question at a time right so you gave me five good
SPEAKER_00good job exactly All right, let's back up. How do we think about tools? If I'm working solo, my choice of tools is less meaningful. Most of us don't work solo. And I did a whole bunch of actually my work, even within companies where I was part of a team, because the way those teams were organized, I was a bit of an autonomous unit in a team. So there wasn't a lot of interaction. We each were, we'd talk about what we were doing, but we each owned whole projects and moved them forwards.
SPEAKER_00So we're fairly autonomous inside the organization. So I did a lot of R because I really like the defaults of the tidyverse and I like dbplyr, how it abstracts away and I don't have to switch between SQL and dplyr code. Like, I think that's all really great and makes me super effective writing fast code and I can get to answers quickly. And that was great. I'm not a software developer. I'm not a particularly skilled programmer. I do it because it helps me get to an answer. But as soon as I started working and largely also when I hired
analysts to work for
SPEAKER_00me, we had to kind of rally around the flag on what are we going to be writing in? Because I wanted them to be able to move code between different analysts and share a code base and use common methods and even literally shared libraries for functionality and And most of the rest of the team was writing Python. So it was a no-brainer, right? This is a network effect problem. The network effect is way stronger than any individual factor. So while on an island,
SPEAKER_00I'm a little faster and more productive with R and Tidyverse, if I'm getting my benefit from being part of a network network, That network of everybody else is more proficient in Python. I switched to Python. And that's what I largely have done when I'm working in that team context. Now, if I sit down to just hammer out a quick example or to teach myself something, we hadn't really talked about it. We've alluded to it about building models sometimes to train us. A lot of times, I'll do that quickly in R because it's more my native tongue,
if you will.
SPEAKER_00And the Python, I have to Google more. It's not a lot of work, but it's a little bit more friction. But, you know, the team uses Python. And when I'm doing code there, I'm writing Python for the analytical team that I'm on. And largely, we use any number of these tools. Moving on to another part of your question. I love it.
SPEAKER_03I was going to ask it and you're already there.
SPEAKER_00Asking myself the questions.
SPEAKER_03Exactly. I mean, you're doing my job. I'm going to find myself.
SPEAKER_00I'm glad you threw five questions at me. So I got to do what I can here. So the next part of it is that, okay, about learning new tools, that should be necessity driven. So the advice about premature optimization, premature optimization is the root of all kinds of evil or whatever. I don't remember the exact quote. Don't start switching tools, platforms, frameworks, all this until you got a problem that needs it. That's a problem I see a lot of folks doing, right? Like, oh, we'll use this shiny new thing because it's shiny new thing. No, you're just introducing complexity and you may be using a tool
that your team doesn't use. And we've already established the network effects of everybody using the same set
SPEAKER_00of tools is actually what makes the team more productive. So you want to bogart those network effects. So use... common tools and then add new tooling when you have a problem that is solved by that new tooling or when you have a class of problems that you need new tooling. So if everything works at a reasonable speed in Pandas or our Tidyverse or whatever your team is using, cruise. Just keep chugging along doing what you're doing. And add more tooling if,
SPEAKER_00for example, the new tooling reduces the complexity of what you're doing. So if you're an analyst type and you're writing, God help us, a bloom filter or something like that, you shouldn't be. You should be using a library that has that built into it. So Cut all that garbage out of your code and use that from a library or something. That would be an example of adopting a tool because it removes complexity and says somebody else can maintain that code or some open source project or some vendor can
SPEAKER_00maintain that code, not me. That's a great return on tooling. Or you say, gosh, I can't read this entire parquet file into memory that I have on my machine because pandas can't hold this whole thing. What do I do? That's a problem DuckDB solves or Polars, for example. Like those are a couple of projects that I'm pretty keen on right now. So you might say, okay, we're going to introduce one of these two because I have a class of problem that this solves.
SPEAKER_00And largely life is, in my experience, analytical life is stumbling along using the tools you know until you bang your head on a problem that you either can't do efficiently or can't do at all. or can't do it fast enough with the tooling you have. And then you stop and you say, okay, what's my real problem here? You isolate the problem. And then you say, what are the selection of tools I have out here in the universe that might solve this specific problem? And then you go, you try to figure out which one of those would be the right
solution for you.
SPEAKER_03Great. I think it being based on necessity is incredibly important. How do you think about... I mean, DuckDB is a great example because it's several years old, but not super mature yet. It's incredibly useful for the use case that you suggested. But how do you even... All marketing pages look the same for all tools and all companies, give or take. So how do you think through actually finding the right tool for the job?
SPEAKER_00So this is where it's like we become a type of filter. You know, I follow, as you well know, I'm following a lot of folks on Twitter and I read a lot of information there. I read a number of blogs and information that flows through a number of blog sources. The vendor stuff is notoriously bad because it's just the signal noise ratio is off in most vendor literature. So I watch the social media, the blogosphere, and I'm filtering.
SPEAKER_00I swear the thing I do efficiently is just filter. Like, this doesn't matter. This is... Oh, wait a second. This is kind of interesting. And I also have a network of trusted friends who will shoot me a text message about, have you seen this? Or we're trading emails or we're in the group chat at work. So once again, a network effect of trusted people who are also filtering lots of different sources, right? And saying, is this interesting? Should we look at this? How hard would this be to replace that problem?
SPEAKER_00And like these conversations are going on in my life over in the sidebar, like literally daily, like constantly through the day. So we have to filter huge amounts of information. And what we'll find on a team is there are people like myself who are like highly tapped into social networks. And that's kind of interesting. And so we do a lot of that. And we become like folks who stream information into the larger group. And then there are other people, like some of the folks on my team, the very idea of having to keep up with all the internal chat
at our company makes
SPEAKER_00them feel swimmy headed, much less Twitter and blogs and all this other stuff. So they're not synthesizing as much external information, but they're probably more likely to build a POC a proof of concept with some piece of tech that I pull in or to help me see a use for it. Or they're perfect for me to sit down after I've refined a handful of interesting technology, sit down with me and help me make sense of them. So I'm a big fan of people in teams, right? People in teams are amazingly more effective than individuals.
And that's an example of me and some of the folks I work with having very different
SPEAKER_00proclivities towards filtering information and pulling in new stuff. So that's a big chunk. Now, the other thing, right, and I'm speaking at the upcoming Vicki Boydkus' norm conf on the topic of subtractive thinking. Now, by saying it, I've kind of given away the punchline in a bunch of my presentation, but I think I'll be okay. One of the things one has to do before you try to match tooling to your problem is you got to isolate your problem. And this is a mistake I see folks making over and over is they
don't fundamentally
SPEAKER_00isolate what is the bottleneck or the problem in what I'm trying to do. You know, they come in with 400 lines of code and they're like, this isn't fast. And it's like, well, my question is, what in there is it fast? Because you're doing like 100 things. And if we can isolate the bottleneck and then we make a simplified example that shows the data that flows in, it shows the bottleneck and it shows what is supposed to be produced. And we have a reproducible simple example. Then we can ask the question, what other ways might we solve this problem or how might we
solve this problem
SPEAKER_00quicker? But we had to get it out of the 500 lines of spaghetti over here, get it in like a notebook cell or two notebook cells showing input, showing output. And then we can do a couple of things that really are damn near magic. And that's show it to lots of people. The incredible effectiveness of sharing your problems with people on your team once they've been narrowed down. Like, I mean, I guess we should back up a step. The back up a step is once you narrow it down, it's rubber duck debugging, right? The process of narrowing it down is like explaining it to the
rubber duck.
SPEAKER_00You discover, oh, That matrix is sparse. I bet if we change the way we store it, it'd be a lot smaller. And that size change in and of itself might solve our problem. Let's try that. And you discover by yourself things. The next part is you have it isolated. You maybe even try a couple of different ways in a notebook of solving your problem. And you begin to shop it around to your team. And they will see things you didn't see or you run it by me. And I'm like, did you know Polars now does streaming off disk?
SPEAKER_00And they're like, no, I didn't know that. Like, well, yeah, they just added it. Maybe we try Polars here for speed and let's benchmark it against Duck and see which we like and why, what the trade-offs are. And we have a simplified notebook where we can implement both of those solutions right there in the notebook and share it with the rest of the team. So we're sharing not just the problem, but then we share what we learn. What we have done then is we've made use of this network effect that is hidden to a lot of people. They don't see the value of getting little pieces of
well-defined problems.
SPEAKER_00So very little startup cost. I didn't have to understand some huge problem. I can just look at this code and think about it. And help my colleagues solve problems or they can help solve my problems. And this is the, you know, reproducible example problem. And I've spoken at the New York R meetup about how to do a good reproducible example. Because it is such, I feel like an underappreciated skill, but it's the first part of it is an exercise in subtraction. Subtract everything that's there besides the little piece
you're having a problem with.
SPEAKER_00and get that isolated. And then you shop it around your team. And if you can't solve it there, well, you replace the inputs with random numbers so that there's no propriety information in there. And then all of a sudden, you've got something you can put on Stack Overflow, right? Or you can post it on Twitter and say, we've found this problem to be unsolvable. Then you'll have a solution, you know, 15, 20 minutes in my experience.
SPEAKER_01Yeah. Right.
SPEAKER_00But the exercise in reducing it down, right, is the tech skill there.
SPEAKER_03Absolutely. So to wrap up, we've talked about this in a variety of terms, but I'd love to hear your thoughts on we always think about us training models, but how can we help models or use models to train us in ways of thinking?
SPEAKER_00This is one of my pet topics. I'm glad you found time for it because this is one of the things on the journey of an analyst that is effective well beyond what it seems like it has any right being. And what we're talking about is creating toy models often in a notebook or a simplified script that build analyst intuition about how something works in the world and any number of times
i have had analysts bring up a question about okay i've done this and i've done this and done this does this answer make sense and i'm like you tell me what jumps out at you well i don't
SPEAKER_00really have any intuition about what could happen okay I gotta tell you, I don't either. So here's what I would do though. I would create a test simplified data set using random numbers. And I would do this convolution, that convolution, this, and then measure what you get on the outside. That will be a similar type problem, but simplified. And see if that gives you enough intuition to check the thing you're seeing over here. And come back and teach me because I don't actually have intuition around that either.
And I must tell one of our analysts to build a toy model multiple times a year. it'll come up of, hey, have you tried just building a simple model of that? One of my favorites is I try to help analysts build intuition around correlation.
SPEAKER_00So if you have two log normal distributions, and we can pick parameters for those log normal distributions, right? So I got a long right tail because they're log normal. And say, what is the most... correlation you can induce between those? And they're like, oh, well, positive one, right? Okay. What's the least correlation, most negative correlation? And it's like, what now? Well, is it negative one? Can't do it. take them, sort one forward and sort the other one reversed and measure
their correlation.
SPEAKER_00Oh, now you're on the road to discovery. You're about to build a bunch of intuition about what is possible, how much correlation can two skewed distributions have if they have skew in the same direction, how much negative correlation they have. And it's like, oh, wow, just let, you know, nobody taught this in school. Yeah, they had no reason to. But if you're in, say, insurance or reinsurance and your whole world is long right tail distributions, You've got to build all this intuition about these really weird things like maximum negative correlation between two highly skewed distributions.
And the easiest way to learn that is start playing reindeer games in a Jupyter
SPEAKER_00notebook or an R script and testing, plotting, looking at the results, having the aha moment. huge benefit to building intuition. And this is all, I may have told this story to you before, but this was how I taught myself probability and statistics because the abstract formulas I was being taught in college didn't stick. I'm very much like a back end of the formula kind of based on what I understand. And a bunch of this just didn't resonate with me. And so I started building little stochastic models.
I didn't know they were stochastic models, little random number models in Excel. in college and basically discovered Monte Carlo simulation to teach myself a lot of
SPEAKER_00these statistical formula or probability formulas. And now I encourage our analysts to go do that, right? And to build up even a catalog internally of these little toy models to teach this to their peers, right? It's a great way. Use the model to train the intuition of the analyst, not just use smart analysts to build good models. That direction isn't the only direction the learning can flow. It can flow backwards.
SPEAKER_03Absolutely. And we can actually bring this full circle to Nassim Taleb's book, Fooled by Randomness, in which he's full of thought experiments, which are simulations. And he may use the term Monte Carlo simulation at some point, which I've done in Python. Others may have done it in R, but he's thinking about survivorship bias. And if you've got, for example, a bunch of people, business owners or hedge fund managers or whatever it is, telling you how they were successful. Anyone telling you about success, there's some sort of survivorship bias, right? And so he gives the example,
SPEAKER_03if you have, let's say, 10,000 investment fund managers who are just making decisions based on flipping coins and making or losing money based on it, given a large enough N, large enough sample size of fund managers, in the end, after a certain amount of steps, some of them will be quite wealthy. Right. And if they tell you all the ways that they made decisions and how they succeeded, you are actually you do have survivorship bias there. And the point of this story is that you can do that using we've developed a mental model and then you can turn into a mathematical model using NumPy for random number simulation or something on those lines.
And you can see that actually play out using Matplotlib and plotting it, for example.
SPEAKER_03Right.
SPEAKER_00Yeah. Yeah. And there's any number of academic papers that have been conceptually this, like showing that we can build a simulation where this thing could have happened based on these sets of probabilities. Now, we're not saying for sure that that's what happened, but it could have been, right? It's a plausible path. exactly jd it's time to wrap up i'd like to thank everyone for joining who popped in and out through the session and we've had a bunch of people here and engage and thank you for all your great questions and comments most of all
i'd like to thank my guest of honor jd long for having and inspiring me for such a generative conversation i always love talking with you my friend and i always learn so much so
SPEAKER_00thank you as well it's been a load of fun thanks for having me on
SPEAKER_03Thanks for tuning in, everybody. And thanks for sticking around to the end of the episode. I would honestly love to hear from you about what resonates with you in the show, what doesn't, and anybody you'd like to hear me speak with, along with topics you'd like to hear more about. The best way to let me know currently is on Twitter, at Vanishing Data is the podcast handle, and I'm at Hugo Bowne. See you in the next episode.
Hilary Mason, CEO of Hidden Door, works with agents across software development and creative projects. Drawing on Richard Hamming’s distinction between science and engineering, she describes agents as “bringing the...
Agents can write the code, run the analysis, and produce a convincing explanation. How do you check that they’ve answered the right question, used the data appropriately, and reached a conclusion you can act on? I...
“It’s an LLM, a loop, and enough tokens.” - Nicolay Gerold, Amp Code So why does a coding agent forget your instructions, keep reading tiny pieces of a file, or struggle with an edit another model handles easily?...
“If you feel that a product is hard to eval, or you feel like, ‘I don’t even know how to eval this,’ it’s a strong smell that your product isn’t good.” - Hamel Husain, on AI product design An AI data agent tells you...
“It would be sad if local models were not an option and there were only proprietary models. It’s good to have alternatives. Competition is good for business.” - Sebastian Raschka, on open-weight AI Kimi K3’s weights...