<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Rohan's Bytes: Probability-Interview-Series]]></title><description><![CDATA[Probability and Statistics Interview Questions]]></description><link>https://www.rohan-paul.com/s/probability-interview-series</link><image><url>https://substackcdn.com/image/fetch/$s_!q7Ea!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20030c9b-4180-453e-9ef3-f42abd8f9de5_1200x1200.png</url><title>Rohan&apos;s Bytes: Probability-Interview-Series</title><link>https://www.rohan-paul.com/s/probability-interview-series</link></image><generator>Substack</generator><lastBuildDate>Mon, 06 Apr 2026 08:36:29 GMT</lastBuildDate><atom:link href="https://www.rohan-paul.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Rohan Paul]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[rohanpaul@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[rohanpaul@substack.com]]></itunes:email><itunes:name><![CDATA[Rohan Paul]]></itunes:name></itunes:owner><itunes:author><![CDATA[Rohan Paul]]></itunes:author><googleplay:owner><![CDATA[rohanpaul@substack.com]]></googleplay:owner><googleplay:email><![CDATA[rohanpaul@substack.com]]></googleplay:email><googleplay:author><![CDATA[Rohan Paul]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[ML Interview Q Series: Powering TikTok's 'For You': Deep Learning for Candidate Generation and Ranking.]]></title><description><![CDATA[Browse all the Probability Interview Questions here.]]></description><link>https://www.rohan-paul.com/p/ml-interview-q-series-powering-tiktoks</link><guid isPermaLink="false">https://www.rohan-paul.com/p/ml-interview-q-series-powering-tiktoks</guid><pubDate>Wed, 04 Jun 2025 14:05:48 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!qiuZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78974f7d-988f-4424-b2e5-5c8ec8090b08_1024x573.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qiuZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78974f7d-988f-4424-b2e5-5c8ec8090b08_1024x573.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qiuZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78974f7d-988f-4424-b2e5-5c8ec8090b08_1024x573.png 424w, https://substackcdn.com/image/fetch/$s_!qiuZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78974f7d-988f-4424-b2e5-5c8ec8090b08_1024x573.png 848w, https://substackcdn.com/image/fetch/$s_!qiuZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78974f7d-988f-4424-b2e5-5c8ec8090b08_1024x573.png 1272w, https://substackcdn.com/image/fetch/$s_!qiuZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78974f7d-988f-4424-b2e5-5c8ec8090b08_1024x573.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qiuZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78974f7d-988f-4424-b2e5-5c8ec8090b08_1024x573.png" width="1024" height="573" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/78974f7d-988f-4424-b2e5-5c8ec8090b08_1024x573.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:573,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:922031,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165191043?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78974f7d-988f-4424-b2e5-5c8ec8090b08_1024x573.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!qiuZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78974f7d-988f-4424-b2e5-5c8ec8090b08_1024x573.png 424w, https://substackcdn.com/image/fetch/$s_!qiuZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78974f7d-988f-4424-b2e5-5c8ec8090b08_1024x573.png 848w, https://substackcdn.com/image/fetch/$s_!qiuZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78974f7d-988f-4424-b2e5-5c8ec8090b08_1024x573.png 1272w, https://substackcdn.com/image/fetch/$s_!qiuZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78974f7d-988f-4424-b2e5-5c8ec8090b08_1024x573.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Browse all the <strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">Probability Interview Questions here</a></strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">.</a></p><h2><strong>1. Design the 'For You' page on TikTok.</strong></h2><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://x.com/rohanpaul_ai&quot;,&quot;text&quot;:&quot;Connect with me on X (Twitter)&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://x.com/rohanpaul_ai"><span>Connect with me on X (Twitter)</span></a></p><p>Understanding the Core Objective of TikTok's 'For You' Page</p><p>The 'For You' page on TikTok is fundamentally about personalized content discovery. TikTok&#8217;s success rests on delivering short-form videos that users find engaging, so the system must:</p><p>Identify relevant videos for each user from a huge content pool. Rank these videos to ensure the user sees the most engaging content first. Continuously adapt and refine recommendations based on user interactions and changing content inventory.</p><p>A strong solution involves a candidate generation stage to filter the broad content set into a smaller set of potentially interesting videos, followed by a sophisticated ranking model that orders these candidates in a way that maximizes user satisfaction and long-term engagement.</p><p>Data Pipeline and Feature Representation</p><p>When building the 'For You' page, the recommendation process depends heavily on data. The system must continuously collect user-video interaction data and transform it into meaningful features that can feed into a machine learning model.</p><p>User-related features might include user demographics, watch history, content interaction history, temporal patterns, device and network attributes, and any explicit user preferences. Video-related features might include category or topic embeddings, textual or audio attributes, engagement metrics (likes, shares, comments), content age, and cluster-level features (e.g., the typical audience that engages with such content). Contextual features might include the time of day, day of the week, geolocation (if relevant), or recent viral trends.</p><p>Many real-world systems rely on embedding representations for both users and items. These embeddings are usually learned by a neural network that ingests user attributes, item attributes, and historical interaction signals.</p><p>For example, one might create an embedding vector that captures user interests gleaned from watch histories, or a fine-tuned language-based or video-based embedding for each piece of content. By aligning user and content embeddings in a shared latent space, you can quickly compute relevance scores.</p><p>Candidate Generation (Retrieval) Component</p><p>Because TikTok has a massive corpus of videos, the system typically splits the recommendation procedure into two steps: candidate generation (also known as retrieval) and ranking. Candidate generation retrieves a small subset (e.g., a few hundred) of videos from a potential pool of millions or billions.</p><p>One popular approach is to use approximate nearest neighbor search on embeddings. The user&#8217;s embedding (representing user preferences) is matched with item embeddings (representing videos). The top-N most similar item embeddings become the candidate set.</p><p>At large scale, this is often done using vector similarity search libraries or tools such as FAISS, ScaNN, or Annoy. The user embedding can be constructed in real-time based on the user&#8217;s short-term activity or a combination of short-term and long-term features. The item embeddings are typically precomputed or updated frequently based on a trained model. By restricting the candidate set to items whose embeddings are relatively close to the user embedding, we filter out most irrelevant content.</p><p>Ranking Component</p><p>After generating a manageable set of candidate videos, a more elaborate ranking model predicts how each candidate matches the user&#8217;s interest. This model typically considers features that are more expensive to compute or more elaborate to store. It outputs a score or probability that the user will engage (like, comment, watch fully, or share).</p><p>A frequent design pattern is to use a deep learning approach that combines user embedding, item embedding, and contextual features into a single multi-layer neural network. The model might output multiple signals&#8212;probability of watching to the end, probability of liking, probability of re-watching, and probability of sharing. These signals can then be combined into a single ranking score using business logic or a learned weighted combination.</p><p>Below is an illustrative (though simplified) example of how you might define such a ranking model in PyTorch:</p><pre><code><code>import torch
import torch.nn as nn
import torch.nn.functional as F

class TikTokRankingModel(nn.Module):
    def __init__(self, user_dim, video_dim, hidden_dim):
        super(TikTokRankingModel, self).__init__()
        # Embedding transformations
        self.user_embed_transform = nn.Linear(user_dim, hidden_dim)
        self.video_embed_transform = nn.Linear(video_dim, hidden_dim)

        # Combine user+video embeddings and context
        self.fc1 = nn.Linear(hidden_dim*2, hidden_dim)
        self.fc2 = nn.Linear(hidden_dim, hidden_dim)

        # Output layer for multiple engagement probabilities
        self.fc_out_watch = nn.Linear(hidden_dim, 1)
        self.fc_out_like = nn.Linear(hidden_dim, 1)
        self.fc_out_share = nn.Linear(hidden_dim, 1)

    def forward(self, user_embedding, video_embedding, context_vector):
        # Transform embeddings
        user_rep = F.relu(self.user_embed_transform(user_embedding))
        video_rep = F.relu(self.video_embed_transform(video_embedding))

        # Combine them
        x = torch.cat([user_rep, video_rep], dim=1)

        # Optionally incorporate context in a similar manner
        # x = torch.cat([x, context_vector], dim=1)

        x = F.relu(self.fc1(x))
        x = F.relu(self.fc2(x))

        # Compute different engagement tasks
        watch_prob = torch.sigmoid(self.fc_out_watch(x))
        like_prob = torch.sigmoid(self.fc_out_like(x))
        share_prob = torch.sigmoid(self.fc_out_share(x))

        return watch_prob, like_prob, share_prob
</code></code></pre><p>The final ranking score might be a combination of these probabilities. You could, for example, define a composite function that emphasizes watch probability heavily, with smaller contributions from like and share probabilities. Alternatively, you can train a single output that directly optimizes an objective function capturing watch time, user satisfaction, or business metrics.</p><p>Below is a conceptual ranking formula:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dzVx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5bb4af3-8758-477d-97ad-ffaed272c0a5_1228x56.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dzVx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5bb4af3-8758-477d-97ad-ffaed272c0a5_1228x56.png 424w, https://substackcdn.com/image/fetch/$s_!dzVx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5bb4af3-8758-477d-97ad-ffaed272c0a5_1228x56.png 848w, https://substackcdn.com/image/fetch/$s_!dzVx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5bb4af3-8758-477d-97ad-ffaed272c0a5_1228x56.png 1272w, https://substackcdn.com/image/fetch/$s_!dzVx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5bb4af3-8758-477d-97ad-ffaed272c0a5_1228x56.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dzVx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5bb4af3-8758-477d-97ad-ffaed272c0a5_1228x56.png" width="1228" height="56" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a5bb4af3-8758-477d-97ad-ffaed272c0a5_1228x56.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:56,&quot;width&quot;:1228,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19067,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165191043?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5bb4af3-8758-477d-97ad-ffaed272c0a5_1228x56.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dzVx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5bb4af3-8758-477d-97ad-ffaed272c0a5_1228x56.png 424w, https://substackcdn.com/image/fetch/$s_!dzVx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5bb4af3-8758-477d-97ad-ffaed272c0a5_1228x56.png 848w, https://substackcdn.com/image/fetch/$s_!dzVx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5bb4af3-8758-477d-97ad-ffaed272c0a5_1228x56.png 1272w, https://substackcdn.com/image/fetch/$s_!dzVx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5bb4af3-8758-477d-97ad-ffaed272c0a5_1228x56.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ciun!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96cb6c78-47ec-415a-9edb-fba678847410_923x220.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ciun!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96cb6c78-47ec-415a-9edb-fba678847410_923x220.png 424w, https://substackcdn.com/image/fetch/$s_!Ciun!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96cb6c78-47ec-415a-9edb-fba678847410_923x220.png 848w, https://substackcdn.com/image/fetch/$s_!Ciun!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96cb6c78-47ec-415a-9edb-fba678847410_923x220.png 1272w, https://substackcdn.com/image/fetch/$s_!Ciun!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96cb6c78-47ec-415a-9edb-fba678847410_923x220.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ciun!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96cb6c78-47ec-415a-9edb-fba678847410_923x220.png" width="923" height="220" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/96cb6c78-47ec-415a-9edb-fba678847410_923x220.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:220,&quot;width&quot;:923,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:50346,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165191043?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96cb6c78-47ec-415a-9edb-fba678847410_923x220.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Ciun!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96cb6c78-47ec-415a-9edb-fba678847410_923x220.png 424w, https://substackcdn.com/image/fetch/$s_!Ciun!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96cb6c78-47ec-415a-9edb-fba678847410_923x220.png 848w, https://substackcdn.com/image/fetch/$s_!Ciun!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96cb6c78-47ec-415a-9edb-fba678847410_923x220.png 1272w, https://substackcdn.com/image/fetch/$s_!Ciun!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96cb6c78-47ec-415a-9edb-fba678847410_923x220.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Handling Cold Start for Users and Content</p><p>Systems must handle new users with little to no historical data, and new videos that haven&#8217;t accumulated engagement signals. For new users, the platform might rely on demographic data, device attributes, or short-term active signals (e.g., the first few videos they watch) to bootstrap the user embedding. For new videos, the system might rely on video-level signals like textual or audio embeddings and early watchers&#8217; engagement patterns.</p><p>As users start interacting with content, the system quickly updates the user embedding or reweights the user representation, so the recommendations rapidly adapt. This is crucial for retaining new users and ensuring fresh content distribution.</p><p>Training and Evaluation</p><p>To train the ranking model, you might use historical interaction logs. For each user-video interaction, the training data can capture whether the user watched to completion, liked the video, shared it, commented on it, or scrolled away quickly.</p><p>A typical training scheme could be:</p><p>Construct training examples from historical logs. Use a binary or multi-label approach for different engagement signals. For instance, watch to completion could be one label, like is another label, share is another label, and so on. Minimize a weighted sum of cross-entropy losses or another differentiable loss function.</p><p>Offline evaluation usually relies on metrics like AUC, cross-entropy loss, or multi-class metrics that reflect how accurately the model predicts engagement. Online evaluation is performed using A/B tests on live traffic. Eventually, online metrics (watch time, user retention, dwell time) carry the most weight.</p><p>System Design Considerations for 'For You' Page</p><p>Real-time responsiveness is critical. TikTok must surface new videos quickly, keep track of ephemeral trends, and update the user&#8217;s recommended content rapidly when user taste shifts.</p><p>Scalability is essential since the system is expected to handle a large number of active users and a massive library of videos. This typically requires distributed systems for both data processing (e.g., streaming logs, feature computation) and for online inference (model serving, caching).</p><p>Fairness and diversity are increasingly important. The algorithm should not concentrate the distribution of views too heavily on a narrow set of creators or topics. Techniques like controlling item-level frequency capping, applying content diversification, or re-ranking to ensure a broad range of topics might be used.</p><p>Feedback loops and popularity bias are relevant issues. If the system only shows extremely popular content, it might overshadow niche or fresh content. A well-designed exploration strategy can be introduced to allow new or specialized videos to be tested with relevant user segments, balancing exploitation of known popular content with exploration of novel candidates.</p><p>User satisfaction and well-being also must be considered. For instance, regulators and users might demand transparency and control over recommended content. This can mean providing user settings to tune or filter recommendations, or applying guardrails to avoid harmful content.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.rohan-paul.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">I write everyday for my readers on actionable AI. Subscribe and instantly get a 1300+ page Python book.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2><strong>How do we handle user embeddings for new users or those with sparse data?</strong></h2><p>When data is sparse, one can initialize the user with a demographic-based or interest-based prior. Basic ideas include:</p><p>Relying on device type, user-supplied age range, or geolocation. Even if these are broad, they can guide initial recommendations. Observing immediate short-term behavior. For the first session, track how the user interacts with a random or lightly personalized set of videos. Update the user embedding in real-time using these signals. Using a larger context of lookalike modeling. If new user u<em> </em>shares profile attributes or initial engagement patterns with existing users, you can infer that u might like similar content to those user clusters.</p><p>Pitfalls include incorrectly assuming a new user&#8217;s demographic or device-based preferences. Real-time recalibration can mitigate that. Ensuring the system is not slow or unresponsive during these updates is essential for retaining new users.</p><h2><strong>How do we incorporate additional signals like content quality or user community interests?</strong></h2><p>Systems can integrate auxiliary signals by learning new features or refining existing embeddings. For content quality:</p><p>Use a pretrained model (e.g., a transformer that analyzes text or an audio model that identifies music genres or speech) to embed the core content. Use engagement-based proxies, like dwell time, watch completion, and user feedback. High watch completion can imply content quality or at least strong user interest.</p><p>For user communities or micro-trends:</p><p>Add cluster-based features that tag each video or user with a label representing a sub-community or topic cluster. Track trending hashtags or audio tracks. If a user frequently engages with a particular cluster, use that as an additional feature in the ranking model.</p><p>An important pitfall is conflating overall content quality with ephemeral popularity. Sometimes a trending piece of content is not necessarily &#8220;high-quality&#8221; for all users. The ranking model must learn to weigh ephemeral signals appropriately while still capturing user interests.</p><h2><strong>How do we prevent echo chambers or filter bubbles?</strong></h2><p>To avoid overly narrowing recommendations:</p><p>Inject diversity in candidate generation. Instead of only retrieving content similar to the user&#8217;s recent watch history, include random samples or content from adjacent clusters. Apply re-ranking post-model inference. The system can ensure a certain coverage of different content categories or topics, especially if a user has broad interests. Monitor metrics such as watch time or user satisfaction specifically for diverse or novel content. This helps calibrate how aggressively to push new categories.</p><p>A subtle point is balancing user preferences with exploration. If you push too much random content, user satisfaction might drop. If you push too little, you risk filter bubbles and missing out on potentially interesting content outside the user&#8217;s explicit preference space.</p><h2><strong>How do we handle the real-time streaming and high traffic in production?</strong></h2><p>To handle large scale in real-time:</p><p>Use a streaming architecture (e.g., Kafka, Flink, Spark Streaming) to collect, preprocess, and update features continuously. Maintain separate services for candidate retrieval and final ranking. The candidate retrieval system might rely on approximate nearest neighbor search in high-dimensional embeddings. The ranking layer could be a high-throughput, low-latency model inference service (e.g., TensorFlow Serving, PyTorch Serve, or a custom C++ inference engine). Cache partial results. For instance, user embeddings can be cached for short durations if they do not change significantly in real-time. Similarly, frequent or popular videos&#8217; embeddings can be stored in memory.</p><p>Pitfalls arise if you do not manage caching carefully. Serving stale user embeddings or outdated trending signals can degrade user experience. The system must orchestrate updates to ensure embeddings are sufficiently fresh without overloading the servers.</p><h2><strong>How do we measure success and optimize for long-term user satisfaction?</strong></h2><p>Key metrics include average watch time per session, retention rates (whether users keep returning to the app), or direct engagement signals like likes, comments, shares. However, focusing only on immediate metrics might encourage addictive patterns or short-term success at the cost of user well-being. Some teams incorporate additional signals:</p><p>Long-term retention metrics, such as the probability of a user returning daily or weekly. Satisfaction surveys or explicit feedback forms. Balanced engagement that correlates with healthy usage patterns rather than purely addictive behaviors.</p><p>A pitfall is that short videos make it tempting to drive up watch counts. Real engagement can come from deeper user-video interactions. Calibrating the objective function to handle short-term and long-term signals is a major engineering and product challenge.</p><h2><strong>Below are additional follow-up questions</strong></h2><h2><strong>How do we incorporate monetization or ad-based content in the 'For You' feed while preserving user experience?</strong></h2><p>Ads are a critical revenue stream on TikTok, yet their placement must be handled delicately to avoid degrading user engagement. One approach is to integrate sponsored content directly within the ranking pipeline, treating ads or branded content as items that can be recommended. However, instead of ranking them purely on predicted engagement, a separate ad-serving policy might determine how frequently ads are injected.</p><p>A common strategy involves multi-slot ranking, where each content slot is either an organic video or an ad. The system uses separate models or distinct scoring functions for ads versus organic content. Balancing user experience with revenue can require constraints like maximum ad frequency, or a cap on consecutive ad impressions. For instance, the pipeline might allocate one ad slot per certain number of videos.</p><p>Pitfalls and edge cases include:</p><p>Over-insertion of ads that causes user churn. A system that doesn&#8217;t carefully track user tolerance to ads may push them away from the platform. Low relevance ads eroding user trust. If users feel ads are irrelevant or intrusive, they may develop negative sentiment toward the platform. Difficulty measuring direct revenue from short-form ads. The system might optimize short-term clicks instead of long-term brand or user loyalty. Regulatory constraints around how ads are disclosed. The app must ensure users can distinguish sponsored content from organic videos.</p><p>A practical example is to maintain an &#8220;ad score&#8221; for each candidate ad based on relevance and predicted conversion probability. The final pipeline can do a combined re-ranking step, ensuring an appropriate ratio of ads to organic content. If the predicted user dissatisfaction from seeing one more ad is too high (inferred from user dwell time or skip patterns), the system defers or reduces ad frequency.</p><h2><strong>How do we handle malicious or noisy user signals that might degrade the recommendation system's quality?</strong></h2><p>Malicious or noisy signals occur when user interaction data doesn&#8217;t reflect genuine content preferences. This may happen with bots, automated loops, or deliberate manipulations (e.g., large groups artificially inflating a video&#8217;s engagement counts).</p><p>One solution is to detect anomalous patterns that deviate from typical user engagement. Features such as the velocity of likes, suspicious watch patterns (e.g., extremely short watch times but high like counts), or repeated replays on multiple accounts from a single IP can flag suspicious activity.</p><p>Possible mitigation steps:</p><p>Filtering out or downweighting suspicious interactions during training and inference. The system might apply a filter or gating function that sets the weight of the suspicious data to zero if a threshold is exceeded. Using robust ranking objectives. For instance, the recommendation model might treat extremely high engagement velocity with suspicion, discounting it until it&#8217;s confirmed to be genuine. Applying adversarial or robust machine learning techniques to reduce the effect of abnormal signals.</p><p>Pitfalls:</p><p>False positives that exclude legitimate content. An overly aggressive filter might penalize authentic viral trends simply because they ramped up quickly. Evolving malicious behaviors that circumvent detection. Attackers or bots change their strategies when they realize how the platform detects them.</p><h2><strong>How would we introduce interpretability or transparency into the recommendation algorithm, especially to comply with regulations or user demands for explanation?</strong></h2><p>Interpretability can be provided at varying granularity. One approach is to surface to the user a simplified statement, such as &#8220;You&#8217;re seeing this video because you&#8217;ve shown interest in dance tutorials.&#8221; Under the hood, the platform can use model explainability techniques to identify which features most influenced the recommendation score.</p><p>Techniques like Integrated Gradients or SHAP can help measure feature importance in complex deep models. However, these are computationally expensive for real-time explanations. A typical compromise is precomputing local explanations for representative user segments or sampling.</p><p>In a regulated environment, the system might be required to offer user-facing controls that let them adjust certain aspects of their preference profile. For instance, a user can remove or downweight certain interest categories in their personalized feed.</p><p>Potential pitfalls:</p><p>Computational overhead, as generating explanations for each ranking at scale can be prohibitively expensive. Over-simplification, which may risk misrepresenting how the model truly works and could lead to confusion or mistrust if the explanation is too generic. Revealing too much about the model&#8217;s internal logic can open the door for adversarial manipulation.</p><h2><strong>How do we handle real-time trending events or ephemeral content that see rapid user engagement for a short time, then quickly fade?</strong></h2><p>Real-time trending is a prime driver of viral content on TikTok. The system must quickly recognize these surges and surface them to relevant users before trends fade. A typical approach is to maintain a streaming service that monitors engagement metrics (likes, shares, watch completions) for each piece of content or hashtag in near real-time.</p><p>The platform can assign a &#8220;trendiness&#8221; or &#8220;burstiness&#8221; score for content that exhibits unusual spikes in engagement. This score can be factored into candidate generation or ranking:</p><p>If a video is trending in a relevant user&#8217;s region or within a content cluster that user frequently engages with, the &#8220;trendiness&#8221; feature might boost it in the ranking. If a trend has cooled down, the system gradually reduces the boost to avoid stale content dominating feeds.</p><p>Pitfalls include:</p><p>Overly amplifying quick bursts that may not be genuinely high-quality or relevant for many users. System lag where the trending detection pipeline is slow and misses the prime window of user interest. Excessive trending diversity can overshadow each user&#8217;s more stable personal interests.</p><h2><strong>How do we manage multi-objective optimization for the recommendation (e.g. combining user engagement with brand safety or user well-being)?</strong></h2><p>In practice, platforms often juggle multiple, potentially conflicting objectives: maximizing watch time, ensuring brand safety, promoting healthy usage patterns, etc. One approach is to define a composite objective function that weights each metric. Another approach is multi-head neural networks, each predicting a different outcome (e.g., watch time vs. probability of harmful content), followed by a post-processing step that merges the predictions according to certain constraints.</p><p>For instance:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jB7Y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa4c6a5b-5b66-4c94-9a75-339b34d044d8_1109x85.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jB7Y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa4c6a5b-5b66-4c94-9a75-339b34d044d8_1109x85.png 424w, https://substackcdn.com/image/fetch/$s_!jB7Y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa4c6a5b-5b66-4c94-9a75-339b34d044d8_1109x85.png 848w, https://substackcdn.com/image/fetch/$s_!jB7Y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa4c6a5b-5b66-4c94-9a75-339b34d044d8_1109x85.png 1272w, https://substackcdn.com/image/fetch/$s_!jB7Y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa4c6a5b-5b66-4c94-9a75-339b34d044d8_1109x85.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jB7Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa4c6a5b-5b66-4c94-9a75-339b34d044d8_1109x85.png" width="1109" height="85" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa4c6a5b-5b66-4c94-9a75-339b34d044d8_1109x85.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:85,&quot;width&quot;:1109,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:18534,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165191043?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa4c6a5b-5b66-4c94-9a75-339b34d044d8_1109x85.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!jB7Y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa4c6a5b-5b66-4c94-9a75-339b34d044d8_1109x85.png 424w, https://substackcdn.com/image/fetch/$s_!jB7Y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa4c6a5b-5b66-4c94-9a75-339b34d044d8_1109x85.png 848w, https://substackcdn.com/image/fetch/$s_!jB7Y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa4c6a5b-5b66-4c94-9a75-339b34d044d8_1109x85.png 1272w, https://substackcdn.com/image/fetch/$s_!jB7Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa4c6a5b-5b66-4c94-9a75-339b34d044d8_1109x85.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Here, &#8220;EngagementScore&#8221; might reflect predicted watch time or like probability, while &#8220;RiskScore&#8221; might capture brand safety or policy violations. We subtract risk from engagement since we want to penalize content that is borderline violating guidelines.</p><p>Pitfalls:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hPZB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4173aefc-b228-4347-bd8e-7f175ccb5d92_863x205.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hPZB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4173aefc-b228-4347-bd8e-7f175ccb5d92_863x205.png 424w, https://substackcdn.com/image/fetch/$s_!hPZB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4173aefc-b228-4347-bd8e-7f175ccb5d92_863x205.png 848w, https://substackcdn.com/image/fetch/$s_!hPZB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4173aefc-b228-4347-bd8e-7f175ccb5d92_863x205.png 1272w, https://substackcdn.com/image/fetch/$s_!hPZB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4173aefc-b228-4347-bd8e-7f175ccb5d92_863x205.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hPZB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4173aefc-b228-4347-bd8e-7f175ccb5d92_863x205.png" width="863" height="205" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4173aefc-b228-4347-bd8e-7f175ccb5d92_863x205.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:205,&quot;width&quot;:863,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:44143,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165191043?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4173aefc-b228-4347-bd8e-7f175ccb5d92_863x205.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!hPZB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4173aefc-b228-4347-bd8e-7f175ccb5d92_863x205.png 424w, https://substackcdn.com/image/fetch/$s_!hPZB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4173aefc-b228-4347-bd8e-7f175ccb5d92_863x205.png 848w, https://substackcdn.com/image/fetch/$s_!hPZB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4173aefc-b228-4347-bd8e-7f175ccb5d92_863x205.png 1272w, https://substackcdn.com/image/fetch/$s_!hPZB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4173aefc-b228-4347-bd8e-7f175ccb5d92_863x205.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h2><strong>In what ways can we incorporate user-initiated feedback such as 'Not Interested' or 'Report' signals, and how do we weigh them relative to positive engagement signals?</strong></h2><p>Explicit negative feedback (like tapping &#8220;Not Interested&#8221;) is very informative but occurs less frequently compared to implicit signals (watch time, likes, shares). Because it&#8217;s a rarer signal, it typically gets a higher weight in the training data or inference pipeline. A single user-initiated negative signal might heavily reduce the probability of seeing similar content in the future.</p><p>Implementation details could include:</p><p>Tracking these signals in the user&#8217;s preference profile. For example, if the user clicks &#8220;Not Interested&#8221; in a certain topic or hashtag, reduce that topic&#8217;s weight in the user embedding. In the training set, label videos for which a user indicated &#8220;Not Interested&#8221; as strong negative samples to help the model learn which content to avoid.</p><p>Pitfalls:</p><p>Users might occasionally tap &#8220;Not Interested&#8221; by accident, or do so for reasons unrelated to genuine disinterest. Overreacting to these signals might degrade personalization. A small subset of users might overuse the negative feedback button, skewing the data distribution.</p><h2><strong>What is the approach to handle harmful or sensitive content in the ranking system while balancing free expression and brand safety concerns?</strong></h2><p>Platforms must detect harmful content, such as hate speech, violent or sexual content, or misinformation. Common practice involves a combination of:</p><p>Automated detection. Models trained on textual, visual, and audio cues. Human review for borderline or flagged content. Policy-driven thresholds that remove or downrank content classified above a certain risk level.</p><p>When content is borderline but not explicitly disallowed, the system might downrank it to limit its distribution. The tension between free expression and brand safety arises because stricter filters might remove legitimate content, potentially angering some users or stifling creativity.</p><p>Pitfalls:</p><p>False positives that suppress normal user expression. Evolving definitions of harmful or sensitive content across cultural contexts. Sophisticated adversaries who adapt their strategies to bypass detection, such as coded language or subtle variations of harmful content.</p><h2><strong>What strategies can we use for cross-platform synergy, i.e. how do we leverage user behavior from sister apps or websites to refine recommendations on TikTok?</strong></h2><p>If a company owns multiple platforms, cross-platform data can significantly enrich user embeddings. For instance, if a user interacts heavily with cooking tutorials on a sister site, TikTok can infer the user might like short-form cooking videos as well. The synergy might involve:</p><p>Unified user IDs or identity resolution across platforms. Aggregating content category preferences from sister apps into the user&#8217;s TikTok profile. Periodically retraining embeddings with combined logs.</p><p>Challenges and pitfalls:</p><p>Data privacy: sharing data across platforms may require explicit user consent, especially in regions with strict privacy regulations. Data mismatch: user behavior on a news-focused site may not translate perfectly to short-form video preferences. Synchronization overhead: if cross-platform data is updated too slowly, it might not capture the user&#8217;s latest shift in interests.</p><h2><strong>Are there any potential benefits to employing reinforcement learning for the ranking algorithm, and how might we implement it in a short-form video environment?</strong></h2><p>Reinforcement learning (RL) allows an agent to optimize decisions based on long-term rewards, such as user retention or daily return rate. Traditional recommendation systems often maximize immediate signals (like watch time on the next video), while RL can incorporate delayed rewards.</p><p>To implement RL:</p><p>Define the state as the user&#8217;s profile, watch history, or short-term context. Define actions as which video to show next (or which set of videos). Define a reward signal that reflects short-term engagement plus long-term user retention or satisfaction.</p><p>An offline approach might involve training on historical logs, simulating a policy that would have shown different content. Online, an RL agent can conduct limited exploration to discover better policies.</p><p>Pitfalls:</p><p>High exploration risk. Serving random or suboptimal content can harm user experience if done excessively. Sparse or delayed rewards. A user&#8217;s decision to leave or return the next day might be influenced by many external factors. Complex implementation. RL-based recommender systems are harder to debug and require advanced infrastructure to handle real-time feedback loops.</p><h2><strong>How do we handle A/B testing at scale for a large user base to measure the impact of ranking updates, and what pitfalls should we avoid?</strong></h2><p>A/B testing is vital for iterating on the recommendation system in a data-driven way. With a massive user base, TikTok can run numerous experiments simultaneously, but it must ensure that experiment segments do not overlap or confound each other.</p><p>Key considerations:</p><p>Randomization. Users should be randomly assigned to test or control groups in a way that ensures statistical fairness. Sufficient test duration. Let each experiment run long enough to capture a stable signal and avoid novelty effects. Robust metrics. Look beyond short-term engagement, track retention and other success metrics.</p><p>Pitfalls:</p><p>Interaction effects among multiple experiments. If the same user is in two or more overlapping experiments, it becomes harder to isolate the impact of each. Unstable or drifting user population. If large events or marketing campaigns drastically change the user base mid-test, the results may be skewed. Unobserved biases in random assignment. In practice, random assignment can fail if user segments are inadvertently correlated with assignment logic.</p>]]></content:encoded></item><item><title><![CDATA[ML Interview Q Series: Likelihood Ratio Test for Comparing Exponential Rate Parameters in Lifetime Data]]></title><description><![CDATA[Browse all the Probability Interview Questions here.]]></description><link>https://www.rohan-paul.com/p/ml-interview-q-series-likelihood-5fc</link><guid isPermaLink="false">https://www.rohan-paul.com/p/ml-interview-q-series-likelihood-5fc</guid><pubDate>Wed, 04 Jun 2025 13:53:37 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!XB7D!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4872fe39-3b0c-432d-8b8a-ddab48923d27_1024x611.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!XB7D!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4872fe39-3b0c-432d-8b8a-ddab48923d27_1024x611.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!XB7D!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4872fe39-3b0c-432d-8b8a-ddab48923d27_1024x611.png 424w, https://substackcdn.com/image/fetch/$s_!XB7D!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4872fe39-3b0c-432d-8b8a-ddab48923d27_1024x611.png 848w, https://substackcdn.com/image/fetch/$s_!XB7D!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4872fe39-3b0c-432d-8b8a-ddab48923d27_1024x611.png 1272w, https://substackcdn.com/image/fetch/$s_!XB7D!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4872fe39-3b0c-432d-8b8a-ddab48923d27_1024x611.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!XB7D!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4872fe39-3b0c-432d-8b8a-ddab48923d27_1024x611.png" width="1024" height="611" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4872fe39-3b0c-432d-8b8a-ddab48923d27_1024x611.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:611,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:652514,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165189707?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4872fe39-3b0c-432d-8b8a-ddab48923d27_1024x611.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!XB7D!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4872fe39-3b0c-432d-8b8a-ddab48923d27_1024x611.png 424w, https://substackcdn.com/image/fetch/$s_!XB7D!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4872fe39-3b0c-432d-8b8a-ddab48923d27_1024x611.png 848w, https://substackcdn.com/image/fetch/$s_!XB7D!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4872fe39-3b0c-432d-8b8a-ddab48923d27_1024x611.png 1272w, https://substackcdn.com/image/fetch/$s_!XB7D!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4872fe39-3b0c-432d-8b8a-ddab48923d27_1024x611.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Browse all the <strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">Probability Interview Questions here</a></strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">.</a></p><h2><strong>20. Say you have a large amount of user data measuring lifetimes, modeled as exponential random variables. What is the likelihood ratio for assessing two potential &#955; values (null vs alternative)?</strong></h2><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://x.com/rohanpaul_ai&quot;,&quot;text&quot;:&quot;Connect with me on X (Twitter)&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://x.com/rohanpaul_ai"><span>Connect with me on X (Twitter)</span></a></p><p>Understanding the setup for exponential lifetimes under two different rate parameters</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4P-j!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc67954af-e664-44d0-9e5f-e8508909a5e5_910x750.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4P-j!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc67954af-e664-44d0-9e5f-e8508909a5e5_910x750.png 424w, https://substackcdn.com/image/fetch/$s_!4P-j!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc67954af-e664-44d0-9e5f-e8508909a5e5_910x750.png 848w, https://substackcdn.com/image/fetch/$s_!4P-j!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc67954af-e664-44d0-9e5f-e8508909a5e5_910x750.png 1272w, https://substackcdn.com/image/fetch/$s_!4P-j!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc67954af-e664-44d0-9e5f-e8508909a5e5_910x750.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4P-j!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc67954af-e664-44d0-9e5f-e8508909a5e5_910x750.png" width="910" height="750" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c67954af-e664-44d0-9e5f-e8508909a5e5_910x750.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:750,&quot;width&quot;:910,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:87771,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165189707?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc67954af-e664-44d0-9e5f-e8508909a5e5_910x750.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!4P-j!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc67954af-e664-44d0-9e5f-e8508909a5e5_910x750.png 424w, https://substackcdn.com/image/fetch/$s_!4P-j!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc67954af-e664-44d0-9e5f-e8508909a5e5_910x750.png 848w, https://substackcdn.com/image/fetch/$s_!4P-j!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc67954af-e664-44d0-9e5f-e8508909a5e5_910x750.png 1272w, https://substackcdn.com/image/fetch/$s_!4P-j!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc67954af-e664-44d0-9e5f-e8508909a5e5_910x750.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Likelihood ratio for exponential distributions</p><p>The likelihood ratio &#923; is defined as the ratio of the likelihood under the null hypothesis to the likelihood under the alternative hypothesis. Concretely:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-0J0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3173fe1-11b7-4ce5-b7c8-4c9beae022bc_1034x188.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-0J0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3173fe1-11b7-4ce5-b7c8-4c9beae022bc_1034x188.png 424w, https://substackcdn.com/image/fetch/$s_!-0J0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3173fe1-11b7-4ce5-b7c8-4c9beae022bc_1034x188.png 848w, https://substackcdn.com/image/fetch/$s_!-0J0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3173fe1-11b7-4ce5-b7c8-4c9beae022bc_1034x188.png 1272w, https://substackcdn.com/image/fetch/$s_!-0J0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3173fe1-11b7-4ce5-b7c8-4c9beae022bc_1034x188.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-0J0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3173fe1-11b7-4ce5-b7c8-4c9beae022bc_1034x188.png" width="1034" height="188" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f3173fe1-11b7-4ce5-b7c8-4c9beae022bc_1034x188.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:188,&quot;width&quot;:1034,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:29231,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165189707?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3173fe1-11b7-4ce5-b7c8-4c9beae022bc_1034x188.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!-0J0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3173fe1-11b7-4ce5-b7c8-4c9beae022bc_1034x188.png 424w, https://substackcdn.com/image/fetch/$s_!-0J0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3173fe1-11b7-4ce5-b7c8-4c9beae022bc_1034x188.png 848w, https://substackcdn.com/image/fetch/$s_!-0J0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3173fe1-11b7-4ce5-b7c8-4c9beae022bc_1034x188.png 1272w, https://substackcdn.com/image/fetch/$s_!-0J0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3173fe1-11b7-4ce5-b7c8-4c9beae022bc_1034x188.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ruqn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8632bc3a-08ad-438e-8229-fb28bd09d49e_928x315.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ruqn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8632bc3a-08ad-438e-8229-fb28bd09d49e_928x315.png 424w, https://substackcdn.com/image/fetch/$s_!Ruqn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8632bc3a-08ad-438e-8229-fb28bd09d49e_928x315.png 848w, https://substackcdn.com/image/fetch/$s_!Ruqn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8632bc3a-08ad-438e-8229-fb28bd09d49e_928x315.png 1272w, https://substackcdn.com/image/fetch/$s_!Ruqn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8632bc3a-08ad-438e-8229-fb28bd09d49e_928x315.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ruqn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8632bc3a-08ad-438e-8229-fb28bd09d49e_928x315.png" width="928" height="315" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8632bc3a-08ad-438e-8229-fb28bd09d49e_928x315.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:315,&quot;width&quot;:928,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:46265,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165189707?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8632bc3a-08ad-438e-8229-fb28bd09d49e_928x315.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Ruqn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8632bc3a-08ad-438e-8229-fb28bd09d49e_928x315.png 424w, https://substackcdn.com/image/fetch/$s_!Ruqn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8632bc3a-08ad-438e-8229-fb28bd09d49e_928x315.png 848w, https://substackcdn.com/image/fetch/$s_!Ruqn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8632bc3a-08ad-438e-8229-fb28bd09d49e_928x315.png 1272w, https://substackcdn.com/image/fetch/$s_!Ruqn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8632bc3a-08ad-438e-8229-fb28bd09d49e_928x315.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The ratio or its log form can be used in a hypothesis testing framework to decide which of the two rate parameters is better supported by the data.</p><p>Deep reasoning on this ratio</p><p>The ratio captures two main factors:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1HG4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2aaddab3-7155-47e4-88ca-354c2c979f2a_938x475.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1HG4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2aaddab3-7155-47e4-88ca-354c2c979f2a_938x475.png 424w, https://substackcdn.com/image/fetch/$s_!1HG4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2aaddab3-7155-47e4-88ca-354c2c979f2a_938x475.png 848w, https://substackcdn.com/image/fetch/$s_!1HG4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2aaddab3-7155-47e4-88ca-354c2c979f2a_938x475.png 1272w, https://substackcdn.com/image/fetch/$s_!1HG4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2aaddab3-7155-47e4-88ca-354c2c979f2a_938x475.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1HG4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2aaddab3-7155-47e4-88ca-354c2c979f2a_938x475.png" width="938" height="475" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2aaddab3-7155-47e4-88ca-354c2c979f2a_938x475.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:475,&quot;width&quot;:938,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:98476,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165189707?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2aaddab3-7155-47e4-88ca-354c2c979f2a_938x475.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!1HG4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2aaddab3-7155-47e4-88ca-354c2c979f2a_938x475.png 424w, https://substackcdn.com/image/fetch/$s_!1HG4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2aaddab3-7155-47e4-88ca-354c2c979f2a_938x475.png 848w, https://substackcdn.com/image/fetch/$s_!1HG4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2aaddab3-7155-47e4-88ca-354c2c979f2a_938x475.png 1272w, https://substackcdn.com/image/fetch/$s_!1HG4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2aaddab3-7155-47e4-88ca-354c2c979f2a_938x475.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p>Compute &#923; from the data.</p></li><li><p>Check if &#923; is greater or less than a threshold (often based on a test significance level or an equivalent statistic such as the log-likelihood ratio).</p></li></ul><p>Because exponential distributions are frequently used in survival analysis, engineering reliability, and user-lifetime modeling, this ratio test is a straightforward technique to do quick model comparisons or to test whether usage lifetimes have changed over time.</p><p>Code snippet demonstrating how one might compute this ratio in Python</p><pre><code><code>import numpy as np

def likelihood_ratio_exponential(data, lambda0, lambda1):
    """
    Computes the likelihood ratio L(lambda0) / L(lambda1)
    for an exponential model given data and two different rate parameters.
    """
    n = len(data)
    sum_x = np.sum(data)

    # Compute the likelihood ratio
    ratio = (lambda0**n * np.exp(-lambda0 * sum_x)) / (lambda1**n * np.exp(-lambda1 * sum_x))
    return ratio

# Example usage:
data = [2.0, 1.5, 3.1, 0.8, 4.2]
lambda0 = 0.5
lambda1 = 0.6

lr = likelihood_ratio_exponential(data, lambda0, lambda1)
print("Likelihood Ratio:", lr)
</code></code></pre><p>Potential real-world pitfalls</p><p>When user lifetime data is heavily censored or truncated, the simple product of densities might not fully capture the setting. Censoring adjustments or partial likelihoods might be required. Also, ensure that the exponential assumption is at least approximately valid. In real user-lifetime data, there can be multiple factors such as mixture distributions or non-exponential decay patterns.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.rohan-paul.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">I write everyday for my readers on actionable AI. Subscribe and instantly get a 1300+ page Python book.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2><strong>Can you talk about how the test statistic is typically used and how to decide on a threshold?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cJEB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f5cc7c5-a671-44e1-a7bd-a6aaf2234ea6_950x663.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cJEB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f5cc7c5-a671-44e1-a7bd-a6aaf2234ea6_950x663.png 424w, https://substackcdn.com/image/fetch/$s_!cJEB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f5cc7c5-a671-44e1-a7bd-a6aaf2234ea6_950x663.png 848w, https://substackcdn.com/image/fetch/$s_!cJEB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f5cc7c5-a671-44e1-a7bd-a6aaf2234ea6_950x663.png 1272w, https://substackcdn.com/image/fetch/$s_!cJEB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f5cc7c5-a671-44e1-a7bd-a6aaf2234ea6_950x663.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cJEB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f5cc7c5-a671-44e1-a7bd-a6aaf2234ea6_950x663.png" width="950" height="663" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5f5cc7c5-a671-44e1-a7bd-a6aaf2234ea6_950x663.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:663,&quot;width&quot;:950,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:135771,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165189707?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f5cc7c5-a671-44e1-a7bd-a6aaf2234ea6_950x663.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!cJEB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f5cc7c5-a671-44e1-a7bd-a6aaf2234ea6_950x663.png 424w, https://substackcdn.com/image/fetch/$s_!cJEB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f5cc7c5-a671-44e1-a7bd-a6aaf2234ea6_950x663.png 848w, https://substackcdn.com/image/fetch/$s_!cJEB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f5cc7c5-a671-44e1-a7bd-a6aaf2234ea6_950x663.png 1272w, https://substackcdn.com/image/fetch/$s_!cJEB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f5cc7c5-a671-44e1-a7bd-a6aaf2234ea6_950x663.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9qeX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d8d6a2-c62a-4281-a02c-21e68529864e_920x822.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9qeX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d8d6a2-c62a-4281-a02c-21e68529864e_920x822.png 424w, https://substackcdn.com/image/fetch/$s_!9qeX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d8d6a2-c62a-4281-a02c-21e68529864e_920x822.png 848w, https://substackcdn.com/image/fetch/$s_!9qeX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d8d6a2-c62a-4281-a02c-21e68529864e_920x822.png 1272w, https://substackcdn.com/image/fetch/$s_!9qeX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d8d6a2-c62a-4281-a02c-21e68529864e_920x822.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9qeX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d8d6a2-c62a-4281-a02c-21e68529864e_920x822.png" width="920" height="822" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f9d8d6a2-c62a-4281-a02c-21e68529864e_920x822.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:822,&quot;width&quot;:920,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:160585,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165189707?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d8d6a2-c62a-4281-a02c-21e68529864e_920x822.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9qeX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d8d6a2-c62a-4281-a02c-21e68529864e_920x822.png 424w, https://substackcdn.com/image/fetch/$s_!9qeX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d8d6a2-c62a-4281-a02c-21e68529864e_920x822.png 848w, https://substackcdn.com/image/fetch/$s_!9qeX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d8d6a2-c62a-4281-a02c-21e68529864e_920x822.png 1272w, https://substackcdn.com/image/fetch/$s_!9qeX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d8d6a2-c62a-4281-a02c-21e68529864e_920x822.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>How can we verify the assumptions behind the exponential model before applying the likelihood ratio?</strong></h2><p>First, checking that the exponential distribution is appropriate is crucial. Common verification techniques include:</p><ul><li><p>Examining the empirical survival function or the empirical cumulative distribution function and comparing it with the exponential's theoretical curve.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!v7Gc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92f6c8ab-6ab8-47a0-84f4-7661ebc005c2_843x111.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!v7Gc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92f6c8ab-6ab8-47a0-84f4-7661ebc005c2_843x111.png 424w, https://substackcdn.com/image/fetch/$s_!v7Gc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92f6c8ab-6ab8-47a0-84f4-7661ebc005c2_843x111.png 848w, https://substackcdn.com/image/fetch/$s_!v7Gc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92f6c8ab-6ab8-47a0-84f4-7661ebc005c2_843x111.png 1272w, https://substackcdn.com/image/fetch/$s_!v7Gc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92f6c8ab-6ab8-47a0-84f4-7661ebc005c2_843x111.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!v7Gc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92f6c8ab-6ab8-47a0-84f4-7661ebc005c2_843x111.png" width="843" height="111" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/92f6c8ab-6ab8-47a0-84f4-7661ebc005c2_843x111.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:111,&quot;width&quot;:843,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:29772,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165189707?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92f6c8ab-6ab8-47a0-84f4-7661ebc005c2_843x111.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!v7Gc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92f6c8ab-6ab8-47a0-84f4-7661ebc005c2_843x111.png 424w, https://substackcdn.com/image/fetch/$s_!v7Gc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92f6c8ab-6ab8-47a0-84f4-7661ebc005c2_843x111.png 848w, https://substackcdn.com/image/fetch/$s_!v7Gc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92f6c8ab-6ab8-47a0-84f4-7661ebc005c2_843x111.png 1272w, https://substackcdn.com/image/fetch/$s_!v7Gc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92f6c8ab-6ab8-47a0-84f4-7661ebc005c2_843x111.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><ul><li><p>Checking that the event rate is roughly constant over time. If the rate changes (e.g., if hazard function is not constant), the exponential assumption might fail.</p></li></ul><h2><strong>Could there be convergence or numerical stability issues with large datasets?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7J2H!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99f06222-b39c-4aa0-8a50-ff374fa09800_588x56.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7J2H!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99f06222-b39c-4aa0-8a50-ff374fa09800_588x56.png 424w, https://substackcdn.com/image/fetch/$s_!7J2H!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99f06222-b39c-4aa0-8a50-ff374fa09800_588x56.png 848w, https://substackcdn.com/image/fetch/$s_!7J2H!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99f06222-b39c-4aa0-8a50-ff374fa09800_588x56.png 1272w, https://substackcdn.com/image/fetch/$s_!7J2H!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99f06222-b39c-4aa0-8a50-ff374fa09800_588x56.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7J2H!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99f06222-b39c-4aa0-8a50-ff374fa09800_588x56.png" width="588" height="56" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/99f06222-b39c-4aa0-8a50-ff374fa09800_588x56.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:56,&quot;width&quot;:588,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:7990,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165189707?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99f06222-b39c-4aa0-8a50-ff374fa09800_588x56.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!7J2H!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99f06222-b39c-4aa0-8a50-ff374fa09800_588x56.png 424w, https://substackcdn.com/image/fetch/$s_!7J2H!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99f06222-b39c-4aa0-8a50-ff374fa09800_588x56.png 848w, https://substackcdn.com/image/fetch/$s_!7J2H!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99f06222-b39c-4aa0-8a50-ff374fa09800_588x56.png 1272w, https://substackcdn.com/image/fetch/$s_!7J2H!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99f06222-b39c-4aa0-8a50-ff374fa09800_588x56.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><ul><li><p>Likelihood values might become extremely small, leading to underflow in floating-point arithmetic. Taking the ratio directly might produce 0.0 or NaN if the numbers are too large or too small for machine precision.</p></li><li><p>A more stable approach is to use the log-likelihood ratio and then exponentiate only at the final step if needed, or simply keep the comparison in log form without exponentiating.</p></li><li><p>In Python, you might prefer computing log&#8289;&#923; and carefully using functions like NumPy&#8217;s <code>logaddexp</code> if needed, to maintain numeric stability.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Qk3g!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c15d162-0a58-4d5d-8e81-7c4d488038eb_939x549.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Qk3g!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c15d162-0a58-4d5d-8e81-7c4d488038eb_939x549.png 424w, https://substackcdn.com/image/fetch/$s_!Qk3g!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c15d162-0a58-4d5d-8e81-7c4d488038eb_939x549.png 848w, https://substackcdn.com/image/fetch/$s_!Qk3g!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c15d162-0a58-4d5d-8e81-7c4d488038eb_939x549.png 1272w, https://substackcdn.com/image/fetch/$s_!Qk3g!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c15d162-0a58-4d5d-8e81-7c4d488038eb_939x549.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Qk3g!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c15d162-0a58-4d5d-8e81-7c4d488038eb_939x549.png" width="939" height="549" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5c15d162-0a58-4d5d-8e81-7c4d488038eb_939x549.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:549,&quot;width&quot;:939,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:112331,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165189707?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c15d162-0a58-4d5d-8e81-7c4d488038eb_939x549.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Qk3g!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c15d162-0a58-4d5d-8e81-7c4d488038eb_939x549.png 424w, https://substackcdn.com/image/fetch/$s_!Qk3g!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c15d162-0a58-4d5d-8e81-7c4d488038eb_939x549.png 848w, https://substackcdn.com/image/fetch/$s_!Qk3g!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c15d162-0a58-4d5d-8e81-7c4d488038eb_939x549.png 1272w, https://substackcdn.com/image/fetch/$s_!Qk3g!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c15d162-0a58-4d5d-8e81-7c4d488038eb_939x549.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>How does censoring affect the likelihood ratio for exponential distributions?</strong></h2><p>If you have right-censored observations (common in survival analysis), say a user&#8217;s lifetime is only known to exceed a certain time but not the exact failure time, the likelihood contribution from that data point becomes</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6Fa7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabb8487a-271c-444a-8b18-648c9e6a98e4_328x52.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6Fa7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabb8487a-271c-444a-8b18-648c9e6a98e4_328x52.png 424w, https://substackcdn.com/image/fetch/$s_!6Fa7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabb8487a-271c-444a-8b18-648c9e6a98e4_328x52.png 848w, https://substackcdn.com/image/fetch/$s_!6Fa7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabb8487a-271c-444a-8b18-648c9e6a98e4_328x52.png 1272w, https://substackcdn.com/image/fetch/$s_!6Fa7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabb8487a-271c-444a-8b18-648c9e6a98e4_328x52.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6Fa7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabb8487a-271c-444a-8b18-648c9e6a98e4_328x52.png" width="328" height="52" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/abb8487a-271c-444a-8b18-648c9e6a98e4_328x52.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:52,&quot;width&quot;:328,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:5996,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165189707?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabb8487a-271c-444a-8b18-648c9e6a98e4_328x52.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!6Fa7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabb8487a-271c-444a-8b18-648c9e6a98e4_328x52.png 424w, https://substackcdn.com/image/fetch/$s_!6Fa7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabb8487a-271c-444a-8b18-648c9e6a98e4_328x52.png 848w, https://substackcdn.com/image/fetch/$s_!6Fa7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabb8487a-271c-444a-8b18-648c9e6a98e4_328x52.png 1272w, https://substackcdn.com/image/fetch/$s_!6Fa7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabb8487a-271c-444a-8b18-648c9e6a98e4_328x52.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>rather than the full PDF. You multiply these survival terms for all censored observations and the PDF for uncensored observations, forming a partial or combined likelihood. The final likelihood ratio test is constructed similarly, except you incorporate the correct form for censored data. This can change the distribution of the test statistic, especially if you do not have a purely complete dataset.</p><h2><strong>Are there alternative approaches besides a likelihood ratio for comparing exponential rates?</strong></h2><p>One could consider:</p><ul><li><p>Bayesian approaches, defining a prior over &#955; and computing posterior odds.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FN0O!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10e8e6c7-702d-4a31-9583-047ab27c59a1_849x117.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FN0O!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10e8e6c7-702d-4a31-9583-047ab27c59a1_849x117.png 424w, https://substackcdn.com/image/fetch/$s_!FN0O!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10e8e6c7-702d-4a31-9583-047ab27c59a1_849x117.png 848w, https://substackcdn.com/image/fetch/$s_!FN0O!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10e8e6c7-702d-4a31-9583-047ab27c59a1_849x117.png 1272w, https://substackcdn.com/image/fetch/$s_!FN0O!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10e8e6c7-702d-4a31-9583-047ab27c59a1_849x117.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FN0O!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10e8e6c7-702d-4a31-9583-047ab27c59a1_849x117.png" width="849" height="117" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/10e8e6c7-702d-4a31-9583-047ab27c59a1_849x117.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:117,&quot;width&quot;:849,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:21989,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165189707?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10e8e6c7-702d-4a31-9583-047ab27c59a1_849x117.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!FN0O!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10e8e6c7-702d-4a31-9583-047ab27c59a1_849x117.png 424w, https://substackcdn.com/image/fetch/$s_!FN0O!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10e8e6c7-702d-4a31-9583-047ab27c59a1_849x117.png 848w, https://substackcdn.com/image/fetch/$s_!FN0O!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10e8e6c7-702d-4a31-9583-047ab27c59a1_849x117.png 1272w, https://substackcdn.com/image/fetch/$s_!FN0O!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F10e8e6c7-702d-4a31-9583-047ab27c59a1_849x117.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Non-parametric tests if you do not fully trust the exponential assumption (though with lifetimes, a parametric approach is common if well justified).</p></li></ul><p>Still, the likelihood ratio test remains a straightforward, classical, and powerful approach in many parametric settings.</p><h2><strong>Below are additional follow-up questions</strong></h2><h2><strong>What if we suspect time-varying rates rather than a constant &#955;?</strong></h2><p>In many real-world scenarios, the rate at which users churn (or &#8220;lifetime ends&#8221;) may not remain constant over time. The exponential model specifically assumes a constant hazard function. If the underlying rate changes, the exponential assumption might not hold. For instance, in user-lifetime data, it is possible that early-stage users might have a higher probability of churn, while more established users become &#8220;stickier,&#8221; lowering the churn rate over time.</p><p>If you still attempt to compare two constant rates, &#955;&#8320; vs &#955;&#8321;, when the true process has time-varying behavior, you risk mis-specification errors. The likelihood ratio derived under the assumption of constant &#955; may become unreliable. Even if one of the two rates better matches the average churn behavior, neither may fully represent reality. This situation can be exacerbated if the sample is large enough that small deviations from the exponential assumption become statistically significant.</p><p>A practical pitfall is ignoring any visible patterns in the data that hint at non-constant hazard. Always inspect whether hazard rates are truly constant. Techniques such as plotting the cumulative hazard over time or applying a parametric survival model that allows for changing rate (like the Weibull or a piecewise exponential) may help confirm or refute the assumption of a single fixed &#955;. In a more flexible approach, you might compare piecewise-constant or semi-parametric models using a likelihood ratio test that accounts for time-varying pieces.</p><h2><strong>Could extreme or outlier values in the data drastically affect the likelihood ratio?</strong></h2><p>An exponential distribution is memoryless but not immune to influence from extreme observations. If you observe unusually large lifetimes, those observations might skew the parameter estimates or make one rate value seem unlikely. For instance, if one or two users remain active for much longer than anyone else, this can push the sum of lifetimes significantly higher, favoring smaller estimates of &#955; in an MLE setting (if the model is being fit).</p><p>When merely comparing fixed rates &#955;&#8320; and &#955;&#8321;, extreme values can swing the likelihood ratio drastically, especially if one &#955; strongly penalizes very long observations relative to the other. For example, a higher &#955; expects the data to concentrate on shorter times, so large outliers can yield extremely small likelihood under that hypothesis. Conversely, a smaller &#955; is more tolerant of large values.</p><p>A major pitfall is failing to explore the distribution of the data before applying the test. If your data has a heavy right tail or includes just a few long-lived outliers, the ratio test might be overly sensitive. One solution is to perform sensitivity analyses&#8212;remove or downweight outliers to see if the conclusion remains consistent. Another approach is to use robust statistical methods or a heavy-tailed distribution if you truly suspect big outliers are part of the natural data generation process.</p><h2><strong>How should we handle truncated data, for example if we only record lifetimes above a certain threshold?</strong></h2><p>Truncation arises if measurements begin only after a certain time has passed, meaning individuals (or users) who &#8220;failed&#8221; or churned before that time are never observed. If your data is left-truncated, it means you only see those users whose lifetime exceeded some lower bound, say a time point t&#8320;. The correct likelihood for an exponentially distributed random variable X, truncated to be greater than t&#8320;, is</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rm06!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad7263fd-8f33-4101-a160-aca588c53ced_1077x177.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rm06!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad7263fd-8f33-4101-a160-aca588c53ced_1077x177.png 424w, https://substackcdn.com/image/fetch/$s_!rm06!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad7263fd-8f33-4101-a160-aca588c53ced_1077x177.png 848w, https://substackcdn.com/image/fetch/$s_!rm06!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad7263fd-8f33-4101-a160-aca588c53ced_1077x177.png 1272w, https://substackcdn.com/image/fetch/$s_!rm06!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad7263fd-8f33-4101-a160-aca588c53ced_1077x177.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rm06!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad7263fd-8f33-4101-a160-aca588c53ced_1077x177.png" width="1077" height="177" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ad7263fd-8f33-4101-a160-aca588c53ced_1077x177.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:177,&quot;width&quot;:1077,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:26844,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165189707?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad7263fd-8f33-4101-a160-aca588c53ced_1077x177.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rm06!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad7263fd-8f33-4101-a160-aca588c53ced_1077x177.png 424w, https://substackcdn.com/image/fetch/$s_!rm06!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad7263fd-8f33-4101-a160-aca588c53ced_1077x177.png 848w, https://substackcdn.com/image/fetch/$s_!rm06!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad7263fd-8f33-4101-a160-aca588c53ced_1077x177.png 1272w, https://substackcdn.com/image/fetch/$s_!rm06!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad7263fd-8f33-4101-a160-aca588c53ced_1077x177.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>where ( S(t_0 \mid \lambda) = \exp(-\lambda t_0) ) is the survival function at t&#8320; for the exponential distribution.</p><p>When comparing &#955;&#8320; vs &#955;&#8321;, each likelihood must incorporate the adjusted densities for truncated data. If you use the naive density without adjusting for truncation, you risk biasing the test. This might incorrectly favor a model that underestimates the rate because you are not accounting for the fact that you are missing all the users who failed before the truncation point. A subtle real-world example: if you only start tracking user retention after a 7-day free trial, you miss those who left earlier, and your data set is left-truncated. Properly weighting the likelihood ensures you do not distort the parameter comparisons.</p><h2><strong>Are there any reparameterizations that make interpreting the likelihood ratio easier?</strong></h2><p>Sometimes it is useful to reparameterize the exponential distribution in terms of its mean &#956; = 1/&#955;. This directly relates to average lifetime rather than the rate. Then the density can be written as</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qr5B!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9bedab-d0e0-4279-aff3-6df9b4a2101b_342x91.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qr5B!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9bedab-d0e0-4279-aff3-6df9b4a2101b_342x91.png 424w, https://substackcdn.com/image/fetch/$s_!qr5B!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9bedab-d0e0-4279-aff3-6df9b4a2101b_342x91.png 848w, https://substackcdn.com/image/fetch/$s_!qr5B!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9bedab-d0e0-4279-aff3-6df9b4a2101b_342x91.png 1272w, https://substackcdn.com/image/fetch/$s_!qr5B!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9bedab-d0e0-4279-aff3-6df9b4a2101b_342x91.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qr5B!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9bedab-d0e0-4279-aff3-6df9b4a2101b_342x91.png" width="342" height="91" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5c9bedab-d0e0-4279-aff3-6df9b4a2101b_342x91.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:91,&quot;width&quot;:342,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:7264,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165189707?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9bedab-d0e0-4279-aff3-6df9b4a2101b_342x91.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!qr5B!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9bedab-d0e0-4279-aff3-6df9b4a2101b_342x91.png 424w, https://substackcdn.com/image/fetch/$s_!qr5B!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9bedab-d0e0-4279-aff3-6df9b4a2101b_342x91.png 848w, https://substackcdn.com/image/fetch/$s_!qr5B!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9bedab-d0e0-4279-aff3-6df9b4a2101b_342x91.png 1272w, https://substackcdn.com/image/fetch/$s_!qr5B!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9bedab-d0e0-4279-aff3-6df9b4a2101b_342x91.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>In this parameterization, comparing &#956;&#8320; vs &#956;&#8321; might be more intuitive for domain experts (e.g., telling a product manager &#8220;the average user lasts 10 days vs. 12 days&#8221;). The likelihood ratio in terms of &#956; would become</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HoYw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2eb5ee90-065e-466a-9c5b-0529e1303830_1190x123.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HoYw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2eb5ee90-065e-466a-9c5b-0529e1303830_1190x123.png 424w, https://substackcdn.com/image/fetch/$s_!HoYw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2eb5ee90-065e-466a-9c5b-0529e1303830_1190x123.png 848w, https://substackcdn.com/image/fetch/$s_!HoYw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2eb5ee90-065e-466a-9c5b-0529e1303830_1190x123.png 1272w, https://substackcdn.com/image/fetch/$s_!HoYw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2eb5ee90-065e-466a-9c5b-0529e1303830_1190x123.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HoYw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2eb5ee90-065e-466a-9c5b-0529e1303830_1190x123.png" width="1190" height="123" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2eb5ee90-065e-466a-9c5b-0529e1303830_1190x123.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:123,&quot;width&quot;:1190,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:24598,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165189707?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2eb5ee90-065e-466a-9c5b-0529e1303830_1190x123.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!HoYw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2eb5ee90-065e-466a-9c5b-0529e1303830_1190x123.png 424w, https://substackcdn.com/image/fetch/$s_!HoYw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2eb5ee90-065e-466a-9c5b-0529e1303830_1190x123.png 848w, https://substackcdn.com/image/fetch/$s_!HoYw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2eb5ee90-065e-466a-9c5b-0529e1303830_1190x123.png 1272w, https://substackcdn.com/image/fetch/$s_!HoYw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2eb5ee90-065e-466a-9c5b-0529e1303830_1190x123.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The structure remains similar; you have merely inverted the parameters. The pitfall is ensuring consistency if you switch parameter definitions mid-analysis. You must keep careful track of whether you are using &#955; or &#956; throughout the pipeline. Also, many standard reference tables and software packages for LRT-based inference in survival analysis are parameterized in terms of &#955;, so reparameterizing might require custom code or additional care to avoid confusion.</p><h2><strong>What if the dataset includes zero or negative values for lifetimes?</strong></h2><p>In principle, for a lifetime distribution, X &#8805; 0 is mandatory. Negative or zero lifetimes typically indicate a data quality problem or a mismatch in the definition of &#8220;start time.&#8221; If the data inadvertently contains these values&#8212;perhaps because the logging system incorrectly recorded churn events or the user joined at one timestamp but was flagged for churn at an earlier timestamp&#8212;then the exponential model&#8217;s PDF is undefined for negative X and is only borderline meaningful for X = 0 (the PDF can approach &#955; for X&#8594;0).</p><p>A pitfall would be to blindly pass such values into your likelihood computation. This can break the math or lead to negative infinite likelihood for that observation, overshadowing the rest of the data. A thorough data-cleaning step is essential. You may need to either remove these cases or correct them if the discrepancy is known to be a logging error. If zero is a genuinely possible outcome (e.g., a user signs up and immediately quits), you might treat it as an extremely small positive number or adopt a mixture model with a point mass at zero plus an exponential tail for nonzero lifetimes.</p><h2><strong>How does sample size influence the power of the likelihood ratio test?</strong></h2><p>The asymptotic properties of the likelihood ratio test rely on having sufficiently large samples. When n is large, &#8722;2log&#8289;(&#923;) (where &#923; is the ratio of likelihoods under H&#8320; vs H&#8321;) will often follow a well-defined distribution that allows for standard inference. With smaller n, the test may not have enough power to discriminate between two close values of &#955;, or the distribution of the ratio under H&#8320; might deviate from the theoretical asymptotic distribution, leading to inaccurate p-values.</p><p>In practice, if the sample is very small, you might prefer exact methods or simulation-based approaches (like a parametric bootstrap) to gauge how often one &#955; outperforms another in repeated samples. If the sample is very large, then even tiny differences in &#955;&#8320; vs &#955;&#8321; might result in a large difference in log-likelihood, leading to an overly sensitive test that flags small deviations as significant&#8212;even if those deviations are practically negligible. A balanced approach is to consider statistical significance alongside effect size, and potentially calibrate the test to domain-meaningful thresholds rather than purely p-value-based thresholds.</p><h2><strong>What issues might arise if &#955;&#8320; and &#955;&#8321; are very close together?</strong></h2><p>If the two rate parameters are nearly identical, the likelihood ratio test might yield a ratio near 1, making it difficult to strongly favor one model over the other. From a practical standpoint, even if your test does produce a statistical difference at a very large sample size, the actual difference in expected lifetimes might be so minimal that it is not actionable.</p><p>A subtle pitfall is to fixate on a minuscule p-value without asking whether the difference in lifetimes is meaningful in business or application contexts. For instance, if &#955;&#8320; = 0.10 per day and &#955;&#8321; = 0.105 per day, the difference in mean lifetimes is 10 vs ~9.52 days, and if you have a massive dataset, you might detect that difference with high significance. But the real-world implication of a half-day shift in average user lifetime may or may not warrant a strategic change. Thus, you should interpret the ratio test in light of domain considerations and effect sizes, not just statistical significance.</p><h2><strong>When might a parametric bootstrap approach be preferred for significance testing?</strong></h2><p>In some scenarios, using the theoretical asymptotic distribution for the likelihood ratio might be unreliable&#8212;for example, if sample sizes are modest, if there is any boundary condition (like a rate approaching zero), or if the distribution of lifetimes is heavily skewed. A parametric bootstrap approach involves:</p><ul><li><p>Fitting under one hypothesis (often the null) to obtain a parameter estimate (if the null is composite).</p></li><li><p>Simulating many synthetic datasets from that model.</p></li><li><p>Computing the likelihood ratio for each synthetic dataset to form an empirical distribution of the test statistic.</p></li><li><p>Comparing the observed test statistic to the bootstrap distribution to obtain a p-value or confidence measure.</p></li></ul><p>This approach can capture finite-sample peculiarities and violations of standard assumptions. A potential pitfall is increased computational cost. Generating and evaluating many synthetic datasets can be expensive, especially for large datasets or complicated models. Additionally, you need to ensure you simulate from a model that closely reflects the real data-generating mechanism or at least the null scenario accurately.</p><h2><strong>How might heterogeneity across user segments complicate comparing two &#955; values?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!s5l9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c398d39-51d2-47a8-954a-ecbd127f66b0_928x271.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!s5l9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c398d39-51d2-47a8-954a-ecbd127f66b0_928x271.png 424w, https://substackcdn.com/image/fetch/$s_!s5l9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c398d39-51d2-47a8-954a-ecbd127f66b0_928x271.png 848w, https://substackcdn.com/image/fetch/$s_!s5l9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c398d39-51d2-47a8-954a-ecbd127f66b0_928x271.png 1272w, https://substackcdn.com/image/fetch/$s_!s5l9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c398d39-51d2-47a8-954a-ecbd127f66b0_928x271.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!s5l9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c398d39-51d2-47a8-954a-ecbd127f66b0_928x271.png" width="928" height="271" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0c398d39-51d2-47a8-954a-ecbd127f66b0_928x271.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:271,&quot;width&quot;:928,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:70901,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165189707?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c398d39-51d2-47a8-954a-ecbd127f66b0_928x271.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!s5l9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c398d39-51d2-47a8-954a-ecbd127f66b0_928x271.png 424w, https://substackcdn.com/image/fetch/$s_!s5l9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c398d39-51d2-47a8-954a-ecbd127f66b0_928x271.png 848w, https://substackcdn.com/image/fetch/$s_!s5l9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c398d39-51d2-47a8-954a-ecbd127f66b0_928x271.png 1272w, https://substackcdn.com/image/fetch/$s_!s5l9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c398d39-51d2-47a8-954a-ecbd127f66b0_928x271.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A subtle pitfall is misinterpretation: you might reject &#955;&#8320; in favor of &#955;&#8321; when, in reality, each subpopulation has a distinct rate, and neither &#955;&#8320; nor &#955;&#8321; matches those varying rates. Another pitfall is that ignoring segmentation can inflate variance or lead to a biased estimate. It is often beneficial to stratify the data or incorporate segment-level random effects (e.g., a hierarchical model) so that the overall test accounts for variation among user subgroups. Otherwise, you may end up with an oversimplified binary comparison that fails to model the underlying complexity.</p><h2><strong>Could dependencies or correlation within the data invalidate the exponential assumption or the test?</strong></h2><p>The classical likelihood ratio for exponential distributions assumes independent and identically distributed (i.i.d.) observations. In real-world settings, user churn might be correlated&#8212;for example, users might follow each other&#8217;s behavior if they are part of a social network, or an external event (e.g., a major competitor&#8217;s promotion) could cause a spike in churn across many users simultaneously. This correlation structure means the data is not truly i.i.d.</p><p>If there is significant correlation, the standard formula for the likelihood ratio remains a formal ratio, but its statistical properties (like the distribution under H&#8320;) may no longer hold. You could end up with an overly optimistic or pessimistic p-value. As a pitfall, ignoring correlation can cause you to incorrectly reject or fail to reject the null hypothesis.</p><p>One approach is to model the correlation explicitly&#8212;perhaps using frailty models in survival analysis, where each user might have a random effect capturing unobserved heterogeneity, or using time-varying covariates in a Cox model. If you truly believe the exponential form is appropriate but want to account for correlation, a multi-level or random-effects exponential model can allow partial pooling of parameters across correlated groups of observations. Each approach requires carefully adjusting the form of the likelihood or test statistic to reflect the lack of independence in the data.</p>]]></content:encoded></item><item><title><![CDATA[ML Interview Q Series: Linear Regression: Equivalence of Maximum Likelihood and Minimum Squared Residuals with Gaussian Errors.]]></title><description><![CDATA[Browse all the Probability Interview Questions here.]]></description><link>https://www.rohan-paul.com/p/ml-interview-q-series-linear-regression</link><guid isPermaLink="false">https://www.rohan-paul.com/p/ml-interview-q-series-linear-regression</guid><pubDate>Wed, 04 Jun 2025 13:36:07 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!fxeE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa39e794a-d7ee-408f-b70d-5c62c88fa2ce_1024x574.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fxeE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa39e794a-d7ee-408f-b70d-5c62c88fa2ce_1024x574.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fxeE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa39e794a-d7ee-408f-b70d-5c62c88fa2ce_1024x574.png 424w, https://substackcdn.com/image/fetch/$s_!fxeE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa39e794a-d7ee-408f-b70d-5c62c88fa2ce_1024x574.png 848w, https://substackcdn.com/image/fetch/$s_!fxeE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa39e794a-d7ee-408f-b70d-5c62c88fa2ce_1024x574.png 1272w, https://substackcdn.com/image/fetch/$s_!fxeE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa39e794a-d7ee-408f-b70d-5c62c88fa2ce_1024x574.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fxeE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa39e794a-d7ee-408f-b70d-5c62c88fa2ce_1024x574.png" width="1024" height="574" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a39e794a-d7ee-408f-b70d-5c62c88fa2ce_1024x574.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:574,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:936887,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa39e794a-d7ee-408f-b70d-5c62c88fa2ce_1024x574.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!fxeE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa39e794a-d7ee-408f-b70d-5c62c88fa2ce_1024x574.png 424w, https://substackcdn.com/image/fetch/$s_!fxeE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa39e794a-d7ee-408f-b70d-5c62c88fa2ce_1024x574.png 848w, https://substackcdn.com/image/fetch/$s_!fxeE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa39e794a-d7ee-408f-b70d-5c62c88fa2ce_1024x574.png 1272w, https://substackcdn.com/image/fetch/$s_!fxeE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa39e794a-d7ee-408f-b70d-5c62c88fa2ce_1024x574.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Browse all the <strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">Probability Interview Questions here</a></strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">.</a></p><h2><strong>19. Suppose you are running a linear regression and model the error terms as normally distributed. Show that maximizing the likelihood of the data is equivalent to minimizing the sum of squared residuals.</strong></h2><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://x.com/rohanpaul_ai&quot;,&quot;text&quot;:&quot;Connect with me on X (Twitter)&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://x.com/rohanpaul_ai"><span>Connect with me on X (Twitter)</span></a></p><p>Understanding the Relationship Between Likelihood and Sum of Squared Residuals in Linear Regression</p><p>It helps to start with a linear regression framework where each observed response value is modeled as a linear function of the predictors plus a noise term. Let the observations be denoted by pairs</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Wq7v!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94cdc284-91b6-4d72-96b9-868a5d05e8f6_134x62.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Wq7v!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94cdc284-91b6-4d72-96b9-868a5d05e8f6_134x62.png 424w, https://substackcdn.com/image/fetch/$s_!Wq7v!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94cdc284-91b6-4d72-96b9-868a5d05e8f6_134x62.png 848w, https://substackcdn.com/image/fetch/$s_!Wq7v!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94cdc284-91b6-4d72-96b9-868a5d05e8f6_134x62.png 1272w, https://substackcdn.com/image/fetch/$s_!Wq7v!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94cdc284-91b6-4d72-96b9-868a5d05e8f6_134x62.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Wq7v!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94cdc284-91b6-4d72-96b9-868a5d05e8f6_134x62.png" width="134" height="62" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/94cdc284-91b6-4d72-96b9-868a5d05e8f6_134x62.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:62,&quot;width&quot;:134,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2650,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94cdc284-91b6-4d72-96b9-868a5d05e8f6_134x62.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Wq7v!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94cdc284-91b6-4d72-96b9-868a5d05e8f6_134x62.png 424w, https://substackcdn.com/image/fetch/$s_!Wq7v!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94cdc284-91b6-4d72-96b9-868a5d05e8f6_134x62.png 848w, https://substackcdn.com/image/fetch/$s_!Wq7v!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94cdc284-91b6-4d72-96b9-868a5d05e8f6_134x62.png 1272w, https://substackcdn.com/image/fetch/$s_!Wq7v!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94cdc284-91b6-4d72-96b9-868a5d05e8f6_134x62.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p>for</p><p>i=1,&#8230;,n</p><p>. The vector of predictor variables for the i-th observation is</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jUZT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc1db66-5a06-429d-9eea-0bbe668f1048_121x61.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jUZT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc1db66-5a06-429d-9eea-0bbe668f1048_121x61.png 424w, https://substackcdn.com/image/fetch/$s_!jUZT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc1db66-5a06-429d-9eea-0bbe668f1048_121x61.png 848w, https://substackcdn.com/image/fetch/$s_!jUZT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc1db66-5a06-429d-9eea-0bbe668f1048_121x61.png 1272w, https://substackcdn.com/image/fetch/$s_!jUZT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc1db66-5a06-429d-9eea-0bbe668f1048_121x61.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jUZT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc1db66-5a06-429d-9eea-0bbe668f1048_121x61.png" width="121" height="61" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6bc1db66-5a06-429d-9eea-0bbe668f1048_121x61.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:61,&quot;width&quot;:121,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2550,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc1db66-5a06-429d-9eea-0bbe668f1048_121x61.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!jUZT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc1db66-5a06-429d-9eea-0bbe668f1048_121x61.png 424w, https://substackcdn.com/image/fetch/$s_!jUZT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc1db66-5a06-429d-9eea-0bbe668f1048_121x61.png 848w, https://substackcdn.com/image/fetch/$s_!jUZT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc1db66-5a06-429d-9eea-0bbe668f1048_121x61.png 1272w, https://substackcdn.com/image/fetch/$s_!jUZT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc1db66-5a06-429d-9eea-0bbe668f1048_121x61.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>, and the corresponding scalar response is</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!liXy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F393068d8-3918-428c-ac56-f6674546a102_115x55.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!liXy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F393068d8-3918-428c-ac56-f6674546a102_115x55.png 424w, https://substackcdn.com/image/fetch/$s_!liXy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F393068d8-3918-428c-ac56-f6674546a102_115x55.png 848w, https://substackcdn.com/image/fetch/$s_!liXy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F393068d8-3918-428c-ac56-f6674546a102_115x55.png 1272w, https://substackcdn.com/image/fetch/$s_!liXy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F393068d8-3918-428c-ac56-f6674546a102_115x55.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!liXy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F393068d8-3918-428c-ac56-f6674546a102_115x55.png" width="115" height="55" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/393068d8-3918-428c-ac56-f6674546a102_115x55.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:55,&quot;width&quot;:115,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2261,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F393068d8-3918-428c-ac56-f6674546a102_115x55.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!liXy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F393068d8-3918-428c-ac56-f6674546a102_115x55.png 424w, https://substackcdn.com/image/fetch/$s_!liXy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F393068d8-3918-428c-ac56-f6674546a102_115x55.png 848w, https://substackcdn.com/image/fetch/$s_!liXy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F393068d8-3918-428c-ac56-f6674546a102_115x55.png 1272w, https://substackcdn.com/image/fetch/$s_!liXy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F393068d8-3918-428c-ac56-f6674546a102_115x55.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>. We assume a linear model of the form</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yqrc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bf30090-8584-48e9-9dc1-76f737cd289f_1059x104.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yqrc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bf30090-8584-48e9-9dc1-76f737cd289f_1059x104.png 424w, https://substackcdn.com/image/fetch/$s_!yqrc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bf30090-8584-48e9-9dc1-76f737cd289f_1059x104.png 848w, https://substackcdn.com/image/fetch/$s_!yqrc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bf30090-8584-48e9-9dc1-76f737cd289f_1059x104.png 1272w, https://substackcdn.com/image/fetch/$s_!yqrc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bf30090-8584-48e9-9dc1-76f737cd289f_1059x104.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yqrc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bf30090-8584-48e9-9dc1-76f737cd289f_1059x104.png" width="1059" height="104" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6bf30090-8584-48e9-9dc1-76f737cd289f_1059x104.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:104,&quot;width&quot;:1059,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:13914,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bf30090-8584-48e9-9dc1-76f737cd289f_1059x104.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!yqrc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bf30090-8584-48e9-9dc1-76f737cd289f_1059x104.png 424w, https://substackcdn.com/image/fetch/$s_!yqrc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bf30090-8584-48e9-9dc1-76f737cd289f_1059x104.png 848w, https://substackcdn.com/image/fetch/$s_!yqrc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bf30090-8584-48e9-9dc1-76f737cd289f_1059x104.png 1272w, https://substackcdn.com/image/fetch/$s_!yqrc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bf30090-8584-48e9-9dc1-76f737cd289f_1059x104.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>where</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FwwC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f0f93e-e2ad-4813-b085-e711f10e6529_347x71.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FwwC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f0f93e-e2ad-4813-b085-e711f10e6529_347x71.png 424w, https://substackcdn.com/image/fetch/$s_!FwwC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f0f93e-e2ad-4813-b085-e711f10e6529_347x71.png 848w, https://substackcdn.com/image/fetch/$s_!FwwC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f0f93e-e2ad-4813-b085-e711f10e6529_347x71.png 1272w, https://substackcdn.com/image/fetch/$s_!FwwC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f0f93e-e2ad-4813-b085-e711f10e6529_347x71.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FwwC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f0f93e-e2ad-4813-b085-e711f10e6529_347x71.png" width="347" height="71" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/75f0f93e-e2ad-4813-b085-e711f10e6529_347x71.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:71,&quot;width&quot;:347,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:5243,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f0f93e-e2ad-4813-b085-e711f10e6529_347x71.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!FwwC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f0f93e-e2ad-4813-b085-e711f10e6529_347x71.png 424w, https://substackcdn.com/image/fetch/$s_!FwwC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f0f93e-e2ad-4813-b085-e711f10e6529_347x71.png 848w, https://substackcdn.com/image/fetch/$s_!FwwC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f0f93e-e2ad-4813-b085-e711f10e6529_347x71.png 1272w, https://substackcdn.com/image/fetch/$s_!FwwC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f0f93e-e2ad-4813-b085-e711f10e6529_347x71.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>are the unknown parameters and</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!o5yj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b405ce8-92cb-473c-a933-158f5906fea1_48x39.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!o5yj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b405ce8-92cb-473c-a933-158f5906fea1_48x39.png 424w, https://substackcdn.com/image/fetch/$s_!o5yj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b405ce8-92cb-473c-a933-158f5906fea1_48x39.png 848w, https://substackcdn.com/image/fetch/$s_!o5yj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b405ce8-92cb-473c-a933-158f5906fea1_48x39.png 1272w, https://substackcdn.com/image/fetch/$s_!o5yj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b405ce8-92cb-473c-a933-158f5906fea1_48x39.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!o5yj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b405ce8-92cb-473c-a933-158f5906fea1_48x39.png" width="48" height="39" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3b405ce8-92cb-473c-a933-158f5906fea1_48x39.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:39,&quot;width&quot;:48,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:803,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b405ce8-92cb-473c-a933-158f5906fea1_48x39.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!o5yj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b405ce8-92cb-473c-a933-158f5906fea1_48x39.png 424w, https://substackcdn.com/image/fetch/$s_!o5yj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b405ce8-92cb-473c-a933-158f5906fea1_48x39.png 848w, https://substackcdn.com/image/fetch/$s_!o5yj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b405ce8-92cb-473c-a933-158f5906fea1_48x39.png 1272w, https://substackcdn.com/image/fetch/$s_!o5yj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b405ce8-92cb-473c-a933-158f5906fea1_48x39.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>are error terms. If we assume these error terms are independent and normally distributed with zero mean and variance</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fcO-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41caf546-5534-40de-a886-033fbef3ecd5_60x46.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fcO-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41caf546-5534-40de-a886-033fbef3ecd5_60x46.png 424w, https://substackcdn.com/image/fetch/$s_!fcO-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41caf546-5534-40de-a886-033fbef3ecd5_60x46.png 848w, https://substackcdn.com/image/fetch/$s_!fcO-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41caf546-5534-40de-a886-033fbef3ecd5_60x46.png 1272w, https://substackcdn.com/image/fetch/$s_!fcO-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41caf546-5534-40de-a886-033fbef3ecd5_60x46.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fcO-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41caf546-5534-40de-a886-033fbef3ecd5_60x46.png" width="60" height="46" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/41caf546-5534-40de-a886-033fbef3ecd5_60x46.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:46,&quot;width&quot;:60,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1021,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41caf546-5534-40de-a886-033fbef3ecd5_60x46.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!fcO-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41caf546-5534-40de-a886-033fbef3ecd5_60x46.png 424w, https://substackcdn.com/image/fetch/$s_!fcO-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41caf546-5534-40de-a886-033fbef3ecd5_60x46.png 848w, https://substackcdn.com/image/fetch/$s_!fcO-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41caf546-5534-40de-a886-033fbef3ecd5_60x46.png 1272w, https://substackcdn.com/image/fetch/$s_!fcO-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41caf546-5534-40de-a886-033fbef3ecd5_60x46.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>, we can write</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cTV0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fceccec47-538e-4899-ad20-78403aab7c86_380x112.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cTV0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fceccec47-538e-4899-ad20-78403aab7c86_380x112.png 424w, https://substackcdn.com/image/fetch/$s_!cTV0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fceccec47-538e-4899-ad20-78403aab7c86_380x112.png 848w, https://substackcdn.com/image/fetch/$s_!cTV0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fceccec47-538e-4899-ad20-78403aab7c86_380x112.png 1272w, https://substackcdn.com/image/fetch/$s_!cTV0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fceccec47-538e-4899-ad20-78403aab7c86_380x112.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cTV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fceccec47-538e-4899-ad20-78403aab7c86_380x112.png" width="380" height="112" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ceccec47-538e-4899-ad20-78403aab7c86_380x112.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:112,&quot;width&quot;:380,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:8662,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fceccec47-538e-4899-ad20-78403aab7c86_380x112.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!cTV0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fceccec47-538e-4899-ad20-78403aab7c86_380x112.png 424w, https://substackcdn.com/image/fetch/$s_!cTV0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fceccec47-538e-4899-ad20-78403aab7c86_380x112.png 848w, https://substackcdn.com/image/fetch/$s_!cTV0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fceccec47-538e-4899-ad20-78403aab7c86_380x112.png 1272w, https://substackcdn.com/image/fetch/$s_!cTV0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fceccec47-538e-4899-ad20-78403aab7c86_380x112.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>This assumption about normality will motivate the link between maximizing the likelihood of the data and minimizing the sum of squared residuals.</p><p>Likelihood of the Observed Data Under Gaussian Assumptions</p><p>When errors are normally distributed, each observation</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Gjek!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2e29042-0ac9-4f92-a78d-3a6ac7dfdebc_78x58.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Gjek!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2e29042-0ac9-4f92-a78d-3a6ac7dfdebc_78x58.png 424w, https://substackcdn.com/image/fetch/$s_!Gjek!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2e29042-0ac9-4f92-a78d-3a6ac7dfdebc_78x58.png 848w, https://substackcdn.com/image/fetch/$s_!Gjek!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2e29042-0ac9-4f92-a78d-3a6ac7dfdebc_78x58.png 1272w, https://substackcdn.com/image/fetch/$s_!Gjek!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2e29042-0ac9-4f92-a78d-3a6ac7dfdebc_78x58.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Gjek!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2e29042-0ac9-4f92-a78d-3a6ac7dfdebc_78x58.png" width="78" height="58" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d2e29042-0ac9-4f92-a78d-3a6ac7dfdebc_78x58.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:58,&quot;width&quot;:78,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1182,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2e29042-0ac9-4f92-a78d-3a6ac7dfdebc_78x58.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Gjek!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2e29042-0ac9-4f92-a78d-3a6ac7dfdebc_78x58.png 424w, https://substackcdn.com/image/fetch/$s_!Gjek!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2e29042-0ac9-4f92-a78d-3a6ac7dfdebc_78x58.png 848w, https://substackcdn.com/image/fetch/$s_!Gjek!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2e29042-0ac9-4f92-a78d-3a6ac7dfdebc_78x58.png 1272w, https://substackcdn.com/image/fetch/$s_!Gjek!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2e29042-0ac9-4f92-a78d-3a6ac7dfdebc_78x58.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>given its predictors</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bMWA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F253ea5ae-fc84-41c4-9099-50eb5d909d78_67x73.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bMWA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F253ea5ae-fc84-41c4-9099-50eb5d909d78_67x73.png 424w, https://substackcdn.com/image/fetch/$s_!bMWA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F253ea5ae-fc84-41c4-9099-50eb5d909d78_67x73.png 848w, https://substackcdn.com/image/fetch/$s_!bMWA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F253ea5ae-fc84-41c4-9099-50eb5d909d78_67x73.png 1272w, https://substackcdn.com/image/fetch/$s_!bMWA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F253ea5ae-fc84-41c4-9099-50eb5d909d78_67x73.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bMWA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F253ea5ae-fc84-41c4-9099-50eb5d909d78_67x73.png" width="67" height="73" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/253ea5ae-fc84-41c4-9099-50eb5d909d78_67x73.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:73,&quot;width&quot;:67,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1090,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F253ea5ae-fc84-41c4-9099-50eb5d909d78_67x73.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!bMWA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F253ea5ae-fc84-41c4-9099-50eb5d909d78_67x73.png 424w, https://substackcdn.com/image/fetch/$s_!bMWA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F253ea5ae-fc84-41c4-9099-50eb5d909d78_67x73.png 848w, https://substackcdn.com/image/fetch/$s_!bMWA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F253ea5ae-fc84-41c4-9099-50eb5d909d78_67x73.png 1272w, https://substackcdn.com/image/fetch/$s_!bMWA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F253ea5ae-fc84-41c4-9099-50eb5d909d78_67x73.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>and the parameters</p><p>&#946;</p><p>is distributed as</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9C4A!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c38e6ca-b729-48db-acfc-9494e2813fa4_1039x125.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9C4A!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c38e6ca-b729-48db-acfc-9494e2813fa4_1039x125.png 424w, https://substackcdn.com/image/fetch/$s_!9C4A!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c38e6ca-b729-48db-acfc-9494e2813fa4_1039x125.png 848w, https://substackcdn.com/image/fetch/$s_!9C4A!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c38e6ca-b729-48db-acfc-9494e2813fa4_1039x125.png 1272w, https://substackcdn.com/image/fetch/$s_!9C4A!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c38e6ca-b729-48db-acfc-9494e2813fa4_1039x125.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9C4A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c38e6ca-b729-48db-acfc-9494e2813fa4_1039x125.png" width="1039" height="125" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4c38e6ca-b729-48db-acfc-9494e2813fa4_1039x125.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:125,&quot;width&quot;:1039,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19476,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c38e6ca-b729-48db-acfc-9494e2813fa4_1039x125.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9C4A!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c38e6ca-b729-48db-acfc-9494e2813fa4_1039x125.png 424w, https://substackcdn.com/image/fetch/$s_!9C4A!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c38e6ca-b729-48db-acfc-9494e2813fa4_1039x125.png 848w, https://substackcdn.com/image/fetch/$s_!9C4A!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c38e6ca-b729-48db-acfc-9494e2813fa4_1039x125.png 1272w, https://substackcdn.com/image/fetch/$s_!9C4A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c38e6ca-b729-48db-acfc-9494e2813fa4_1039x125.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Hence, the probability density for a single observation</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!f6HZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae60fc63-3b38-4375-91c1-b5696b590c54_47x62.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!f6HZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae60fc63-3b38-4375-91c1-b5696b590c54_47x62.png 424w, https://substackcdn.com/image/fetch/$s_!f6HZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae60fc63-3b38-4375-91c1-b5696b590c54_47x62.png 848w, https://substackcdn.com/image/fetch/$s_!f6HZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae60fc63-3b38-4375-91c1-b5696b590c54_47x62.png 1272w, https://substackcdn.com/image/fetch/$s_!f6HZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae60fc63-3b38-4375-91c1-b5696b590c54_47x62.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!f6HZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae60fc63-3b38-4375-91c1-b5696b590c54_47x62.png" width="47" height="62" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ae60fc63-3b38-4375-91c1-b5696b590c54_47x62.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:62,&quot;width&quot;:47,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1071,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae60fc63-3b38-4375-91c1-b5696b590c54_47x62.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!f6HZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae60fc63-3b38-4375-91c1-b5696b590c54_47x62.png 424w, https://substackcdn.com/image/fetch/$s_!f6HZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae60fc63-3b38-4375-91c1-b5696b590c54_47x62.png 848w, https://substackcdn.com/image/fetch/$s_!f6HZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae60fc63-3b38-4375-91c1-b5696b590c54_47x62.png 1272w, https://substackcdn.com/image/fetch/$s_!f6HZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae60fc63-3b38-4375-91c1-b5696b590c54_47x62.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>can be written as</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AWpL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F308c9edc-3855-43ae-94cb-a060a885efd1_1080x201.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AWpL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F308c9edc-3855-43ae-94cb-a060a885efd1_1080x201.png 424w, https://substackcdn.com/image/fetch/$s_!AWpL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F308c9edc-3855-43ae-94cb-a060a885efd1_1080x201.png 848w, https://substackcdn.com/image/fetch/$s_!AWpL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F308c9edc-3855-43ae-94cb-a060a885efd1_1080x201.png 1272w, https://substackcdn.com/image/fetch/$s_!AWpL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F308c9edc-3855-43ae-94cb-a060a885efd1_1080x201.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AWpL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F308c9edc-3855-43ae-94cb-a060a885efd1_1080x201.png" width="1080" height="201" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/308c9edc-3855-43ae-94cb-a060a885efd1_1080x201.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:201,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:29767,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F308c9edc-3855-43ae-94cb-a060a885efd1_1080x201.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!AWpL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F308c9edc-3855-43ae-94cb-a060a885efd1_1080x201.png 424w, https://substackcdn.com/image/fetch/$s_!AWpL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F308c9edc-3855-43ae-94cb-a060a885efd1_1080x201.png 848w, https://substackcdn.com/image/fetch/$s_!AWpL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F308c9edc-3855-43ae-94cb-a060a885efd1_1080x201.png 1272w, https://substackcdn.com/image/fetch/$s_!AWpL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F308c9edc-3855-43ae-94cb-a060a885efd1_1080x201.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>where</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!kdNX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94065f2f-ee54-4c58-b199-acd4270039bc_53x73.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kdNX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94065f2f-ee54-4c58-b199-acd4270039bc_53x73.png 424w, https://substackcdn.com/image/fetch/$s_!kdNX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94065f2f-ee54-4c58-b199-acd4270039bc_53x73.png 848w, https://substackcdn.com/image/fetch/$s_!kdNX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94065f2f-ee54-4c58-b199-acd4270039bc_53x73.png 1272w, https://substackcdn.com/image/fetch/$s_!kdNX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94065f2f-ee54-4c58-b199-acd4270039bc_53x73.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kdNX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94065f2f-ee54-4c58-b199-acd4270039bc_53x73.png" width="53" height="73" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/94065f2f-ee54-4c58-b199-acd4270039bc_53x73.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:73,&quot;width&quot;:53,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1019,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94065f2f-ee54-4c58-b199-acd4270039bc_53x73.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!kdNX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94065f2f-ee54-4c58-b199-acd4270039bc_53x73.png 424w, https://substackcdn.com/image/fetch/$s_!kdNX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94065f2f-ee54-4c58-b199-acd4270039bc_53x73.png 848w, https://substackcdn.com/image/fetch/$s_!kdNX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94065f2f-ee54-4c58-b199-acd4270039bc_53x73.png 1272w, https://substackcdn.com/image/fetch/$s_!kdNX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94065f2f-ee54-4c58-b199-acd4270039bc_53x73.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>is understood to include a leading 1 if we fold</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!THf9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d6fe383-75f0-4256-b1c6-a80870acd079_55x70.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!THf9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d6fe383-75f0-4256-b1c6-a80870acd079_55x70.png 424w, https://substackcdn.com/image/fetch/$s_!THf9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d6fe383-75f0-4256-b1c6-a80870acd079_55x70.png 848w, https://substackcdn.com/image/fetch/$s_!THf9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d6fe383-75f0-4256-b1c6-a80870acd079_55x70.png 1272w, https://substackcdn.com/image/fetch/$s_!THf9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d6fe383-75f0-4256-b1c6-a80870acd079_55x70.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!THf9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d6fe383-75f0-4256-b1c6-a80870acd079_55x70.png" width="55" height="70" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0d6fe383-75f0-4256-b1c6-a80870acd079_55x70.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:70,&quot;width&quot;:55,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1364,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d6fe383-75f0-4256-b1c6-a80870acd079_55x70.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!THf9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d6fe383-75f0-4256-b1c6-a80870acd079_55x70.png 424w, https://substackcdn.com/image/fetch/$s_!THf9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d6fe383-75f0-4256-b1c6-a80870acd079_55x70.png 848w, https://substackcdn.com/image/fetch/$s_!THf9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d6fe383-75f0-4256-b1c6-a80870acd079_55x70.png 1272w, https://substackcdn.com/image/fetch/$s_!THf9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d6fe383-75f0-4256-b1c6-a80870acd079_55x70.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>into the parameter vector</p><p>&#946;</p><p>for notational simplicity.</p><p>Since the observations are assumed independent, the joint likelihood of all data points</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!UCMF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a10d5f-fdce-4f4d-9f11-dc35fd46575f_115x52.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!UCMF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a10d5f-fdce-4f4d-9f11-dc35fd46575f_115x52.png 424w, https://substackcdn.com/image/fetch/$s_!UCMF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a10d5f-fdce-4f4d-9f11-dc35fd46575f_115x52.png 848w, https://substackcdn.com/image/fetch/$s_!UCMF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a10d5f-fdce-4f4d-9f11-dc35fd46575f_115x52.png 1272w, https://substackcdn.com/image/fetch/$s_!UCMF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a10d5f-fdce-4f4d-9f11-dc35fd46575f_115x52.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!UCMF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a10d5f-fdce-4f4d-9f11-dc35fd46575f_115x52.png" width="115" height="52" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c9a10d5f-fdce-4f4d-9f11-dc35fd46575f_115x52.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:52,&quot;width&quot;:115,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2631,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a10d5f-fdce-4f4d-9f11-dc35fd46575f_115x52.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!UCMF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a10d5f-fdce-4f4d-9f11-dc35fd46575f_115x52.png 424w, https://substackcdn.com/image/fetch/$s_!UCMF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a10d5f-fdce-4f4d-9f11-dc35fd46575f_115x52.png 848w, https://substackcdn.com/image/fetch/$s_!UCMF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a10d5f-fdce-4f4d-9f11-dc35fd46575f_115x52.png 1272w, https://substackcdn.com/image/fetch/$s_!UCMF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a10d5f-fdce-4f4d-9f11-dc35fd46575f_115x52.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>given</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!r_Dy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb915a4b-1c5e-4dfd-91a4-9f323b91173c_130x61.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!r_Dy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb915a4b-1c5e-4dfd-91a4-9f323b91173c_130x61.png 424w, https://substackcdn.com/image/fetch/$s_!r_Dy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb915a4b-1c5e-4dfd-91a4-9f323b91173c_130x61.png 848w, https://substackcdn.com/image/fetch/$s_!r_Dy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb915a4b-1c5e-4dfd-91a4-9f323b91173c_130x61.png 1272w, https://substackcdn.com/image/fetch/$s_!r_Dy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb915a4b-1c5e-4dfd-91a4-9f323b91173c_130x61.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!r_Dy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb915a4b-1c5e-4dfd-91a4-9f323b91173c_130x61.png" width="130" height="61" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/eb915a4b-1c5e-4dfd-91a4-9f323b91173c_130x61.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:61,&quot;width&quot;:130,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2533,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb915a4b-1c5e-4dfd-91a4-9f323b91173c_130x61.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!r_Dy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb915a4b-1c5e-4dfd-91a4-9f323b91173c_130x61.png 424w, https://substackcdn.com/image/fetch/$s_!r_Dy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb915a4b-1c5e-4dfd-91a4-9f323b91173c_130x61.png 848w, https://substackcdn.com/image/fetch/$s_!r_Dy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb915a4b-1c5e-4dfd-91a4-9f323b91173c_130x61.png 1272w, https://substackcdn.com/image/fetch/$s_!r_Dy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb915a4b-1c5e-4dfd-91a4-9f323b91173c_130x61.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>can be written as the product of these individual densities:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!V09m!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb80b848-40d2-41b4-8231-2752e575a4c4_997x188.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!V09m!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb80b848-40d2-41b4-8231-2752e575a4c4_997x188.png 424w, https://substackcdn.com/image/fetch/$s_!V09m!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb80b848-40d2-41b4-8231-2752e575a4c4_997x188.png 848w, https://substackcdn.com/image/fetch/$s_!V09m!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb80b848-40d2-41b4-8231-2752e575a4c4_997x188.png 1272w, https://substackcdn.com/image/fetch/$s_!V09m!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb80b848-40d2-41b4-8231-2752e575a4c4_997x188.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!V09m!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb80b848-40d2-41b4-8231-2752e575a4c4_997x188.png" width="997" height="188" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/db80b848-40d2-41b4-8231-2752e575a4c4_997x188.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:188,&quot;width&quot;:997,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:28428,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb80b848-40d2-41b4-8231-2752e575a4c4_997x188.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!V09m!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb80b848-40d2-41b4-8231-2752e575a4c4_997x188.png 424w, https://substackcdn.com/image/fetch/$s_!V09m!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb80b848-40d2-41b4-8231-2752e575a4c4_997x188.png 848w, https://substackcdn.com/image/fetch/$s_!V09m!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb80b848-40d2-41b4-8231-2752e575a4c4_997x188.png 1272w, https://substackcdn.com/image/fetch/$s_!V09m!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb80b848-40d2-41b4-8231-2752e575a4c4_997x188.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>To make it simpler, we often consider the log of the likelihood, which is called the log-likelihood:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DcXs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F584f425c-a2d1-447a-8f90-25a1384976da_1145x205.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DcXs!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F584f425c-a2d1-447a-8f90-25a1384976da_1145x205.png 424w, https://substackcdn.com/image/fetch/$s_!DcXs!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F584f425c-a2d1-447a-8f90-25a1384976da_1145x205.png 848w, https://substackcdn.com/image/fetch/$s_!DcXs!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F584f425c-a2d1-447a-8f90-25a1384976da_1145x205.png 1272w, https://substackcdn.com/image/fetch/$s_!DcXs!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F584f425c-a2d1-447a-8f90-25a1384976da_1145x205.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DcXs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F584f425c-a2d1-447a-8f90-25a1384976da_1145x205.png" width="1145" height="205" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/584f425c-a2d1-447a-8f90-25a1384976da_1145x205.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:205,&quot;width&quot;:1145,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:31175,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F584f425c-a2d1-447a-8f90-25a1384976da_1145x205.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!DcXs!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F584f425c-a2d1-447a-8f90-25a1384976da_1145x205.png 424w, https://substackcdn.com/image/fetch/$s_!DcXs!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F584f425c-a2d1-447a-8f90-25a1384976da_1145x205.png 848w, https://substackcdn.com/image/fetch/$s_!DcXs!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F584f425c-a2d1-447a-8f90-25a1384976da_1145x205.png 1272w, https://substackcdn.com/image/fetch/$s_!DcXs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F584f425c-a2d1-447a-8f90-25a1384976da_1145x205.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>We can split this into two separate parts:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8V68!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F217b538f-0890-4400-a3d5-07f6707185f3_1129x195.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8V68!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F217b538f-0890-4400-a3d5-07f6707185f3_1129x195.png 424w, https://substackcdn.com/image/fetch/$s_!8V68!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F217b538f-0890-4400-a3d5-07f6707185f3_1129x195.png 848w, https://substackcdn.com/image/fetch/$s_!8V68!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F217b538f-0890-4400-a3d5-07f6707185f3_1129x195.png 1272w, https://substackcdn.com/image/fetch/$s_!8V68!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F217b538f-0890-4400-a3d5-07f6707185f3_1129x195.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8V68!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F217b538f-0890-4400-a3d5-07f6707185f3_1129x195.png" width="1129" height="195" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/217b538f-0890-4400-a3d5-07f6707185f3_1129x195.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:195,&quot;width&quot;:1129,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:26357,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F217b538f-0890-4400-a3d5-07f6707185f3_1129x195.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8V68!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F217b538f-0890-4400-a3d5-07f6707185f3_1129x195.png 424w, https://substackcdn.com/image/fetch/$s_!8V68!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F217b538f-0890-4400-a3d5-07f6707185f3_1129x195.png 848w, https://substackcdn.com/image/fetch/$s_!8V68!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F217b538f-0890-4400-a3d5-07f6707185f3_1129x195.png 1272w, https://substackcdn.com/image/fetch/$s_!8V68!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F217b538f-0890-4400-a3d5-07f6707185f3_1129x195.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Maximizing the Log-Likelihood with Respect to</p><p>&#946;</p><p>To find the parameter vector</p><p>&#946;</p><p>that maximizes the log-likelihood, we note that the first term depends on</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SGSp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd99f2f2-8b8a-4256-b0ae-756ef834d284_65x61.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SGSp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd99f2f2-8b8a-4256-b0ae-756ef834d284_65x61.png 424w, https://substackcdn.com/image/fetch/$s_!SGSp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd99f2f2-8b8a-4256-b0ae-756ef834d284_65x61.png 848w, https://substackcdn.com/image/fetch/$s_!SGSp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd99f2f2-8b8a-4256-b0ae-756ef834d284_65x61.png 1272w, https://substackcdn.com/image/fetch/$s_!SGSp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd99f2f2-8b8a-4256-b0ae-756ef834d284_65x61.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SGSp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd99f2f2-8b8a-4256-b0ae-756ef834d284_65x61.png" width="65" height="61" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dd99f2f2-8b8a-4256-b0ae-756ef834d284_65x61.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:61,&quot;width&quot;:65,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1069,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd99f2f2-8b8a-4256-b0ae-756ef834d284_65x61.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!SGSp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd99f2f2-8b8a-4256-b0ae-756ef834d284_65x61.png 424w, https://substackcdn.com/image/fetch/$s_!SGSp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd99f2f2-8b8a-4256-b0ae-756ef834d284_65x61.png 848w, https://substackcdn.com/image/fetch/$s_!SGSp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd99f2f2-8b8a-4256-b0ae-756ef834d284_65x61.png 1272w, https://substackcdn.com/image/fetch/$s_!SGSp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd99f2f2-8b8a-4256-b0ae-756ef834d284_65x61.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>but not on</p><p>&#946;</p><p>, while the second term depends on both. However, for a fixed</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uNaH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1ec912c-a754-475a-a3d5-5984c8c80b38_50x49.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uNaH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1ec912c-a754-475a-a3d5-5984c8c80b38_50x49.png 424w, https://substackcdn.com/image/fetch/$s_!uNaH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1ec912c-a754-475a-a3d5-5984c8c80b38_50x49.png 848w, https://substackcdn.com/image/fetch/$s_!uNaH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1ec912c-a754-475a-a3d5-5984c8c80b38_50x49.png 1272w, https://substackcdn.com/image/fetch/$s_!uNaH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1ec912c-a754-475a-a3d5-5984c8c80b38_50x49.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uNaH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1ec912c-a754-475a-a3d5-5984c8c80b38_50x49.png" width="50" height="49" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e1ec912c-a754-475a-a3d5-5984c8c80b38_50x49.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:49,&quot;width&quot;:50,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1003,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1ec912c-a754-475a-a3d5-5984c8c80b38_50x49.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!uNaH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1ec912c-a754-475a-a3d5-5984c8c80b38_50x49.png 424w, https://substackcdn.com/image/fetch/$s_!uNaH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1ec912c-a754-475a-a3d5-5984c8c80b38_50x49.png 848w, https://substackcdn.com/image/fetch/$s_!uNaH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1ec912c-a754-475a-a3d5-5984c8c80b38_50x49.png 1272w, https://substackcdn.com/image/fetch/$s_!uNaH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1ec912c-a754-475a-a3d5-5984c8c80b38_50x49.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>, maximizing the log-likelihood with respect to</p><p>&#946;</p><p>is equivalent to minimizing</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SxQX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde932296-3d92-44c6-8d52-62634b90f22b_448x215.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SxQX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde932296-3d92-44c6-8d52-62634b90f22b_448x215.png 424w, https://substackcdn.com/image/fetch/$s_!SxQX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde932296-3d92-44c6-8d52-62634b90f22b_448x215.png 848w, https://substackcdn.com/image/fetch/$s_!SxQX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde932296-3d92-44c6-8d52-62634b90f22b_448x215.png 1272w, https://substackcdn.com/image/fetch/$s_!SxQX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde932296-3d92-44c6-8d52-62634b90f22b_448x215.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SxQX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde932296-3d92-44c6-8d52-62634b90f22b_448x215.png" width="448" height="215" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/de932296-3d92-44c6-8d52-62634b90f22b_448x215.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:215,&quot;width&quot;:448,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:12561,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde932296-3d92-44c6-8d52-62634b90f22b_448x215.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!SxQX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde932296-3d92-44c6-8d52-62634b90f22b_448x215.png 424w, https://substackcdn.com/image/fetch/$s_!SxQX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde932296-3d92-44c6-8d52-62634b90f22b_448x215.png 848w, https://substackcdn.com/image/fetch/$s_!SxQX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde932296-3d92-44c6-8d52-62634b90f22b_448x215.png 1272w, https://substackcdn.com/image/fetch/$s_!SxQX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde932296-3d92-44c6-8d52-62634b90f22b_448x215.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>That sum is precisely the sum of squared residuals. Therefore, under the Gaussian noise assumption, the maximum likelihood estimate of</p><p>&#946;</p><p>is the same as the parameter choice that minimizes the sum of squared residuals. This equivalence is why Ordinary Least Squares (OLS) emerges naturally from the normality assumption on the errors.</p><p>Mathematically, the partial derivative of the log-likelihood with respect to</p><p>&#946;</p><p>(for fixed</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Fq3j!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38037374-d282-4b50-87f6-27cbc59858cc_84x49.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Fq3j!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38037374-d282-4b50-87f6-27cbc59858cc_84x49.png 424w, https://substackcdn.com/image/fetch/$s_!Fq3j!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38037374-d282-4b50-87f6-27cbc59858cc_84x49.png 848w, https://substackcdn.com/image/fetch/$s_!Fq3j!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38037374-d282-4b50-87f6-27cbc59858cc_84x49.png 1272w, https://substackcdn.com/image/fetch/$s_!Fq3j!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38037374-d282-4b50-87f6-27cbc59858cc_84x49.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Fq3j!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38037374-d282-4b50-87f6-27cbc59858cc_84x49.png" width="84" height="49" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/38037374-d282-4b50-87f6-27cbc59858cc_84x49.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:49,&quot;width&quot;:84,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1072,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38037374-d282-4b50-87f6-27cbc59858cc_84x49.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Fq3j!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38037374-d282-4b50-87f6-27cbc59858cc_84x49.png 424w, https://substackcdn.com/image/fetch/$s_!Fq3j!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38037374-d282-4b50-87f6-27cbc59858cc_84x49.png 848w, https://substackcdn.com/image/fetch/$s_!Fq3j!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38037374-d282-4b50-87f6-27cbc59858cc_84x49.png 1272w, https://substackcdn.com/image/fetch/$s_!Fq3j!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38037374-d282-4b50-87f6-27cbc59858cc_84x49.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>) leads to the normal equations, which in matrix form can be written as</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!S0FF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cede65c-81a1-4b13-a024-0b7a67645a48_481x123.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!S0FF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cede65c-81a1-4b13-a024-0b7a67645a48_481x123.png 424w, https://substackcdn.com/image/fetch/$s_!S0FF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cede65c-81a1-4b13-a024-0b7a67645a48_481x123.png 848w, https://substackcdn.com/image/fetch/$s_!S0FF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cede65c-81a1-4b13-a024-0b7a67645a48_481x123.png 1272w, https://substackcdn.com/image/fetch/$s_!S0FF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cede65c-81a1-4b13-a024-0b7a67645a48_481x123.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!S0FF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cede65c-81a1-4b13-a024-0b7a67645a48_481x123.png" width="481" height="123" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5cede65c-81a1-4b13-a024-0b7a67645a48_481x123.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:123,&quot;width&quot;:481,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:8181,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cede65c-81a1-4b13-a024-0b7a67645a48_481x123.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!S0FF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cede65c-81a1-4b13-a024-0b7a67645a48_481x123.png 424w, https://substackcdn.com/image/fetch/$s_!S0FF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cede65c-81a1-4b13-a024-0b7a67645a48_481x123.png 848w, https://substackcdn.com/image/fetch/$s_!S0FF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cede65c-81a1-4b13-a024-0b7a67645a48_481x123.png 1272w, https://substackcdn.com/image/fetch/$s_!S0FF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cede65c-81a1-4b13-a024-0b7a67645a48_481x123.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Solving these yields the ordinary least squares solution</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-S2c!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefeee7b5-4e08-4a13-a1df-0b477a8aeaa8_511x137.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-S2c!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefeee7b5-4e08-4a13-a1df-0b477a8aeaa8_511x137.png 424w, https://substackcdn.com/image/fetch/$s_!-S2c!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefeee7b5-4e08-4a13-a1df-0b477a8aeaa8_511x137.png 848w, https://substackcdn.com/image/fetch/$s_!-S2c!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefeee7b5-4e08-4a13-a1df-0b477a8aeaa8_511x137.png 1272w, https://substackcdn.com/image/fetch/$s_!-S2c!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefeee7b5-4e08-4a13-a1df-0b477a8aeaa8_511x137.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-S2c!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefeee7b5-4e08-4a13-a1df-0b477a8aeaa8_511x137.png" width="511" height="137" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/efeee7b5-4e08-4a13-a1df-0b477a8aeaa8_511x137.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:137,&quot;width&quot;:511,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:8105,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefeee7b5-4e08-4a13-a1df-0b477a8aeaa8_511x137.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!-S2c!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefeee7b5-4e08-4a13-a1df-0b477a8aeaa8_511x137.png 424w, https://substackcdn.com/image/fetch/$s_!-S2c!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefeee7b5-4e08-4a13-a1df-0b477a8aeaa8_511x137.png 848w, https://substackcdn.com/image/fetch/$s_!-S2c!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefeee7b5-4e08-4a13-a1df-0b477a8aeaa8_511x137.png 1272w, https://substackcdn.com/image/fetch/$s_!-S2c!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefeee7b5-4e08-4a13-a1df-0b477a8aeaa8_511x137.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>which is also the solution to minimizing the sum of squared errors in linear regression. Thus, maximizing the likelihood under Gaussian errors is exactly the same as minimizing the sum of squared deviations from the regression hyperplane.</p><p>Implementation Example in Python</p><p>Below is a simple code snippet using NumPy that illustrates how one might solve for the least squares estimate. In practice, frameworks like scikit-learn, PyTorch, or TensorFlow typically provide efficient built-in routines for this purpose, but this code shows the basic idea.</p><pre><code><code>import numpy as np

# Suppose X is an n x d matrix (including a column of ones for intercept)
# Suppose y is an n x 1 vector of targets

# Generate a random dataset for illustration
np.random.seed(42)
n, d = 100, 2  # 100 samples, 2 features (the first feature will be all ones for the intercept)
X = np.ones((n, d))
X[:, 1] = np.random.randn(n)
true_beta = np.array([1.5, -2.0])  # intercept = 1.5, slope = -2.0
noise = 0.5 * np.random.randn(n)
y = X.dot(true_beta) + noise

# Solve for beta using the OLS closed-form solution
beta_est = np.linalg.inv(X.T.dot(X)).dot(X.T).dot(y)

print("True beta:", true_beta)
print("Estimated beta:", beta_est)
</code></code></pre><p>This code sets up a design matrix <code>X</code> with one feature plus an intercept term, simulates target values with an added normal noise, and solves for the linear regression parameters using the closed-form Ordinary Least Squares solution. The method finds the parameter values that minimize the sum of squared residuals, which is the same parameter choice that maximizes the likelihood when the errors are assumed to be normally distributed.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.rohan-paul.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">I write everyday for my readers on actionable AI. Subscribe and instantly get a 1300+ page Python book.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2><strong>What if the Error Distribution is Not Gaussian?</strong></h2><p>If the noise distribution is not Gaussian, maximizing the likelihood no longer corresponds exactly to minimizing the sum of squared errors. For instance, if you assume a Laplace distribution for the error terms, maximizing the likelihood becomes equivalent to minimizing the sum of absolute errors. This is the connection between model assumptions and the corresponding cost function you are minimizing.</p><h2><strong>Could We Derive the Same Result by Minimizing the Negative Log-Likelihood?</strong></h2><p>Yes, minimizing the negative log-likelihood of a Gaussian model is the same as maximizing the log-likelihood. The negative log-likelihood for a Gaussian model is proportional to the sum of squared residuals plus terms that do not depend on</p><p><em>&#946;</em></p><p>, so minimizing that expression in</p><p>&#946;</p><p>also yields the classical Ordinary Least Squares solution.</p><h2><strong>Why Do We Often Use the Log-Likelihood Instead of the Likelihood?</strong></h2><p>The likelihood can be a product of many small numbers (probability densities) multiplied together, which can become numerically unstable or extremely small. Taking the log transforms the products into sums and typically leads to more numerically stable computations. It also turns exponential functions into linear forms that are easier to differentiate and optimize.</p><h2><strong>How Does This Relate to Gradient-Based Methods in Deep Learning?</strong></h2><p>Although the classical linear regression solution can be found in closed form, modern deep learning often uses gradient-based optimization (like stochastic gradient descent) to handle much more complex models without closed-form solutions. Even for linear regression, you can still arrive at the same result (minimizing the sum of squared residuals) by applying gradient descent to the mean squared error (MSE) cost function, which again parallels maximizing the Gaussian log-likelihood.</p><h2><strong>Potential Pitfalls and Edge Cases</strong></h2><p>In practical scenarios, the assumption of normal errors might be only approximately valid. If errors have outliers or heavy tails, the sum of squared residuals can yield parameter estimates heavily influenced by extreme data points. Additionally, if features in the design matrix are highly correlated, the matrix</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hgqo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93673205-4ef8-470e-aaed-b6468ef52f35_118x61.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hgqo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93673205-4ef8-470e-aaed-b6468ef52f35_118x61.png 424w, https://substackcdn.com/image/fetch/$s_!hgqo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93673205-4ef8-470e-aaed-b6468ef52f35_118x61.png 848w, https://substackcdn.com/image/fetch/$s_!hgqo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93673205-4ef8-470e-aaed-b6468ef52f35_118x61.png 1272w, https://substackcdn.com/image/fetch/$s_!hgqo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93673205-4ef8-470e-aaed-b6468ef52f35_118x61.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hgqo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93673205-4ef8-470e-aaed-b6468ef52f35_118x61.png" width="118" height="61" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/93673205-4ef8-470e-aaed-b6468ef52f35_118x61.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:61,&quot;width&quot;:118,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1122,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93673205-4ef8-470e-aaed-b6468ef52f35_118x61.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!hgqo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93673205-4ef8-470e-aaed-b6468ef52f35_118x61.png 424w, https://substackcdn.com/image/fetch/$s_!hgqo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93673205-4ef8-470e-aaed-b6468ef52f35_118x61.png 848w, https://substackcdn.com/image/fetch/$s_!hgqo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93673205-4ef8-470e-aaed-b6468ef52f35_118x61.png 1272w, https://substackcdn.com/image/fetch/$s_!hgqo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93673205-4ef8-470e-aaed-b6468ef52f35_118x61.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>may be close to singular, causing instability in the closed-form solution. Regularization techniques like ridge regression or lasso can help in such cases, effectively modifying the likelihood or the cost function to include constraints or penalties on the parameter magnitudes.</p><h2><strong>Follow-up Question 1</strong></h2><h3><strong>Why does the maximum likelihood approach under a Gaussian assumption lead to the same solution as Ordinary Least Squares, but under a Laplacian assumption it leads to Least Absolute Deviations?</strong></h3><p>When errors follow a Gaussian distribution, the probability density is proportional to the exponential of the squared error. This makes the log-likelihood function proportional to the sum of squared errors, so minimizing that sum (or maximizing the likelihood) yields the same parameter estimates. On the other hand, for Laplace-distributed errors, the density is proportional to the exponential of the absolute error. Taking the log then leads to minimizing the sum of absolute deviations. This shows how the choice of error distribution in a probabilistic model directly affects the form of the objective function we minimize.</p><h2><strong>Follow-up Question 2</strong></h2><h3><strong>How do we interpret the variance</strong></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nuM5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3081806-0cda-43f9-b010-deb154fca092_92x89.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nuM5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3081806-0cda-43f9-b010-deb154fca092_92x89.png 424w, https://substackcdn.com/image/fetch/$s_!nuM5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3081806-0cda-43f9-b010-deb154fca092_92x89.png 848w, https://substackcdn.com/image/fetch/$s_!nuM5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3081806-0cda-43f9-b010-deb154fca092_92x89.png 1272w, https://substackcdn.com/image/fetch/$s_!nuM5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3081806-0cda-43f9-b010-deb154fca092_92x89.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nuM5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3081806-0cda-43f9-b010-deb154fca092_92x89.png" width="92" height="89" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c3081806-0cda-43f9-b010-deb154fca092_92x89.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:89,&quot;width&quot;:92,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1454,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3081806-0cda-43f9-b010-deb154fca092_92x89.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!nuM5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3081806-0cda-43f9-b010-deb154fca092_92x89.png 424w, https://substackcdn.com/image/fetch/$s_!nuM5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3081806-0cda-43f9-b010-deb154fca092_92x89.png 848w, https://substackcdn.com/image/fetch/$s_!nuM5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3081806-0cda-43f9-b010-deb154fca092_92x89.png 1272w, https://substackcdn.com/image/fetch/$s_!nuM5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3081806-0cda-43f9-b010-deb154fca092_92x89.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3><strong>in the context of maximizing the likelihood?</strong></h3><p>In this Gaussian regression setting,</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bd9F!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7723e795-1551-44ba-b1c0-b72e383a06af_71x51.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bd9F!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7723e795-1551-44ba-b1c0-b72e383a06af_71x51.png 424w, https://substackcdn.com/image/fetch/$s_!bd9F!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7723e795-1551-44ba-b1c0-b72e383a06af_71x51.png 848w, https://substackcdn.com/image/fetch/$s_!bd9F!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7723e795-1551-44ba-b1c0-b72e383a06af_71x51.png 1272w, https://substackcdn.com/image/fetch/$s_!bd9F!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7723e795-1551-44ba-b1c0-b72e383a06af_71x51.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bd9F!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7723e795-1551-44ba-b1c0-b72e383a06af_71x51.png" width="71" height="51" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7723e795-1551-44ba-b1c0-b72e383a06af_71x51.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:51,&quot;width&quot;:71,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1052,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7723e795-1551-44ba-b1c0-b72e383a06af_71x51.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!bd9F!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7723e795-1551-44ba-b1c0-b72e383a06af_71x51.png 424w, https://substackcdn.com/image/fetch/$s_!bd9F!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7723e795-1551-44ba-b1c0-b72e383a06af_71x51.png 848w, https://substackcdn.com/image/fetch/$s_!bd9F!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7723e795-1551-44ba-b1c0-b72e383a06af_71x51.png 1272w, https://substackcdn.com/image/fetch/$s_!bd9F!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7723e795-1551-44ba-b1c0-b72e383a06af_71x51.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>represents the variance of the noise or the error term. When you maximize the likelihood with respect to</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!LIX2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1528ea8-a63b-44f2-973e-8a141cead93d_69x57.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!LIX2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1528ea8-a63b-44f2-973e-8a141cead93d_69x57.png 424w, https://substackcdn.com/image/fetch/$s_!LIX2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1528ea8-a63b-44f2-973e-8a141cead93d_69x57.png 848w, https://substackcdn.com/image/fetch/$s_!LIX2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1528ea8-a63b-44f2-973e-8a141cead93d_69x57.png 1272w, https://substackcdn.com/image/fetch/$s_!LIX2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1528ea8-a63b-44f2-973e-8a141cead93d_69x57.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!LIX2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1528ea8-a63b-44f2-973e-8a141cead93d_69x57.png" width="69" height="57" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b1528ea8-a63b-44f2-973e-8a141cead93d_69x57.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:57,&quot;width&quot;:69,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1082,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1528ea8-a63b-44f2-973e-8a141cead93d_69x57.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!LIX2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1528ea8-a63b-44f2-973e-8a141cead93d_69x57.png 424w, https://substackcdn.com/image/fetch/$s_!LIX2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1528ea8-a63b-44f2-973e-8a141cead93d_69x57.png 848w, https://substackcdn.com/image/fetch/$s_!LIX2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1528ea8-a63b-44f2-973e-8a141cead93d_69x57.png 1272w, https://substackcdn.com/image/fetch/$s_!LIX2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1528ea8-a63b-44f2-973e-8a141cead93d_69x57.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>(once</p><p>&#946;</p><p>is found), you can solve for the variance that best explains the residuals in the data. Specifically, one can show that the maximum likelihood estimate of</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1ET3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e08236-b04a-4d8b-b4f1-f2a612fc0e1a_56x59.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1ET3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e08236-b04a-4d8b-b4f1-f2a612fc0e1a_56x59.png 424w, https://substackcdn.com/image/fetch/$s_!1ET3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e08236-b04a-4d8b-b4f1-f2a612fc0e1a_56x59.png 848w, https://substackcdn.com/image/fetch/$s_!1ET3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e08236-b04a-4d8b-b4f1-f2a612fc0e1a_56x59.png 1272w, https://substackcdn.com/image/fetch/$s_!1ET3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e08236-b04a-4d8b-b4f1-f2a612fc0e1a_56x59.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1ET3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e08236-b04a-4d8b-b4f1-f2a612fc0e1a_56x59.png" width="56" height="59" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/30e08236-b04a-4d8b-b4f1-f2a612fc0e1a_56x59.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:59,&quot;width&quot;:56,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1040,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e08236-b04a-4d8b-b4f1-f2a612fc0e1a_56x59.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!1ET3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e08236-b04a-4d8b-b4f1-f2a612fc0e1a_56x59.png 424w, https://substackcdn.com/image/fetch/$s_!1ET3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e08236-b04a-4d8b-b4f1-f2a612fc0e1a_56x59.png 848w, https://substackcdn.com/image/fetch/$s_!1ET3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e08236-b04a-4d8b-b4f1-f2a612fc0e1a_56x59.png 1272w, https://substackcdn.com/image/fetch/$s_!1ET3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e08236-b04a-4d8b-b4f1-f2a612fc0e1a_56x59.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>is the average of the squared residuals. This links neatly to the idea that the residuals have variance</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hA7_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff71fdd80-5aca-43e2-a289-360318864e1d_86x61.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hA7_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff71fdd80-5aca-43e2-a289-360318864e1d_86x61.png 424w, https://substackcdn.com/image/fetch/$s_!hA7_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff71fdd80-5aca-43e2-a289-360318864e1d_86x61.png 848w, https://substackcdn.com/image/fetch/$s_!hA7_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff71fdd80-5aca-43e2-a289-360318864e1d_86x61.png 1272w, https://substackcdn.com/image/fetch/$s_!hA7_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff71fdd80-5aca-43e2-a289-360318864e1d_86x61.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hA7_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff71fdd80-5aca-43e2-a289-360318864e1d_86x61.png" width="86" height="61" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f71fdd80-5aca-43e2-a289-360318864e1d_86x61.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:61,&quot;width&quot;:86,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1106,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff71fdd80-5aca-43e2-a289-360318864e1d_86x61.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!hA7_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff71fdd80-5aca-43e2-a289-360318864e1d_86x61.png 424w, https://substackcdn.com/image/fetch/$s_!hA7_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff71fdd80-5aca-43e2-a289-360318864e1d_86x61.png 848w, https://substackcdn.com/image/fetch/$s_!hA7_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff71fdd80-5aca-43e2-a289-360318864e1d_86x61.png 1272w, https://substackcdn.com/image/fetch/$s_!hA7_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff71fdd80-5aca-43e2-a289-360318864e1d_86x61.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>if the model is correctly specified.</p><h2><strong>Follow-up Question 3</strong></h2><h3><strong>If the design matrix is not full rank, how does that affect the maximum likelihood estimate?</strong></h3><p>If the matrix</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!V6WF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30bc0acc-dc11-45b0-8744-ef74f07d0b00_160x56.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!V6WF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30bc0acc-dc11-45b0-8744-ef74f07d0b00_160x56.png 424w, https://substackcdn.com/image/fetch/$s_!V6WF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30bc0acc-dc11-45b0-8744-ef74f07d0b00_160x56.png 848w, https://substackcdn.com/image/fetch/$s_!V6WF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30bc0acc-dc11-45b0-8744-ef74f07d0b00_160x56.png 1272w, https://substackcdn.com/image/fetch/$s_!V6WF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30bc0acc-dc11-45b0-8744-ef74f07d0b00_160x56.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!V6WF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30bc0acc-dc11-45b0-8744-ef74f07d0b00_160x56.png" width="160" height="56" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/30bc0acc-dc11-45b0-8744-ef74f07d0b00_160x56.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:56,&quot;width&quot;:160,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1145,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30bc0acc-dc11-45b0-8744-ef74f07d0b00_160x56.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!V6WF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30bc0acc-dc11-45b0-8744-ef74f07d0b00_160x56.png 424w, https://substackcdn.com/image/fetch/$s_!V6WF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30bc0acc-dc11-45b0-8744-ef74f07d0b00_160x56.png 848w, https://substackcdn.com/image/fetch/$s_!V6WF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30bc0acc-dc11-45b0-8744-ef74f07d0b00_160x56.png 1272w, https://substackcdn.com/image/fetch/$s_!V6WF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30bc0acc-dc11-45b0-8744-ef74f07d0b00_160x56.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>is not invertible (or very close to being singular), this indicates a collinearity or linear dependence among some features. The closed-form solution for</p><p>&#946;</p><p>becomes either not uniquely determined or numerically unstable. In this situation, infinite sets of solutions can all minimize the sum of squared errors equally well, making the maximum likelihood estimate non-unique. Practitioners address this by using regularization (like ridge regression), which modifies the objective by adding a penalty term and ensures that the matrix to be inverted remains well-conditioned.</p><h2><strong>Follow-up Question 4</strong></h2><h3><strong>Can you show a simple gradient-based derivation that arrives at the same result?</strong></h3><p>Yes, one can start with the mean squared error cost function, which is proportional to the sum of squared residuals, and take its gradient with respect to</p><p><em>&#946;</em></p><p>. If we arrange our data in matrix form so that</p><p>y</p><p>is an</p><p>n</p><p>-dimensional vector of targets and</p><p>X</p><p>is the</p><p>n&#215;d</p><p>design matrix (including a column of 1s for the intercept), the cost function can be written as</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qz-e!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c771890-3e50-4097-8567-cd4bcf68669c_811x165.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qz-e!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c771890-3e50-4097-8567-cd4bcf68669c_811x165.png 424w, https://substackcdn.com/image/fetch/$s_!qz-e!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c771890-3e50-4097-8567-cd4bcf68669c_811x165.png 848w, https://substackcdn.com/image/fetch/$s_!qz-e!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c771890-3e50-4097-8567-cd4bcf68669c_811x165.png 1272w, https://substackcdn.com/image/fetch/$s_!qz-e!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c771890-3e50-4097-8567-cd4bcf68669c_811x165.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qz-e!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c771890-3e50-4097-8567-cd4bcf68669c_811x165.png" width="811" height="165" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1c771890-3e50-4097-8567-cd4bcf68669c_811x165.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:165,&quot;width&quot;:811,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:16957,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c771890-3e50-4097-8567-cd4bcf68669c_811x165.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!qz-e!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c771890-3e50-4097-8567-cd4bcf68669c_811x165.png 424w, https://substackcdn.com/image/fetch/$s_!qz-e!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c771890-3e50-4097-8567-cd4bcf68669c_811x165.png 848w, https://substackcdn.com/image/fetch/$s_!qz-e!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c771890-3e50-4097-8567-cd4bcf68669c_811x165.png 1272w, https://substackcdn.com/image/fetch/$s_!qz-e!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c771890-3e50-4097-8567-cd4bcf68669c_811x165.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Taking the gradient and setting it to zero yields</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!BJVQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dad71c9-6728-436b-995b-1c421a77f3d2_802x116.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BJVQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dad71c9-6728-436b-995b-1c421a77f3d2_802x116.png 424w, https://substackcdn.com/image/fetch/$s_!BJVQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dad71c9-6728-436b-995b-1c421a77f3d2_802x116.png 848w, https://substackcdn.com/image/fetch/$s_!BJVQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dad71c9-6728-436b-995b-1c421a77f3d2_802x116.png 1272w, https://substackcdn.com/image/fetch/$s_!BJVQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dad71c9-6728-436b-995b-1c421a77f3d2_802x116.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BJVQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dad71c9-6728-436b-995b-1c421a77f3d2_802x116.png" width="802" height="116" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1dad71c9-6728-436b-995b-1c421a77f3d2_802x116.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:116,&quot;width&quot;:802,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:11917,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dad71c9-6728-436b-995b-1c421a77f3d2_802x116.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!BJVQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dad71c9-6728-436b-995b-1c421a77f3d2_802x116.png 424w, https://substackcdn.com/image/fetch/$s_!BJVQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dad71c9-6728-436b-995b-1c421a77f3d2_802x116.png 848w, https://substackcdn.com/image/fetch/$s_!BJVQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dad71c9-6728-436b-995b-1c421a77f3d2_802x116.png 1272w, https://substackcdn.com/image/fetch/$s_!BJVQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dad71c9-6728-436b-995b-1c421a77f3d2_802x116.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>which leads to</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Nqqv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c40e680-5c96-4187-a9ca-442dac8b2362_427x114.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Nqqv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c40e680-5c96-4187-a9ca-442dac8b2362_427x114.png 424w, https://substackcdn.com/image/fetch/$s_!Nqqv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c40e680-5c96-4187-a9ca-442dac8b2362_427x114.png 848w, https://substackcdn.com/image/fetch/$s_!Nqqv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c40e680-5c96-4187-a9ca-442dac8b2362_427x114.png 1272w, https://substackcdn.com/image/fetch/$s_!Nqqv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c40e680-5c96-4187-a9ca-442dac8b2362_427x114.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Nqqv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c40e680-5c96-4187-a9ca-442dac8b2362_427x114.png" width="427" height="114" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1c40e680-5c96-4187-a9ca-442dac8b2362_427x114.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:114,&quot;width&quot;:427,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:8085,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c40e680-5c96-4187-a9ca-442dac8b2362_427x114.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Nqqv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c40e680-5c96-4187-a9ca-442dac8b2362_427x114.png 424w, https://substackcdn.com/image/fetch/$s_!Nqqv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c40e680-5c96-4187-a9ca-442dac8b2362_427x114.png 848w, https://substackcdn.com/image/fetch/$s_!Nqqv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c40e680-5c96-4187-a9ca-442dac8b2362_427x114.png 1272w, https://substackcdn.com/image/fetch/$s_!Nqqv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c40e680-5c96-4187-a9ca-442dac8b2362_427x114.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>whose solution is</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wNDT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5459761-e15a-40f4-92be-2826e7e8c43d_569x118.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wNDT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5459761-e15a-40f4-92be-2826e7e8c43d_569x118.png 424w, https://substackcdn.com/image/fetch/$s_!wNDT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5459761-e15a-40f4-92be-2826e7e8c43d_569x118.png 848w, https://substackcdn.com/image/fetch/$s_!wNDT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5459761-e15a-40f4-92be-2826e7e8c43d_569x118.png 1272w, https://substackcdn.com/image/fetch/$s_!wNDT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5459761-e15a-40f4-92be-2826e7e8c43d_569x118.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wNDT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5459761-e15a-40f4-92be-2826e7e8c43d_569x118.png" width="569" height="118" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d5459761-e15a-40f4-92be-2826e7e8c43d_569x118.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:118,&quot;width&quot;:569,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:8008,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5459761-e15a-40f4-92be-2826e7e8c43d_569x118.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!wNDT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5459761-e15a-40f4-92be-2826e7e8c43d_569x118.png 424w, https://substackcdn.com/image/fetch/$s_!wNDT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5459761-e15a-40f4-92be-2826e7e8c43d_569x118.png 848w, https://substackcdn.com/image/fetch/$s_!wNDT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5459761-e15a-40f4-92be-2826e7e8c43d_569x118.png 1272w, https://substackcdn.com/image/fetch/$s_!wNDT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5459761-e15a-40f4-92be-2826e7e8c43d_569x118.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>This matches precisely the solution obtained by maximizing the Gaussian log-likelihood.</p><h2><strong>Follow-up Question 5</strong></h2><h3><strong>Why might we prefer iterative (like gradient descent) or approximate methods over the closed-form solution in modern machine learning?</strong></h3><p>In high-dimensional or large-scale problems, computing</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ROYQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7237a2f6-a930-4a4e-8348-4dae09243485_153x59.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ROYQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7237a2f6-a930-4a4e-8348-4dae09243485_153x59.png 424w, https://substackcdn.com/image/fetch/$s_!ROYQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7237a2f6-a930-4a4e-8348-4dae09243485_153x59.png 848w, https://substackcdn.com/image/fetch/$s_!ROYQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7237a2f6-a930-4a4e-8348-4dae09243485_153x59.png 1272w, https://substackcdn.com/image/fetch/$s_!ROYQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7237a2f6-a930-4a4e-8348-4dae09243485_153x59.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ROYQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7237a2f6-a930-4a4e-8348-4dae09243485_153x59.png" width="153" height="59" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7237a2f6-a930-4a4e-8348-4dae09243485_153x59.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:59,&quot;width&quot;:153,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2070,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7237a2f6-a930-4a4e-8348-4dae09243485_153x59.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ROYQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7237a2f6-a930-4a4e-8348-4dae09243485_153x59.png 424w, https://substackcdn.com/image/fetch/$s_!ROYQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7237a2f6-a930-4a4e-8348-4dae09243485_153x59.png 848w, https://substackcdn.com/image/fetch/$s_!ROYQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7237a2f6-a930-4a4e-8348-4dae09243485_153x59.png 1272w, https://substackcdn.com/image/fetch/$s_!ROYQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7237a2f6-a930-4a4e-8348-4dae09243485_153x59.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>directly becomes impractical or very memory-intensive. Iterative methods such as gradient descent or stochastic gradient descent can handle extremely large datasets and high-dimensional parameter spaces without needing to invert large matrices explicitly. Moreover, in deep learning, the model structures are far more complex and cannot be expressed in a neat closed-form solution. Hence, gradient-based methods are the go-to solution in most real-world scenarios, even though for standard linear regression the closed-form solution theoretically exists.</p><h2><strong>Follow-up Question 6</strong></h2><h3><strong>Are there any assumptions about independence of errors, and how crucial is that assumption?</strong></h3><p>Yes, classical linear regression generally assumes that each error term</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GRrL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad04c53d-e334-42d1-9d03-c243cb175d92_72x76.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GRrL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad04c53d-e334-42d1-9d03-c243cb175d92_72x76.png 424w, https://substackcdn.com/image/fetch/$s_!GRrL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad04c53d-e334-42d1-9d03-c243cb175d92_72x76.png 848w, https://substackcdn.com/image/fetch/$s_!GRrL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad04c53d-e334-42d1-9d03-c243cb175d92_72x76.png 1272w, https://substackcdn.com/image/fetch/$s_!GRrL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad04c53d-e334-42d1-9d03-c243cb175d92_72x76.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GRrL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad04c53d-e334-42d1-9d03-c243cb175d92_72x76.png" width="72" height="76" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ad04c53d-e334-42d1-9d03-c243cb175d92_72x76.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:76,&quot;width&quot;:72,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1034,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad04c53d-e334-42d1-9d03-c243cb175d92_72x76.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!GRrL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad04c53d-e334-42d1-9d03-c243cb175d92_72x76.png 424w, https://substackcdn.com/image/fetch/$s_!GRrL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad04c53d-e334-42d1-9d03-c243cb175d92_72x76.png 848w, https://substackcdn.com/image/fetch/$s_!GRrL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad04c53d-e334-42d1-9d03-c243cb175d92_72x76.png 1272w, https://substackcdn.com/image/fetch/$s_!GRrL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad04c53d-e334-42d1-9d03-c243cb175d92_72x76.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>is independent of the others and identically distributed. This independence underpins the factorization of the likelihood into the product of individual densities. If errors are correlated (as in time-series data with autocorrelated residuals), standard linear regression methods can be suboptimal or yield incorrect confidence intervals and significance tests. In such scenarios, one might switch to models specifically designed for correlated errors, such as Generalized Least Squares or methods that incorporate correlation structures in the noise model.</p><div><hr></div><h2><strong>Below are additional follow-up questions</strong></h2><h2><strong>How does the choice of loss function influence the sensitivity to outliers, and are there variants of Gaussian-based regression that are more robust?</strong></h2><p>When we assume Gaussian noise, the log-likelihood expression becomes proportional to the sum of squared residuals. Squaring the residuals magnifies large errors more than smaller ones, causing outliers (points that deviate substantially from the rest) to have a significant influence on the resulting parameter estimates. In real-world data, these outliers could arise due to measurement errors or unusual, rare phenomena, and their presence may unduly distort the regression model.</p><p>To mitigate this, researchers sometimes adopt robust regression techniques. One common approach is to replace the standard Gaussian assumption (leading to squared residuals) with distributions less sensitive to large deviations. For instance, a robust alternative is to place a heavier-tailed distributional assumption on the error term (e.g., a Student&#8217;s t-distribution). The t-distribution with a smaller degrees-of-freedom parameter has heavier tails than a Gaussian, reducing the impact of outliers on the parameter estimates. Another strategy is to use an iterative reweighting of residuals, such as in M-estimators, which reduce the contribution of points deemed outliers.</p><p>Potential pitfalls include choosing a too heavy-tailed distribution, leading to insufficient penalization of moderate errors. Also, iterative robust methods may converge more slowly or get stuck if the initial guesses or step sizes are poorly chosen. In practice, it is essential to balance outlier resilience with stable convergence and interpretability.</p><h2><strong>What happens if we do not include an intercept term in our model, and how does that affect the maximum likelihood estimation?</strong></h2><p>Including an intercept (often represented in the design matrix by a column of ones) allows the regression hyperplane to shift up or down relative to the axes. If no intercept is included, the hyperplane is forced to go through the origin. The implications for maximum likelihood are as follows:</p><ol><li><p>If the true relationship between features and targets does not pass through the origin, then omitting the intercept introduces a systematic bias in the model. The estimate of parameters will attempt to account for this by adjusting slopes in a way that might lead to higher residual variance.</p></li><li><p>The variance estimate</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!EFsv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d2eefb-7783-4b9f-bafc-7fcf2ef1463e_82x53.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!EFsv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d2eefb-7783-4b9f-bafc-7fcf2ef1463e_82x53.png 424w, https://substackcdn.com/image/fetch/$s_!EFsv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d2eefb-7783-4b9f-bafc-7fcf2ef1463e_82x53.png 848w, https://substackcdn.com/image/fetch/$s_!EFsv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d2eefb-7783-4b9f-bafc-7fcf2ef1463e_82x53.png 1272w, https://substackcdn.com/image/fetch/$s_!EFsv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d2eefb-7783-4b9f-bafc-7fcf2ef1463e_82x53.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!EFsv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d2eefb-7783-4b9f-bafc-7fcf2ef1463e_82x53.png" width="82" height="53" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a1d2eefb-7783-4b9f-bafc-7fcf2ef1463e_82x53.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:53,&quot;width&quot;:82,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1082,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d2eefb-7783-4b9f-bafc-7fcf2ef1463e_82x53.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!EFsv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d2eefb-7783-4b9f-bafc-7fcf2ef1463e_82x53.png 424w, https://substackcdn.com/image/fetch/$s_!EFsv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d2eefb-7783-4b9f-bafc-7fcf2ef1463e_82x53.png 848w, https://substackcdn.com/image/fetch/$s_!EFsv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d2eefb-7783-4b9f-bafc-7fcf2ef1463e_82x53.png 1272w, https://substackcdn.com/image/fetch/$s_!EFsv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d2eefb-7783-4b9f-bafc-7fcf2ef1463e_82x53.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>in a model without intercept may be artificially inflated, because residuals will systematically deviate from zero if the relationship does not naturally pass through the origin.</p></li><li><p>In terms of maximum likelihood, the log-likelihood function is still defined (under the Gaussian assumption) using the sum of squared residuals, but the residuals themselves can be systematically larger due to the forced through-origin constraint. This typically results in a suboptimal fit if a non-zero intercept is appropriate.</p></li></ol><p>A possible edge case is a dataset known to pass through the origin (e.g., physical laws that dictate zero input leads to zero output). In that special case, omitting the intercept can be correct and might reduce the risk of overfitting the constant term. However, in most real-world contexts, the intercept is crucial.</p><h2><strong>How can we formally verify that the maximum likelihood estimates for linear regression are unbiased estimators of the true parameters?</strong></h2><p>Under the classical assumptions&#8212;namely that the design matrix is full rank, errors are independent and identically distributed as</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vY6p!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9ecbb39-a9a4-4151-90b3-0c8fa3c15eb9_130x54.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vY6p!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9ecbb39-a9a4-4151-90b3-0c8fa3c15eb9_130x54.png 424w, https://substackcdn.com/image/fetch/$s_!vY6p!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9ecbb39-a9a4-4151-90b3-0c8fa3c15eb9_130x54.png 848w, https://substackcdn.com/image/fetch/$s_!vY6p!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9ecbb39-a9a4-4151-90b3-0c8fa3c15eb9_130x54.png 1272w, https://substackcdn.com/image/fetch/$s_!vY6p!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9ecbb39-a9a4-4151-90b3-0c8fa3c15eb9_130x54.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vY6p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9ecbb39-a9a4-4151-90b3-0c8fa3c15eb9_130x54.png" width="130" height="54" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b9ecbb39-a9a4-4151-90b3-0c8fa3c15eb9_130x54.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:54,&quot;width&quot;:130,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:3094,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9ecbb39-a9a4-4151-90b3-0c8fa3c15eb9_130x54.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vY6p!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9ecbb39-a9a4-4151-90b3-0c8fa3c15eb9_130x54.png 424w, https://substackcdn.com/image/fetch/$s_!vY6p!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9ecbb39-a9a4-4151-90b3-0c8fa3c15eb9_130x54.png 848w, https://substackcdn.com/image/fetch/$s_!vY6p!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9ecbb39-a9a4-4151-90b3-0c8fa3c15eb9_130x54.png 1272w, https://substackcdn.com/image/fetch/$s_!vY6p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9ecbb39-a9a4-4151-90b3-0c8fa3c15eb9_130x54.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>, and the model is correct (i.e., linear structure plus Gaussian noise)&#8212;we can show that the expected value of the Ordinary Least Squares (OLS) estimator equals the true parameter vector. The derivation hinges on:</p><ol><li><p>The OLS solution being</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RcP6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cb16cc6-b229-4995-aa87-651182b50c34_289x69.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RcP6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cb16cc6-b229-4995-aa87-651182b50c34_289x69.png 424w, https://substackcdn.com/image/fetch/$s_!RcP6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cb16cc6-b229-4995-aa87-651182b50c34_289x69.png 848w, https://substackcdn.com/image/fetch/$s_!RcP6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cb16cc6-b229-4995-aa87-651182b50c34_289x69.png 1272w, https://substackcdn.com/image/fetch/$s_!RcP6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cb16cc6-b229-4995-aa87-651182b50c34_289x69.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RcP6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cb16cc6-b229-4995-aa87-651182b50c34_289x69.png" width="289" height="69" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9cb16cc6-b229-4995-aa87-651182b50c34_289x69.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:69,&quot;width&quot;:289,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:4244,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cb16cc6-b229-4995-aa87-651182b50c34_289x69.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!RcP6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cb16cc6-b229-4995-aa87-651182b50c34_289x69.png 424w, https://substackcdn.com/image/fetch/$s_!RcP6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cb16cc6-b229-4995-aa87-651182b50c34_289x69.png 848w, https://substackcdn.com/image/fetch/$s_!RcP6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cb16cc6-b229-4995-aa87-651182b50c34_289x69.png 1272w, https://substackcdn.com/image/fetch/$s_!RcP6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cb16cc6-b229-4995-aa87-651182b50c34_289x69.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>2. Given</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8lOc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1af85048-0742-49ed-aa75-603e966a931c_230x79.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8lOc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1af85048-0742-49ed-aa75-603e966a931c_230x79.png 424w, https://substackcdn.com/image/fetch/$s_!8lOc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1af85048-0742-49ed-aa75-603e966a931c_230x79.png 848w, https://substackcdn.com/image/fetch/$s_!8lOc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1af85048-0742-49ed-aa75-603e966a931c_230x79.png 1272w, https://substackcdn.com/image/fetch/$s_!8lOc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1af85048-0742-49ed-aa75-603e966a931c_230x79.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8lOc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1af85048-0742-49ed-aa75-603e966a931c_230x79.png" width="230" height="79" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1af85048-0742-49ed-aa75-603e966a931c_230x79.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:79,&quot;width&quot;:230,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:3747,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1af85048-0742-49ed-aa75-603e966a931c_230x79.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8lOc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1af85048-0742-49ed-aa75-603e966a931c_230x79.png 424w, https://substackcdn.com/image/fetch/$s_!8lOc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1af85048-0742-49ed-aa75-603e966a931c_230x79.png 848w, https://substackcdn.com/image/fetch/$s_!8lOc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1af85048-0742-49ed-aa75-603e966a931c_230x79.png 1272w, https://substackcdn.com/image/fetch/$s_!8lOc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1af85048-0742-49ed-aa75-603e966a931c_230x79.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>we have</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ra6K!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbab44fde-b187-4125-bc82-d044af7aac6e_412x80.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ra6K!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbab44fde-b187-4125-bc82-d044af7aac6e_412x80.png 424w, https://substackcdn.com/image/fetch/$s_!Ra6K!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbab44fde-b187-4125-bc82-d044af7aac6e_412x80.png 848w, https://substackcdn.com/image/fetch/$s_!Ra6K!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbab44fde-b187-4125-bc82-d044af7aac6e_412x80.png 1272w, https://substackcdn.com/image/fetch/$s_!Ra6K!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbab44fde-b187-4125-bc82-d044af7aac6e_412x80.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ra6K!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbab44fde-b187-4125-bc82-d044af7aac6e_412x80.png" width="412" height="80" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bab44fde-b187-4125-bc82-d044af7aac6e_412x80.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:80,&quot;width&quot;:412,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:6083,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbab44fde-b187-4125-bc82-d044af7aac6e_412x80.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Ra6K!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbab44fde-b187-4125-bc82-d044af7aac6e_412x80.png 424w, https://substackcdn.com/image/fetch/$s_!Ra6K!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbab44fde-b187-4125-bc82-d044af7aac6e_412x80.png 848w, https://substackcdn.com/image/fetch/$s_!Ra6K!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbab44fde-b187-4125-bc82-d044af7aac6e_412x80.png 1272w, https://substackcdn.com/image/fetch/$s_!Ra6K!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbab44fde-b187-4125-bc82-d044af7aac6e_412x80.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div></li></ol><ol start="3"><li><p>The expectation of</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qRuJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82036d21-bd93-4126-91d1-5d876c5f59d3_57x59.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qRuJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82036d21-bd93-4126-91d1-5d876c5f59d3_57x59.png 424w, https://substackcdn.com/image/fetch/$s_!qRuJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82036d21-bd93-4126-91d1-5d876c5f59d3_57x59.png 848w, https://substackcdn.com/image/fetch/$s_!qRuJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82036d21-bd93-4126-91d1-5d876c5f59d3_57x59.png 1272w, https://substackcdn.com/image/fetch/$s_!qRuJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82036d21-bd93-4126-91d1-5d876c5f59d3_57x59.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qRuJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82036d21-bd93-4126-91d1-5d876c5f59d3_57x59.png" width="57" height="59" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/82036d21-bd93-4126-91d1-5d876c5f59d3_57x59.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:59,&quot;width&quot;:57,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1143,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82036d21-bd93-4126-91d1-5d876c5f59d3_57x59.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!qRuJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82036d21-bd93-4126-91d1-5d876c5f59d3_57x59.png 424w, https://substackcdn.com/image/fetch/$s_!qRuJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82036d21-bd93-4126-91d1-5d876c5f59d3_57x59.png 848w, https://substackcdn.com/image/fetch/$s_!qRuJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82036d21-bd93-4126-91d1-5d876c5f59d3_57x59.png 1272w, https://substackcdn.com/image/fetch/$s_!qRuJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82036d21-bd93-4126-91d1-5d876c5f59d3_57x59.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>is</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vMgf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F847ba223-1656-4214-b40d-d6e7bf30bb6f_486x67.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vMgf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F847ba223-1656-4214-b40d-d6e7bf30bb6f_486x67.png 424w, https://substackcdn.com/image/fetch/$s_!vMgf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F847ba223-1656-4214-b40d-d6e7bf30bb6f_486x67.png 848w, https://substackcdn.com/image/fetch/$s_!vMgf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F847ba223-1656-4214-b40d-d6e7bf30bb6f_486x67.png 1272w, https://substackcdn.com/image/fetch/$s_!vMgf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F847ba223-1656-4214-b40d-d6e7bf30bb6f_486x67.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vMgf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F847ba223-1656-4214-b40d-d6e7bf30bb6f_486x67.png" width="486" height="67" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/847ba223-1656-4214-b40d-d6e7bf30bb6f_486x67.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:67,&quot;width&quot;:486,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:7269,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F847ba223-1656-4214-b40d-d6e7bf30bb6f_486x67.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vMgf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F847ba223-1656-4214-b40d-d6e7bf30bb6f_486x67.png 424w, https://substackcdn.com/image/fetch/$s_!vMgf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F847ba223-1656-4214-b40d-d6e7bf30bb6f_486x67.png 848w, https://substackcdn.com/image/fetch/$s_!vMgf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F847ba223-1656-4214-b40d-d6e7bf30bb6f_486x67.png 1272w, https://substackcdn.com/image/fetch/$s_!vMgf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F847ba223-1656-4214-b40d-d6e7bf30bb6f_486x67.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><ol start="4"><li><p>Assuming</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!S1iO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7087a4d-4bdb-4517-b047-9fdb995684b3_126x69.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!S1iO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7087a4d-4bdb-4517-b047-9fdb995684b3_126x69.png 424w, https://substackcdn.com/image/fetch/$s_!S1iO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7087a4d-4bdb-4517-b047-9fdb995684b3_126x69.png 848w, https://substackcdn.com/image/fetch/$s_!S1iO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7087a4d-4bdb-4517-b047-9fdb995684b3_126x69.png 1272w, https://substackcdn.com/image/fetch/$s_!S1iO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7087a4d-4bdb-4517-b047-9fdb995684b3_126x69.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!S1iO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7087a4d-4bdb-4517-b047-9fdb995684b3_126x69.png" width="126" height="69" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e7087a4d-4bdb-4517-b047-9fdb995684b3_126x69.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:69,&quot;width&quot;:126,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2116,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7087a4d-4bdb-4517-b047-9fdb995684b3_126x69.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!S1iO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7087a4d-4bdb-4517-b047-9fdb995684b3_126x69.png 424w, https://substackcdn.com/image/fetch/$s_!S1iO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7087a4d-4bdb-4517-b047-9fdb995684b3_126x69.png 848w, https://substackcdn.com/image/fetch/$s_!S1iO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7087a4d-4bdb-4517-b047-9fdb995684b3_126x69.png 1272w, https://substackcdn.com/image/fetch/$s_!S1iO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7087a4d-4bdb-4517-b047-9fdb995684b3_126x69.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>and</p><p>X</p><p>is non-random (or treated as fixed in the classical sense),</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MZPv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8eb15571-fd74-4890-8b59-f1f7fe333cc5_192x57.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MZPv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8eb15571-fd74-4890-8b59-f1f7fe333cc5_192x57.png 424w, https://substackcdn.com/image/fetch/$s_!MZPv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8eb15571-fd74-4890-8b59-f1f7fe333cc5_192x57.png 848w, https://substackcdn.com/image/fetch/$s_!MZPv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8eb15571-fd74-4890-8b59-f1f7fe333cc5_192x57.png 1272w, https://substackcdn.com/image/fetch/$s_!MZPv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8eb15571-fd74-4890-8b59-f1f7fe333cc5_192x57.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MZPv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8eb15571-fd74-4890-8b59-f1f7fe333cc5_192x57.png" width="192" height="57" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8eb15571-fd74-4890-8b59-f1f7fe333cc5_192x57.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:57,&quot;width&quot;:192,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:3540,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8eb15571-fd74-4890-8b59-f1f7fe333cc5_192x57.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!MZPv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8eb15571-fd74-4890-8b59-f1f7fe333cc5_192x57.png 424w, https://substackcdn.com/image/fetch/$s_!MZPv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8eb15571-fd74-4890-8b59-f1f7fe333cc5_192x57.png 848w, https://substackcdn.com/image/fetch/$s_!MZPv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8eb15571-fd74-4890-8b59-f1f7fe333cc5_192x57.png 1272w, https://substackcdn.com/image/fetch/$s_!MZPv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8eb15571-fd74-4890-8b59-f1f7fe333cc5_192x57.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Hence, the estimator is unbiased. Subtle issues arise when the design matrix or the error distribution violates the standard assumptions (e.g., non-zero mean errors or random features correlated with errors). In practice, data might not perfectly follow these rules, which can make the OLS estimator biased or inconsistent. That is why domain checks and robust modeling assumptions are often required.</p><h2><strong>How do we address the scenario when data is missing or partially observed, and how does it affect the maximum likelihood approach?</strong></h2><p>In real-world contexts, it is not uncommon for some observations to be incomplete, with missing feature values or target values. Naively ignoring these incomplete rows can reduce sample size, weakening statistical power. Depending on the missingness mechanism (Missing Completely at Random, Missing at Random, or Missing Not at Random), different approaches exist:</p><ol><li><p><strong>Listwise Deletion</strong>: Drop all rows with missing data. This simplifies the likelihood but may introduce bias if the data is not missing completely at random.</p></li><li><p><strong>Imputation Methods</strong>: Attempt to estimate or &#8220;fill in&#8221; missing values. For example:</p><ul><li><p>Simple methods (mean imputation, median imputation) can bias variance estimates or reduce data variability.</p></li><li><p>More advanced approaches (multiple imputation, regression-based imputation) better incorporate uncertainty and relationship with other features.</p></li></ul></li><li><p><strong>Expectation-Maximization (EM)</strong>: An iterative maximum likelihood technique that treats missing data as latent variables. The algorithm alternates between estimating the missing values based on current parameter estimates (E-step) and updating the parameters to maximize the likelihood (M-step).</p></li></ol><p>The EM algorithm is particularly relevant to linear regression under a Gaussian assumption, as each step often has closed-form updates. However, it can be computationally heavier and can converge to local optima if not carefully initialized or if the data deviate from the normal assumption. Moreover, the presence of missing data can exacerbate identification problems (e.g., collinearity), so practitioners need to watch out for ill-conditioned updates.</p><h2><strong>How do we handle a situation where the noise variance</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wZxB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2cd1a58b-18bc-4707-a538-43f0ef17e562_78x74.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wZxB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2cd1a58b-18bc-4707-a538-43f0ef17e562_78x74.png 424w, https://substackcdn.com/image/fetch/$s_!wZxB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2cd1a58b-18bc-4707-a538-43f0ef17e562_78x74.png 848w, https://substackcdn.com/image/fetch/$s_!wZxB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2cd1a58b-18bc-4707-a538-43f0ef17e562_78x74.png 1272w, https://substackcdn.com/image/fetch/$s_!wZxB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2cd1a58b-18bc-4707-a538-43f0ef17e562_78x74.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wZxB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2cd1a58b-18bc-4707-a538-43f0ef17e562_78x74.png" width="78" height="74" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2cd1a58b-18bc-4707-a538-43f0ef17e562_78x74.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:74,&quot;width&quot;:78,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1557,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2cd1a58b-18bc-4707-a538-43f0ef17e562_78x74.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!wZxB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2cd1a58b-18bc-4707-a538-43f0ef17e562_78x74.png 424w, https://substackcdn.com/image/fetch/$s_!wZxB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2cd1a58b-18bc-4707-a538-43f0ef17e562_78x74.png 848w, https://substackcdn.com/image/fetch/$s_!wZxB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2cd1a58b-18bc-4707-a538-43f0ef17e562_78x74.png 1272w, https://substackcdn.com/image/fetch/$s_!wZxB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2cd1a58b-18bc-4707-a538-43f0ef17e562_78x74.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h2><strong>is not constant but depends on the predictors or the true mean (heteroscedasticity)?</strong></h2><p>Heteroscedasticity means that the variance of the error term is not uniform across all observations; instead, it may depend on certain predictor values or predicted responses. This violates the classical homoscedasticity assumption used in deriving the Ordinary Least Squares (OLS) solution as the Best Linear Unbiased Estimator (BLUE).</p><p>In such scenarios, maximizing the standard Gaussian likelihood is no longer optimal, because the assumption</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9qQm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c97ffb7-194d-4d60-958b-a65f6eb7d7ec_201x69.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9qQm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c97ffb7-194d-4d60-958b-a65f6eb7d7ec_201x69.png 424w, https://substackcdn.com/image/fetch/$s_!9qQm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c97ffb7-194d-4d60-958b-a65f6eb7d7ec_201x69.png 848w, https://substackcdn.com/image/fetch/$s_!9qQm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c97ffb7-194d-4d60-958b-a65f6eb7d7ec_201x69.png 1272w, https://substackcdn.com/image/fetch/$s_!9qQm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c97ffb7-194d-4d60-958b-a65f6eb7d7ec_201x69.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9qQm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c97ffb7-194d-4d60-958b-a65f6eb7d7ec_201x69.png" width="201" height="69" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2c97ffb7-194d-4d60-958b-a65f6eb7d7ec_201x69.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:69,&quot;width&quot;:201,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:4081,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c97ffb7-194d-4d60-958b-a65f6eb7d7ec_201x69.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9qQm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c97ffb7-194d-4d60-958b-a65f6eb7d7ec_201x69.png 424w, https://substackcdn.com/image/fetch/$s_!9qQm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c97ffb7-194d-4d60-958b-a65f6eb7d7ec_201x69.png 848w, https://substackcdn.com/image/fetch/$s_!9qQm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c97ffb7-194d-4d60-958b-a65f6eb7d7ec_201x69.png 1272w, https://substackcdn.com/image/fetch/$s_!9qQm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c97ffb7-194d-4d60-958b-a65f6eb7d7ec_201x69.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>is replaced with something like</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aM1e!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf91e3fe-2b60-44e4-9ee4-7412a1999557_195x68.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aM1e!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf91e3fe-2b60-44e4-9ee4-7412a1999557_195x68.png 424w, https://substackcdn.com/image/fetch/$s_!aM1e!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf91e3fe-2b60-44e4-9ee4-7412a1999557_195x68.png 848w, https://substackcdn.com/image/fetch/$s_!aM1e!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf91e3fe-2b60-44e4-9ee4-7412a1999557_195x68.png 1272w, https://substackcdn.com/image/fetch/$s_!aM1e!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf91e3fe-2b60-44e4-9ee4-7412a1999557_195x68.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aM1e!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf91e3fe-2b60-44e4-9ee4-7412a1999557_195x68.png" width="195" height="68" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bf91e3fe-2b60-44e4-9ee4-7412a1999557_195x68.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:68,&quot;width&quot;:195,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:4278,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf91e3fe-2b60-44e4-9ee4-7412a1999557_195x68.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!aM1e!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf91e3fe-2b60-44e4-9ee4-7412a1999557_195x68.png 424w, https://substackcdn.com/image/fetch/$s_!aM1e!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf91e3fe-2b60-44e4-9ee4-7412a1999557_195x68.png 848w, https://substackcdn.com/image/fetch/$s_!aM1e!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf91e3fe-2b60-44e4-9ee4-7412a1999557_195x68.png 1272w, https://substackcdn.com/image/fetch/$s_!aM1e!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf91e3fe-2b60-44e4-9ee4-7412a1999557_195x68.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>, where</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DeD9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58284a56-956f-4e72-ad18-b3c5d82b1303_60x63.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DeD9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58284a56-956f-4e72-ad18-b3c5d82b1303_60x63.png 424w, https://substackcdn.com/image/fetch/$s_!DeD9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58284a56-956f-4e72-ad18-b3c5d82b1303_60x63.png 848w, https://substackcdn.com/image/fetch/$s_!DeD9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58284a56-956f-4e72-ad18-b3c5d82b1303_60x63.png 1272w, https://substackcdn.com/image/fetch/$s_!DeD9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58284a56-956f-4e72-ad18-b3c5d82b1303_60x63.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DeD9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58284a56-956f-4e72-ad18-b3c5d82b1303_60x63.png" width="60" height="63" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/58284a56-956f-4e72-ad18-b3c5d82b1303_60x63.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:63,&quot;width&quot;:60,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1248,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58284a56-956f-4e72-ad18-b3c5d82b1303_60x63.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!DeD9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58284a56-956f-4e72-ad18-b3c5d82b1303_60x63.png 424w, https://substackcdn.com/image/fetch/$s_!DeD9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58284a56-956f-4e72-ad18-b3c5d82b1303_60x63.png 848w, https://substackcdn.com/image/fetch/$s_!DeD9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58284a56-956f-4e72-ad18-b3c5d82b1303_60x63.png 1272w, https://substackcdn.com/image/fetch/$s_!DeD9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58284a56-956f-4e72-ad18-b3c5d82b1303_60x63.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>varies among observations. One approach is:</p><ol><li><p><strong>Weighted Least Squares (WLS)</strong>: If we know or can estimate</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!BqmQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F983e0036-2c57-4700-bfc3-b4829dc1257f_68x64.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BqmQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F983e0036-2c57-4700-bfc3-b4829dc1257f_68x64.png 424w, https://substackcdn.com/image/fetch/$s_!BqmQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F983e0036-2c57-4700-bfc3-b4829dc1257f_68x64.png 848w, https://substackcdn.com/image/fetch/$s_!BqmQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F983e0036-2c57-4700-bfc3-b4829dc1257f_68x64.png 1272w, https://substackcdn.com/image/fetch/$s_!BqmQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F983e0036-2c57-4700-bfc3-b4829dc1257f_68x64.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BqmQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F983e0036-2c57-4700-bfc3-b4829dc1257f_68x64.png" width="68" height="64" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/983e0036-2c57-4700-bfc3-b4829dc1257f_68x64.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:64,&quot;width&quot;:68,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1324,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F983e0036-2c57-4700-bfc3-b4829dc1257f_68x64.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!BqmQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F983e0036-2c57-4700-bfc3-b4829dc1257f_68x64.png 424w, https://substackcdn.com/image/fetch/$s_!BqmQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F983e0036-2c57-4700-bfc3-b4829dc1257f_68x64.png 848w, https://substackcdn.com/image/fetch/$s_!BqmQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F983e0036-2c57-4700-bfc3-b4829dc1257f_68x64.png 1272w, https://substackcdn.com/image/fetch/$s_!BqmQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F983e0036-2c57-4700-bfc3-b4829dc1257f_68x64.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div></li></ol><p>, we can incorporate weights in the objective function. The negative log-likelihood then becomes proportional to</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PD1f!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b940866-cc43-4b0c-8e23-1e00ed758a11_256x93.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PD1f!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b940866-cc43-4b0c-8e23-1e00ed758a11_256x93.png 424w, https://substackcdn.com/image/fetch/$s_!PD1f!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b940866-cc43-4b0c-8e23-1e00ed758a11_256x93.png 848w, https://substackcdn.com/image/fetch/$s_!PD1f!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b940866-cc43-4b0c-8e23-1e00ed758a11_256x93.png 1272w, https://substackcdn.com/image/fetch/$s_!PD1f!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b940866-cc43-4b0c-8e23-1e00ed758a11_256x93.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PD1f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b940866-cc43-4b0c-8e23-1e00ed758a11_256x93.png" width="256" height="93" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4b940866-cc43-4b0c-8e23-1e00ed758a11_256x93.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:93,&quot;width&quot;:256,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:6384,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b940866-cc43-4b0c-8e23-1e00ed758a11_256x93.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!PD1f!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b940866-cc43-4b0c-8e23-1e00ed758a11_256x93.png 424w, https://substackcdn.com/image/fetch/$s_!PD1f!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b940866-cc43-4b0c-8e23-1e00ed758a11_256x93.png 848w, https://substackcdn.com/image/fetch/$s_!PD1f!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b940866-cc43-4b0c-8e23-1e00ed758a11_256x93.png 1272w, https://substackcdn.com/image/fetch/$s_!PD1f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b940866-cc43-4b0c-8e23-1e00ed758a11_256x93.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>, assigning higher weight to observations with smaller variance.</p><ol><li><p><strong>Generalized Least Squares (GLS)</strong>: A more general framework for correlated and/or heteroscedastic errors. One posits a covariance structure</p><p>&#931;</p><p>for the error terms and then uses that in place of</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dv_t!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8df260b-3830-481e-a363-c15ea5a2c6c8_63x79.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dv_t!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8df260b-3830-481e-a363-c15ea5a2c6c8_63x79.png 424w, https://substackcdn.com/image/fetch/$s_!dv_t!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8df260b-3830-481e-a363-c15ea5a2c6c8_63x79.png 848w, https://substackcdn.com/image/fetch/$s_!dv_t!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8df260b-3830-481e-a363-c15ea5a2c6c8_63x79.png 1272w, https://substackcdn.com/image/fetch/$s_!dv_t!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8df260b-3830-481e-a363-c15ea5a2c6c8_63x79.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dv_t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8df260b-3830-481e-a363-c15ea5a2c6c8_63x79.png" width="63" height="79" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e8df260b-3830-481e-a363-c15ea5a2c6c8_63x79.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:79,&quot;width&quot;:63,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1300,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8df260b-3830-481e-a363-c15ea5a2c6c8_63x79.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dv_t!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8df260b-3830-481e-a363-c15ea5a2c6c8_63x79.png 424w, https://substackcdn.com/image/fetch/$s_!dv_t!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8df260b-3830-481e-a363-c15ea5a2c6c8_63x79.png 848w, https://substackcdn.com/image/fetch/$s_!dv_t!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8df260b-3830-481e-a363-c15ea5a2c6c8_63x79.png 1272w, https://substackcdn.com/image/fetch/$s_!dv_t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8df260b-3830-481e-a363-c15ea5a2c6c8_63x79.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>in the classical derivations.</p></li></ol><p>Potential pitfalls include:</p><ul><li><p><strong>Inaccurate variance modeling</strong>: If the user incorrectly specifies</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aDDf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff26c7247-ad53-41c5-97b6-c9cd2d4f08e0_76x57.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aDDf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff26c7247-ad53-41c5-97b6-c9cd2d4f08e0_76x57.png 424w, https://substackcdn.com/image/fetch/$s_!aDDf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff26c7247-ad53-41c5-97b6-c9cd2d4f08e0_76x57.png 848w, https://substackcdn.com/image/fetch/$s_!aDDf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff26c7247-ad53-41c5-97b6-c9cd2d4f08e0_76x57.png 1272w, https://substackcdn.com/image/fetch/$s_!aDDf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff26c7247-ad53-41c5-97b6-c9cd2d4f08e0_76x57.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aDDf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff26c7247-ad53-41c5-97b6-c9cd2d4f08e0_76x57.png" width="76" height="57" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f26c7247-ad53-41c5-97b6-c9cd2d4f08e0_76x57.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:57,&quot;width&quot;:76,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1326,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff26c7247-ad53-41c5-97b6-c9cd2d4f08e0_76x57.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!aDDf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff26c7247-ad53-41c5-97b6-c9cd2d4f08e0_76x57.png 424w, https://substackcdn.com/image/fetch/$s_!aDDf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff26c7247-ad53-41c5-97b6-c9cd2d4f08e0_76x57.png 848w, https://substackcdn.com/image/fetch/$s_!aDDf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff26c7247-ad53-41c5-97b6-c9cd2d4f08e0_76x57.png 1272w, https://substackcdn.com/image/fetch/$s_!aDDf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff26c7247-ad53-41c5-97b6-c9cd2d4f08e0_76x57.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>or the structure of</p><p>&#931;<br>, the resulting estimates might be worse than naive OLS.</p></li><li><p><strong>Computational Complexity</strong>: Estimating a full covariance structure can be expensive for large datasets.</p></li></ul><h2><strong>When performing linear regression in high-dimensional spaces (e.g., more features than samples), how does this affect the maximum likelihood solution?</strong></h2><p>In a high-dimensional setup&#8212;often referred to as the &#8220;p &gt;&gt; n&#8221; scenario&#8212;the matrix</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!d6E_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9472b0f-fcd0-41b5-a898-db27640c6f6c_89x54.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!d6E_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9472b0f-fcd0-41b5-a898-db27640c6f6c_89x54.png 424w, https://substackcdn.com/image/fetch/$s_!d6E_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9472b0f-fcd0-41b5-a898-db27640c6f6c_89x54.png 848w, https://substackcdn.com/image/fetch/$s_!d6E_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9472b0f-fcd0-41b5-a898-db27640c6f6c_89x54.png 1272w, https://substackcdn.com/image/fetch/$s_!d6E_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9472b0f-fcd0-41b5-a898-db27640c6f6c_89x54.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!d6E_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9472b0f-fcd0-41b5-a898-db27640c6f6c_89x54.png" width="89" height="54" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d9472b0f-fcd0-41b5-a898-db27640c6f6c_89x54.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:54,&quot;width&quot;:89,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1075,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9472b0f-fcd0-41b5-a898-db27640c6f6c_89x54.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!d6E_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9472b0f-fcd0-41b5-a898-db27640c6f6c_89x54.png 424w, https://substackcdn.com/image/fetch/$s_!d6E_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9472b0f-fcd0-41b5-a898-db27640c6f6c_89x54.png 848w, https://substackcdn.com/image/fetch/$s_!d6E_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9472b0f-fcd0-41b5-a898-db27640c6f6c_89x54.png 1272w, https://substackcdn.com/image/fetch/$s_!d6E_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9472b0f-fcd0-41b5-a898-db27640c6f6c_89x54.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>becomes singular or nearly singular, meaning the ordinary least squares closed-form solution is not uniquely defined. Several implications arise:</p><ol><li><p><strong>Overfitting</strong>: With many parameters and few data points, the model can fit noise rather than the underlying signal.</p></li><li><p><strong>Non-unique MLE</strong>: There can be infinitely many parameter vectors that yield the same minimized sum of squared residuals, making standard OLS ill-defined in a practical sense.</p></li><li><p><strong>Regularization</strong>: Approaches like ridge regression (L2 penalty) or lasso (L1 penalty) impose constraints on the parameter space, leading to more stable estimates. These can be viewed as penalized maximum likelihood approaches under specific prior assumptions (e.g., Gaussian prior for ridge, Laplacian prior for lasso).</p></li></ol><p>Edge cases happen if even with regularization, certain features are perfectly collinear or extremely correlated. The solution might still be unstable. Proper cross-validation and dimensionality reduction (like PCA or domain-driven feature selection) often become essential.</p><h2><strong>What if the residuals are not identically distributed, even if they are individually Gaussian? For instance, if each data point has a different variance or a different mean structure?</strong></h2><p>Non-identical distributions break the simple i.i.d. assumption. Even if each error is Gaussian, the model&#8217;s structural assumptions might fail if the mean function or the variance structure changes per observation. The classical OLS objective is derived from the assumption</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!WApP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F577ae427-3123-45a2-b487-4df8a3f9e33a_832x151.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WApP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F577ae427-3123-45a2-b487-4df8a3f9e33a_832x151.png 424w, https://substackcdn.com/image/fetch/$s_!WApP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F577ae427-3123-45a2-b487-4df8a3f9e33a_832x151.png 848w, https://substackcdn.com/image/fetch/$s_!WApP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F577ae427-3123-45a2-b487-4df8a3f9e33a_832x151.png 1272w, https://substackcdn.com/image/fetch/$s_!WApP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F577ae427-3123-45a2-b487-4df8a3f9e33a_832x151.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WApP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F577ae427-3123-45a2-b487-4df8a3f9e33a_832x151.png" width="832" height="151" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/577ae427-3123-45a2-b487-4df8a3f9e33a_832x151.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:151,&quot;width&quot;:832,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:15895,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F577ae427-3123-45a2-b487-4df8a3f9e33a_832x151.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!WApP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F577ae427-3123-45a2-b487-4df8a3f9e33a_832x151.png 424w, https://substackcdn.com/image/fetch/$s_!WApP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F577ae427-3123-45a2-b487-4df8a3f9e33a_832x151.png 848w, https://substackcdn.com/image/fetch/$s_!WApP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F577ae427-3123-45a2-b487-4df8a3f9e33a_832x151.png 1272w, https://substackcdn.com/image/fetch/$s_!WApP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F577ae427-3123-45a2-b487-4df8a3f9e33a_832x151.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>If the variance</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!T5YG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa29e5c9e-b522-4135-bb89-a794bc177441_64x57.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!T5YG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa29e5c9e-b522-4135-bb89-a794bc177441_64x57.png 424w, https://substackcdn.com/image/fetch/$s_!T5YG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa29e5c9e-b522-4135-bb89-a794bc177441_64x57.png 848w, https://substackcdn.com/image/fetch/$s_!T5YG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa29e5c9e-b522-4135-bb89-a794bc177441_64x57.png 1272w, https://substackcdn.com/image/fetch/$s_!T5YG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa29e5c9e-b522-4135-bb89-a794bc177441_64x57.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!T5YG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa29e5c9e-b522-4135-bb89-a794bc177441_64x57.png" width="64" height="57" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a29e5c9e-b522-4135-bb89-a794bc177441_64x57.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:57,&quot;width&quot;:64,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1058,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa29e5c9e-b522-4135-bb89-a794bc177441_64x57.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!T5YG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa29e5c9e-b522-4135-bb89-a794bc177441_64x57.png 424w, https://substackcdn.com/image/fetch/$s_!T5YG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa29e5c9e-b522-4135-bb89-a794bc177441_64x57.png 848w, https://substackcdn.com/image/fetch/$s_!T5YG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa29e5c9e-b522-4135-bb89-a794bc177441_64x57.png 1272w, https://substackcdn.com/image/fetch/$s_!T5YG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa29e5c9e-b522-4135-bb89-a794bc177441_64x57.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>is not constant or if the mean depends on other factors not captured by</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8Txi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c008dfe-18fd-4325-9327-b886dbb2eee9_82x62.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8Txi!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c008dfe-18fd-4325-9327-b886dbb2eee9_82x62.png 424w, https://substackcdn.com/image/fetch/$s_!8Txi!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c008dfe-18fd-4325-9327-b886dbb2eee9_82x62.png 848w, https://substackcdn.com/image/fetch/$s_!8Txi!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c008dfe-18fd-4325-9327-b886dbb2eee9_82x62.png 1272w, https://substackcdn.com/image/fetch/$s_!8Txi!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c008dfe-18fd-4325-9327-b886dbb2eee9_82x62.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8Txi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c008dfe-18fd-4325-9327-b886dbb2eee9_82x62.png" width="82" height="62" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4c008dfe-18fd-4325-9327-b886dbb2eee9_82x62.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:62,&quot;width&quot;:82,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2013,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c008dfe-18fd-4325-9327-b886dbb2eee9_82x62.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8Txi!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c008dfe-18fd-4325-9327-b886dbb2eee9_82x62.png 424w, https://substackcdn.com/image/fetch/$s_!8Txi!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c008dfe-18fd-4325-9327-b886dbb2eee9_82x62.png 848w, https://substackcdn.com/image/fetch/$s_!8Txi!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c008dfe-18fd-4325-9327-b886dbb2eee9_82x62.png 1272w, https://substackcdn.com/image/fetch/$s_!8Txi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c008dfe-18fd-4325-9327-b886dbb2eee9_82x62.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>, then maximizing the standard Gaussian likelihood is no longer the correct approach. Instead, you might:</p><ol><li><p>Use Weighted Least Squares if the variance changes per data point but remains known or estimable.</p></li><li><p>Use Generalized Linear Models (GLMs) with appropriate link and variance functions if the mean-variance relationship is more complex (e.g., for count data or binary data).</p></li></ol><p>Pitfalls include a mismatch between the chosen model family and the actual data. Even if you forcibly apply OLS, your inferences on confidence intervals and significance may be misleading.</p><h2><strong>How do we reconcile maximum likelihood approaches with Bayesian inference in linear regression?</strong></h2><p>From a Bayesian perspective, you place a prior distribution on the parameters (e.g., a Gaussian prior for each coefficient) and then update to a posterior distribution based on the likelihood of observed data. This means:</p><ul><li><p>The classical maximum likelihood estimate (MLE) is a single point in the parameter space that maximizes the likelihood.</p></li><li><p>Under a Bayesian approach, you compute the posterior, which is proportional to the product of the prior and the likelihood. The maximum a posteriori (MAP) estimate is then the parameter vector that maximizes the posterior distribution.</p></li></ul><p>For linear regression under a Gaussian prior, the MAP estimate often coincides with ridge regression. It can also be shown that if you assume a Laplace prior on parameters, the MAP estimate coincides with lasso. Real-world issues include the choice of prior: a poor choice can skew results. Also, exact Bayesian computations might require integration over large parameter spaces, typically handled via Markov Chain Monte Carlo (MCMC) or variational methods in practice.</p><h2><strong>How does collinearity between predictors influence the maximum likelihood estimator in linear regression, and what are some best practices to diagnose and address collinearity?</strong></h2><p>Collinearity arises when two or more predictors are (almost) linearly dependent. For example, if one predictor is a near-scaled version of another. This leads to:</p><ol><li><p><strong>Instability of Estimates</strong>: Small changes in the data can produce large variations in parameter estimates. The matrix</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PvcB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff03f7725-6126-496e-83d4-7861b8571dbe_92x54.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PvcB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff03f7725-6126-496e-83d4-7861b8571dbe_92x54.png 424w, https://substackcdn.com/image/fetch/$s_!PvcB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff03f7725-6126-496e-83d4-7861b8571dbe_92x54.png 848w, https://substackcdn.com/image/fetch/$s_!PvcB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff03f7725-6126-496e-83d4-7861b8571dbe_92x54.png 1272w, https://substackcdn.com/image/fetch/$s_!PvcB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff03f7725-6126-496e-83d4-7861b8571dbe_92x54.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PvcB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff03f7725-6126-496e-83d4-7861b8571dbe_92x54.png" width="92" height="54" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f03f7725-6126-496e-83d4-7861b8571dbe_92x54.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:54,&quot;width&quot;:92,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1064,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff03f7725-6126-496e-83d4-7861b8571dbe_92x54.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!PvcB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff03f7725-6126-496e-83d4-7861b8571dbe_92x54.png 424w, https://substackcdn.com/image/fetch/$s_!PvcB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff03f7725-6126-496e-83d4-7861b8571dbe_92x54.png 848w, https://substackcdn.com/image/fetch/$s_!PvcB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff03f7725-6126-496e-83d4-7861b8571dbe_92x54.png 1272w, https://substackcdn.com/image/fetch/$s_!PvcB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff03f7725-6126-496e-83d4-7861b8571dbe_92x54.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>may be close to singular, making</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nGBe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6357809b-8d95-4cff-95f0-84354eca8548_142x63.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nGBe!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6357809b-8d95-4cff-95f0-84354eca8548_142x63.png 424w, https://substackcdn.com/image/fetch/$s_!nGBe!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6357809b-8d95-4cff-95f0-84354eca8548_142x63.png 848w, https://substackcdn.com/image/fetch/$s_!nGBe!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6357809b-8d95-4cff-95f0-84354eca8548_142x63.png 1272w, https://substackcdn.com/image/fetch/$s_!nGBe!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6357809b-8d95-4cff-95f0-84354eca8548_142x63.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nGBe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6357809b-8d95-4cff-95f0-84354eca8548_142x63.png" width="142" height="63" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6357809b-8d95-4cff-95f0-84354eca8548_142x63.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:63,&quot;width&quot;:142,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2031,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6357809b-8d95-4cff-95f0-84354eca8548_142x63.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!nGBe!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6357809b-8d95-4cff-95f0-84354eca8548_142x63.png 424w, https://substackcdn.com/image/fetch/$s_!nGBe!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6357809b-8d95-4cff-95f0-84354eca8548_142x63.png 848w, https://substackcdn.com/image/fetch/$s_!nGBe!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6357809b-8d95-4cff-95f0-84354eca8548_142x63.png 1272w, https://substackcdn.com/image/fetch/$s_!nGBe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6357809b-8d95-4cff-95f0-84354eca8548_142x63.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>numerically unstable.</p><ol start="2"><li><p><strong>Inflated Variance of Coefficients</strong>: Collinear predictors can cause large standard errors for parameter estimates, complicating interpretability.</p></li></ol><p>Diagnosing collinearity can be done via:</p><ul><li><p><strong>Variance Inflation Factor (VIF)</strong>: A high VIF indicates that a predictor is highly correlated with other predictors.</p></li><li><p><strong>Condition Number of</strong></p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!swg7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63d3709d-94bc-4b03-9c78-69878c56abd4_97x57.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!swg7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63d3709d-94bc-4b03-9c78-69878c56abd4_97x57.png 424w, https://substackcdn.com/image/fetch/$s_!swg7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63d3709d-94bc-4b03-9c78-69878c56abd4_97x57.png 848w, https://substackcdn.com/image/fetch/$s_!swg7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63d3709d-94bc-4b03-9c78-69878c56abd4_97x57.png 1272w, https://substackcdn.com/image/fetch/$s_!swg7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63d3709d-94bc-4b03-9c78-69878c56abd4_97x57.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!swg7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63d3709d-94bc-4b03-9c78-69878c56abd4_97x57.png" width="97" height="57" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/63d3709d-94bc-4b03-9c78-69878c56abd4_97x57.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:57,&quot;width&quot;:97,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1087,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63d3709d-94bc-4b03-9c78-69878c56abd4_97x57.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!swg7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63d3709d-94bc-4b03-9c78-69878c56abd4_97x57.png 424w, https://substackcdn.com/image/fetch/$s_!swg7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63d3709d-94bc-4b03-9c78-69878c56abd4_97x57.png 848w, https://substackcdn.com/image/fetch/$s_!swg7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63d3709d-94bc-4b03-9c78-69878c56abd4_97x57.png 1272w, https://substackcdn.com/image/fetch/$s_!swg7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63d3709d-94bc-4b03-9c78-69878c56abd4_97x57.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><ul><li><p>: A large condition number implies near-singular behavior.</p></li></ul><p>Addressing collinearity involves:</p><ul><li><p>Removing or combining redundant features if domain knowledge indicates they provide overlapping information.</p></li><li><p>Applying dimensionality reduction, such as PCA, to compress correlated features into fewer components.</p></li><li><p>Regularization (ridge regression) which penalizes large coefficients and stabilizes the inversion.</p></li></ul><p>A subtle trap is that collinearity might not be obvious if the correlation matrix does not reveal a single pair of highly correlated variables but multiple partial correlations among groups of variables. Always validate the design matrix thoroughly.</p><h2><strong>In what ways does linear regression with maximum likelihood assumptions differ from generalized linear regression approaches, such as logistic or Poisson regression?</strong></h2><p>While linear regression under Gaussian assumptions leads to a sum-of-squares cost function, generalized linear models (GLMs) adapt the distribution (and corresponding link function) to the nature of the response variable:</p><ol><li><p><strong>Logistic Regression</strong>: For binary outcomes, the Bernoulli distribution is used, and the logit link is employed. The negative log-likelihood becomes the cross-entropy or logistic loss, not the sum of squares.</p></li><li><p><strong>Poisson Regression</strong>: For count data, errors are modeled via a Poisson distribution, and the link is typically the log function. The cost function or deviance differs from the sum of squares.</p></li></ol><p>Although the principle of maximum likelihood remains consistent&#8212;choosing parameters that maximize the likelihood of observed data&#8212;the resulting objective functions differ because each distribution dictates a different form for the log-likelihood. Pitfalls include using the wrong distribution or ignoring overdispersion (variance higher than the mean) in count data, which might degrade the fidelity of maximum likelihood estimates.</p><h2><strong>How do non-linear transformations of predictors or polynomial expansions affect the underlying assumption of Gaussian errors?</strong></h2><p>When we introduce polynomial or non-linear transformations of predictors, the model form becomes:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!B5xW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b387178-71e6-40fd-bd90-9b17e65207e4_436x107.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!B5xW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b387178-71e6-40fd-bd90-9b17e65207e4_436x107.png 424w, https://substackcdn.com/image/fetch/$s_!B5xW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b387178-71e6-40fd-bd90-9b17e65207e4_436x107.png 848w, https://substackcdn.com/image/fetch/$s_!B5xW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b387178-71e6-40fd-bd90-9b17e65207e4_436x107.png 1272w, https://substackcdn.com/image/fetch/$s_!B5xW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b387178-71e6-40fd-bd90-9b17e65207e4_436x107.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!B5xW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b387178-71e6-40fd-bd90-9b17e65207e4_436x107.png" width="436" height="107" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2b387178-71e6-40fd-bd90-9b17e65207e4_436x107.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:107,&quot;width&quot;:436,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:8099,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b387178-71e6-40fd-bd90-9b17e65207e4_436x107.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!B5xW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b387178-71e6-40fd-bd90-9b17e65207e4_436x107.png 424w, https://substackcdn.com/image/fetch/$s_!B5xW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b387178-71e6-40fd-bd90-9b17e65207e4_436x107.png 848w, https://substackcdn.com/image/fetch/$s_!B5xW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b387178-71e6-40fd-bd90-9b17e65207e4_436x107.png 1272w, https://substackcdn.com/image/fetch/$s_!B5xW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b387178-71e6-40fd-bd90-9b17e65207e4_436x107.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>where</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rqzt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd4da2b1-aa78-4b4f-ab8e-58e493615547_97x59.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rqzt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd4da2b1-aa78-4b4f-ab8e-58e493615547_97x59.png 424w, https://substackcdn.com/image/fetch/$s_!rqzt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd4da2b1-aa78-4b4f-ab8e-58e493615547_97x59.png 848w, https://substackcdn.com/image/fetch/$s_!rqzt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd4da2b1-aa78-4b4f-ab8e-58e493615547_97x59.png 1272w, https://substackcdn.com/image/fetch/$s_!rqzt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd4da2b1-aa78-4b4f-ab8e-58e493615547_97x59.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rqzt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd4da2b1-aa78-4b4f-ab8e-58e493615547_97x59.png" width="97" height="59" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fd4da2b1-aa78-4b4f-ab8e-58e493615547_97x59.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:59,&quot;width&quot;:97,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2147,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd4da2b1-aa78-4b4f-ab8e-58e493615547_97x59.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rqzt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd4da2b1-aa78-4b4f-ab8e-58e493615547_97x59.png 424w, https://substackcdn.com/image/fetch/$s_!rqzt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd4da2b1-aa78-4b4f-ab8e-58e493615547_97x59.png 848w, https://substackcdn.com/image/fetch/$s_!rqzt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd4da2b1-aa78-4b4f-ab8e-58e493615547_97x59.png 1272w, https://substackcdn.com/image/fetch/$s_!rqzt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd4da2b1-aa78-4b4f-ab8e-58e493615547_97x59.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>could be, for example, a polynomial expansion or other non-linear transformation. As long as the error term</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OhIX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15adb3fc-5984-4ccc-ba2d-3c144bd34d12_66x44.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OhIX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15adb3fc-5984-4ccc-ba2d-3c144bd34d12_66x44.png 424w, https://substackcdn.com/image/fetch/$s_!OhIX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15adb3fc-5984-4ccc-ba2d-3c144bd34d12_66x44.png 848w, https://substackcdn.com/image/fetch/$s_!OhIX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15adb3fc-5984-4ccc-ba2d-3c144bd34d12_66x44.png 1272w, https://substackcdn.com/image/fetch/$s_!OhIX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15adb3fc-5984-4ccc-ba2d-3c144bd34d12_66x44.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OhIX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15adb3fc-5984-4ccc-ba2d-3c144bd34d12_66x44.png" width="66" height="44" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/15adb3fc-5984-4ccc-ba2d-3c144bd34d12_66x44.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:44,&quot;width&quot;:66,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:852,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15adb3fc-5984-4ccc-ba2d-3c144bd34d12_66x44.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!OhIX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15adb3fc-5984-4ccc-ba2d-3c144bd34d12_66x44.png 424w, https://substackcdn.com/image/fetch/$s_!OhIX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15adb3fc-5984-4ccc-ba2d-3c144bd34d12_66x44.png 848w, https://substackcdn.com/image/fetch/$s_!OhIX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15adb3fc-5984-4ccc-ba2d-3c144bd34d12_66x44.png 1272w, https://substackcdn.com/image/fetch/$s_!OhIX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15adb3fc-5984-4ccc-ba2d-3c144bd34d12_66x44.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>remains normally distributed with constant variance around the mean function</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cqN7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05d6c29b-fe36-4410-bfa4-b2f740ece4f3_104x59.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cqN7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05d6c29b-fe36-4410-bfa4-b2f740ece4f3_104x59.png 424w, https://substackcdn.com/image/fetch/$s_!cqN7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05d6c29b-fe36-4410-bfa4-b2f740ece4f3_104x59.png 848w, https://substackcdn.com/image/fetch/$s_!cqN7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05d6c29b-fe36-4410-bfa4-b2f740ece4f3_104x59.png 1272w, https://substackcdn.com/image/fetch/$s_!cqN7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05d6c29b-fe36-4410-bfa4-b2f740ece4f3_104x59.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cqN7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05d6c29b-fe36-4410-bfa4-b2f740ece4f3_104x59.png" width="104" height="59" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/05d6c29b-fe36-4410-bfa4-b2f740ece4f3_104x59.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:59,&quot;width&quot;:104,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2263,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05d6c29b-fe36-4410-bfa4-b2f740ece4f3_104x59.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!cqN7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05d6c29b-fe36-4410-bfa4-b2f740ece4f3_104x59.png 424w, https://substackcdn.com/image/fetch/$s_!cqN7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05d6c29b-fe36-4410-bfa4-b2f740ece4f3_104x59.png 848w, https://substackcdn.com/image/fetch/$s_!cqN7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05d6c29b-fe36-4410-bfa4-b2f740ece4f3_104x59.png 1272w, https://substackcdn.com/image/fetch/$s_!cqN7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05d6c29b-fe36-4410-bfa4-b2f740ece4f3_104x59.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>the maximum likelihood approach under that Gaussian assumption still leads to minimizing squared residuals between</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!UeIY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21fd55d6-098e-4e40-ba63-ec276e0249b3_80x58.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!UeIY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21fd55d6-098e-4e40-ba63-ec276e0249b3_80x58.png 424w, https://substackcdn.com/image/fetch/$s_!UeIY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21fd55d6-098e-4e40-ba63-ec276e0249b3_80x58.png 848w, https://substackcdn.com/image/fetch/$s_!UeIY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21fd55d6-098e-4e40-ba63-ec276e0249b3_80x58.png 1272w, https://substackcdn.com/image/fetch/$s_!UeIY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21fd55d6-098e-4e40-ba63-ec276e0249b3_80x58.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!UeIY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21fd55d6-098e-4e40-ba63-ec276e0249b3_80x58.png" width="80" height="58" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/21fd55d6-098e-4e40-ba63-ec276e0249b3_80x58.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:58,&quot;width&quot;:80,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1166,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21fd55d6-098e-4e40-ba63-ec276e0249b3_80x58.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!UeIY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21fd55d6-098e-4e40-ba63-ec276e0249b3_80x58.png 424w, https://substackcdn.com/image/fetch/$s_!UeIY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21fd55d6-098e-4e40-ba63-ec276e0249b3_80x58.png 848w, https://substackcdn.com/image/fetch/$s_!UeIY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21fd55d6-098e-4e40-ba63-ec276e0249b3_80x58.png 1272w, https://substackcdn.com/image/fetch/$s_!UeIY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21fd55d6-098e-4e40-ba63-ec276e0249b3_80x58.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>and</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!231B!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd10a86b4-71fa-4744-a2f7-fd8f2d1f993e_101x80.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!231B!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd10a86b4-71fa-4744-a2f7-fd8f2d1f993e_101x80.png 424w, https://substackcdn.com/image/fetch/$s_!231B!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd10a86b4-71fa-4744-a2f7-fd8f2d1f993e_101x80.png 848w, https://substackcdn.com/image/fetch/$s_!231B!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd10a86b4-71fa-4744-a2f7-fd8f2d1f993e_101x80.png 1272w, https://substackcdn.com/image/fetch/$s_!231B!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd10a86b4-71fa-4744-a2f7-fd8f2d1f993e_101x80.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!231B!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd10a86b4-71fa-4744-a2f7-fd8f2d1f993e_101x80.png" width="101" height="80" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d10a86b4-71fa-4744-a2f7-fd8f2d1f993e_101x80.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:80,&quot;width&quot;:101,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2217,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd10a86b4-71fa-4744-a2f7-fd8f2d1f993e_101x80.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!231B!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd10a86b4-71fa-4744-a2f7-fd8f2d1f993e_101x80.png 424w, https://substackcdn.com/image/fetch/$s_!231B!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd10a86b4-71fa-4744-a2f7-fd8f2d1f993e_101x80.png 848w, https://substackcdn.com/image/fetch/$s_!231B!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd10a86b4-71fa-4744-a2f7-fd8f2d1f993e_101x80.png 1272w, https://substackcdn.com/image/fetch/$s_!231B!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd10a86b4-71fa-4744-a2f7-fd8f2d1f993e_101x80.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>However, potential complications arise:</p><ol><li><p><strong>Overfitting</strong>: High-degree polynomial expansions can fit noise and lead to poor generalization.</p></li><li><p><strong>Collinearity Within Polynomial Terms</strong>: Terms like</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!426c!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7074e580-e68f-47ae-8186-8d422ec3c285_67x60.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!426c!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7074e580-e68f-47ae-8186-8d422ec3c285_67x60.png 424w, https://substackcdn.com/image/fetch/$s_!426c!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7074e580-e68f-47ae-8186-8d422ec3c285_67x60.png 848w, https://substackcdn.com/image/fetch/$s_!426c!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7074e580-e68f-47ae-8186-8d422ec3c285_67x60.png 1272w, https://substackcdn.com/image/fetch/$s_!426c!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7074e580-e68f-47ae-8186-8d422ec3c285_67x60.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!426c!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7074e580-e68f-47ae-8186-8d422ec3c285_67x60.png" width="67" height="60" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7074e580-e68f-47ae-8186-8d422ec3c285_67x60.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:60,&quot;width&quot;:67,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1377,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7074e580-e68f-47ae-8186-8d422ec3c285_67x60.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!426c!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7074e580-e68f-47ae-8186-8d422ec3c285_67x60.png 424w, https://substackcdn.com/image/fetch/$s_!426c!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7074e580-e68f-47ae-8186-8d422ec3c285_67x60.png 848w, https://substackcdn.com/image/fetch/$s_!426c!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7074e580-e68f-47ae-8186-8d422ec3c285_67x60.png 1272w, https://substackcdn.com/image/fetch/$s_!426c!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7074e580-e68f-47ae-8186-8d422ec3c285_67x60.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>and</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!W-qx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F894bc9bd-899f-45cc-9a35-3ffaaf6f6dfd_73x69.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!W-qx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F894bc9bd-899f-45cc-9a35-3ffaaf6f6dfd_73x69.png 424w, https://substackcdn.com/image/fetch/$s_!W-qx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F894bc9bd-899f-45cc-9a35-3ffaaf6f6dfd_73x69.png 848w, https://substackcdn.com/image/fetch/$s_!W-qx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F894bc9bd-899f-45cc-9a35-3ffaaf6f6dfd_73x69.png 1272w, https://substackcdn.com/image/fetch/$s_!W-qx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F894bc9bd-899f-45cc-9a35-3ffaaf6f6dfd_73x69.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!W-qx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F894bc9bd-899f-45cc-9a35-3ffaaf6f6dfd_73x69.png" width="73" height="69" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/894bc9bd-899f-45cc-9a35-3ffaaf6f6dfd_73x69.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:69,&quot;width&quot;:73,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1449,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F894bc9bd-899f-45cc-9a35-3ffaaf6f6dfd_73x69.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!W-qx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F894bc9bd-899f-45cc-9a35-3ffaaf6f6dfd_73x69.png 424w, https://substackcdn.com/image/fetch/$s_!W-qx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F894bc9bd-899f-45cc-9a35-3ffaaf6f6dfd_73x69.png 848w, https://substackcdn.com/image/fetch/$s_!W-qx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F894bc9bd-899f-45cc-9a35-3ffaaf6f6dfd_73x69.png 1272w, https://substackcdn.com/image/fetch/$s_!W-qx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F894bc9bd-899f-45cc-9a35-3ffaaf6f6dfd_73x69.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>can be correlated with each other and with the original</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!LEhE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3af13a8c-0d37-4d7c-9c52-03cdd1fe361e_50x53.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!LEhE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3af13a8c-0d37-4d7c-9c52-03cdd1fe361e_50x53.png 424w, https://substackcdn.com/image/fetch/$s_!LEhE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3af13a8c-0d37-4d7c-9c52-03cdd1fe361e_50x53.png 848w, https://substackcdn.com/image/fetch/$s_!LEhE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3af13a8c-0d37-4d7c-9c52-03cdd1fe361e_50x53.png 1272w, https://substackcdn.com/image/fetch/$s_!LEhE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3af13a8c-0d37-4d7c-9c52-03cdd1fe361e_50x53.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!LEhE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3af13a8c-0d37-4d7c-9c52-03cdd1fe361e_50x53.png" width="50" height="53" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3af13a8c-0d37-4d7c-9c52-03cdd1fe361e_50x53.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:53,&quot;width&quot;:50,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1086,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3af13a8c-0d37-4d7c-9c52-03cdd1fe361e_50x53.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!LEhE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3af13a8c-0d37-4d7c-9c52-03cdd1fe361e_50x53.png 424w, https://substackcdn.com/image/fetch/$s_!LEhE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3af13a8c-0d37-4d7c-9c52-03cdd1fe361e_50x53.png 848w, https://substackcdn.com/image/fetch/$s_!LEhE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3af13a8c-0d37-4d7c-9c52-03cdd1fe361e_50x53.png 1272w, https://substackcdn.com/image/fetch/$s_!LEhE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3af13a8c-0d37-4d7c-9c52-03cdd1fe361e_50x53.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>exacerbating collinearity.</p><ol start="3"><li><p><strong>Non-constant Variance</strong>: Sometimes, the polynomial or non-linear transformation might inadvertently make the error variance grow with larger</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!v9UH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F124f9eef-4bd1-4149-88a7-79d413b3e114_61x39.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!v9UH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F124f9eef-4bd1-4149-88a7-79d413b3e114_61x39.png 424w, https://substackcdn.com/image/fetch/$s_!v9UH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F124f9eef-4bd1-4149-88a7-79d413b3e114_61x39.png 848w, https://substackcdn.com/image/fetch/$s_!v9UH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F124f9eef-4bd1-4149-88a7-79d413b3e114_61x39.png 1272w, https://substackcdn.com/image/fetch/$s_!v9UH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F124f9eef-4bd1-4149-88a7-79d413b3e114_61x39.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!v9UH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F124f9eef-4bd1-4149-88a7-79d413b3e114_61x39.png" width="61" height="39" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/124f9eef-4bd1-4149-88a7-79d413b3e114_61x39.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:39,&quot;width&quot;:61,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:973,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F124f9eef-4bd1-4149-88a7-79d413b3e114_61x39.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!v9UH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F124f9eef-4bd1-4149-88a7-79d413b3e114_61x39.png 424w, https://substackcdn.com/image/fetch/$s_!v9UH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F124f9eef-4bd1-4149-88a7-79d413b3e114_61x39.png 848w, https://substackcdn.com/image/fetch/$s_!v9UH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F124f9eef-4bd1-4149-88a7-79d413b3e114_61x39.png 1272w, https://substackcdn.com/image/fetch/$s_!v9UH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F124f9eef-4bd1-4149-88a7-79d413b3e114_61x39.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><ol><li><p>values. This violates the constant-variance assumption.</p></li></ol><p>For robust inference, one might use transformations or weighting schemes to stabilize variance, or might rely on cross-validation to choose the model complexity that best balances fit and generalizability.</p><h2><strong>Can we use maximum likelihood estimation in linear regression to compute confidence intervals or prediction intervals, and what assumptions are needed?</strong></h2><p>Yes, after fitting a linear regression via OLS (which coincides with the MLE under Gaussian assumptions), we typically compute:</p><ol><li><p><strong>Confidence Intervals for Parameters</strong>: Based on the estimated variance-covariance matrix of</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gtI6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6159d0c9-e777-40ed-af9c-3692313f699a_323x204.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gtI6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6159d0c9-e777-40ed-af9c-3692313f699a_323x204.png 424w, https://substackcdn.com/image/fetch/$s_!gtI6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6159d0c9-e777-40ed-af9c-3692313f699a_323x204.png 848w, https://substackcdn.com/image/fetch/$s_!gtI6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6159d0c9-e777-40ed-af9c-3692313f699a_323x204.png 1272w, https://substackcdn.com/image/fetch/$s_!gtI6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6159d0c9-e777-40ed-af9c-3692313f699a_323x204.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gtI6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6159d0c9-e777-40ed-af9c-3692313f699a_323x204.png" width="323" height="204" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6159d0c9-e777-40ed-af9c-3692313f699a_323x204.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:204,&quot;width&quot;:323,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:7440,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6159d0c9-e777-40ed-af9c-3692313f699a_323x204.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!gtI6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6159d0c9-e777-40ed-af9c-3692313f699a_323x204.png 424w, https://substackcdn.com/image/fetch/$s_!gtI6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6159d0c9-e777-40ed-af9c-3692313f699a_323x204.png 848w, https://substackcdn.com/image/fetch/$s_!gtI6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6159d0c9-e777-40ed-af9c-3692313f699a_323x204.png 1272w, https://substackcdn.com/image/fetch/$s_!gtI6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6159d0c9-e777-40ed-af9c-3692313f699a_323x204.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>If the errors are Gaussian and independent,</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!eXZW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff65de98b-0cee-42b0-9404-5867c368a747_54x40.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!eXZW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff65de98b-0cee-42b0-9404-5867c368a747_54x40.png 424w, https://substackcdn.com/image/fetch/$s_!eXZW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff65de98b-0cee-42b0-9404-5867c368a747_54x40.png 848w, https://substackcdn.com/image/fetch/$s_!eXZW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff65de98b-0cee-42b0-9404-5867c368a747_54x40.png 1272w, https://substackcdn.com/image/fetch/$s_!eXZW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff65de98b-0cee-42b0-9404-5867c368a747_54x40.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!eXZW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff65de98b-0cee-42b0-9404-5867c368a747_54x40.png" width="54" height="40" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f65de98b-0cee-42b0-9404-5867c368a747_54x40.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:40,&quot;width&quot;:54,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1111,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff65de98b-0cee-42b0-9404-5867c368a747_54x40.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!eXZW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff65de98b-0cee-42b0-9404-5867c368a747_54x40.png 424w, https://substackcdn.com/image/fetch/$s_!eXZW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff65de98b-0cee-42b0-9404-5867c368a747_54x40.png 848w, https://substackcdn.com/image/fetch/$s_!eXZW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff65de98b-0cee-42b0-9404-5867c368a747_54x40.png 1272w, https://substackcdn.com/image/fetch/$s_!eXZW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff65de98b-0cee-42b0-9404-5867c368a747_54x40.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>follows a multivariate normal distribution, and each parameter can be given a confidence interval using the appropriate t-distribution or normal approximation (when sample size is large).</p></li><li><p><strong>Prediction Intervals</strong>: Combining the uncertainty in</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_FjA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff42a4561-49a4-4290-afe3-d732823e1f84_46x52.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_FjA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff42a4561-49a4-4290-afe3-d732823e1f84_46x52.png 424w, https://substackcdn.com/image/fetch/$s_!_FjA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff42a4561-49a4-4290-afe3-d732823e1f84_46x52.png 848w, https://substackcdn.com/image/fetch/$s_!_FjA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff42a4561-49a4-4290-afe3-d732823e1f84_46x52.png 1272w, https://substackcdn.com/image/fetch/$s_!_FjA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff42a4561-49a4-4290-afe3-d732823e1f84_46x52.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_FjA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff42a4561-49a4-4290-afe3-d732823e1f84_46x52.png" width="46" height="52" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f42a4561-49a4-4290-afe3-d732823e1f84_46x52.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:52,&quot;width&quot;:46,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1103,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff42a4561-49a4-4290-afe3-d732823e1f84_46x52.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_FjA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff42a4561-49a4-4290-afe3-d732823e1f84_46x52.png 424w, https://substackcdn.com/image/fetch/$s_!_FjA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff42a4561-49a4-4290-afe3-d732823e1f84_46x52.png 848w, https://substackcdn.com/image/fetch/$s_!_FjA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff42a4561-49a4-4290-afe3-d732823e1f84_46x52.png 1272w, https://substackcdn.com/image/fetch/$s_!_FjA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff42a4561-49a4-4290-afe3-d732823e1f84_46x52.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>plus the residual variance</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8tp8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41751385-46be-4d13-8b0a-e1dee1313725_77x54.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8tp8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41751385-46be-4d13-8b0a-e1dee1313725_77x54.png 424w, https://substackcdn.com/image/fetch/$s_!8tp8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41751385-46be-4d13-8b0a-e1dee1313725_77x54.png 848w, https://substackcdn.com/image/fetch/$s_!8tp8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41751385-46be-4d13-8b0a-e1dee1313725_77x54.png 1272w, https://substackcdn.com/image/fetch/$s_!8tp8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41751385-46be-4d13-8b0a-e1dee1313725_77x54.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8tp8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41751385-46be-4d13-8b0a-e1dee1313725_77x54.png" width="77" height="54" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/41751385-46be-4d13-8b0a-e1dee1313725_77x54.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:54,&quot;width&quot;:77,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1072,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41751385-46be-4d13-8b0a-e1dee1313725_77x54.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8tp8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41751385-46be-4d13-8b0a-e1dee1313725_77x54.png 424w, https://substackcdn.com/image/fetch/$s_!8tp8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41751385-46be-4d13-8b0a-e1dee1313725_77x54.png 848w, https://substackcdn.com/image/fetch/$s_!8tp8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41751385-46be-4d13-8b0a-e1dee1313725_77x54.png 1272w, https://substackcdn.com/image/fetch/$s_!8tp8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41751385-46be-4d13-8b0a-e1dee1313725_77x54.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>to express the uncertainty in a new prediction.</p></li></ol><p>Pitfalls:</p><ul><li><p>If the errors are not Gaussian or independent, standard confidence and prediction intervals may be inaccurate.</p></li><li><p>Heteroscedasticity invalidates the straightforward usage of</p><p>&#963;2(X&#8868;X)&#8722;1.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!w1JB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21b783f2-a0ae-4fdc-9bc9-5fa3672efb5f_188x63.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!w1JB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21b783f2-a0ae-4fdc-9bc9-5fa3672efb5f_188x63.png 424w, https://substackcdn.com/image/fetch/$s_!w1JB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21b783f2-a0ae-4fdc-9bc9-5fa3672efb5f_188x63.png 848w, https://substackcdn.com/image/fetch/$s_!w1JB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21b783f2-a0ae-4fdc-9bc9-5fa3672efb5f_188x63.png 1272w, https://substackcdn.com/image/fetch/$s_!w1JB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21b783f2-a0ae-4fdc-9bc9-5fa3672efb5f_188x63.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!w1JB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21b783f2-a0ae-4fdc-9bc9-5fa3672efb5f_188x63.png" width="188" height="63" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/21b783f2-a0ae-4fdc-9bc9-5fa3672efb5f_188x63.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:63,&quot;width&quot;:188,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:3220,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21b783f2-a0ae-4fdc-9bc9-5fa3672efb5f_188x63.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!w1JB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21b783f2-a0ae-4fdc-9bc9-5fa3672efb5f_188x63.png 424w, https://substackcdn.com/image/fetch/$s_!w1JB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21b783f2-a0ae-4fdc-9bc9-5fa3672efb5f_188x63.png 848w, https://substackcdn.com/image/fetch/$s_!w1JB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21b783f2-a0ae-4fdc-9bc9-5fa3672efb5f_188x63.png 1272w, https://substackcdn.com/image/fetch/$s_!w1JB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21b783f2-a0ae-4fdc-9bc9-5fa3672efb5f_188x63.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div></li></ul><ul><li><p>Correlation between errors (e.g., in time-series) can shrink or inflate interval widths unpredictably if not accounted for in the covariance structure.</p></li></ul><h2><strong>Under what circumstances do iterative reweighted least squares (IRLS) methods become relevant for maximum likelihood estimation in regression, and how does IRLS differ from standard OLS?</strong></h2><p>Iterative Reweighted Least Squares (IRLS) methods emerge when:</p><ul><li><p>The objective function arises from a likelihood that is not strictly the sum of squared errors but can be turned into a weighted least squares form at each iteration. This is common in generalized linear models, including logistic and Poisson regression.</p></li><li><p>Robust regression frameworks (like Huber loss or Tukey&#8217;s biweight) use IRLS to down-weight outliers in each iteration.</p></li></ul><p>The high-level distinction from standard OLS is that in IRLS, at each iteration, we compute updated weights based on the current residuals or model predictions, forming a weighted least squares problem. That is solved for the new estimates of parameters, and then the process repeats. By contrast, standard OLS (for linear Gaussian models) has a single closed-form solution and needs no iterative refinement.</p><p>Potential pitfalls include divergence or oscillatory behavior if the iteration is not well-tuned, especially when the data is particularly noisy or the model is highly nonlinear. Careful step-size selection or damping can be necessary.</p><h2><strong>How can diagnostic tests like the Shapiro-Wilk test for normality of residuals or Q&#8211;Q plots help validate the maximum likelihood assumptions of linear regression?</strong></h2><p>A core assumption in classical linear regression is that the errors are normally distributed. While the MLE under a Gaussian assumption is still the solution that minimizes sum of squared residuals regardless, the standard inferences and confidence intervals rely heavily on this normality assumption (and on homoscedasticity).</p><ol><li><p><strong>Shapiro-Wilk Test</strong>: A formal statistical test that checks if your residuals deviate significantly from a normal distribution. A low p-value suggests non-normality, potentially undermining classical inference.</p></li><li><p><strong>Q&#8211;Q Plot</strong>: A graphical tool to compare the distribution of residuals against a theoretical normal distribution. Deviations in the tails or near the center can reveal skewness, heavy tails, or other patterns.</p></li></ol><p>If the residuals are not Gaussian, the MLE is still the sum-of-squares solution for</p><p>&#946;,</p><p>but the standard errors, confidence intervals, and hypothesis tests might not be valid. One might need to adopt bootstrap methods or robust standard errors (e.g., White&#8217;s &#8220;sandwich&#8221; estimator) to accommodate deviations from normality.</p><h2><strong>In maximum likelihood estimation for linear regression, how do we account for potential correlation among errors (e.g., in panel or longitudinal data)?</strong></h2><p>When dealing with repeated measurements or cluster-structured data (such as multiple observations from the same individual or entity over time), the errors within a cluster may be correlated. Classical OLS and the standard MLE for linear regression assume independent errors, which may no longer hold. Two major strategies stand out:</p><ol><li><p><strong>Clustered Standard Errors</strong>: Estimate robust standard errors that adjust for within-cluster correlation without necessarily changing the point estimates of</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ASub!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a076c38-d3f3-4ba1-9068-e84ca0cd2c06_58x69.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ASub!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a076c38-d3f3-4ba1-9068-e84ca0cd2c06_58x69.png 424w, https://substackcdn.com/image/fetch/$s_!ASub!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a076c38-d3f3-4ba1-9068-e84ca0cd2c06_58x69.png 848w, https://substackcdn.com/image/fetch/$s_!ASub!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a076c38-d3f3-4ba1-9068-e84ca0cd2c06_58x69.png 1272w, https://substackcdn.com/image/fetch/$s_!ASub!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a076c38-d3f3-4ba1-9068-e84ca0cd2c06_58x69.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ASub!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a076c38-d3f3-4ba1-9068-e84ca0cd2c06_58x69.png" width="58" height="69" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1a076c38-d3f3-4ba1-9068-e84ca0cd2c06_58x69.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:69,&quot;width&quot;:58,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1163,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a076c38-d3f3-4ba1-9068-e84ca0cd2c06_58x69.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ASub!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a076c38-d3f3-4ba1-9068-e84ca0cd2c06_58x69.png 424w, https://substackcdn.com/image/fetch/$s_!ASub!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a076c38-d3f3-4ba1-9068-e84ca0cd2c06_58x69.png 848w, https://substackcdn.com/image/fetch/$s_!ASub!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a076c38-d3f3-4ba1-9068-e84ca0cd2c06_58x69.png 1272w, https://substackcdn.com/image/fetch/$s_!ASub!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a076c38-d3f3-4ba1-9068-e84ca0cd2c06_58x69.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>. This is a partial solution if you only need valid inference on parameters.</p></li><li><p><strong>Mixed-Effects Models</strong>: Formally model the correlation by including random effects that capture the within-cluster correlation structure. The likelihood then becomes more complex, typically requiring iterative methods (e.g., restricted maximum likelihood or full maximum likelihood). The random effects approach can handle unbalanced data and multiple levels of clustering.</p></li></ol><p>Edge cases include incorrectly specifying the random effects structure (e.g., ignoring random slopes when they exist), which can bias inferences. Furthermore, computational complexity can grow quickly if the random-effects structure is large or the dataset is huge.</p><h2><strong>Does maximum likelihood estimation for linear regression remain valid under measurement error in the predictors (errors-in-variables), and how do we deal with that?</strong></h2><p>The standard linear regression model assumes predictor variables are measured without error, focusing noise only in the response. If one or more predictors contain measurement error, then OLS estimates can be biased, typically attenuated toward zero (a phenomenon known as attenuation bias).</p><p>Methods to handle errors-in-variables include:</p><ol><li><p><strong>Errors-in-Variables (EIV) Models</strong>: Extend the linear regression framework by explicitly modeling uncertainty in the predictors. One can then form a likelihood that includes the distribution of measurement errors in</p><p>X</p><p>.</p></li><li><p><strong>Instrumental Variables</strong>: If valid instruments are available (variables correlated with the true predictor but uncorrelated with the error in the outcome), consistent estimates can be recovered using a two-stage procedure.</p></li></ol><p>Pitfalls:</p><ul><li><p>Valid instruments can be challenging to find in practice, and weak instruments can worsen the problem.</p></li><li><p>If the measurement error variances are unknown or large, model identifiability becomes tenuous.</p></li></ul><h2><strong>In certain cases, we might transform the target variable (e.g., taking a log transform of</strong></h2><h2><strong>y</strong></h2><h2><strong>). How does that transformation affect the assumption of normal error distribution and the interpretation of parameters?</strong></h2><p>If you model</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-cyX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8382818-249e-4768-8efb-464404c63d0c_289x85.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-cyX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8382818-249e-4768-8efb-464404c63d0c_289x85.png 424w, https://substackcdn.com/image/fetch/$s_!-cyX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8382818-249e-4768-8efb-464404c63d0c_289x85.png 848w, https://substackcdn.com/image/fetch/$s_!-cyX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8382818-249e-4768-8efb-464404c63d0c_289x85.png 1272w, https://substackcdn.com/image/fetch/$s_!-cyX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8382818-249e-4768-8efb-464404c63d0c_289x85.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-cyX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8382818-249e-4768-8efb-464404c63d0c_289x85.png" width="289" height="85" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a8382818-249e-4768-8efb-464404c63d0c_289x85.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:85,&quot;width&quot;:289,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:5368,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8382818-249e-4768-8efb-464404c63d0c_289x85.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!-cyX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8382818-249e-4768-8efb-464404c63d0c_289x85.png 424w, https://substackcdn.com/image/fetch/$s_!-cyX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8382818-249e-4768-8efb-464404c63d0c_289x85.png 848w, https://substackcdn.com/image/fetch/$s_!-cyX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8382818-249e-4768-8efb-464404c63d0c_289x85.png 1272w, https://substackcdn.com/image/fetch/$s_!-cyX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8382818-249e-4768-8efb-464404c63d0c_289x85.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>under the assumption</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1etG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a4bc1ab-c070-4a85-bad2-89da26386575_212x71.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1etG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a4bc1ab-c070-4a85-bad2-89da26386575_212x71.png 424w, https://substackcdn.com/image/fetch/$s_!1etG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a4bc1ab-c070-4a85-bad2-89da26386575_212x71.png 848w, https://substackcdn.com/image/fetch/$s_!1etG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a4bc1ab-c070-4a85-bad2-89da26386575_212x71.png 1272w, https://substackcdn.com/image/fetch/$s_!1etG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a4bc1ab-c070-4a85-bad2-89da26386575_212x71.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1etG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a4bc1ab-c070-4a85-bad2-89da26386575_212x71.png" width="212" height="71" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3a4bc1ab-c070-4a85-bad2-89da26386575_212x71.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:71,&quot;width&quot;:212,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:4170,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a4bc1ab-c070-4a85-bad2-89da26386575_212x71.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!1etG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a4bc1ab-c070-4a85-bad2-89da26386575_212x71.png 424w, https://substackcdn.com/image/fetch/$s_!1etG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a4bc1ab-c070-4a85-bad2-89da26386575_212x71.png 848w, https://substackcdn.com/image/fetch/$s_!1etG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a4bc1ab-c070-4a85-bad2-89da26386575_212x71.png 1272w, https://substackcdn.com/image/fetch/$s_!1etG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a4bc1ab-c070-4a85-bad2-89da26386575_212x71.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>it means that</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iAp9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0ef239d-325a-44b6-9a38-4308a95b54bd_50x59.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iAp9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0ef239d-325a-44b6-9a38-4308a95b54bd_50x59.png 424w, https://substackcdn.com/image/fetch/$s_!iAp9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0ef239d-325a-44b6-9a38-4308a95b54bd_50x59.png 848w, https://substackcdn.com/image/fetch/$s_!iAp9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0ef239d-325a-44b6-9a38-4308a95b54bd_50x59.png 1272w, https://substackcdn.com/image/fetch/$s_!iAp9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0ef239d-325a-44b6-9a38-4308a95b54bd_50x59.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iAp9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0ef239d-325a-44b6-9a38-4308a95b54bd_50x59.png" width="50" height="59" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d0ef239d-325a-44b6-9a38-4308a95b54bd_50x59.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:59,&quot;width&quot;:50,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1076,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0ef239d-325a-44b6-9a38-4308a95b54bd_50x59.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!iAp9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0ef239d-325a-44b6-9a38-4308a95b54bd_50x59.png 424w, https://substackcdn.com/image/fetch/$s_!iAp9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0ef239d-325a-44b6-9a38-4308a95b54bd_50x59.png 848w, https://substackcdn.com/image/fetch/$s_!iAp9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0ef239d-325a-44b6-9a38-4308a95b54bd_50x59.png 1272w, https://substackcdn.com/image/fetch/$s_!iAp9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0ef239d-325a-44b6-9a38-4308a95b54bd_50x59.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>is log-normally distributed, and</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iD3M!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4bfc7f13-1e86-42ca-8716-affc44753904_567x125.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iD3M!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4bfc7f13-1e86-42ca-8716-affc44753904_567x125.png 424w, https://substackcdn.com/image/fetch/$s_!iD3M!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4bfc7f13-1e86-42ca-8716-affc44753904_567x125.png 848w, https://substackcdn.com/image/fetch/$s_!iD3M!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4bfc7f13-1e86-42ca-8716-affc44753904_567x125.png 1272w, https://substackcdn.com/image/fetch/$s_!iD3M!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4bfc7f13-1e86-42ca-8716-affc44753904_567x125.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iD3M!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4bfc7f13-1e86-42ca-8716-affc44753904_567x125.png" width="567" height="125" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4bfc7f13-1e86-42ca-8716-affc44753904_567x125.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:125,&quot;width&quot;:567,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:11518,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4bfc7f13-1e86-42ca-8716-affc44753904_567x125.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!iD3M!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4bfc7f13-1e86-42ca-8716-affc44753904_567x125.png 424w, https://substackcdn.com/image/fetch/$s_!iD3M!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4bfc7f13-1e86-42ca-8716-affc44753904_567x125.png 848w, https://substackcdn.com/image/fetch/$s_!iD3M!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4bfc7f13-1e86-42ca-8716-affc44753904_567x125.png 1272w, https://substackcdn.com/image/fetch/$s_!iD3M!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4bfc7f13-1e86-42ca-8716-affc44753904_567x125.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>This can stabilize variance if the original</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gpXY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0292d79b-d6b8-4e5f-9424-455d63107b30_50x42.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gpXY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0292d79b-d6b8-4e5f-9424-455d63107b30_50x42.png 424w, https://substackcdn.com/image/fetch/$s_!gpXY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0292d79b-d6b8-4e5f-9424-455d63107b30_50x42.png 848w, https://substackcdn.com/image/fetch/$s_!gpXY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0292d79b-d6b8-4e5f-9424-455d63107b30_50x42.png 1272w, https://substackcdn.com/image/fetch/$s_!gpXY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0292d79b-d6b8-4e5f-9424-455d63107b30_50x42.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gpXY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0292d79b-d6b8-4e5f-9424-455d63107b30_50x42.png" width="50" height="42" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0292d79b-d6b8-4e5f-9424-455d63107b30_50x42.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:42,&quot;width&quot;:50,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1048,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0292d79b-d6b8-4e5f-9424-455d63107b30_50x42.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!gpXY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0292d79b-d6b8-4e5f-9424-455d63107b30_50x42.png 424w, https://substackcdn.com/image/fetch/$s_!gpXY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0292d79b-d6b8-4e5f-9424-455d63107b30_50x42.png 848w, https://substackcdn.com/image/fetch/$s_!gpXY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0292d79b-d6b8-4e5f-9424-455d63107b30_50x42.png 1272w, https://substackcdn.com/image/fetch/$s_!gpXY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0292d79b-d6b8-4e5f-9424-455d63107b30_50x42.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>was skewed and the spread of the data grows exponentially with the mean. The MLE for</p><p>&#946;</p><p>in the log-space is then the solution to minimizing the sum of squared residuals in log-space. The parameter interpretation changes:</p><ul><li><p>Coefficients become elasticities or percent changes in</p><p>y</p><p>for a one-unit change in the predictor, rather than absolute changes.</p></li><li><p>Predictions in the original scale require exponentiation:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OY4G!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0b68b7a-73b3-4861-a353-9fb90282da56_280x62.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OY4G!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0b68b7a-73b3-4861-a353-9fb90282da56_280x62.png 424w, https://substackcdn.com/image/fetch/$s_!OY4G!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0b68b7a-73b3-4861-a353-9fb90282da56_280x62.png 848w, https://substackcdn.com/image/fetch/$s_!OY4G!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0b68b7a-73b3-4861-a353-9fb90282da56_280x62.png 1272w, https://substackcdn.com/image/fetch/$s_!OY4G!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0b68b7a-73b3-4861-a353-9fb90282da56_280x62.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OY4G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0b68b7a-73b3-4861-a353-9fb90282da56_280x62.png" width="280" height="62" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a0b68b7a-73b3-4861-a353-9fb90282da56_280x62.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:62,&quot;width&quot;:280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:5401,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0b68b7a-73b3-4861-a353-9fb90282da56_280x62.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!OY4G!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0b68b7a-73b3-4861-a353-9fb90282da56_280x62.png 424w, https://substackcdn.com/image/fetch/$s_!OY4G!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0b68b7a-73b3-4861-a353-9fb90282da56_280x62.png 848w, https://substackcdn.com/image/fetch/$s_!OY4G!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0b68b7a-73b3-4861-a353-9fb90282da56_280x62.png 1272w, https://substackcdn.com/image/fetch/$s_!OY4G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0b68b7a-73b3-4861-a353-9fb90282da56_280x62.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div></li></ul><p>A subtlety is the &#8220;retransformation bias&#8221;: simply taking</p><p>exp&#8289;(predicted log value)exp(predicted log value)</p><p>can underestimate the true mean of</p><p>y</p><p>because</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_ocO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d9b5bb5-13e5-40f8-bb59-679f2ccceed5_213x64.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_ocO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d9b5bb5-13e5-40f8-bb59-679f2ccceed5_213x64.png 424w, https://substackcdn.com/image/fetch/$s_!_ocO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d9b5bb5-13e5-40f8-bb59-679f2ccceed5_213x64.png 848w, https://substackcdn.com/image/fetch/$s_!_ocO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d9b5bb5-13e5-40f8-bb59-679f2ccceed5_213x64.png 1272w, https://substackcdn.com/image/fetch/$s_!_ocO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d9b5bb5-13e5-40f8-bb59-679f2ccceed5_213x64.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_ocO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d9b5bb5-13e5-40f8-bb59-679f2ccceed5_213x64.png" width="213" height="64" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6d9b5bb5-13e5-40f8-bb59-679f2ccceed5_213x64.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:64,&quot;width&quot;:213,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:4432,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d9b5bb5-13e5-40f8-bb59-679f2ccceed5_213x64.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_ocO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d9b5bb5-13e5-40f8-bb59-679f2ccceed5_213x64.png 424w, https://substackcdn.com/image/fetch/$s_!_ocO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d9b5bb5-13e5-40f8-bb59-679f2ccceed5_213x64.png 848w, https://substackcdn.com/image/fetch/$s_!_ocO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d9b5bb5-13e5-40f8-bb59-679f2ccceed5_213x64.png 1272w, https://substackcdn.com/image/fetch/$s_!_ocO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d9b5bb5-13e5-40f8-bb59-679f2ccceed5_213x64.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>A common correction factor is</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SjwN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedef90d0-84bd-4140-869c-83936d9b7c34_168x60.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SjwN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedef90d0-84bd-4140-869c-83936d9b7c34_168x60.png 424w, https://substackcdn.com/image/fetch/$s_!SjwN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedef90d0-84bd-4140-869c-83936d9b7c34_168x60.png 848w, https://substackcdn.com/image/fetch/$s_!SjwN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedef90d0-84bd-4140-869c-83936d9b7c34_168x60.png 1272w, https://substackcdn.com/image/fetch/$s_!SjwN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedef90d0-84bd-4140-869c-83936d9b7c34_168x60.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SjwN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedef90d0-84bd-4140-869c-83936d9b7c34_168x60.png" width="168" height="60" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/edef90d0-84bd-4140-869c-83936d9b7c34_168x60.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:60,&quot;width&quot;:168,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:3818,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedef90d0-84bd-4140-869c-83936d9b7c34_168x60.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!SjwN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedef90d0-84bd-4140-869c-83936d9b7c34_168x60.png 424w, https://substackcdn.com/image/fetch/$s_!SjwN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedef90d0-84bd-4140-869c-83936d9b7c34_168x60.png 848w, https://substackcdn.com/image/fetch/$s_!SjwN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedef90d0-84bd-4140-869c-83936d9b7c34_168x60.png 1272w, https://substackcdn.com/image/fetch/$s_!SjwN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedef90d0-84bd-4140-869c-83936d9b7c34_168x60.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>if you assume normality of residuals in log-space. Omitting it can bias your final predictions for</p><p>y.</p><h2><strong>When might we prefer a non-parametric or semi-parametric approach over a purely parametric Gaussian-based linear regression?</strong></h2><p>In some real-world problems, the functional relationship between features and target is not well-captured by a simple linear function (even after transformations). Additionally, strict distributional assumptions, such as Gaussianity for errors, may be incorrect. Non-parametric or semi-parametric approaches (e.g., kernel regression, spline-based regression, GAMs) can:</p><ol><li><p>Capture more flexible relationships between predictors and the response.</p></li><li><p>Avoid heavy assumptions about parametric forms or exact normality of error distributions.</p></li></ol><p>Potential downsides include:</p><ul><li><p>Higher risk of overfitting if the method is too flexible, especially in small samples.</p></li><li><p>Computational complexity can be higher than classical linear regression methods, especially for large datasets.</p></li><li><p>Interpretation of the resulting fit may be more complicated than a simple linear combination of features.</p></li></ul><p>Edge cases occur if the data actually is linear but you apply an extremely flexible non-parametric model; you risk unnecessary complexity, slow training times, and potential for large variance in the estimates. Cross-validation to tune complexity is often critical.</p><h2><strong>How do we incorporate domain knowledge or constraints (e.g., positivity constraints on parameters) into maximum likelihood estimation for linear regression?</strong></h2><p>Sometimes, prior knowledge indicates that certain parameters should be non-negative or lie within a particular range (e.g., a growth rate parameter that cannot be negative). Standard OLS or unconstrained MLE might produce estimates violating these constraints. Approaches include:</p><ol><li><p><strong>Constrained Optimization</strong>: Solve the least squares problem under inequality constraints, for example using quadratic programming or a projected gradient method. This ensures the solution respects parameter bounds.</p></li><li><p><strong>Reparameterization</strong>: Impose positivity by modeling a coefficient as</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!U6PD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb8abfc9-c867-4d5e-8025-602dd414f193_205x57.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!U6PD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb8abfc9-c867-4d5e-8025-602dd414f193_205x57.png 424w, https://substackcdn.com/image/fetch/$s_!U6PD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb8abfc9-c867-4d5e-8025-602dd414f193_205x57.png 848w, https://substackcdn.com/image/fetch/$s_!U6PD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb8abfc9-c867-4d5e-8025-602dd414f193_205x57.png 1272w, https://substackcdn.com/image/fetch/$s_!U6PD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb8abfc9-c867-4d5e-8025-602dd414f193_205x57.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!U6PD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb8abfc9-c867-4d5e-8025-602dd414f193_205x57.png" width="205" height="57" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bb8abfc9-c867-4d5e-8025-602dd414f193_205x57.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:57,&quot;width&quot;:205,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:4099,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb8abfc9-c867-4d5e-8025-602dd414f193_205x57.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!U6PD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb8abfc9-c867-4d5e-8025-602dd414f193_205x57.png 424w, https://substackcdn.com/image/fetch/$s_!U6PD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb8abfc9-c867-4d5e-8025-602dd414f193_205x57.png 848w, https://substackcdn.com/image/fetch/$s_!U6PD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb8abfc9-c867-4d5e-8025-602dd414f193_205x57.png 1272w, https://substackcdn.com/image/fetch/$s_!U6PD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb8abfc9-c867-4d5e-8025-602dd414f193_205x57.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>, transforming an unconstrained parameter</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!p-6y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49d62abb-ca5f-47c8-9312-3d103c7dcf6f_57x51.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!p-6y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49d62abb-ca5f-47c8-9312-3d103c7dcf6f_57x51.png 424w, https://substackcdn.com/image/fetch/$s_!p-6y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49d62abb-ca5f-47c8-9312-3d103c7dcf6f_57x51.png 848w, https://substackcdn.com/image/fetch/$s_!p-6y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49d62abb-ca5f-47c8-9312-3d103c7dcf6f_57x51.png 1272w, https://substackcdn.com/image/fetch/$s_!p-6y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49d62abb-ca5f-47c8-9312-3d103c7dcf6f_57x51.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!p-6y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49d62abb-ca5f-47c8-9312-3d103c7dcf6f_57x51.png" width="57" height="51" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/49d62abb-ca5f-47c8-9312-3d103c7dcf6f_57x51.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:51,&quot;width&quot;:57,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1138,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49d62abb-ca5f-47c8-9312-3d103c7dcf6f_57x51.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!p-6y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49d62abb-ca5f-47c8-9312-3d103c7dcf6f_57x51.png 424w, https://substackcdn.com/image/fetch/$s_!p-6y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49d62abb-ca5f-47c8-9312-3d103c7dcf6f_57x51.png 848w, https://substackcdn.com/image/fetch/$s_!p-6y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49d62abb-ca5f-47c8-9312-3d103c7dcf6f_57x51.png 1272w, https://substackcdn.com/image/fetch/$s_!p-6y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49d62abb-ca5f-47c8-9312-3d103c7dcf6f_57x51.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>into a constrained space. Then MLE in terms of</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jNdE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2e47a3f-0771-43c3-b9e0-0dc428f0184d_49x57.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jNdE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2e47a3f-0771-43c3-b9e0-0dc428f0184d_49x57.png 424w, https://substackcdn.com/image/fetch/$s_!jNdE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2e47a3f-0771-43c3-b9e0-0dc428f0184d_49x57.png 848w, https://substackcdn.com/image/fetch/$s_!jNdE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2e47a3f-0771-43c3-b9e0-0dc428f0184d_49x57.png 1272w, https://substackcdn.com/image/fetch/$s_!jNdE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2e47a3f-0771-43c3-b9e0-0dc428f0184d_49x57.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jNdE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2e47a3f-0771-43c3-b9e0-0dc428f0184d_49x57.png" width="49" height="57" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f2e47a3f-0771-43c3-b9e0-0dc428f0184d_49x57.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:57,&quot;width&quot;:49,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1135,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2e47a3f-0771-43c3-b9e0-0dc428f0184d_49x57.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!jNdE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2e47a3f-0771-43c3-b9e0-0dc428f0184d_49x57.png 424w, https://substackcdn.com/image/fetch/$s_!jNdE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2e47a3f-0771-43c3-b9e0-0dc428f0184d_49x57.png 848w, https://substackcdn.com/image/fetch/$s_!jNdE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2e47a3f-0771-43c3-b9e0-0dc428f0184d_49x57.png 1272w, https://substackcdn.com/image/fetch/$s_!jNdE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2e47a3f-0771-43c3-b9e0-0dc428f0184d_49x57.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>automatically enforces positivity in</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gDjo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fbc1022-d7a1-497d-96ba-93bc24ffbebb_58x56.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gDjo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fbc1022-d7a1-497d-96ba-93bc24ffbebb_58x56.png 424w, https://substackcdn.com/image/fetch/$s_!gDjo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fbc1022-d7a1-497d-96ba-93bc24ffbebb_58x56.png 848w, https://substackcdn.com/image/fetch/$s_!gDjo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fbc1022-d7a1-497d-96ba-93bc24ffbebb_58x56.png 1272w, https://substackcdn.com/image/fetch/$s_!gDjo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fbc1022-d7a1-497d-96ba-93bc24ffbebb_58x56.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gDjo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fbc1022-d7a1-497d-96ba-93bc24ffbebb_58x56.png" width="58" height="56" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5fbc1022-d7a1-497d-96ba-93bc24ffbebb_58x56.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:56,&quot;width&quot;:58,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1292,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fbc1022-d7a1-497d-96ba-93bc24ffbebb_58x56.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!gDjo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fbc1022-d7a1-497d-96ba-93bc24ffbebb_58x56.png 424w, https://substackcdn.com/image/fetch/$s_!gDjo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fbc1022-d7a1-497d-96ba-93bc24ffbebb_58x56.png 848w, https://substackcdn.com/image/fetch/$s_!gDjo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fbc1022-d7a1-497d-96ba-93bc24ffbebb_58x56.png 1272w, https://substackcdn.com/image/fetch/$s_!gDjo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fbc1022-d7a1-497d-96ba-93bc24ffbebb_58x56.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div></li><li><p><strong>Bayesian Approach with Informative Priors</strong>: Place priors that reflect domain knowledge, such as a half-Gaussian or half-Cauchy prior for non-negative parameters.</p></li></ol><p>A subtlety is that imposing such constraints changes the geometry of the solution space, potentially complicating optimization. If the domain constraint is correct, the resulting estimates will be more physically or scientifically meaningful. If the constraint is incorrect or too restrictive, bias can be introduced.</p><h2><strong>If the true model is polynomial or has interaction terms, but we only fit a main-effects linear regression, does maximum likelihood under the Gaussian assumption still &#8220;work&#8221;?</strong></h2><p>Maximum likelihood estimation under a misspecified model (i.e., the model form</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fMpC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe01f9af6-6f73-4c99-948a-cc1ebe7d9706_91x60.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fMpC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe01f9af6-6f73-4c99-948a-cc1ebe7d9706_91x60.png 424w, https://substackcdn.com/image/fetch/$s_!fMpC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe01f9af6-6f73-4c99-948a-cc1ebe7d9706_91x60.png 848w, https://substackcdn.com/image/fetch/$s_!fMpC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe01f9af6-6f73-4c99-948a-cc1ebe7d9706_91x60.png 1272w, https://substackcdn.com/image/fetch/$s_!fMpC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe01f9af6-6f73-4c99-948a-cc1ebe7d9706_91x60.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fMpC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe01f9af6-6f73-4c99-948a-cc1ebe7d9706_91x60.png" width="91" height="60" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e01f9af6-6f73-4c99-948a-cc1ebe7d9706_91x60.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:60,&quot;width&quot;:91,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2009,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe01f9af6-6f73-4c99-948a-cc1ebe7d9706_91x60.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!fMpC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe01f9af6-6f73-4c99-948a-cc1ebe7d9706_91x60.png 424w, https://substackcdn.com/image/fetch/$s_!fMpC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe01f9af6-6f73-4c99-948a-cc1ebe7d9706_91x60.png 848w, https://substackcdn.com/image/fetch/$s_!fMpC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe01f9af6-6f73-4c99-948a-cc1ebe7d9706_91x60.png 1272w, https://substackcdn.com/image/fetch/$s_!fMpC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe01f9af6-6f73-4c99-948a-cc1ebe7d9706_91x60.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>is not the true underlying function) is no longer guaranteed to produce unbiased estimates of the true relationship. Instead, it finds the best linear approximation in the sense of minimizing sum-of-squares under that linear constraint. While this might still yield a useful linear approximation, it does not capture the underlying non-linear or interaction structure if such terms are indeed significant.</p><p>In practice, to check for potential polynomial or interaction effects, researchers often:</p><ul><li><p>Conduct residual diagnostics to see if residuals systematically vary with certain predictors.</p></li><li><p>Fit extended models with polynomial or interaction terms and compare model fit using criteria such as AIC/BIC or cross-validation error.</p></li></ul><p>Pitfalls:</p><ul><li><p>Overfitting can occur if we blindly add higher-order terms or many interactions without verifying necessity.</p></li><li><p>Interactions can introduce multicollinearity, so interpretability and variance of estimates might suffer.</p></li></ul><h2><strong>What if the covariance of the noise is not diagonal but has a certain pattern (e.g., an AR(1) structure in time series), and how does maximum likelihood under that structure relate to least squares?</strong></h2><p>When residuals have serial correlation (like in time-series analysis with an AR(1) structure, meaning</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GY1J!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47ea0806-0534-4034-a0f9-3ce270c2607b_82x49.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GY1J!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47ea0806-0534-4034-a0f9-3ce270c2607b_82x49.png 424w, https://substackcdn.com/image/fetch/$s_!GY1J!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47ea0806-0534-4034-a0f9-3ce270c2607b_82x49.png 848w, https://substackcdn.com/image/fetch/$s_!GY1J!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47ea0806-0534-4034-a0f9-3ce270c2607b_82x49.png 1272w, https://substackcdn.com/image/fetch/$s_!GY1J!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47ea0806-0534-4034-a0f9-3ce270c2607b_82x49.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GY1J!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47ea0806-0534-4034-a0f9-3ce270c2607b_82x49.png" width="82" height="49" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/47ea0806-0534-4034-a0f9-3ce270c2607b_82x49.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:49,&quot;width&quot;:82,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:871,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47ea0806-0534-4034-a0f9-3ce270c2607b_82x49.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!GY1J!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47ea0806-0534-4034-a0f9-3ce270c2607b_82x49.png 424w, https://substackcdn.com/image/fetch/$s_!GY1J!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47ea0806-0534-4034-a0f9-3ce270c2607b_82x49.png 848w, https://substackcdn.com/image/fetch/$s_!GY1J!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47ea0806-0534-4034-a0f9-3ce270c2607b_82x49.png 1272w, https://substackcdn.com/image/fetch/$s_!GY1J!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47ea0806-0534-4034-a0f9-3ce270c2607b_82x49.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>depends on</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!W8sM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d94ebda-3a0a-40c5-9b3d-47b9ba26da96_74x50.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!W8sM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d94ebda-3a0a-40c5-9b3d-47b9ba26da96_74x50.png 424w, https://substackcdn.com/image/fetch/$s_!W8sM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d94ebda-3a0a-40c5-9b3d-47b9ba26da96_74x50.png 848w, https://substackcdn.com/image/fetch/$s_!W8sM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d94ebda-3a0a-40c5-9b3d-47b9ba26da96_74x50.png 1272w, https://substackcdn.com/image/fetch/$s_!W8sM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d94ebda-3a0a-40c5-9b3d-47b9ba26da96_74x50.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!W8sM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d94ebda-3a0a-40c5-9b3d-47b9ba26da96_74x50.png" width="74" height="50" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3d94ebda-3a0a-40c5-9b3d-47b9ba26da96_74x50.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:50,&quot;width&quot;:74,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1033,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d94ebda-3a0a-40c5-9b3d-47b9ba26da96_74x50.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!W8sM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d94ebda-3a0a-40c5-9b3d-47b9ba26da96_74x50.png 424w, https://substackcdn.com/image/fetch/$s_!W8sM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d94ebda-3a0a-40c5-9b3d-47b9ba26da96_74x50.png 848w, https://substackcdn.com/image/fetch/$s_!W8sM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d94ebda-3a0a-40c5-9b3d-47b9ba26da96_74x50.png 1272w, https://substackcdn.com/image/fetch/$s_!W8sM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d94ebda-3a0a-40c5-9b3d-47b9ba26da96_74x50.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>), the naive OLS approach is no longer the maximum likelihood solution under the correct correlated error structure. The generalized least squares approach modifies the objective to account for the covariance structure</p><p>&#931;</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wDJp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e375582-2c85-4616-a321-25a8e597f4c1_885x119.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wDJp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e375582-2c85-4616-a321-25a8e597f4c1_885x119.png 424w, https://substackcdn.com/image/fetch/$s_!wDJp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e375582-2c85-4616-a321-25a8e597f4c1_885x119.png 848w, https://substackcdn.com/image/fetch/$s_!wDJp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e375582-2c85-4616-a321-25a8e597f4c1_885x119.png 1272w, https://substackcdn.com/image/fetch/$s_!wDJp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e375582-2c85-4616-a321-25a8e597f4c1_885x119.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wDJp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e375582-2c85-4616-a321-25a8e597f4c1_885x119.png" width="885" height="119" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4e375582-2c85-4616-a321-25a8e597f4c1_885x119.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:119,&quot;width&quot;:885,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:16495,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165185854?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e375582-2c85-4616-a321-25a8e597f4c1_885x119.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!wDJp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e375582-2c85-4616-a321-25a8e597f4c1_885x119.png 424w, https://substackcdn.com/image/fetch/$s_!wDJp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e375582-2c85-4616-a321-25a8e597f4c1_885x119.png 848w, https://substackcdn.com/image/fetch/$s_!wDJp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e375582-2c85-4616-a321-25a8e597f4c1_885x119.png 1272w, https://substackcdn.com/image/fetch/$s_!wDJp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e375582-2c85-4616-a321-25a8e597f4c1_885x119.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Maximizing the Gaussian log-likelihood with correlated errors is mathematically equivalent to minimizing the above generalized least squares objective. However, one must estimate or know</p><p>&#931;</p><p>, often requiring iterative procedures (like Cochrane-Orcutt or more general maximum likelihood techniques).</p><p>A major pitfall is incorrectly specifying the correlation pattern. If the assumed covariance structure is far from reality, the estimates may be inconsistent or the confidence intervals inaccurate. On the other hand, if done correctly, modeling correlation can yield more efficient (i.e., lower-variance) parameter estimates and valid inference.</p><p></p>]]></content:encoded></item><item><title><![CDATA[ML Interview Q Series: Bayesian Updating Predicts Show Hit Probability Using Rater Feedback]]></title><description><![CDATA[Browse all the Probability Interview Questions here.]]></description><link>https://www.rohan-paul.com/p/ml-interview-q-series-bayesian-updating</link><guid isPermaLink="false">https://www.rohan-paul.com/p/ml-interview-q-series-bayesian-updating</guid><pubDate>Wed, 04 Jun 2025 12:45:37 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!xK_G!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc87b05fc-931e-48a7-95ef-698f33fad392_1024x572.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xK_G!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc87b05fc-931e-48a7-95ef-698f33fad392_1024x572.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xK_G!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc87b05fc-931e-48a7-95ef-698f33fad392_1024x572.png 424w, https://substackcdn.com/image/fetch/$s_!xK_G!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc87b05fc-931e-48a7-95ef-698f33fad392_1024x572.png 848w, https://substackcdn.com/image/fetch/$s_!xK_G!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc87b05fc-931e-48a7-95ef-698f33fad392_1024x572.png 1272w, https://substackcdn.com/image/fetch/$s_!xK_G!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc87b05fc-931e-48a7-95ef-698f33fad392_1024x572.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xK_G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc87b05fc-931e-48a7-95ef-698f33fad392_1024x572.png" width="1024" height="572" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c87b05fc-931e-48a7-95ef-698f33fad392_1024x572.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:572,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1131325,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc87b05fc-931e-48a7-95ef-698f33fad392_1024x572.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!xK_G!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc87b05fc-931e-48a7-95ef-698f33fad392_1024x572.png 424w, https://substackcdn.com/image/fetch/$s_!xK_G!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc87b05fc-931e-48a7-95ef-698f33fad392_1024x572.png 848w, https://substackcdn.com/image/fetch/$s_!xK_G!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc87b05fc-931e-48a7-95ef-698f33fad392_1024x572.png 1272w, https://substackcdn.com/image/fetch/$s_!xK_G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc87b05fc-931e-48a7-95ef-698f33fad392_1024x572.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Browse all the <strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">Probability Interview Questions here</a></strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">.</a></p><h2><strong>18. Before a show is released, it is shown to several in-house raters. You assume two types of shows: hits (80% chance that any viewer likes it) and misses (20% chance). Prior: 60% hit, 40% miss. After 8 raters, 6 liked it. What is the new posterior probability that it is a hit?</strong></h2><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://x.com/rohanpaul_ai&quot;,&quot;text&quot;:&quot;Connect with me on X (Twitter)&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://x.com/rohanpaul_ai"><span>Connect with me on X (Twitter)</span></a></p><p>Understanding Bayesian updating in this scenario requires carefully applying the likelihood of seeing the observed evidence (6 likes out of 8) given each hypothesis (show is a "hit" vs. show is a "miss"), combined with the prior probabilities (60% for hit, 40% for miss).</p><p>Bayesian Reasoning for This Problem</p><p>Bayesian inference suggests that we take our prior belief about whether a show is a hit or a miss, calculate the probability of observing the evidence (6 out of 8 raters like it) under each hypothesis, and update our belief to get the posterior probability. The formula is:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HxAZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F048a804a-de50-48d6-b3c8-2dba8f0f0a1c_1179x120.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HxAZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F048a804a-de50-48d6-b3c8-2dba8f0f0a1c_1179x120.png 424w, https://substackcdn.com/image/fetch/$s_!HxAZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F048a804a-de50-48d6-b3c8-2dba8f0f0a1c_1179x120.png 848w, https://substackcdn.com/image/fetch/$s_!HxAZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F048a804a-de50-48d6-b3c8-2dba8f0f0a1c_1179x120.png 1272w, https://substackcdn.com/image/fetch/$s_!HxAZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F048a804a-de50-48d6-b3c8-2dba8f0f0a1c_1179x120.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HxAZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F048a804a-de50-48d6-b3c8-2dba8f0f0a1c_1179x120.png" width="1179" height="120" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/048a804a-de50-48d6-b3c8-2dba8f0f0a1c_1179x120.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:120,&quot;width&quot;:1179,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:27452,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F048a804a-de50-48d6-b3c8-2dba8f0f0a1c_1179x120.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!HxAZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F048a804a-de50-48d6-b3c8-2dba8f0f0a1c_1179x120.png 424w, https://substackcdn.com/image/fetch/$s_!HxAZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F048a804a-de50-48d6-b3c8-2dba8f0f0a1c_1179x120.png 848w, https://substackcdn.com/image/fetch/$s_!HxAZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F048a804a-de50-48d6-b3c8-2dba8f0f0a1c_1179x120.png 1272w, https://substackcdn.com/image/fetch/$s_!HxAZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F048a804a-de50-48d6-b3c8-2dba8f0f0a1c_1179x120.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p>In this problem:</p><p>P(Hit) = 0.60</p><p>P(Miss) = 0.40</p><p>If the show is a hit, each viewer independently likes it with probability 0.80. If the show is a miss, each viewer independently likes it with probability 0.20.</p><p>For a show that is a hit, the probability that exactly 6 out of 8 raters like it is given by the binomial distribution. In a broad sense, that binomial probability is:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xFqV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d03e9dd-eb4d-4e69-b00c-373d43dae520_502x186.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xFqV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d03e9dd-eb4d-4e69-b00c-373d43dae520_502x186.png 424w, https://substackcdn.com/image/fetch/$s_!xFqV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d03e9dd-eb4d-4e69-b00c-373d43dae520_502x186.png 848w, https://substackcdn.com/image/fetch/$s_!xFqV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d03e9dd-eb4d-4e69-b00c-373d43dae520_502x186.png 1272w, https://substackcdn.com/image/fetch/$s_!xFqV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d03e9dd-eb4d-4e69-b00c-373d43dae520_502x186.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xFqV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d03e9dd-eb4d-4e69-b00c-373d43dae520_502x186.png" width="502" height="186" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8d03e9dd-eb4d-4e69-b00c-373d43dae520_502x186.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:186,&quot;width&quot;:502,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:15468,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d03e9dd-eb4d-4e69-b00c-373d43dae520_502x186.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!xFqV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d03e9dd-eb4d-4e69-b00c-373d43dae520_502x186.png 424w, https://substackcdn.com/image/fetch/$s_!xFqV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d03e9dd-eb4d-4e69-b00c-373d43dae520_502x186.png 848w, https://substackcdn.com/image/fetch/$s_!xFqV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d03e9dd-eb4d-4e69-b00c-373d43dae520_502x186.png 1272w, https://substackcdn.com/image/fetch/$s_!xFqV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d03e9dd-eb4d-4e69-b00c-373d43dae520_502x186.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Similarly, for a miss:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dbao!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74c07628-67ec-424e-b612-cf456e1c8cbd_504x194.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dbao!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74c07628-67ec-424e-b612-cf456e1c8cbd_504x194.png 424w, https://substackcdn.com/image/fetch/$s_!dbao!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74c07628-67ec-424e-b612-cf456e1c8cbd_504x194.png 848w, https://substackcdn.com/image/fetch/$s_!dbao!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74c07628-67ec-424e-b612-cf456e1c8cbd_504x194.png 1272w, https://substackcdn.com/image/fetch/$s_!dbao!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74c07628-67ec-424e-b612-cf456e1c8cbd_504x194.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dbao!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74c07628-67ec-424e-b612-cf456e1c8cbd_504x194.png" width="504" height="194" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/74c07628-67ec-424e-b612-cf456e1c8cbd_504x194.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:194,&quot;width&quot;:504,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:15566,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74c07628-67ec-424e-b612-cf456e1c8cbd_504x194.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dbao!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74c07628-67ec-424e-b612-cf456e1c8cbd_504x194.png 424w, https://substackcdn.com/image/fetch/$s_!dbao!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74c07628-67ec-424e-b612-cf456e1c8cbd_504x194.png 848w, https://substackcdn.com/image/fetch/$s_!dbao!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74c07628-67ec-424e-b612-cf456e1c8cbd_504x194.png 1272w, https://substackcdn.com/image/fetch/$s_!dbao!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74c07628-67ec-424e-b612-cf456e1c8cbd_504x194.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>However, for the Bayesian posterior ratio, the combinatorial factor</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!X7LL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69ab4c7e-46b5-4ec2-ba5c-248d3e87b533_88x104.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!X7LL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69ab4c7e-46b5-4ec2-ba5c-248d3e87b533_88x104.png 424w, https://substackcdn.com/image/fetch/$s_!X7LL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69ab4c7e-46b5-4ec2-ba5c-248d3e87b533_88x104.png 848w, https://substackcdn.com/image/fetch/$s_!X7LL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69ab4c7e-46b5-4ec2-ba5c-248d3e87b533_88x104.png 1272w, https://substackcdn.com/image/fetch/$s_!X7LL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69ab4c7e-46b5-4ec2-ba5c-248d3e87b533_88x104.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!X7LL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69ab4c7e-46b5-4ec2-ba5c-248d3e87b533_88x104.png" width="88" height="104" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/69ab4c7e-46b5-4ec2-ba5c-248d3e87b533_88x104.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:104,&quot;width&quot;:88,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:3256,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69ab4c7e-46b5-4ec2-ba5c-248d3e87b533_88x104.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!X7LL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69ab4c7e-46b5-4ec2-ba5c-248d3e87b533_88x104.png 424w, https://substackcdn.com/image/fetch/$s_!X7LL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69ab4c7e-46b5-4ec2-ba5c-248d3e87b533_88x104.png 848w, https://substackcdn.com/image/fetch/$s_!X7LL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69ab4c7e-46b5-4ec2-ba5c-248d3e87b533_88x104.png 1272w, https://substackcdn.com/image/fetch/$s_!X7LL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69ab4c7e-46b5-4ec2-ba5c-248d3e87b533_88x104.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>is common to both numerator and denominator, so it cancels out. Thus, to compute the posterior, we can equivalently consider only:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vIWQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F557cc10e-b7c0-440c-96ce-6cc01ac6b0e9_472x61.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vIWQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F557cc10e-b7c0-440c-96ce-6cc01ac6b0e9_472x61.png 424w, https://substackcdn.com/image/fetch/$s_!vIWQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F557cc10e-b7c0-440c-96ce-6cc01ac6b0e9_472x61.png 848w, https://substackcdn.com/image/fetch/$s_!vIWQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F557cc10e-b7c0-440c-96ce-6cc01ac6b0e9_472x61.png 1272w, https://substackcdn.com/image/fetch/$s_!vIWQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F557cc10e-b7c0-440c-96ce-6cc01ac6b0e9_472x61.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vIWQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F557cc10e-b7c0-440c-96ce-6cc01ac6b0e9_472x61.png" width="472" height="61" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/557cc10e-b7c0-440c-96ce-6cc01ac6b0e9_472x61.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:61,&quot;width&quot;:472,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:8694,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F557cc10e-b7c0-440c-96ce-6cc01ac6b0e9_472x61.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vIWQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F557cc10e-b7c0-440c-96ce-6cc01ac6b0e9_472x61.png 424w, https://substackcdn.com/image/fetch/$s_!vIWQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F557cc10e-b7c0-440c-96ce-6cc01ac6b0e9_472x61.png 848w, https://substackcdn.com/image/fetch/$s_!vIWQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F557cc10e-b7c0-440c-96ce-6cc01ac6b0e9_472x61.png 1272w, https://substackcdn.com/image/fetch/$s_!vIWQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F557cc10e-b7c0-440c-96ce-6cc01ac6b0e9_472x61.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>and multiply them by the respective priors 0.60 and 0.40, then normalize.</p><p>Performing the Calculation</p><p>Likelihood for hit:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sfiI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9bc4e2d-b8aa-4861-8168-fc3b91debf15_209x58.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sfiI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9bc4e2d-b8aa-4861-8168-fc3b91debf15_209x58.png 424w, https://substackcdn.com/image/fetch/$s_!sfiI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9bc4e2d-b8aa-4861-8168-fc3b91debf15_209x58.png 848w, https://substackcdn.com/image/fetch/$s_!sfiI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9bc4e2d-b8aa-4861-8168-fc3b91debf15_209x58.png 1272w, https://substackcdn.com/image/fetch/$s_!sfiI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9bc4e2d-b8aa-4861-8168-fc3b91debf15_209x58.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sfiI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9bc4e2d-b8aa-4861-8168-fc3b91debf15_209x58.png" width="209" height="58" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d9bc4e2d-b8aa-4861-8168-fc3b91debf15_209x58.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:58,&quot;width&quot;:209,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:4714,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9bc4e2d-b8aa-4861-8168-fc3b91debf15_209x58.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!sfiI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9bc4e2d-b8aa-4861-8168-fc3b91debf15_209x58.png 424w, https://substackcdn.com/image/fetch/$s_!sfiI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9bc4e2d-b8aa-4861-8168-fc3b91debf15_209x58.png 848w, https://substackcdn.com/image/fetch/$s_!sfiI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9bc4e2d-b8aa-4861-8168-fc3b91debf15_209x58.png 1272w, https://substackcdn.com/image/fetch/$s_!sfiI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9bc4e2d-b8aa-4861-8168-fc3b91debf15_209x58.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Likelihood for miss:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3QPB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd62b56c0-687f-4680-8373-4ec2bec46505_206x84.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3QPB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd62b56c0-687f-4680-8373-4ec2bec46505_206x84.png 424w, https://substackcdn.com/image/fetch/$s_!3QPB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd62b56c0-687f-4680-8373-4ec2bec46505_206x84.png 848w, https://substackcdn.com/image/fetch/$s_!3QPB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd62b56c0-687f-4680-8373-4ec2bec46505_206x84.png 1272w, https://substackcdn.com/image/fetch/$s_!3QPB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd62b56c0-687f-4680-8373-4ec2bec46505_206x84.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3QPB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd62b56c0-687f-4680-8373-4ec2bec46505_206x84.png" width="206" height="84" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d62b56c0-687f-4680-8373-4ec2bec46505_206x84.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:84,&quot;width&quot;:206,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:4878,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd62b56c0-687f-4680-8373-4ec2bec46505_206x84.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!3QPB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd62b56c0-687f-4680-8373-4ec2bec46505_206x84.png 424w, https://substackcdn.com/image/fetch/$s_!3QPB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd62b56c0-687f-4680-8373-4ec2bec46505_206x84.png 848w, https://substackcdn.com/image/fetch/$s_!3QPB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd62b56c0-687f-4680-8373-4ec2bec46505_206x84.png 1272w, https://substackcdn.com/image/fetch/$s_!3QPB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd62b56c0-687f-4680-8373-4ec2bec46505_206x84.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Multiply them by the priors 0.60 (hit) and 0.40 (miss). Let&#8217;s illustrate how we might compute this directly in Python.</p><pre><code><code>import math

prior_hit = 0.6
prior_miss = 0.4

like_hit = (0.8**6) * (0.2**2)
like_miss = (0.2**6) * (0.8**2)

numerator = prior_hit * like_hit
denominator = numerator + prior_miss * like_miss

posterior_hit = numerator / denominator

print(posterior_hit)
</code></code></pre><p>Running this (or doing it by hand) yields a posterior probability of approximately 0.9974. Interpreted in percentage terms, there is roughly a 99.74% chance that the show is a hit after observing that 6 out of 8 raters liked it.</p><p>Explanation of Why the Posterior is So High</p><p>Many find it surprising that the posterior probability ends up being around 99.7%. The reason is that an 80% like probability is quite high compared to 20%, so the likelihood ratio for 6 out of 8 in favor of the show heavily biases it toward &#8220;hit.&#8221; Specifically, 6 out of 8 likes is far more probable under a scenario where each viewer has an 80% chance of liking the show than if each viewer has only a 20% chance. Additionally, we began with a prior that already slightly favored &#8220;hit&#8221; (0.60 vs. 0.40). These factors compound to give a very strong posterior for &#8220;hit.&#8221;</p><p>Subtle Points to Consider</p><p>It&#8217;s important not only to plug in the numbers, but also to understand potential pitfalls in real-world data scenarios:</p><p>&#8226; Independence Assumption: We assumed the 8 in-house raters are independent in whether they like or dislike the show. In reality, raters might influence each other (e.g., if they watch the show together or share opinions), so the posterior might be less extreme if independence is violated.</p><p>&#8226; Prior Sensitivity: Changing the prior from 60% vs. 40% to something else (say 50% vs. 50%) or if you had strong reasons to believe the show is more/less likely to be a hit, the posterior would shift. However, the large likelihood difference can still drive the posterior heavily toward &#8220;hit.&#8221;</p><p>&#8226; Evidence Strength: Observing 6 of 8 likes is moderate evidence in favor of the show&#8217;s success. Yet, for a big difference in like probabilities (80% vs. 20%), even moderate evidence can become quite compelling in Bayesian terms.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.rohan-paul.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">I write everyday for my readers on actionable AI. Subscribe and instantly get a 1300+ page Python book.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2><strong>What if Only 5 Out of 8 Liked It?</strong></h2><p>A natural follow-up question might be how the posterior changes if we had a slightly different outcome, like 5 out of 8 instead of 6 out of 8. Let&#8217;s answer that as well:</p><p>We simply use the same Bayesian formula but with the updated likelihood for 5 likes and 3 dislikes:</p><p>Likelihood for hit in that scenario:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2662!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F782170bc-daab-4b13-b309-50e059e07bec_272x99.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2662!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F782170bc-daab-4b13-b309-50e059e07bec_272x99.png 424w, https://substackcdn.com/image/fetch/$s_!2662!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F782170bc-daab-4b13-b309-50e059e07bec_272x99.png 848w, https://substackcdn.com/image/fetch/$s_!2662!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F782170bc-daab-4b13-b309-50e059e07bec_272x99.png 1272w, https://substackcdn.com/image/fetch/$s_!2662!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F782170bc-daab-4b13-b309-50e059e07bec_272x99.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2662!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F782170bc-daab-4b13-b309-50e059e07bec_272x99.png" width="272" height="99" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/782170bc-daab-4b13-b309-50e059e07bec_272x99.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:99,&quot;width&quot;:272,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:7691,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F782170bc-daab-4b13-b309-50e059e07bec_272x99.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2662!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F782170bc-daab-4b13-b309-50e059e07bec_272x99.png 424w, https://substackcdn.com/image/fetch/$s_!2662!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F782170bc-daab-4b13-b309-50e059e07bec_272x99.png 848w, https://substackcdn.com/image/fetch/$s_!2662!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F782170bc-daab-4b13-b309-50e059e07bec_272x99.png 1272w, https://substackcdn.com/image/fetch/$s_!2662!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F782170bc-daab-4b13-b309-50e059e07bec_272x99.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Likelihood for miss:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pqLH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F440d5587-620d-404c-a9f6-0ed1464ecf01_287x94.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pqLH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F440d5587-620d-404c-a9f6-0ed1464ecf01_287x94.png 424w, https://substackcdn.com/image/fetch/$s_!pqLH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F440d5587-620d-404c-a9f6-0ed1464ecf01_287x94.png 848w, https://substackcdn.com/image/fetch/$s_!pqLH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F440d5587-620d-404c-a9f6-0ed1464ecf01_287x94.png 1272w, https://substackcdn.com/image/fetch/$s_!pqLH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F440d5587-620d-404c-a9f6-0ed1464ecf01_287x94.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pqLH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F440d5587-620d-404c-a9f6-0ed1464ecf01_287x94.png" width="287" height="94" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/440d5587-620d-404c-a9f6-0ed1464ecf01_287x94.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:94,&quot;width&quot;:287,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:7699,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F440d5587-620d-404c-a9f6-0ed1464ecf01_287x94.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!pqLH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F440d5587-620d-404c-a9f6-0ed1464ecf01_287x94.png 424w, https://substackcdn.com/image/fetch/$s_!pqLH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F440d5587-620d-404c-a9f6-0ed1464ecf01_287x94.png 848w, https://substackcdn.com/image/fetch/$s_!pqLH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F440d5587-620d-404c-a9f6-0ed1464ecf01_287x94.png 1272w, https://substackcdn.com/image/fetch/$s_!pqLH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F440d5587-620d-404c-a9f6-0ed1464ecf01_287x94.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Both have the same binomial coefficient</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!duJA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb8e6151-7564-41a1-b716-0f6b69c0fc24_73x91.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!duJA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb8e6151-7564-41a1-b716-0f6b69c0fc24_73x91.png 424w, https://substackcdn.com/image/fetch/$s_!duJA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb8e6151-7564-41a1-b716-0f6b69c0fc24_73x91.png 848w, https://substackcdn.com/image/fetch/$s_!duJA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb8e6151-7564-41a1-b716-0f6b69c0fc24_73x91.png 1272w, https://substackcdn.com/image/fetch/$s_!duJA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb8e6151-7564-41a1-b716-0f6b69c0fc24_73x91.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!duJA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb8e6151-7564-41a1-b716-0f6b69c0fc24_73x91.png" width="73" height="91" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fb8e6151-7564-41a1-b716-0f6b69c0fc24_73x91.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:91,&quot;width&quot;:73,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:3131,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb8e6151-7564-41a1-b716-0f6b69c0fc24_73x91.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!duJA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb8e6151-7564-41a1-b716-0f6b69c0fc24_73x91.png 424w, https://substackcdn.com/image/fetch/$s_!duJA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb8e6151-7564-41a1-b716-0f6b69c0fc24_73x91.png 848w, https://substackcdn.com/image/fetch/$s_!duJA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb8e6151-7564-41a1-b716-0f6b69c0fc24_73x91.png 1272w, https://substackcdn.com/image/fetch/$s_!duJA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb8e6151-7564-41a1-b716-0f6b69c0fc24_73x91.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>, so after multiplying each by its prior (0.60 and 0.40 respectively) and normalizing, we would get a smaller posterior for &#8220;hit&#8221; compared to the 6 out of 8 scenario, but it would still likely favor &#8220;hit.&#8221; The exact number can be computed similarly.</p><h2><strong>Could the Posterior Probability Ever Decrease Below the Prior After Observing Some Likes?</strong></h2><p>A tricky question might be: &#8220;Is it ever possible that observing some likes actually reduces your belief in the show being a hit?&#8221; This could happen if we had so many likes that it was actually less probable under 80% than some alternative hypothesis that had an even higher like rate (though that&#8217;s not in our current problem). With only two hypotheses&#8212;80% chance of like vs. 20%&#8212;observing any pattern with more than 4 out of 8 likes will push the posterior more strongly toward the 80% side, since that pattern is more likely under the 80% model.</p><h2><strong>Deeper Insight Into Why the Ratio Is So Extreme</strong></h2><p>A standard way to grasp this is to look at the likelihood ratio between &#8220;hit&#8221; and &#8220;miss.&#8221; The ratio of the probabilities for 6 likes out of 8 is:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vHNy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff21f1968-f0df-4704-a808-29171e37a7aa_390x184.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vHNy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff21f1968-f0df-4704-a808-29171e37a7aa_390x184.png 424w, https://substackcdn.com/image/fetch/$s_!vHNy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff21f1968-f0df-4704-a808-29171e37a7aa_390x184.png 848w, https://substackcdn.com/image/fetch/$s_!vHNy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff21f1968-f0df-4704-a808-29171e37a7aa_390x184.png 1272w, https://substackcdn.com/image/fetch/$s_!vHNy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff21f1968-f0df-4704-a808-29171e37a7aa_390x184.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vHNy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff21f1968-f0df-4704-a808-29171e37a7aa_390x184.png" width="390" height="184" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f21f1968-f0df-4704-a808-29171e37a7aa_390x184.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:184,&quot;width&quot;:390,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:20973,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff21f1968-f0df-4704-a808-29171e37a7aa_390x184.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vHNy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff21f1968-f0df-4704-a808-29171e37a7aa_390x184.png 424w, https://substackcdn.com/image/fetch/$s_!vHNy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff21f1968-f0df-4704-a808-29171e37a7aa_390x184.png 848w, https://substackcdn.com/image/fetch/$s_!vHNy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff21f1968-f0df-4704-a808-29171e37a7aa_390x184.png 1272w, https://substackcdn.com/image/fetch/$s_!vHNy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff21f1968-f0df-4704-a808-29171e37a7aa_390x184.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>One can rewrite this as:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Cy5p!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3284165b-61ea-4563-b62a-e10551db5a06_855x157.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Cy5p!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3284165b-61ea-4563-b62a-e10551db5a06_855x157.png 424w, https://substackcdn.com/image/fetch/$s_!Cy5p!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3284165b-61ea-4563-b62a-e10551db5a06_855x157.png 848w, https://substackcdn.com/image/fetch/$s_!Cy5p!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3284165b-61ea-4563-b62a-e10551db5a06_855x157.png 1272w, https://substackcdn.com/image/fetch/$s_!Cy5p!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3284165b-61ea-4563-b62a-e10551db5a06_855x157.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Cy5p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3284165b-61ea-4563-b62a-e10551db5a06_855x157.png" width="855" height="157" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3284165b-61ea-4563-b62a-e10551db5a06_855x157.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:157,&quot;width&quot;:855,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:25736,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3284165b-61ea-4563-b62a-e10551db5a06_855x157.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Cy5p!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3284165b-61ea-4563-b62a-e10551db5a06_855x157.png 424w, https://substackcdn.com/image/fetch/$s_!Cy5p!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3284165b-61ea-4563-b62a-e10551db5a06_855x157.png 848w, https://substackcdn.com/image/fetch/$s_!Cy5p!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3284165b-61ea-4563-b62a-e10551db5a06_855x157.png 1272w, https://substackcdn.com/image/fetch/$s_!Cy5p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3284165b-61ea-4563-b62a-e10551db5a06_855x157.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The term</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wSO5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F532665f5-8c67-4a19-9181-a2f39154f1f4_59x62.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wSO5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F532665f5-8c67-4a19-9181-a2f39154f1f4_59x62.png 424w, https://substackcdn.com/image/fetch/$s_!wSO5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F532665f5-8c67-4a19-9181-a2f39154f1f4_59x62.png 848w, https://substackcdn.com/image/fetch/$s_!wSO5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F532665f5-8c67-4a19-9181-a2f39154f1f4_59x62.png 1272w, https://substackcdn.com/image/fetch/$s_!wSO5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F532665f5-8c67-4a19-9181-a2f39154f1f4_59x62.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wSO5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F532665f5-8c67-4a19-9181-a2f39154f1f4_59x62.png" width="59" height="62" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/532665f5-8c67-4a19-9181-a2f39154f1f4_59x62.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:62,&quot;width&quot;:59,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1022,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F532665f5-8c67-4a19-9181-a2f39154f1f4_59x62.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!wSO5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F532665f5-8c67-4a19-9181-a2f39154f1f4_59x62.png 424w, https://substackcdn.com/image/fetch/$s_!wSO5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F532665f5-8c67-4a19-9181-a2f39154f1f4_59x62.png 848w, https://substackcdn.com/image/fetch/$s_!wSO5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F532665f5-8c67-4a19-9181-a2f39154f1f4_59x62.png 1272w, https://substackcdn.com/image/fetch/$s_!wSO5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F532665f5-8c67-4a19-9181-a2f39154f1f4_59x62.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>is 4096. The term</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ENcG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb93ce932-a6e7-4c76-a8a0-a61e562f0657_138x57.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ENcG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb93ce932-a6e7-4c76-a8a0-a61e562f0657_138x57.png 424w, https://substackcdn.com/image/fetch/$s_!ENcG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb93ce932-a6e7-4c76-a8a0-a61e562f0657_138x57.png 848w, https://substackcdn.com/image/fetch/$s_!ENcG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb93ce932-a6e7-4c76-a8a0-a61e562f0657_138x57.png 1272w, https://substackcdn.com/image/fetch/$s_!ENcG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb93ce932-a6e7-4c76-a8a0-a61e562f0657_138x57.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ENcG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb93ce932-a6e7-4c76-a8a0-a61e562f0657_138x57.png" width="138" height="57" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b93ce932-a6e7-4c76-a8a0-a61e562f0657_138x57.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:57,&quot;width&quot;:138,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2881,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb93ce932-a6e7-4c76-a8a0-a61e562f0657_138x57.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ENcG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb93ce932-a6e7-4c76-a8a0-a61e562f0657_138x57.png 424w, https://substackcdn.com/image/fetch/$s_!ENcG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb93ce932-a6e7-4c76-a8a0-a61e562f0657_138x57.png 848w, https://substackcdn.com/image/fetch/$s_!ENcG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb93ce932-a6e7-4c76-a8a0-a61e562f0657_138x57.png 1272w, https://substackcdn.com/image/fetch/$s_!ENcG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb93ce932-a6e7-4c76-a8a0-a61e562f0657_138x57.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>is 0.0625. Multiplying them gives 256. This 256:1 likelihood ratio is enormous; once you also fold in the prior ratio of</p><p>0.60/0.40=1.5<br>you get 384. The posterior is</p><p>384/(1+384)&#8776;0.9974.</p><p>Hence the large posterior.</p><h2><strong>Potential Pitfalls in Real-World Applications</strong></h2><p>Many interviewers will dig deeper into practical complications:</p><p>&#8226; Overfitting to Rater Feedback: Real watchers might differ systematically from in-house raters, leading to posterior overconfidence if the in-house ratings are not representative of the broader population.</p><p>&#8226; Beta-Binomial Conjugate Prior: If you had an underlying Beta prior for the &#8220;like&#8221; rate rather than a discrete hypothesis (hit vs. miss), you would do Bayesian updating on the continuous distribution. This can be more flexible but requires more advanced posterior calculations.</p><p>&#8226; Non-Binary or Contextual Aspects of &#8220;Like&#8221;: Sometimes a show might have partial likes, neutral opinions, or other forms of feedback not captured by a simple yes/no. This can complicate modeling and might require a more nuanced approach.</p><p>Regardless, in a simple discrete &#8220;hit vs. miss&#8221; scenario with independence and known probabilities of likes for each category, Bayesian updating with binomial likelihoods is straightforward. The final posterior of about 99.74% that the show is a hit indicates a very high belief after seeing 6 out of 8 raters liking it.</p><h2><strong>How Would One Implement This in a Real System?</strong></h2><p>A direct extension is:</p><p>&#8226; Define a discrete set of categories (e.g., &#8220;Likely a flop,&#8221; &#8220;Likely moderate,&#8221; &#8220;Likely a success,&#8221; &#8220;Likely a runaway hit&#8221;), each with a different prior and different probability of any individual liking the show. &#8226; As rater feedback arrives, multiply the prior for each category by the observed binomial likelihood, then normalize to get a new posterior distribution over categories. &#8226; Switch from discrete categories to a continuous prior, such as a Beta distribution for the &#8220;like&#8221; probability, so you can more flexibly handle uncertainty and update as more data comes in.</p><p>In standard data pipelines, you could keep a record of the number of likes and dislikes among internal screenings, then compute real-time posterior probabilities for different performance tiers.</p><h2><strong>Edge Cases: Very Few Raters or Very Many Raters</strong></h2><p>Another subtle area an interviewer might explore:</p><p>&#8226; If only 1 or 2 raters watched the show, the posterior might be highly sensitive and not very reliable. For example, if just 1 person rated it and they liked it, the posterior for &#8220;hit&#8221; would shift somewhat, but not too drastically because the data is meager. &#8226; If a very large number of raters have seen the show, the law of large numbers takes over. If the show&#8217;s true &#8220;like&#8221; probability is near 0.80, observing a proportion near 0.80 is highly likely, and your posterior that it is in fact a &#8220;hit&#8221; becomes extremely high, overshadowing the small chance that it&#8217;s a miss.</p><h2><strong>Conclusion of the Main Question</strong></h2><p>The posterior probability that the show is a hit, after observing 6 out of 8 raters like it, is approximately 99.74%. This result comes from the relatively large difference between the two likelihood models (80% vs. 20%) and the prior belief that already leans slightly in favor of &#8220;hit&#8221; (0.60).</p><div><hr></div><h2><strong>Below are additional follow-up questions</strong></h2><h2><strong>How would you handle a scenario where each rater has a different probability of liking the show, rather than a single 80% or 20%?</strong></h2><p>In practice, not all raters are alike. Some might be more generous, and others more critical. The original calculation assumes a single fixed probability of liking (80% or 20%) across all 8 raters. If we suspect that each rater could have their own intrinsic bias, we need a different modeling approach.</p><p>A common technique is to assume each rater has a latent parameter that affects their likelihood of enjoying any given show. You could have a distribution over individual biases and then integrate out those biases in your Bayesian update. For a &#8220;hit&#8221; show, maybe the average like probability is high, but each rater&#8217;s personal taste might modulate that baseline probability. Similarly, for a &#8220;miss&#8221; show, you might have a low baseline that is again modulated by individual rater differences.</p><p>In a very simple extension, let</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_Nf_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb59d8c6-d97c-41ca-bcf2-cc234fadd802_59x55.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_Nf_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb59d8c6-d97c-41ca-bcf2-cc234fadd802_59x55.png 424w, https://substackcdn.com/image/fetch/$s_!_Nf_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb59d8c6-d97c-41ca-bcf2-cc234fadd802_59x55.png 848w, https://substackcdn.com/image/fetch/$s_!_Nf_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb59d8c6-d97c-41ca-bcf2-cc234fadd802_59x55.png 1272w, https://substackcdn.com/image/fetch/$s_!_Nf_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb59d8c6-d97c-41ca-bcf2-cc234fadd802_59x55.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_Nf_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb59d8c6-d97c-41ca-bcf2-cc234fadd802_59x55.png" width="59" height="55" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cb59d8c6-d97c-41ca-bcf2-cc234fadd802_59x55.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:55,&quot;width&quot;:59,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1052,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb59d8c6-d97c-41ca-bcf2-cc234fadd802_59x55.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_Nf_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb59d8c6-d97c-41ca-bcf2-cc234fadd802_59x55.png 424w, https://substackcdn.com/image/fetch/$s_!_Nf_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb59d8c6-d97c-41ca-bcf2-cc234fadd802_59x55.png 848w, https://substackcdn.com/image/fetch/$s_!_Nf_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb59d8c6-d97c-41ca-bcf2-cc234fadd802_59x55.png 1272w, https://substackcdn.com/image/fetch/$s_!_Nf_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb59d8c6-d97c-41ca-bcf2-cc234fadd802_59x55.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>be the probability that rater</p><p>i</p><p>will like the show if it is a hit, and let</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OgDr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F901ea527-7180-41cf-b3d7-d120fafe01f5_65x47.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OgDr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F901ea527-7180-41cf-b3d7-d120fafe01f5_65x47.png 424w, https://substackcdn.com/image/fetch/$s_!OgDr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F901ea527-7180-41cf-b3d7-d120fafe01f5_65x47.png 848w, https://substackcdn.com/image/fetch/$s_!OgDr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F901ea527-7180-41cf-b3d7-d120fafe01f5_65x47.png 1272w, https://substackcdn.com/image/fetch/$s_!OgDr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F901ea527-7180-41cf-b3d7-d120fafe01f5_65x47.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OgDr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F901ea527-7180-41cf-b3d7-d120fafe01f5_65x47.png" width="65" height="47" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/901ea527-7180-41cf-b3d7-d120fafe01f5_65x47.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:47,&quot;width&quot;:65,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1002,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F901ea527-7180-41cf-b3d7-d120fafe01f5_65x47.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!OgDr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F901ea527-7180-41cf-b3d7-d120fafe01f5_65x47.png 424w, https://substackcdn.com/image/fetch/$s_!OgDr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F901ea527-7180-41cf-b3d7-d120fafe01f5_65x47.png 848w, https://substackcdn.com/image/fetch/$s_!OgDr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F901ea527-7180-41cf-b3d7-d120fafe01f5_65x47.png 1272w, https://substackcdn.com/image/fetch/$s_!OgDr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F901ea527-7180-41cf-b3d7-d120fafe01f5_65x47.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>be the probability that rater</p><p>i</p><p>will like the show if it is a miss. To update the probability of the show being a hit, you would compute the product over all observed ratings:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fept!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8e278357-69f9-43e1-bb05-021b9073b889_1063x216.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fept!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8e278357-69f9-43e1-bb05-021b9073b889_1063x216.png 424w, https://substackcdn.com/image/fetch/$s_!fept!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8e278357-69f9-43e1-bb05-021b9073b889_1063x216.png 848w, https://substackcdn.com/image/fetch/$s_!fept!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8e278357-69f9-43e1-bb05-021b9073b889_1063x216.png 1272w, https://substackcdn.com/image/fetch/$s_!fept!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8e278357-69f9-43e1-bb05-021b9073b889_1063x216.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fept!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8e278357-69f9-43e1-bb05-021b9073b889_1063x216.png" width="1063" height="216" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8e278357-69f9-43e1-bb05-021b9073b889_1063x216.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:216,&quot;width&quot;:1063,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:22846,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8e278357-69f9-43e1-bb05-021b9073b889_1063x216.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!fept!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8e278357-69f9-43e1-bb05-021b9073b889_1063x216.png 424w, https://substackcdn.com/image/fetch/$s_!fept!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8e278357-69f9-43e1-bb05-021b9073b889_1063x216.png 848w, https://substackcdn.com/image/fetch/$s_!fept!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8e278357-69f9-43e1-bb05-021b9073b889_1063x216.png 1272w, https://substackcdn.com/image/fetch/$s_!fept!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8e278357-69f9-43e1-bb05-021b9073b889_1063x216.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>where</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!KIiM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20f3d9a5-ae6b-4ccb-8cfa-969b26a6bf58_111x53.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!KIiM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20f3d9a5-ae6b-4ccb-8cfa-969b26a6bf58_111x53.png 424w, https://substackcdn.com/image/fetch/$s_!KIiM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20f3d9a5-ae6b-4ccb-8cfa-969b26a6bf58_111x53.png 848w, https://substackcdn.com/image/fetch/$s_!KIiM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20f3d9a5-ae6b-4ccb-8cfa-969b26a6bf58_111x53.png 1272w, https://substackcdn.com/image/fetch/$s_!KIiM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20f3d9a5-ae6b-4ccb-8cfa-969b26a6bf58_111x53.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!KIiM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20f3d9a5-ae6b-4ccb-8cfa-969b26a6bf58_111x53.png" width="111" height="53" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/20f3d9a5-ae6b-4ccb-8cfa-969b26a6bf58_111x53.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:53,&quot;width&quot;:111,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1830,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20f3d9a5-ae6b-4ccb-8cfa-969b26a6bf58_111x53.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!KIiM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20f3d9a5-ae6b-4ccb-8cfa-969b26a6bf58_111x53.png 424w, https://substackcdn.com/image/fetch/$s_!KIiM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20f3d9a5-ae6b-4ccb-8cfa-969b26a6bf58_111x53.png 848w, https://substackcdn.com/image/fetch/$s_!KIiM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20f3d9a5-ae6b-4ccb-8cfa-969b26a6bf58_111x53.png 1272w, https://substackcdn.com/image/fetch/$s_!KIiM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20f3d9a5-ae6b-4ccb-8cfa-969b26a6bf58_111x53.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>is 1 if rater</p><p>i</p><p>liked it, and 0 otherwise. An analogous expression applies for &#8220;miss,&#8221; using</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oSkQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd66fbb05-e448-4081-927e-08175912f45e_66x55.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oSkQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd66fbb05-e448-4081-927e-08175912f45e_66x55.png 424w, https://substackcdn.com/image/fetch/$s_!oSkQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd66fbb05-e448-4081-927e-08175912f45e_66x55.png 848w, https://substackcdn.com/image/fetch/$s_!oSkQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd66fbb05-e448-4081-927e-08175912f45e_66x55.png 1272w, https://substackcdn.com/image/fetch/$s_!oSkQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd66fbb05-e448-4081-927e-08175912f45e_66x55.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oSkQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd66fbb05-e448-4081-927e-08175912f45e_66x55.png" width="66" height="55" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d66fbb05-e448-4081-927e-08175912f45e_66x55.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:55,&quot;width&quot;:66,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1029,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd66fbb05-e448-4081-927e-08175912f45e_66x55.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!oSkQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd66fbb05-e448-4081-927e-08175912f45e_66x55.png 424w, https://substackcdn.com/image/fetch/$s_!oSkQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd66fbb05-e448-4081-927e-08175912f45e_66x55.png 848w, https://substackcdn.com/image/fetch/$s_!oSkQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd66fbb05-e448-4081-927e-08175912f45e_66x55.png 1272w, https://substackcdn.com/image/fetch/$s_!oSkQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd66fbb05-e448-4081-927e-08175912f45e_66x55.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>. With these likelihoods multiplied by the priors, you would normalize to get the posterior.</p><p>However, if the set of probabilities</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1NXY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa5badf0-9710-47b4-8a44-b3d71a5d5393_58x50.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1NXY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa5badf0-9710-47b4-8a44-b3d71a5d5393_58x50.png 424w, https://substackcdn.com/image/fetch/$s_!1NXY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa5badf0-9710-47b4-8a44-b3d71a5d5393_58x50.png 848w, https://substackcdn.com/image/fetch/$s_!1NXY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa5badf0-9710-47b4-8a44-b3d71a5d5393_58x50.png 1272w, https://substackcdn.com/image/fetch/$s_!1NXY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa5badf0-9710-47b4-8a44-b3d71a5d5393_58x50.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1NXY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa5badf0-9710-47b4-8a44-b3d71a5d5393_58x50.png" width="58" height="50" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa5badf0-9710-47b4-8a44-b3d71a5d5393_58x50.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:50,&quot;width&quot;:58,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1054,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa5badf0-9710-47b4-8a44-b3d71a5d5393_58x50.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!1NXY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa5badf0-9710-47b4-8a44-b3d71a5d5393_58x50.png 424w, https://substackcdn.com/image/fetch/$s_!1NXY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa5badf0-9710-47b4-8a44-b3d71a5d5393_58x50.png 848w, https://substackcdn.com/image/fetch/$s_!1NXY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa5badf0-9710-47b4-8a44-b3d71a5d5393_58x50.png 1272w, https://substackcdn.com/image/fetch/$s_!1NXY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa5badf0-9710-47b4-8a44-b3d71a5d5393_58x50.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>and</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mDCo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b21fd15-5771-4988-9067-d60eac8f8105_78x51.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mDCo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b21fd15-5771-4988-9067-d60eac8f8105_78x51.png 424w, https://substackcdn.com/image/fetch/$s_!mDCo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b21fd15-5771-4988-9067-d60eac8f8105_78x51.png 848w, https://substackcdn.com/image/fetch/$s_!mDCo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b21fd15-5771-4988-9067-d60eac8f8105_78x51.png 1272w, https://substackcdn.com/image/fetch/$s_!mDCo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b21fd15-5771-4988-9067-d60eac8f8105_78x51.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mDCo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b21fd15-5771-4988-9067-d60eac8f8105_78x51.png" width="78" height="51" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0b21fd15-5771-4988-9067-d60eac8f8105_78x51.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:51,&quot;width&quot;:78,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1044,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b21fd15-5771-4988-9067-d60eac8f8105_78x51.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!mDCo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b21fd15-5771-4988-9067-d60eac8f8105_78x51.png 424w, https://substackcdn.com/image/fetch/$s_!mDCo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b21fd15-5771-4988-9067-d60eac8f8105_78x51.png 848w, https://substackcdn.com/image/fetch/$s_!mDCo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b21fd15-5771-4988-9067-d60eac8f8105_78x51.png 1272w, https://substackcdn.com/image/fetch/$s_!mDCo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b21fd15-5771-4988-9067-d60eac8f8105_78x51.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>is not known upfront, you may need a hierarchical Bayesian model to learn or infer them. This can become more computationally intensive, but it is often more realistic for real-world use cases.</p><p>A potential pitfall is overfitting the rater-specific probabilities if you have very few ratings per rater. In that case, you might place a prior on</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!h3gl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53badb84-a16e-4c9b-9294-02f2a68a7776_69x53.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!h3gl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53badb84-a16e-4c9b-9294-02f2a68a7776_69x53.png 424w, https://substackcdn.com/image/fetch/$s_!h3gl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53badb84-a16e-4c9b-9294-02f2a68a7776_69x53.png 848w, https://substackcdn.com/image/fetch/$s_!h3gl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53badb84-a16e-4c9b-9294-02f2a68a7776_69x53.png 1272w, https://substackcdn.com/image/fetch/$s_!h3gl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53badb84-a16e-4c9b-9294-02f2a68a7776_69x53.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!h3gl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53badb84-a16e-4c9b-9294-02f2a68a7776_69x53.png" width="69" height="53" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/53badb84-a16e-4c9b-9294-02f2a68a7776_69x53.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:53,&quot;width&quot;:69,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1101,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53badb84-a16e-4c9b-9294-02f2a68a7776_69x53.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!h3gl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53badb84-a16e-4c9b-9294-02f2a68a7776_69x53.png 424w, https://substackcdn.com/image/fetch/$s_!h3gl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53badb84-a16e-4c9b-9294-02f2a68a7776_69x53.png 848w, https://substackcdn.com/image/fetch/$s_!h3gl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53badb84-a16e-4c9b-9294-02f2a68a7776_69x53.png 1272w, https://substackcdn.com/image/fetch/$s_!h3gl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53badb84-a16e-4c9b-9294-02f2a68a7776_69x53.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>and</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ArYS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29d0d591-e85d-4c10-990a-0e870983cae7_61x48.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ArYS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29d0d591-e85d-4c10-990a-0e870983cae7_61x48.png 424w, https://substackcdn.com/image/fetch/$s_!ArYS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29d0d591-e85d-4c10-990a-0e870983cae7_61x48.png 848w, https://substackcdn.com/image/fetch/$s_!ArYS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29d0d591-e85d-4c10-990a-0e870983cae7_61x48.png 1272w, https://substackcdn.com/image/fetch/$s_!ArYS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29d0d591-e85d-4c10-990a-0e870983cae7_61x48.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ArYS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29d0d591-e85d-4c10-990a-0e870983cae7_61x48.png" width="61" height="48" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/29d0d591-e85d-4c10-990a-0e870983cae7_61x48.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:48,&quot;width&quot;:61,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:976,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29d0d591-e85d-4c10-990a-0e870983cae7_61x48.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ArYS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29d0d591-e85d-4c10-990a-0e870983cae7_61x48.png 424w, https://substackcdn.com/image/fetch/$s_!ArYS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29d0d591-e85d-4c10-990a-0e870983cae7_61x48.png 848w, https://substackcdn.com/image/fetch/$s_!ArYS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29d0d591-e85d-4c10-990a-0e870983cae7_61x48.png 1272w, https://substackcdn.com/image/fetch/$s_!ArYS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29d0d591-e85d-4c10-990a-0e870983cae7_61x48.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>(for instance, a Beta distribution) and do partial pooling to avoid extreme estimates. This ensures you do not become overconfident about a rater&#8217;s preferences based on too few data points.</p><h2><strong>How would the posterior change if we allow for correlations between raters&#8217; opinions?</strong></h2><p>The standard binomial-based Bayesian approach relies on the independence assumption: each rater&#8217;s like or dislike is assumed independent given the show&#8217;s true status (hit or miss). But in many real settings, if a show receives a positive review from a respected rater, others might be influenced.</p><p>When ratings are correlated, the likelihood factorization that underlies the binomial expression no longer holds. If two or more raters have correlated opinions, you cannot simply multiply the probabilities independently. You must account for the joint distribution of the ratings.</p><p>A possible modeling approach for correlation is to assume a latent variable capturing &#8220;general sentiment&#8221; among raters. Then each rater&#8217;s response is partially driven by this shared sentiment. That might require specifying or learning the correlation structure, such as a covariance matrix in a multivariate probit or logistic framework. With 8 raters, a full correlation matrix has many parameters. More commonly, you might assume a single correlation parameter that captures a tendency for raters to move together.</p><p>A major pitfall is that naive models that ignore correlation will overestimate the certainty of the posterior. If most raters are in agreement (like in the scenario of 6 out of 8 liking the show), correlated models might find that it&#8217;s not as strong of an indicator if those raters were heavily influencing each other. This can reduce the posterior probability of the show being a hit compared to the simpler independent assumption.</p><h2><strong>How would you modify the approach if the show can be in more than two states, for example &#8220;blockbuster,&#8221; &#8220;moderate hit,&#8221; or &#8220;miss&#8221;?</strong></h2><p>When you expand beyond two discrete categories, you extend the same Bayesian logic but over multiple hypotheses. Let&#8217;s say there are three categories: &#8220;blockbuster&#8221; (e.g., 90% chance viewers like it), &#8220;moderate&#8221; (50% chance), and &#8220;miss&#8221; (20% chance). You also have a prior distribution over these three categories (for instance, 20%, 40%, 40%).</p><p>You would compute a likelihood for each category. For &#8220;blockbuster,&#8221; you use the probability that exactly 6 out of 8 liked it under a 90% success chance. For &#8220;moderate,&#8221; you use 50%, and for &#8220;miss,&#8221; 20%. Each is a binomial expression:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!g2Fs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc535f6c7-30c0-41dc-b070-3156d713c5e4_867x197.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!g2Fs!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc535f6c7-30c0-41dc-b070-3156d713c5e4_867x197.png 424w, https://substackcdn.com/image/fetch/$s_!g2Fs!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc535f6c7-30c0-41dc-b070-3156d713c5e4_867x197.png 848w, https://substackcdn.com/image/fetch/$s_!g2Fs!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc535f6c7-30c0-41dc-b070-3156d713c5e4_867x197.png 1272w, https://substackcdn.com/image/fetch/$s_!g2Fs!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc535f6c7-30c0-41dc-b070-3156d713c5e4_867x197.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!g2Fs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc535f6c7-30c0-41dc-b070-3156d713c5e4_867x197.png" width="867" height="197" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c535f6c7-30c0-41dc-b070-3156d713c5e4_867x197.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:197,&quot;width&quot;:867,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:21645,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc535f6c7-30c0-41dc-b070-3156d713c5e4_867x197.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!g2Fs!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc535f6c7-30c0-41dc-b070-3156d713c5e4_867x197.png 424w, https://substackcdn.com/image/fetch/$s_!g2Fs!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc535f6c7-30c0-41dc-b070-3156d713c5e4_867x197.png 848w, https://substackcdn.com/image/fetch/$s_!g2Fs!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc535f6c7-30c0-41dc-b070-3156d713c5e4_867x197.png 1272w, https://substackcdn.com/image/fetch/$s_!g2Fs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc535f6c7-30c0-41dc-b070-3156d713c5e4_867x197.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>where</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Sc8Q!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cbfcb39-e8ec-437d-9dff-d3f813edfdb2_49x56.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Sc8Q!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cbfcb39-e8ec-437d-9dff-d3f813edfdb2_49x56.png 424w, https://substackcdn.com/image/fetch/$s_!Sc8Q!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cbfcb39-e8ec-437d-9dff-d3f813edfdb2_49x56.png 848w, https://substackcdn.com/image/fetch/$s_!Sc8Q!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cbfcb39-e8ec-437d-9dff-d3f813edfdb2_49x56.png 1272w, https://substackcdn.com/image/fetch/$s_!Sc8Q!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cbfcb39-e8ec-437d-9dff-d3f813edfdb2_49x56.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Sc8Q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cbfcb39-e8ec-437d-9dff-d3f813edfdb2_49x56.png" width="49" height="56" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7cbfcb39-e8ec-437d-9dff-d3f813edfdb2_49x56.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:56,&quot;width&quot;:49,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1163,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cbfcb39-e8ec-437d-9dff-d3f813edfdb2_49x56.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Sc8Q!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cbfcb39-e8ec-437d-9dff-d3f813edfdb2_49x56.png 424w, https://substackcdn.com/image/fetch/$s_!Sc8Q!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cbfcb39-e8ec-437d-9dff-d3f813edfdb2_49x56.png 848w, https://substackcdn.com/image/fetch/$s_!Sc8Q!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cbfcb39-e8ec-437d-9dff-d3f813edfdb2_49x56.png 1272w, https://substackcdn.com/image/fetch/$s_!Sc8Q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cbfcb39-e8ec-437d-9dff-d3f813edfdb2_49x56.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>is the &#8220;like&#8221; probability for category</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!th6S!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe48ed0fa-99f8-4578-b9a9-e8c5c02df86c_61x51.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!th6S!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe48ed0fa-99f8-4578-b9a9-e8c5c02df86c_61x51.png 424w, https://substackcdn.com/image/fetch/$s_!th6S!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe48ed0fa-99f8-4578-b9a9-e8c5c02df86c_61x51.png 848w, https://substackcdn.com/image/fetch/$s_!th6S!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe48ed0fa-99f8-4578-b9a9-e8c5c02df86c_61x51.png 1272w, https://substackcdn.com/image/fetch/$s_!th6S!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe48ed0fa-99f8-4578-b9a9-e8c5c02df86c_61x51.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!th6S!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe48ed0fa-99f8-4578-b9a9-e8c5c02df86c_61x51.png" width="61" height="51" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e48ed0fa-99f8-4578-b9a9-e8c5c02df86c_61x51.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:51,&quot;width&quot;:61,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1180,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe48ed0fa-99f8-4578-b9a9-e8c5c02df86c_61x51.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!th6S!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe48ed0fa-99f8-4578-b9a9-e8c5c02df86c_61x51.png 424w, https://substackcdn.com/image/fetch/$s_!th6S!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe48ed0fa-99f8-4578-b9a9-e8c5c02df86c_61x51.png 848w, https://substackcdn.com/image/fetch/$s_!th6S!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe48ed0fa-99f8-4578-b9a9-e8c5c02df86c_61x51.png 1272w, https://substackcdn.com/image/fetch/$s_!th6S!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe48ed0fa-99f8-4578-b9a9-e8c5c02df86c_61x51.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>. Multiply by the respective prior and normalize among all three categories to get your posteriors. The main difference from the two-category scenario is that the denominator in the posterior expression extends to sum the products of prior and likelihood for all categories.</p><p>A subtle pitfall here is that you need good calibrations of these different &#8220;like&#8221; probabilities for each category, and good priors for how often each category occurs. If your categories are poorly defined or your priors are not realistic (e.g., you assume a 50% prior on &#8220;blockbuster&#8221;), you can end up with nonsensical posterior results. Always check your categories and calibrate them properly from historical data.</p><h2><strong>How could we incorporate the length or complexity of the show&#8217;s content into this Bayesian framework?</strong></h2><p>Sometimes, the probability a viewer likes a show might depend on factors like the show&#8217;s length or complexity. A short, easily digestible show might have a higher or lower probability of being liked than a longer, more niche show. The simple model we used is static: either 80% (hit) or 20% (miss). To incorporate show-specific characteristics, you can build a logistic regression or another parametric function that outputs the probability of a viewer liking the show given specific features: cast, genre, length, etc.</p><p>For instance, define a parameter</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tBEW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69d1d99b-c1f8-4154-8d23-72c2652ad6ca_82x66.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tBEW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69d1d99b-c1f8-4154-8d23-72c2652ad6ca_82x66.png 424w, https://substackcdn.com/image/fetch/$s_!tBEW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69d1d99b-c1f8-4154-8d23-72c2652ad6ca_82x66.png 848w, https://substackcdn.com/image/fetch/$s_!tBEW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69d1d99b-c1f8-4154-8d23-72c2652ad6ca_82x66.png 1272w, https://substackcdn.com/image/fetch/$s_!tBEW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69d1d99b-c1f8-4154-8d23-72c2652ad6ca_82x66.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tBEW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69d1d99b-c1f8-4154-8d23-72c2652ad6ca_82x66.png" width="82" height="66" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/69d1d99b-c1f8-4154-8d23-72c2652ad6ca_82x66.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:66,&quot;width&quot;:82,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1445,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69d1d99b-c1f8-4154-8d23-72c2652ad6ca_82x66.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!tBEW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69d1d99b-c1f8-4154-8d23-72c2652ad6ca_82x66.png 424w, https://substackcdn.com/image/fetch/$s_!tBEW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69d1d99b-c1f8-4154-8d23-72c2652ad6ca_82x66.png 848w, https://substackcdn.com/image/fetch/$s_!tBEW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69d1d99b-c1f8-4154-8d23-72c2652ad6ca_82x66.png 1272w, https://substackcdn.com/image/fetch/$s_!tBEW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69d1d99b-c1f8-4154-8d23-72c2652ad6ca_82x66.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>that captures the baseline log-odds of liking the show, plus additional parameters</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_vcr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0ce0731-7359-44a3-bfe0-bcaf29a0cdea_162x58.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_vcr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0ce0731-7359-44a3-bfe0-bcaf29a0cdea_162x58.png 424w, https://substackcdn.com/image/fetch/$s_!_vcr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0ce0731-7359-44a3-bfe0-bcaf29a0cdea_162x58.png 848w, https://substackcdn.com/image/fetch/$s_!_vcr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0ce0731-7359-44a3-bfe0-bcaf29a0cdea_162x58.png 1272w, https://substackcdn.com/image/fetch/$s_!_vcr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0ce0731-7359-44a3-bfe0-bcaf29a0cdea_162x58.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_vcr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0ce0731-7359-44a3-bfe0-bcaf29a0cdea_162x58.png" width="162" height="58" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c0ce0731-7359-44a3-bfe0-bcaf29a0cdea_162x58.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:58,&quot;width&quot;:162,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2635,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0ce0731-7359-44a3-bfe0-bcaf29a0cdea_162x58.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_vcr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0ce0731-7359-44a3-bfe0-bcaf29a0cdea_162x58.png 424w, https://substackcdn.com/image/fetch/$s_!_vcr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0ce0731-7359-44a3-bfe0-bcaf29a0cdea_162x58.png 848w, https://substackcdn.com/image/fetch/$s_!_vcr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0ce0731-7359-44a3-bfe0-bcaf29a0cdea_162x58.png 1272w, https://substackcdn.com/image/fetch/$s_!_vcr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0ce0731-7359-44a3-bfe0-bcaf29a0cdea_162x58.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>for different features. Then for each rater, the probability of liking the show is computed as:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Eiyo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7fb3f5-df2e-44ff-846c-6db43cb61fb0_696x155.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Eiyo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7fb3f5-df2e-44ff-846c-6db43cb61fb0_696x155.png 424w, https://substackcdn.com/image/fetch/$s_!Eiyo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7fb3f5-df2e-44ff-846c-6db43cb61fb0_696x155.png 848w, https://substackcdn.com/image/fetch/$s_!Eiyo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7fb3f5-df2e-44ff-846c-6db43cb61fb0_696x155.png 1272w, https://substackcdn.com/image/fetch/$s_!Eiyo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7fb3f5-df2e-44ff-846c-6db43cb61fb0_696x155.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Eiyo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7fb3f5-df2e-44ff-846c-6db43cb61fb0_696x155.png" width="696" height="155" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5c7fb3f5-df2e-44ff-846c-6db43cb61fb0_696x155.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:155,&quot;width&quot;:696,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:10112,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7fb3f5-df2e-44ff-846c-6db43cb61fb0_696x155.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Eiyo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7fb3f5-df2e-44ff-846c-6db43cb61fb0_696x155.png 424w, https://substackcdn.com/image/fetch/$s_!Eiyo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7fb3f5-df2e-44ff-846c-6db43cb61fb0_696x155.png 848w, https://substackcdn.com/image/fetch/$s_!Eiyo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7fb3f5-df2e-44ff-846c-6db43cb61fb0_696x155.png 1272w, https://substackcdn.com/image/fetch/$s_!Eiyo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c7fb3f5-df2e-44ff-846c-6db43cb61fb0_696x155.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>where</p><p>&#963;(&#8901;)</p><p>is the sigmoid (logistic) function. You can do Bayesian inference on these parameters if you have a prior on them, or you can do a maximum-likelihood approach first and then refine with a Bayesian update. The posterior probability that &#8220;the show will be liked by a random viewer&#8221; is then integrated or averaged over uncertain parameters.</p><p>A potential pitfall is over-parameterizing the model with too many show-specific features relative to the number of raters you have. If 8 raters watch a show with a large number of features in your logistic model, you might not have enough data to reliably learn each parameter. That can lead to wide posterior intervals and a less certain classification.</p><h2><strong>How would you address the situation where some raters only watched a partial cut of the show or were distracted?</strong></h2><p>If your 8 raters did not all watch the same final cut or some were not paying full attention, their decisions to like or dislike might differ systematically from that of typical viewers. In Bayesian terms, the &#8220;likelihood&#8221; part of your update is no longer purely about an 80% or 20% chance of liking the show; it might be 80% for raters who watch the full version but unknown (and probably lower) for partial watchers.</p><p>You can address this by splitting your raters into separate groups based on the conditions under which they watched the show, each with its own probability of liking. For instance, if half the raters watched the final version and half an early rough cut, you could model:</p><p>&#8226; Probability of liking the final cut if show is a hit: 0.80 &#8226; Probability of liking the early cut if show is a hit: maybe slightly lower, such as 0.70, if that rough cut is not as polished</p><p>Similarly for a miss scenario:</p><p>&#8226; Probability of liking the final cut if show is a miss: 0.20 &#8226; Probability of liking the early cut if show is a miss: maybe 0.15 or 0.25, depending on assumptions</p><p>You then multiply out the correct probabilities for each subgroup. The main pitfall is incorrectly assigning the probabilities for partial watchers. If you overestimate how close partial watchers&#8217; experiences are to the final version, you might artificially inflate or deflate your posterior for &#8220;hit.&#8221; This is why in real production analytics, controlling or standardizing the environment is crucial.</p><h2><strong>How might the posterior probability shift if we had a significant marketing campaign influencing the raters?</strong></h2><p>If in-house raters are exposed to marketing hype or the show is heavily promoted, there is a psychological bias that might inflate the likelihood of them saying they &#8220;like&#8221; it. In Bayesian terms, this means that the observed 6 out of 8 likes might not directly correspond to a true 80% preference probability in the general population. Instead, it could be artificially inflated due to hype.</p><p>A way to handle this is to adjust your model or prior to reflect that rater opinions might be systematically higher than the true average. For example, if your marketing is particularly strong, you might guess that if the show is a &#8220;true hit&#8221; for the general population with a real like probability of 80%, your in-house group might like it at 85%. If the show is a &#8220;true miss&#8221; at 20%, your in-house group might still like it at 25%. These adjustments shift your likelihoods upward for the in-house raters, so your final posterior will be more conservative about calling it a hit for the general audience.</p><p>The major pitfall is quantifying how big this marketing effect is. If you guess incorrectly, your posterior could either be too high or too low. Gathering data from a small subset of raters who are not exposed to the hype can help calibrate these adjustments.</p><h2><strong>What if we want to incorporate the cost of misclassifying a miss as a hit and vice versa?</strong></h2><p>Up until now, we have treated the posterior probability as the final number we care about. However, in a real production scenario, the cost of taking a show to a large release if it&#8217;s truly a miss could be large, and the cost of rejecting a show that could be a hit is also significant. Bayesian decision theory tells us we should combine the posterior probabilities with the costs (or payoffs) associated with each decision (e.g., green-light the show for a big release, test it further, or shelve it).</p><p>After you have the posterior</p><p>P(Hit&#8739;data)<br>, define a utility or cost function:</p><p>&#8226;</p><p>C(H_predicted=1,H_true=0)</p><p>is the cost of a false positive (promoting a show that is actually a miss). &#8226;</p><p>C(H_predicted=0,H_true=1)</p><p>is the cost of a false negative (not promoting a show that would have been a hit).</p><p>A rational decision would choose to promote the show if the expected cost of that decision is lower than the expected cost of rejecting it. Formally, compute the expected cost for &#8220;promote&#8221; vs. &#8220;reject&#8221;:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Qi51!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac843b01-e06b-463e-96dd-29e04c99d709_1310x85.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Qi51!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac843b01-e06b-463e-96dd-29e04c99d709_1310x85.png 424w, https://substackcdn.com/image/fetch/$s_!Qi51!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac843b01-e06b-463e-96dd-29e04c99d709_1310x85.png 848w, https://substackcdn.com/image/fetch/$s_!Qi51!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac843b01-e06b-463e-96dd-29e04c99d709_1310x85.png 1272w, https://substackcdn.com/image/fetch/$s_!Qi51!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac843b01-e06b-463e-96dd-29e04c99d709_1310x85.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Qi51!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac843b01-e06b-463e-96dd-29e04c99d709_1310x85.png" width="1310" height="85" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ac843b01-e06b-463e-96dd-29e04c99d709_1310x85.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:85,&quot;width&quot;:1310,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:35971,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac843b01-e06b-463e-96dd-29e04c99d709_1310x85.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Qi51!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac843b01-e06b-463e-96dd-29e04c99d709_1310x85.png 424w, https://substackcdn.com/image/fetch/$s_!Qi51!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac843b01-e06b-463e-96dd-29e04c99d709_1310x85.png 848w, https://substackcdn.com/image/fetch/$s_!Qi51!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac843b01-e06b-463e-96dd-29e04c99d709_1310x85.png 1272w, https://substackcdn.com/image/fetch/$s_!Qi51!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac843b01-e06b-463e-96dd-29e04c99d709_1310x85.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Whichever is smaller indicates the optimal decision in a Bayesian decision-theoretic sense. The main pitfall is that quantifying these costs can be challenging. Real-world cost estimates&#8212;marketing budgets, lost opportunities, brand damage&#8212;can be difficult to pin down with confidence, yet they critically change your decision threshold for calling something a &#8220;hit.&#8221;</p><h2><strong>How can the model be adapted if the probability of like for a miss show is not exactly 20%, but uncertain?</strong></h2><p>The original framing uses two fixed probabilities (80% for hit, 20% for miss). But what if the &#8220;miss&#8221; category includes a range of possible like probabilities anywhere from 0% to 40%? You can incorporate uncertainty into these probabilities by placing a prior over</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iRRc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f6bee1e-1c73-425e-8ed7-4639874b17c0_76x58.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iRRc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f6bee1e-1c73-425e-8ed7-4639874b17c0_76x58.png 424w, https://substackcdn.com/image/fetch/$s_!iRRc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f6bee1e-1c73-425e-8ed7-4639874b17c0_76x58.png 848w, https://substackcdn.com/image/fetch/$s_!iRRc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f6bee1e-1c73-425e-8ed7-4639874b17c0_76x58.png 1272w, https://substackcdn.com/image/fetch/$s_!iRRc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f6bee1e-1c73-425e-8ed7-4639874b17c0_76x58.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iRRc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f6bee1e-1c73-425e-8ed7-4639874b17c0_76x58.png" width="76" height="58" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8f6bee1e-1c73-425e-8ed7-4639874b17c0_76x58.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:58,&quot;width&quot;:76,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1446,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f6bee1e-1c73-425e-8ed7-4639874b17c0_76x58.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!iRRc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f6bee1e-1c73-425e-8ed7-4639874b17c0_76x58.png 424w, https://substackcdn.com/image/fetch/$s_!iRRc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f6bee1e-1c73-425e-8ed7-4639874b17c0_76x58.png 848w, https://substackcdn.com/image/fetch/$s_!iRRc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f6bee1e-1c73-425e-8ed7-4639874b17c0_76x58.png 1272w, https://substackcdn.com/image/fetch/$s_!iRRc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f6bee1e-1c73-425e-8ed7-4639874b17c0_76x58.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>and</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!w1WX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74fb311d-cda1-4e79-8637-3de3c82c4f93_103x60.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!w1WX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74fb311d-cda1-4e79-8637-3de3c82c4f93_103x60.png 424w, https://substackcdn.com/image/fetch/$s_!w1WX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74fb311d-cda1-4e79-8637-3de3c82c4f93_103x60.png 848w, https://substackcdn.com/image/fetch/$s_!w1WX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74fb311d-cda1-4e79-8637-3de3c82c4f93_103x60.png 1272w, https://substackcdn.com/image/fetch/$s_!w1WX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74fb311d-cda1-4e79-8637-3de3c82c4f93_103x60.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!w1WX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74fb311d-cda1-4e79-8637-3de3c82c4f93_103x60.png" width="103" height="60" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/74fb311d-cda1-4e79-8637-3de3c82c4f93_103x60.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:60,&quot;width&quot;:103,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1701,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74fb311d-cda1-4e79-8637-3de3c82c4f93_103x60.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!w1WX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74fb311d-cda1-4e79-8637-3de3c82c4f93_103x60.png 424w, https://substackcdn.com/image/fetch/$s_!w1WX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74fb311d-cda1-4e79-8637-3de3c82c4f93_103x60.png 848w, https://substackcdn.com/image/fetch/$s_!w1WX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74fb311d-cda1-4e79-8637-3de3c82c4f93_103x60.png 1272w, https://substackcdn.com/image/fetch/$s_!w1WX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74fb311d-cda1-4e79-8637-3de3c82c4f93_103x60.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>. For instance, you might define:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aK5E!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e4b6dcb-8bf8-409d-89e3-6359eac1ab26_304x198.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aK5E!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e4b6dcb-8bf8-409d-89e3-6359eac1ab26_304x198.png 424w, https://substackcdn.com/image/fetch/$s_!aK5E!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e4b6dcb-8bf8-409d-89e3-6359eac1ab26_304x198.png 848w, https://substackcdn.com/image/fetch/$s_!aK5E!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e4b6dcb-8bf8-409d-89e3-6359eac1ab26_304x198.png 1272w, https://substackcdn.com/image/fetch/$s_!aK5E!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e4b6dcb-8bf8-409d-89e3-6359eac1ab26_304x198.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aK5E!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e4b6dcb-8bf8-409d-89e3-6359eac1ab26_304x198.png" width="304" height="198" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5e4b6dcb-8bf8-409d-89e3-6359eac1ab26_304x198.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:198,&quot;width&quot;:304,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:11794,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e4b6dcb-8bf8-409d-89e3-6359eac1ab26_304x198.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!aK5E!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e4b6dcb-8bf8-409d-89e3-6359eac1ab26_304x198.png 424w, https://substackcdn.com/image/fetch/$s_!aK5E!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e4b6dcb-8bf8-409d-89e3-6359eac1ab26_304x198.png 848w, https://substackcdn.com/image/fetch/$s_!aK5E!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e4b6dcb-8bf8-409d-89e3-6359eac1ab26_304x198.png 1272w, https://substackcdn.com/image/fetch/$s_!aK5E!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e4b6dcb-8bf8-409d-89e3-6359eac1ab26_304x198.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Then, &#8220;hit&#8221; and &#8220;miss&#8221; become distributions rather than single points. If your prior knowledge says that a typical &#8220;hit&#8221; is around 80% but anywhere in 70%&#8211;90% range, you select hyperparameters</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!T1fS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2e3d491-1610-4a7e-a316-ca11fc4471c7_106x60.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!T1fS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2e3d491-1610-4a7e-a316-ca11fc4471c7_106x60.png 424w, https://substackcdn.com/image/fetch/$s_!T1fS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2e3d491-1610-4a7e-a316-ca11fc4471c7_106x60.png 848w, https://substackcdn.com/image/fetch/$s_!T1fS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2e3d491-1610-4a7e-a316-ca11fc4471c7_106x60.png 1272w, https://substackcdn.com/image/fetch/$s_!T1fS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2e3d491-1610-4a7e-a316-ca11fc4471c7_106x60.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!T1fS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2e3d491-1610-4a7e-a316-ca11fc4471c7_106x60.png" width="106" height="60" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b2e3d491-1610-4a7e-a316-ca11fc4471c7_106x60.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:60,&quot;width&quot;:106,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2042,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2e3d491-1610-4a7e-a316-ca11fc4471c7_106x60.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!T1fS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2e3d491-1610-4a7e-a316-ca11fc4471c7_106x60.png 424w, https://substackcdn.com/image/fetch/$s_!T1fS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2e3d491-1610-4a7e-a316-ca11fc4471c7_106x60.png 848w, https://substackcdn.com/image/fetch/$s_!T1fS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2e3d491-1610-4a7e-a316-ca11fc4471c7_106x60.png 1272w, https://substackcdn.com/image/fetch/$s_!T1fS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2e3d491-1610-4a7e-a316-ca11fc4471c7_106x60.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>accordingly. Similarly, if a &#8220;miss&#8221; can vary from 0% to 40%, pick suitable hyperparameters for</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!WvOG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81873100-7c71-4464-859a-eebb5839048c_97x51.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WvOG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81873100-7c71-4464-859a-eebb5839048c_97x51.png 424w, https://substackcdn.com/image/fetch/$s_!WvOG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81873100-7c71-4464-859a-eebb5839048c_97x51.png 848w, https://substackcdn.com/image/fetch/$s_!WvOG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81873100-7c71-4464-859a-eebb5839048c_97x51.png 1272w, https://substackcdn.com/image/fetch/$s_!WvOG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81873100-7c71-4464-859a-eebb5839048c_97x51.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WvOG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81873100-7c71-4464-859a-eebb5839048c_97x51.png" width="97" height="51" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/81873100-7c71-4464-859a-eebb5839048c_97x51.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:51,&quot;width&quot;:97,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1903,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81873100-7c71-4464-859a-eebb5839048c_97x51.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!WvOG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81873100-7c71-4464-859a-eebb5839048c_97x51.png 424w, https://substackcdn.com/image/fetch/$s_!WvOG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81873100-7c71-4464-859a-eebb5839048c_97x51.png 848w, https://substackcdn.com/image/fetch/$s_!WvOG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81873100-7c71-4464-859a-eebb5839048c_97x51.png 1272w, https://substackcdn.com/image/fetch/$s_!WvOG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81873100-7c71-4464-859a-eebb5839048c_97x51.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Upon receiving data (like 6 out of 8 likes), you would update these Beta distributions. The new posterior is something that requires integrating over these distributions for</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uzx5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08cd86dd-6f64-4198-a638-0b2aae69c7ff_88x53.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uzx5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08cd86dd-6f64-4198-a638-0b2aae69c7ff_88x53.png 424w, https://substackcdn.com/image/fetch/$s_!uzx5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08cd86dd-6f64-4198-a638-0b2aae69c7ff_88x53.png 848w, https://substackcdn.com/image/fetch/$s_!uzx5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08cd86dd-6f64-4198-a638-0b2aae69c7ff_88x53.png 1272w, https://substackcdn.com/image/fetch/$s_!uzx5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08cd86dd-6f64-4198-a638-0b2aae69c7ff_88x53.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uzx5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08cd86dd-6f64-4198-a638-0b2aae69c7ff_88x53.png" width="88" height="53" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/08cd86dd-6f64-4198-a638-0b2aae69c7ff_88x53.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:53,&quot;width&quot;:88,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1440,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08cd86dd-6f64-4198-a638-0b2aae69c7ff_88x53.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!uzx5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08cd86dd-6f64-4198-a638-0b2aae69c7ff_88x53.png 424w, https://substackcdn.com/image/fetch/$s_!uzx5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08cd86dd-6f64-4198-a638-0b2aae69c7ff_88x53.png 848w, https://substackcdn.com/image/fetch/$s_!uzx5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08cd86dd-6f64-4198-a638-0b2aae69c7ff_88x53.png 1272w, https://substackcdn.com/image/fetch/$s_!uzx5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08cd86dd-6f64-4198-a638-0b2aae69c7ff_88x53.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>and</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!D7c6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53704207-6459-4909-84e7-01e91f09c9f1_86x57.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!D7c6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53704207-6459-4909-84e7-01e91f09c9f1_86x57.png 424w, https://substackcdn.com/image/fetch/$s_!D7c6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53704207-6459-4909-84e7-01e91f09c9f1_86x57.png 848w, https://substackcdn.com/image/fetch/$s_!D7c6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53704207-6459-4909-84e7-01e91f09c9f1_86x57.png 1272w, https://substackcdn.com/image/fetch/$s_!D7c6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53704207-6459-4909-84e7-01e91f09c9f1_86x57.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!D7c6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53704207-6459-4909-84e7-01e91f09c9f1_86x57.png" width="86" height="57" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/53704207-6459-4909-84e7-01e91f09c9f1_86x57.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:57,&quot;width&quot;:86,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1681,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53704207-6459-4909-84e7-01e91f09c9f1_86x57.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!D7c6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53704207-6459-4909-84e7-01e91f09c9f1_86x57.png 424w, https://substackcdn.com/image/fetch/$s_!D7c6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53704207-6459-4909-84e7-01e91f09c9f1_86x57.png 848w, https://substackcdn.com/image/fetch/$s_!D7c6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53704207-6459-4909-84e7-01e91f09c9f1_86x57.png 1272w, https://substackcdn.com/image/fetch/$s_!D7c6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53704207-6459-4909-84e7-01e91f09c9f1_86x57.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>. This can be done with a small numerical approach or Markov Chain Monte Carlo if you want a more flexible framework.</p><p>A potential pitfall is computational complexity, as the two Beta distributions and the discrete category membership can lead to more elaborate calculations. Still, the payoff is a richer model that acknowledges that &#8220;80%&#8221; or &#8220;20%&#8221; might just be a rough guess, and you let the data refine that guess.</p><h2><strong>How do you handle the situation where only binary like/dislike data isn&#8217;t sufficient (e.g., if raters can provide a rating from 1 to 10)?</strong></h2><p>In many real rating systems, raters give a numeric score or a star rating rather than a simple like/dislike. That means your data is not Bernoulli but rather ordinal or continuous. The simplest extension is to treat the rating as coming from some distribution parameterized differently for a &#8220;hit&#8221; vs. a &#8220;miss.&#8221; For instance, for a &#8220;hit,&#8221; you might assume an average rating of 8 (out of 10) with some variance, and for a &#8220;miss,&#8221; an average rating of 3 with its own variance. Then you can compute the probability of each observed rating under each distribution and multiply them together.</p><p>Alternatively, if the rating is ordinal (like 1 star to 5 stars), you might use an ordinal regression model that ties the latent preference to thresholds in a cumulative distribution. The Bayesian update concept remains the same: you compute</p><p><em>P</em>(Data&#8739;Hit)</p><p>and</p><p>P(Data&#8739;Miss)</p><p>using an appropriate likelihood for the rating type, multiply by the priors, and normalize to get your posterior for &#8220;hit&#8221; or &#8220;miss.&#8221;</p><p>A subtle pitfall is that numeric ratings often come with rater-specific calibration (some people rarely give 10/10, others often do), so you might need rater-specific intercepts or a hierarchical structure. If you ignore that, you might misinterpret the data and incorrectly push your posterior.</p><h2><strong>How would you proceed if you only get a fraction of the feedback sequentially (e.g., after each rater, you want to update the probability on the fly)?</strong></h2><p>Sequential updating is a hallmark of Bayesian methods: you do not need all 8 ratings at once. Suppose you have a prior of 0.60 for &#8220;hit&#8221; and 0.40 for &#8220;miss.&#8221; You observe the first rater&#8217;s response. You compute the posterior. Then the second rater&#8217;s response arrives, and you treat your new posterior as the prior for the next update. This continues until you have processed all 8.</p><p>Here is a simple code snippet demonstrating how to do it sequentially:</p><pre><code><code>import math

# Let's say the data is a list of rater outcomes in order: 1 for like, 0 for dislike
# For example, the show receives: [1, 1, 0, 1, 1, 1, 0, 1]
# We'll see how the posterior evolves after each rater.

data = [1, 1, 0, 1, 1, 1, 0, 1]
p_hit = 0.6    # initial prior for 'hit'
p_miss = 0.4   # initial prior for 'miss'
like_if_hit = 0.8
like_if_miss = 0.2

for i, rating in enumerate(data, start=1):
    # rating = 1 =&gt; rater liked it, rating = 0 =&gt; rater disliked it
    # Compute the likelihood under hit
    if rating == 1:
        likelihood_hit = like_if_hit
        likelihood_miss = like_if_miss
    else:
        likelihood_hit = 1 - like_if_hit
        likelihood_miss = 1 - like_if_miss

    numerator = p_hit * likelihood_hit
    denominator = numerator + p_miss * likelihood_miss
    new_p_hit = numerator / denominator

    # p_miss is just 1 - p_hit in the 2-category scenario
    p_hit = new_p_hit
    p_miss = 1 - p_hit

    print(f"After rater {i} -&gt; Posterior for hit: {p_hit:.4f}, miss: {p_miss:.4f}")
</code></code></pre><p>The advantage of this sequential approach is that you can stop gathering ratings early if you become sufficiently certain about the show&#8217;s status. Or conversely, if the data so far is inconclusive, you might choose to gather more raters. One pitfall is that, in practice, the order of raters might matter if there is potential correlation (e.g., people watch together or discuss among themselves). If you treat the ratings as conditionally independent but they&#8217;re not, your sequential updates might overstate your confidence.</p><h2><strong>How might you handle a scenario where the notion of &#8220;like&#8221; evolves over time as cultural tastes change?</strong></h2><p>Sometimes, a show that might be considered a hit today could be perceived differently if cultural preferences evolve. A comedic style, for example, might become outdated, reducing the probability that future raters enjoy it. In a longer-term approach, you might want a dynamic Bayesian model that updates not only on who has liked or disliked but also tracks how the probability of liking drifts over time.</p><p>For instance, you could define a time-dependent parameter</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rWDh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F711e9d93-513d-48b7-9707-80b533baeb2c_64x56.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rWDh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F711e9d93-513d-48b7-9707-80b533baeb2c_64x56.png 424w, https://substackcdn.com/image/fetch/$s_!rWDh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F711e9d93-513d-48b7-9707-80b533baeb2c_64x56.png 848w, https://substackcdn.com/image/fetch/$s_!rWDh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F711e9d93-513d-48b7-9707-80b533baeb2c_64x56.png 1272w, https://substackcdn.com/image/fetch/$s_!rWDh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F711e9d93-513d-48b7-9707-80b533baeb2c_64x56.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rWDh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F711e9d93-513d-48b7-9707-80b533baeb2c_64x56.png" width="64" height="56" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/711e9d93-513d-48b7-9707-80b533baeb2c_64x56.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:56,&quot;width&quot;:64,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1101,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F711e9d93-513d-48b7-9707-80b533baeb2c_64x56.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rWDh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F711e9d93-513d-48b7-9707-80b533baeb2c_64x56.png 424w, https://substackcdn.com/image/fetch/$s_!rWDh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F711e9d93-513d-48b7-9707-80b533baeb2c_64x56.png 848w, https://substackcdn.com/image/fetch/$s_!rWDh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F711e9d93-513d-48b7-9707-80b533baeb2c_64x56.png 1272w, https://substackcdn.com/image/fetch/$s_!rWDh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F711e9d93-513d-48b7-9707-80b533baeb2c_64x56.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>for &#8220;hit,&#8221; which might gradually shift according to a random walk or some specified process. Each new rating at time</p><p>t</p><p>updates your posterior on</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!S6l4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f63314a-9aa9-45fd-8672-2bba6cb24817_58x48.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!S6l4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f63314a-9aa9-45fd-8672-2bba6cb24817_58x48.png 424w, https://substackcdn.com/image/fetch/$s_!S6l4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f63314a-9aa9-45fd-8672-2bba6cb24817_58x48.png 848w, https://substackcdn.com/image/fetch/$s_!S6l4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f63314a-9aa9-45fd-8672-2bba6cb24817_58x48.png 1272w, https://substackcdn.com/image/fetch/$s_!S6l4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f63314a-9aa9-45fd-8672-2bba6cb24817_58x48.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!S6l4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f63314a-9aa9-45fd-8672-2bba6cb24817_58x48.png" width="58" height="48" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1f63314a-9aa9-45fd-8672-2bba6cb24817_58x48.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:48,&quot;width&quot;:58,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1056,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f63314a-9aa9-45fd-8672-2bba6cb24817_58x48.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!S6l4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f63314a-9aa9-45fd-8672-2bba6cb24817_58x48.png 424w, https://substackcdn.com/image/fetch/$s_!S6l4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f63314a-9aa9-45fd-8672-2bba6cb24817_58x48.png 848w, https://substackcdn.com/image/fetch/$s_!S6l4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f63314a-9aa9-45fd-8672-2bba6cb24817_58x48.png 1272w, https://substackcdn.com/image/fetch/$s_!S6l4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f63314a-9aa9-45fd-8672-2bba6cb24817_58x48.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>. You might also have a prior for how quickly</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!At5T!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc049dde3-ea1b-491d-b83f-01ca009ab8c8_64x49.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!At5T!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc049dde3-ea1b-491d-b83f-01ca009ab8c8_64x49.png 424w, https://substackcdn.com/image/fetch/$s_!At5T!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc049dde3-ea1b-491d-b83f-01ca009ab8c8_64x49.png 848w, https://substackcdn.com/image/fetch/$s_!At5T!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc049dde3-ea1b-491d-b83f-01ca009ab8c8_64x49.png 1272w, https://substackcdn.com/image/fetch/$s_!At5T!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc049dde3-ea1b-491d-b83f-01ca009ab8c8_64x49.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!At5T!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc049dde3-ea1b-491d-b83f-01ca009ab8c8_64x49.png" width="64" height="49" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c049dde3-ea1b-491d-b83f-01ca009ab8c8_64x49.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:49,&quot;width&quot;:64,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1086,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc049dde3-ea1b-491d-b83f-01ca009ab8c8_64x49.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!At5T!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc049dde3-ea1b-491d-b83f-01ca009ab8c8_64x49.png 424w, https://substackcdn.com/image/fetch/$s_!At5T!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc049dde3-ea1b-491d-b83f-01ca009ab8c8_64x49.png 848w, https://substackcdn.com/image/fetch/$s_!At5T!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc049dde3-ea1b-491d-b83f-01ca009ab8c8_64x49.png 1272w, https://substackcdn.com/image/fetch/$s_!At5T!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc049dde3-ea1b-491d-b83f-01ca009ab8c8_64x49.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>can drift from one time point to the next. This is reminiscent of state-space models or Bayesian filters like the Kalman filter, except for a Bernoulli or binomial process.</p><p>The pitfall is increased model complexity: you must specify how quickly tastes can evolve and ensure you have enough data over time to credibly infer the drift. Otherwise, the model might behave erratically and shift</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iwkd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27f7e33e-7935-4f9c-a8d2-e07213cca390_47x46.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iwkd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27f7e33e-7935-4f9c-a8d2-e07213cca390_47x46.png 424w, https://substackcdn.com/image/fetch/$s_!iwkd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27f7e33e-7935-4f9c-a8d2-e07213cca390_47x46.png 848w, https://substackcdn.com/image/fetch/$s_!iwkd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27f7e33e-7935-4f9c-a8d2-e07213cca390_47x46.png 1272w, https://substackcdn.com/image/fetch/$s_!iwkd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27f7e33e-7935-4f9c-a8d2-e07213cca390_47x46.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iwkd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27f7e33e-7935-4f9c-a8d2-e07213cca390_47x46.png" width="47" height="46" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/27f7e33e-7935-4f9c-a8d2-e07213cca390_47x46.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:46,&quot;width&quot;:47,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1043,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165183906?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27f7e33e-7935-4f9c-a8d2-e07213cca390_47x46.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!iwkd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27f7e33e-7935-4f9c-a8d2-e07213cca390_47x46.png 424w, https://substackcdn.com/image/fetch/$s_!iwkd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27f7e33e-7935-4f9c-a8d2-e07213cca390_47x46.png 848w, https://substackcdn.com/image/fetch/$s_!iwkd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27f7e33e-7935-4f9c-a8d2-e07213cca390_47x46.png 1272w, https://substackcdn.com/image/fetch/$s_!iwkd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27f7e33e-7935-4f9c-a8d2-e07213cca390_47x46.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>too freely, or it might be too rigid and fail to capture real changes in cultural tastes.</p>]]></content:encoded></item><item><title><![CDATA[ML Interview Q Series: Uncorrelated X+Y and X−Y: Understanding the Equal Variance Requirement.]]></title><description><![CDATA[Browse all the Probability Interview Questions here.]]></description><link>https://www.rohan-paul.com/p/ml-interview-q-series-uncorrelated-447</link><guid isPermaLink="false">https://www.rohan-paul.com/p/ml-interview-q-series-uncorrelated-447</guid><pubDate>Wed, 04 Jun 2025 12:13:38 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!vsrm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd74c8054-77c6-4c2e-bea2-ae958e080371_1920x1080.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vsrm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd74c8054-77c6-4c2e-bea2-ae958e080371_1920x1080.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vsrm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd74c8054-77c6-4c2e-bea2-ae958e080371_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!vsrm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd74c8054-77c6-4c2e-bea2-ae958e080371_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!vsrm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd74c8054-77c6-4c2e-bea2-ae958e080371_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!vsrm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd74c8054-77c6-4c2e-bea2-ae958e080371_1920x1080.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vsrm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd74c8054-77c6-4c2e-bea2-ae958e080371_1920x1080.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d74c8054-77c6-4c2e-bea2-ae958e080371_1920x1080.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1907931,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165179924?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd74c8054-77c6-4c2e-bea2-ae958e080371_1920x1080.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vsrm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd74c8054-77c6-4c2e-bea2-ae958e080371_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!vsrm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd74c8054-77c6-4c2e-bea2-ae958e080371_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!vsrm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd74c8054-77c6-4c2e-bea2-ae958e080371_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!vsrm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd74c8054-77c6-4c2e-bea2-ae958e080371_1920x1080.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Browse all the <strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">Probability Interview Questions here</a></strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">.</a></p><h2><strong>Suppose we have two random variables X and Y. Under what condition are X+Y and X&#8722;Y uncorrelated?</strong></h2><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://x.com/rohanpaul_ai&quot;,&quot;text&quot;:&quot;Connect with me on X (Twitter)&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://x.com/rohanpaul_ai"><span>Connect with me on X (Twitter)</span></a></p><p>Under the usual definition in probability theory, two random variables are uncorrelated if their covariance is zero. So we need to analyze the covariance of X+Y and X&#8722;Y. The question is: when is</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!j9rA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c117274-3141-44b7-9294-f8f2042cf829_686x115.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!j9rA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c117274-3141-44b7-9294-f8f2042cf829_686x115.png 424w, https://substackcdn.com/image/fetch/$s_!j9rA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c117274-3141-44b7-9294-f8f2042cf829_686x115.png 848w, https://substackcdn.com/image/fetch/$s_!j9rA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c117274-3141-44b7-9294-f8f2042cf829_686x115.png 1272w, https://substackcdn.com/image/fetch/$s_!j9rA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c117274-3141-44b7-9294-f8f2042cf829_686x115.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!j9rA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c117274-3141-44b7-9294-f8f2042cf829_686x115.png" width="686" height="115" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2c117274-3141-44b7-9294-f8f2042cf829_686x115.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:115,&quot;width&quot;:686,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:12101,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165179924?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c117274-3141-44b7-9294-f8f2042cf829_686x115.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!j9rA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c117274-3141-44b7-9294-f8f2042cf829_686x115.png 424w, https://substackcdn.com/image/fetch/$s_!j9rA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c117274-3141-44b7-9294-f8f2042cf829_686x115.png 848w, https://substackcdn.com/image/fetch/$s_!j9rA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c117274-3141-44b7-9294-f8f2042cf829_686x115.png 1272w, https://substackcdn.com/image/fetch/$s_!j9rA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c117274-3141-44b7-9294-f8f2042cf829_686x115.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p>Below is an extensive explanation of the reasoning and the important details surrounding this condition, plus possible follow-up questions and answers.</p><h2><strong>Understanding the Covariance Expression</strong></h2><p>The covariance of two random variables U and V is defined as</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tqFM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5572813-d36b-4eaf-b7af-fb4142afa491_783x232.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tqFM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5572813-d36b-4eaf-b7af-fb4142afa491_783x232.png 424w, https://substackcdn.com/image/fetch/$s_!tqFM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5572813-d36b-4eaf-b7af-fb4142afa491_783x232.png 848w, https://substackcdn.com/image/fetch/$s_!tqFM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5572813-d36b-4eaf-b7af-fb4142afa491_783x232.png 1272w, https://substackcdn.com/image/fetch/$s_!tqFM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5572813-d36b-4eaf-b7af-fb4142afa491_783x232.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tqFM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5572813-d36b-4eaf-b7af-fb4142afa491_783x232.png" width="783" height="232" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d5572813-d36b-4eaf-b7af-fb4142afa491_783x232.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:232,&quot;width&quot;:783,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:28511,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165179924?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5572813-d36b-4eaf-b7af-fb4142afa491_783x232.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!tqFM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5572813-d36b-4eaf-b7af-fb4142afa491_783x232.png 424w, https://substackcdn.com/image/fetch/$s_!tqFM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5572813-d36b-4eaf-b7af-fb4142afa491_783x232.png 848w, https://substackcdn.com/image/fetch/$s_!tqFM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5572813-d36b-4eaf-b7af-fb4142afa491_783x232.png 1272w, https://substackcdn.com/image/fetch/$s_!tqFM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5572813-d36b-4eaf-b7af-fb4142afa491_783x232.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!c8Nd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21450083-80d8-4a14-816e-4e7ff270845e_985x144.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!c8Nd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21450083-80d8-4a14-816e-4e7ff270845e_985x144.png 424w, https://substackcdn.com/image/fetch/$s_!c8Nd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21450083-80d8-4a14-816e-4e7ff270845e_985x144.png 848w, https://substackcdn.com/image/fetch/$s_!c8Nd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21450083-80d8-4a14-816e-4e7ff270845e_985x144.png 1272w, https://substackcdn.com/image/fetch/$s_!c8Nd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21450083-80d8-4a14-816e-4e7ff270845e_985x144.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!c8Nd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21450083-80d8-4a14-816e-4e7ff270845e_985x144.png" width="985" height="144" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/21450083-80d8-4a14-816e-4e7ff270845e_985x144.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:144,&quot;width&quot;:985,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:20633,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165179924?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21450083-80d8-4a14-816e-4e7ff270845e_985x144.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!c8Nd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21450083-80d8-4a14-816e-4e7ff270845e_985x144.png 424w, https://substackcdn.com/image/fetch/$s_!c8Nd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21450083-80d8-4a14-816e-4e7ff270845e_985x144.png 848w, https://substackcdn.com/image/fetch/$s_!c8Nd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21450083-80d8-4a14-816e-4e7ff270845e_985x144.png 1272w, https://substackcdn.com/image/fetch/$s_!c8Nd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21450083-80d8-4a14-816e-4e7ff270845e_985x144.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Hence</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OhGz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a1a180e-1c15-4f96-a3a2-8e47b3f08004_1162x84.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OhGz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a1a180e-1c15-4f96-a3a2-8e47b3f08004_1162x84.png 424w, https://substackcdn.com/image/fetch/$s_!OhGz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a1a180e-1c15-4f96-a3a2-8e47b3f08004_1162x84.png 848w, https://substackcdn.com/image/fetch/$s_!OhGz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a1a180e-1c15-4f96-a3a2-8e47b3f08004_1162x84.png 1272w, https://substackcdn.com/image/fetch/$s_!OhGz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a1a180e-1c15-4f96-a3a2-8e47b3f08004_1162x84.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OhGz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a1a180e-1c15-4f96-a3a2-8e47b3f08004_1162x84.png" width="1162" height="84" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1a1a180e-1c15-4f96-a3a2-8e47b3f08004_1162x84.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:84,&quot;width&quot;:1162,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:18592,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165179924?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a1a180e-1c15-4f96-a3a2-8e47b3f08004_1162x84.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!OhGz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a1a180e-1c15-4f96-a3a2-8e47b3f08004_1162x84.png 424w, https://substackcdn.com/image/fetch/$s_!OhGz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a1a180e-1c15-4f96-a3a2-8e47b3f08004_1162x84.png 848w, https://substackcdn.com/image/fetch/$s_!OhGz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a1a180e-1c15-4f96-a3a2-8e47b3f08004_1162x84.png 1272w, https://substackcdn.com/image/fetch/$s_!OhGz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a1a180e-1c15-4f96-a3a2-8e47b3f08004_1162x84.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7_VP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F575bd80e-eb29-4fa4-91ac-e5a672facc08_827x127.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7_VP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F575bd80e-eb29-4fa4-91ac-e5a672facc08_827x127.png 424w, https://substackcdn.com/image/fetch/$s_!7_VP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F575bd80e-eb29-4fa4-91ac-e5a672facc08_827x127.png 848w, https://substackcdn.com/image/fetch/$s_!7_VP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F575bd80e-eb29-4fa4-91ac-e5a672facc08_827x127.png 1272w, https://substackcdn.com/image/fetch/$s_!7_VP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F575bd80e-eb29-4fa4-91ac-e5a672facc08_827x127.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7_VP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F575bd80e-eb29-4fa4-91ac-e5a672facc08_827x127.png" width="827" height="127" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/575bd80e-eb29-4fa4-91ac-e5a672facc08_827x127.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:127,&quot;width&quot;:827,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:14308,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165179924?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F575bd80e-eb29-4fa4-91ac-e5a672facc08_827x127.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!7_VP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F575bd80e-eb29-4fa4-91ac-e5a672facc08_827x127.png 424w, https://substackcdn.com/image/fetch/$s_!7_VP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F575bd80e-eb29-4fa4-91ac-e5a672facc08_827x127.png 848w, https://substackcdn.com/image/fetch/$s_!7_VP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F575bd80e-eb29-4fa4-91ac-e5a672facc08_827x127.png 1272w, https://substackcdn.com/image/fetch/$s_!7_VP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F575bd80e-eb29-4fa4-91ac-e5a672facc08_827x127.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>So</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DvOp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dbf85c1-08ac-4965-a1ad-d037d24f2445_1091x88.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DvOp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dbf85c1-08ac-4965-a1ad-d037d24f2445_1091x88.png 424w, https://substackcdn.com/image/fetch/$s_!DvOp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dbf85c1-08ac-4965-a1ad-d037d24f2445_1091x88.png 848w, https://substackcdn.com/image/fetch/$s_!DvOp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dbf85c1-08ac-4965-a1ad-d037d24f2445_1091x88.png 1272w, https://substackcdn.com/image/fetch/$s_!DvOp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dbf85c1-08ac-4965-a1ad-d037d24f2445_1091x88.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DvOp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dbf85c1-08ac-4965-a1ad-d037d24f2445_1091x88.png" width="1091" height="88" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5dbf85c1-08ac-4965-a1ad-d037d24f2445_1091x88.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:88,&quot;width&quot;:1091,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:12932,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165179924?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dbf85c1-08ac-4965-a1ad-d037d24f2445_1091x88.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!DvOp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dbf85c1-08ac-4965-a1ad-d037d24f2445_1091x88.png 424w, https://substackcdn.com/image/fetch/$s_!DvOp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dbf85c1-08ac-4965-a1ad-d037d24f2445_1091x88.png 848w, https://substackcdn.com/image/fetch/$s_!DvOp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dbf85c1-08ac-4965-a1ad-d037d24f2445_1091x88.png 1272w, https://substackcdn.com/image/fetch/$s_!DvOp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dbf85c1-08ac-4965-a1ad-d037d24f2445_1091x88.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Meanwhile,</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GoRK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fe31fe4-e0ad-4138-b5c1-80adb76c16c9_458x77.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GoRK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fe31fe4-e0ad-4138-b5c1-80adb76c16c9_458x77.png 424w, https://substackcdn.com/image/fetch/$s_!GoRK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fe31fe4-e0ad-4138-b5c1-80adb76c16c9_458x77.png 848w, https://substackcdn.com/image/fetch/$s_!GoRK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fe31fe4-e0ad-4138-b5c1-80adb76c16c9_458x77.png 1272w, https://substackcdn.com/image/fetch/$s_!GoRK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fe31fe4-e0ad-4138-b5c1-80adb76c16c9_458x77.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GoRK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fe31fe4-e0ad-4138-b5c1-80adb76c16c9_458x77.png" width="458" height="77" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3fe31fe4-e0ad-4138-b5c1-80adb76c16c9_458x77.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:77,&quot;width&quot;:458,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:6384,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165179924?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fe31fe4-e0ad-4138-b5c1-80adb76c16c9_458x77.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!GoRK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fe31fe4-e0ad-4138-b5c1-80adb76c16c9_458x77.png 424w, https://substackcdn.com/image/fetch/$s_!GoRK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fe31fe4-e0ad-4138-b5c1-80adb76c16c9_458x77.png 848w, https://substackcdn.com/image/fetch/$s_!GoRK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fe31fe4-e0ad-4138-b5c1-80adb76c16c9_458x77.png 1272w, https://substackcdn.com/image/fetch/$s_!GoRK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3fe31fe4-e0ad-4138-b5c1-80adb76c16c9_458x77.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Putting these together:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QClX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb469b1b8-9d1f-433d-9ad6-690f30d32b51_1089x90.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QClX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb469b1b8-9d1f-433d-9ad6-690f30d32b51_1089x90.png 424w, https://substackcdn.com/image/fetch/$s_!QClX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb469b1b8-9d1f-433d-9ad6-690f30d32b51_1089x90.png 848w, https://substackcdn.com/image/fetch/$s_!QClX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb469b1b8-9d1f-433d-9ad6-690f30d32b51_1089x90.png 1272w, https://substackcdn.com/image/fetch/$s_!QClX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb469b1b8-9d1f-433d-9ad6-690f30d32b51_1089x90.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QClX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb469b1b8-9d1f-433d-9ad6-690f30d32b51_1089x90.png" width="1089" height="90" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b469b1b8-9d1f-433d-9ad6-690f30d32b51_1089x90.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:90,&quot;width&quot;:1089,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:20065,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165179924?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb469b1b8-9d1f-433d-9ad6-690f30d32b51_1089x90.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!QClX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb469b1b8-9d1f-433d-9ad6-690f30d32b51_1089x90.png 424w, https://substackcdn.com/image/fetch/$s_!QClX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb469b1b8-9d1f-433d-9ad6-690f30d32b51_1089x90.png 848w, https://substackcdn.com/image/fetch/$s_!QClX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb469b1b8-9d1f-433d-9ad6-690f30d32b51_1089x90.png 1272w, https://substackcdn.com/image/fetch/$s_!QClX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb469b1b8-9d1f-433d-9ad6-690f30d32b51_1089x90.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ksQ1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F417abe20-a295-4858-aa12-69542cd6ad2e_912x58.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ksQ1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F417abe20-a295-4858-aa12-69542cd6ad2e_912x58.png 424w, https://substackcdn.com/image/fetch/$s_!ksQ1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F417abe20-a295-4858-aa12-69542cd6ad2e_912x58.png 848w, https://substackcdn.com/image/fetch/$s_!ksQ1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F417abe20-a295-4858-aa12-69542cd6ad2e_912x58.png 1272w, https://substackcdn.com/image/fetch/$s_!ksQ1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F417abe20-a295-4858-aa12-69542cd6ad2e_912x58.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ksQ1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F417abe20-a295-4858-aa12-69542cd6ad2e_912x58.png" width="912" height="58" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/417abe20-a295-4858-aa12-69542cd6ad2e_912x58.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:58,&quot;width&quot;:912,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:13678,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165179924?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F417abe20-a295-4858-aa12-69542cd6ad2e_912x58.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ksQ1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F417abe20-a295-4858-aa12-69542cd6ad2e_912x58.png 424w, https://substackcdn.com/image/fetch/$s_!ksQ1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F417abe20-a295-4858-aa12-69542cd6ad2e_912x58.png 848w, https://substackcdn.com/image/fetch/$s_!ksQ1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F417abe20-a295-4858-aa12-69542cd6ad2e_912x58.png 1272w, https://substackcdn.com/image/fetch/$s_!ksQ1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F417abe20-a295-4858-aa12-69542cd6ad2e_912x58.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Hence:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!l0k0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c37bd54-5c85-4c3a-b763-2c38f49966f3_1071x135.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!l0k0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c37bd54-5c85-4c3a-b763-2c38f49966f3_1071x135.png 424w, https://substackcdn.com/image/fetch/$s_!l0k0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c37bd54-5c85-4c3a-b763-2c38f49966f3_1071x135.png 848w, https://substackcdn.com/image/fetch/$s_!l0k0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c37bd54-5c85-4c3a-b763-2c38f49966f3_1071x135.png 1272w, https://substackcdn.com/image/fetch/$s_!l0k0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c37bd54-5c85-4c3a-b763-2c38f49966f3_1071x135.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!l0k0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c37bd54-5c85-4c3a-b763-2c38f49966f3_1071x135.png" width="1071" height="135" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9c37bd54-5c85-4c3a-b763-2c38f49966f3_1071x135.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:135,&quot;width&quot;:1071,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19127,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165179924?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c37bd54-5c85-4c3a-b763-2c38f49966f3_1071x135.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!l0k0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c37bd54-5c85-4c3a-b763-2c38f49966f3_1071x135.png 424w, https://substackcdn.com/image/fetch/$s_!l0k0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c37bd54-5c85-4c3a-b763-2c38f49966f3_1071x135.png 848w, https://substackcdn.com/image/fetch/$s_!l0k0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c37bd54-5c85-4c3a-b763-2c38f49966f3_1071x135.png 1272w, https://substackcdn.com/image/fetch/$s_!l0k0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c37bd54-5c85-4c3a-b763-2c38f49966f3_1071x135.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Therefore, for X+Y and X&#8722;Y to be uncorrelated, we need:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bwmw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcf865b6-1f55-4912-b71c-4fb00a13a33a_1095x107.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bwmw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcf865b6-1f55-4912-b71c-4fb00a13a33a_1095x107.png 424w, https://substackcdn.com/image/fetch/$s_!bwmw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcf865b6-1f55-4912-b71c-4fb00a13a33a_1095x107.png 848w, https://substackcdn.com/image/fetch/$s_!bwmw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcf865b6-1f55-4912-b71c-4fb00a13a33a_1095x107.png 1272w, https://substackcdn.com/image/fetch/$s_!bwmw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcf865b6-1f55-4912-b71c-4fb00a13a33a_1095x107.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bwmw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcf865b6-1f55-4912-b71c-4fb00a13a33a_1095x107.png" width="1095" height="107" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bcf865b6-1f55-4912-b71c-4fb00a13a33a_1095x107.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:107,&quot;width&quot;:1095,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:15917,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165179924?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcf865b6-1f55-4912-b71c-4fb00a13a33a_1095x107.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!bwmw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcf865b6-1f55-4912-b71c-4fb00a13a33a_1095x107.png 424w, https://substackcdn.com/image/fetch/$s_!bwmw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcf865b6-1f55-4912-b71c-4fb00a13a33a_1095x107.png 848w, https://substackcdn.com/image/fetch/$s_!bwmw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcf865b6-1f55-4912-b71c-4fb00a13a33a_1095x107.png 1272w, https://substackcdn.com/image/fetch/$s_!bwmw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcf865b6-1f55-4912-b71c-4fb00a13a33a_1095x107.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Thus, <strong>X+Y and X&#8722;Y are uncorrelated precisely when X and Y have the same variance.</strong></p><h2><strong>Intuition and Subtle Points</strong></h2><p>When random variables have equal variances, the positive &#8220;spread&#8221; contributed by X is essentially balanced by the negative &#8220;spread&#8221; from Y when we form X&#8722;Y, in such a way that the cross-term influence cancels out in the covariance calculation. Notice that the derivation did not require any assumption on Cov(X,Y) itself; that part canceled out in the algebraic expansion. Similarly, no special assumptions about means (such as zero-mean) were necessary&#8212;everything works out as long as the difference in variances is zero.</p><p>Although they are uncorrelated under this condition, remember that <strong>uncorrelated does not necessarily mean independent</strong>. If X and Y do not follow a jointly Gaussian distribution or some other specific conditions, X+Y and X&#8722;Y<em> </em>might still be dependent. However, from the perspective of linear correlation, the condition of equal variances in X and Y alone is enough to drive their covariance to zero.</p><h2><strong>Real-World or Practical Insights</strong></h2><p>If you ever see a real system where the sum and difference of two signals exhibit zero correlation, it is often a sign that the two signals have similar &#8220;energy&#8221; or magnitude of fluctuations. In many signal processing or communications applications, analyzing sums and differences of signals can help identify certain symmetrical properties. The condition that Var(X)=Var(Y) can also arise in scenarios where X and Y are identically distributed (though identical distribution is not strictly required if they merely share the same variance).</p><p>Below are some additional questions that a skilled interviewer might ask to probe deeper, along with thorough answers.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.rohan-paul.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">I write everyday for my readers on actionable AI. Subscribe and instantly get a 1300+ page Python book.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2><strong>What if X</strong><em><strong> </strong></em><strong>and Y have different means? Does that affect the condition?</strong></h2><p>Even if X and Y have different means, our derivation shows that the covariance Cov(X+Y,&#8201;X&#8722;Y) simplifies to Var(X)&#8722;Var(Y), completely independent of their means. The difference in means does not appear in the final condition for uncorrelatedness. So X+Y and X&#8722;Y are uncorrelated if and only if Var(X)=Var(Y), regardless of the values of E[X] and E[Y].</p><h2><strong>How would this change if we instead required X+Y and X&#8722;Y to be independent?</strong></h2><p>Uncorrelatedness is a weaker condition than independence. In general, requiring independence of X+Y and X&#8722;Y usually imposes stricter conditions on X and Y. For instance, if X and Y are jointly Gaussian random variables, then uncorrelatedness implies independence. In that special Gaussian case, the condition Var(X)=Var(Y) plus the fact that Cov(X+Y,X&#8722;Y)=0 would mean X+Y and X&#8722;Y are indeed independent. However, for arbitrary distributions, X+Y and X&#8722;Y<em> </em>can be uncorrelated (under the same-variance condition) but not independent unless further assumptions (such as joint Gaussianity or linear relationships) are also satisfied.</p><h2><strong>Could X+Y and X&#8722;Y be uncorrelated if either X</strong><em><strong> </strong></em><strong>or Y is a constant?</strong></h2><p>If one variable is a constant, say Y=c with variance 0, then Var(Y)=0 while Var(X) might be nonzero. The difference in variances will not be zero unless Var(X) is also zero (which would mean X is also constant). If both are constants, then all sums and differences are trivially constant and uncorrelated (the covariance is zero because there's no variation). But if only one is constant, they will not satisfy Var(X)=Var(Y) unless Var(X)=0 too.</p><h2><strong>Why does Cov(X,Y) vanish from the final expression?</strong></h2><p>When you expand Cov(X+Y,X&#8722;Y) in a typical scenario, you see terms like Cov(X,X), Cov(X,&#8722;Y), Cov(Y,X), and Cov(Y,&#8722;Y). Usually, you might expect cross-covariance terms to remain. But note that Cov(Y,X)=Cov(X,Y), and one appears with a plus sign, the other with a minus sign, causing them to cancel perfectly. This reveals a neat symmetry: the cross-terms do not affect the covariance in this specific combination of sum and difference. The only terms left are Var(X) and &#8722;Var(Y).</p><h2><strong>Can we verify this condition programmatically with a simple simulation in Python?</strong></h2><p>Yes, we can do a straightforward empirical simulation to verify that if X and Y have the same variance, the empirical covariance of X+Y and X&#8722;Y is near zero.</p><pre><code><code>import numpy as np

# Fix a random seed for reproducibility
np.random.seed(42)

# Generate X and Y with the same variance
# For example, X ~ Normal(0, 1), Y ~ Normal(10, 1)
# so they have the same variance (1), but different means (0 vs 10)
N = 10_000_000
X = np.random.normal(0, 1, size=N)
Y = np.random.normal(10, 1, size=N)

# Form X+Y and X-Y
U = X + Y
V = X - Y

# Compute empirical covariance
cov_UV = np.cov(U, V, bias=True)[0, 1]  # Index [0,1] in the covariance matrix
print("Empirical covariance:", cov_UV)
</code></code></pre><p>If you run this code, you should see that the empirical covariance is extremely close to zero (the larger the sample size, the closer to zero it becomes). The difference in means does not affect this result, only the difference in variance does. If you were to change the variance of Y so that it differs from that of X, then the covariance of X+Y and X&#8722;Y would no longer be near zero.</p><h2><strong>What if X and Y have the same variance, but are correlated?</strong></h2><p>Even if there is a nonzero correlation between X and Y, the algebraic expansion shows that these cross terms cancel out in Cov(X+Y,X&#8722;Y). So the correlation between X and Y does not interfere with the result. All that matters is Var(X)=Var(Y). In effect, the sum and difference can be uncorrelated even if X and Y themselves exhibit correlation.</p><h2><strong>Could you elaborate on a practical scenario where X and Y might have equal variances but not be independent?</strong></h2><p>Consider a finance application where X and Y represent daily returns of two stocks that are typically correlated because they are in the same market. The two stocks might have distinct expected returns (means), but over the long term, the day-to-day fluctuation magnitudes (their variances) could be quite similar. Even if these two stocks have some correlation (positive or negative), if their variances match exactly, X+Y and X&#8722;Y will still have zero covariance. However, the correlation between X and Y in general remains nonzero, showing that uncorrelatedness of X+Y and X&#8722;Y does not guarantee independence.</p><h2><strong>Are there any potential pitfalls in applying this condition?</strong></h2><p>One subtlety is that uncorrelated random variables do not imply causation or independence. Also, in real datasets, the observed or estimated variances might be close to&#8212;but not exactly&#8212;the same. Numerical approximation and finite data can lead to estimates that are not exact. You might mistakenly conclude that X+Y and X&#8722;Y are uncorrelated when, in fact, you simply do not have enough data to differentiate the variances. Always check confidence intervals or run further hypothesis tests to confirm.</p><p>A second subtlety is that the condition Var(X)=Var(Y) is purely about second-order statistics. Higher moments (like skewness and kurtosis) can also create dependencies in sums and differences in more complicated ways, but the second-order measure of correlation is determined by variances and covariances only.</p><h2><strong>How can this insight be extended to more than two random variables?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Jy40!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73281105-b93f-4e96-8baf-cb5313b94bc7_936x389.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Jy40!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73281105-b93f-4e96-8baf-cb5313b94bc7_936x389.png 424w, https://substackcdn.com/image/fetch/$s_!Jy40!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73281105-b93f-4e96-8baf-cb5313b94bc7_936x389.png 848w, https://substackcdn.com/image/fetch/$s_!Jy40!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73281105-b93f-4e96-8baf-cb5313b94bc7_936x389.png 1272w, https://substackcdn.com/image/fetch/$s_!Jy40!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73281105-b93f-4e96-8baf-cb5313b94bc7_936x389.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Jy40!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73281105-b93f-4e96-8baf-cb5313b94bc7_936x389.png" width="936" height="389" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/73281105-b93f-4e96-8baf-cb5313b94bc7_936x389.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:389,&quot;width&quot;:936,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:94801,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165179924?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73281105-b93f-4e96-8baf-cb5313b94bc7_936x389.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Jy40!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73281105-b93f-4e96-8baf-cb5313b94bc7_936x389.png 424w, https://substackcdn.com/image/fetch/$s_!Jy40!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73281105-b93f-4e96-8baf-cb5313b94bc7_936x389.png 848w, https://substackcdn.com/image/fetch/$s_!Jy40!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73281105-b93f-4e96-8baf-cb5313b94bc7_936x389.png 1272w, https://substackcdn.com/image/fetch/$s_!Jy40!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73281105-b93f-4e96-8baf-cb5313b94bc7_936x389.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>In summary, how do you concisely restate the condition?</strong></h2><p>For two random variables X and Y, the sum X+Y<em> </em>and the difference X&#8722;Y<em> </em>are uncorrelated precisely when:</p><h1><strong>Var(X)=Var(Y).</strong></h1><p>No other assumptions (about means, correlation between X and Y, etc.) are needed.</p><h2><strong>Below are additional follow-up questions</strong></h2><h2><strong>If X and Y are vector-valued random variables, how does the condition for uncorrelatedness of X+Y and X&#8722;Y extend to multiple dimensions?</strong></h2><p>When X and Y are vectors, say X &#8712; &#8477;^n and Y &#8712; &#8477;^n, we must consider their covariance matrices rather than single scalar variances. For two n-dimensional random vectors U and V, uncorrelatedness means their cross-covariance matrix is the zero matrix. Concretely, U = X + Y and V = X - Y are also n-dimensional random vectors, and they are uncorrelated if</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mhbr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2342362-cecc-4fab-80ce-c1cd95f761b7_1079x138.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mhbr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2342362-cecc-4fab-80ce-c1cd95f761b7_1079x138.png 424w, https://substackcdn.com/image/fetch/$s_!mhbr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2342362-cecc-4fab-80ce-c1cd95f761b7_1079x138.png 848w, https://substackcdn.com/image/fetch/$s_!mhbr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2342362-cecc-4fab-80ce-c1cd95f761b7_1079x138.png 1272w, https://substackcdn.com/image/fetch/$s_!mhbr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2342362-cecc-4fab-80ce-c1cd95f761b7_1079x138.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mhbr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2342362-cecc-4fab-80ce-c1cd95f761b7_1079x138.png" width="1079" height="138" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b2342362-cecc-4fab-80ce-c1cd95f761b7_1079x138.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:138,&quot;width&quot;:1079,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:20471,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165179924?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2342362-cecc-4fab-80ce-c1cd95f761b7_1079x138.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!mhbr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2342362-cecc-4fab-80ce-c1cd95f761b7_1079x138.png 424w, https://substackcdn.com/image/fetch/$s_!mhbr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2342362-cecc-4fab-80ce-c1cd95f761b7_1079x138.png 848w, https://substackcdn.com/image/fetch/$s_!mhbr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2342362-cecc-4fab-80ce-c1cd95f761b7_1079x138.png 1272w, https://substackcdn.com/image/fetch/$s_!mhbr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2342362-cecc-4fab-80ce-c1cd95f761b7_1079x138.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>In matrix form, their covariance is:</p><ol><li><p>Cov(X+Y, X+Y) is the sum of Cov(X, X), Cov(X, Y), Cov(Y, X), Cov(Y, Y), etc.</p></li><li><p>Cov(X+Y, X-Y) expands to Cov(X, X) - Cov(X, Y) + Cov(Y, X) - Cov(Y, Y).</p></li></ol><p>In the scalar case, we discovered that Var(X) &#8722; Var(Y) must be zero. For the vector case, that condition becomes:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QT9m!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed664c74-532c-4915-bd69-828443bf52fb_546x115.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QT9m!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed664c74-532c-4915-bd69-828443bf52fb_546x115.png 424w, https://substackcdn.com/image/fetch/$s_!QT9m!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed664c74-532c-4915-bd69-828443bf52fb_546x115.png 848w, https://substackcdn.com/image/fetch/$s_!QT9m!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed664c74-532c-4915-bd69-828443bf52fb_546x115.png 1272w, https://substackcdn.com/image/fetch/$s_!QT9m!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed664c74-532c-4915-bd69-828443bf52fb_546x115.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QT9m!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed664c74-532c-4915-bd69-828443bf52fb_546x115.png" width="546" height="115" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ed664c74-532c-4915-bd69-828443bf52fb_546x115.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:115,&quot;width&quot;:546,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:8390,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165179924?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed664c74-532c-4915-bd69-828443bf52fb_546x115.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!QT9m!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed664c74-532c-4915-bd69-828443bf52fb_546x115.png 424w, https://substackcdn.com/image/fetch/$s_!QT9m!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed664c74-532c-4915-bd69-828443bf52fb_546x115.png 848w, https://substackcdn.com/image/fetch/$s_!QT9m!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed664c74-532c-4915-bd69-828443bf52fb_546x115.png 1272w, https://substackcdn.com/image/fetch/$s_!QT9m!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed664c74-532c-4915-bd69-828443bf52fb_546x115.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>where &#931;_{XX} = Cov(X, X) is the covariance matrix of X, and &#931;_{YY} = Cov(Y, Y) is the covariance matrix of Y. Therefore, for X+Y and X&#8722;Y to be uncorrelated component-wise, we need &#931;_{XX} = &#931;_{YY}.</p><p>A common pitfall arises when we assume the result &#8220;Var(X)=Var(Y)&#8221; in the scalar sense and blindly apply it to a vector scenario. Now we must match full covariance matrices: if the diagonal elements (variances of each coordinate) and off-diagonal elements (cross-covariances within each vector) all match, then X+Y and X&#8722;Y will be uncorrelated dimension by dimension. If only the diagonal entries match but the off-diagonals differ, the uncorrelatedness condition can fail because there may still be cross-component correlations that do not cancel out.</p><p>In real-world applications&#8212;e.g., in image processing or multivariate financial data&#8212;ensuring two vectors have identical covariance matrices can be nontrivial. The slightest mismatch in how each component correlates with others can break the uncorrelatedness. Therefore, to apply this condition in multidimensional settings, the entire covariance structure of X and Y must be identical, not just their overall &#8220;spread&#8221; in a single scalar sense.</p><h2><strong>Does the discrete or continuous nature of X and Y affect the condition for uncorrelatedness between X+Y and X&#8722;Y?</strong></h2><p>Uncorrelatedness in probability theory is defined through the covariance, which involves expectations (i.e., integrals or sums over the distribution). Whether X and Y follow discrete or continuous distributions, the derivation of Cov(X+Y, X&#8722;Y) = Var(X) &#8722; Var(Y) holds exactly the same. The key steps in the proof revolve around linearity of expectation and expanding expressions like (X+Y)(X&#8722;Y). None of these operations require X or Y to be continuous specifically; they merely require well-defined second moments (i.e., finite variances).</p><p>A practical pitfall is that in discrete distributions with heavy tails, the variance may be infinite or extremely large. In such cases, the notion of covariance might be undefined or highly unstable. If Var(X) or Var(Y) is infinite, we cannot even state the condition Var(X)=Var(Y). Hence, a crucial real-world edge case is verifying that both random variables have well-defined, finite variances. If they do, and those variances match, the result remains valid whether the distributions are discrete or continuous.</p><h2><strong>How do outliers or heavy-tailed distributions impact the ability to verify that Var(X)=Var(Y)?</strong></h2><p>Heavy-tailed or highly skewed distributions can make sample variance estimates very sensitive to outliers. When you try to estimate Var(X) and Var(Y) from finite data, a few extreme points can drastically shift the empirical variance. Consequently, in practice, you might incorrectly conclude that Var(X) &#8800; Var(Y) if your sample is not large enough or if you have a few anomalous data points. Alternatively, you might overfit to a small dataset and find spurious equality of variances.</p><p>A subtlety here is that uncorrelatedness is about the true underlying distributions, not just estimates. With heavy-tailed data, you need robust statistical techniques&#8212;such as trimming or Winsorizing outliers, or using robust variance estimators&#8212;to get more reliable estimates of Var(X) and Var(Y). If those are close enough to be within some margin of estimation error, you might still conclude in practice that X+Y and X&#8722;Y are uncorrelated. However, you must remain cautious: a real possibility exists that additional data could reveal significant differences in variance. In financial data, for instance, rare but huge market moves can heavily influence variance and thus break the equality.</p><h2><strong>Does the condition Var(X)=Var(Y) impose any specific constraints on higher moments like skewness or kurtosis?</strong></h2><p>No, uncorrelatedness of X+Y and X&#8722;Y is determined solely by second-order statistics. Specifically, it depends only on Var(X) and Var(Y). Higher moments, such as skewness (third moment about the mean) or kurtosis (fourth moment about the mean), do not directly affect the covariance. Therefore, you can have distributions with wildly different skewness or kurtosis but the same variance, and still satisfy the condition that X+Y and X&#8722;Y have zero covariance.</p><p>However, just because these higher moments do not appear in the condition does not mean they cannot influence the broader relationship between X and Y. They could influence independence, tail dependencies, or other forms of non-linear correlation. But as far as the linear measure of uncorrelatedness is concerned, only the second moments come into play. This can be a pitfall if someone mistakenly interprets uncorrelatedness as an indication that the distributions are &#8220;similar&#8221; or that there are no other differences. Indeed, they may still differ significantly in shape and tail behavior.</p><h2><strong>If we scale X by a positive constant, how does that affect the uncorrelatedness of X+Y and X&#8722;Y?</strong></h2><p>Suppose we replace X with a scaled version aX, where a is a positive real constant. Then the sum and difference become (aX+Y) and (aX&#8722;Y). To check their covariance:</p><ul><li><p>Var(aX) = a^2 Var(X).</p></li><li><p>Var(Y) remains the same if we do not scale Y.</p></li></ul><p>Then Cov(aX+Y, aX&#8722;Y) = a^2 Var(X) &#8722; Var(Y). For these two new variables to be uncorrelated, we need a^2 Var(X) = Var(Y). If originally Var(X)=Var(Y), but then we apply a &#8800; 1, that equality no longer holds unless we also change Y in a complementary manner.</p><p>Hence, scaling X alone changes the variance in a quadratic fashion. In practice, if you want to preserve the uncorrelatedness of the sum and difference after scaling, you would need to adjust both X and Y (or adjust your scale factors) to keep their variances identical. A common pitfall is applying some normalization (say, dividing X by its own standard deviation but not Y) and then expecting X+Y and X&#8722;Y to remain uncorrelated. That will break the condition unless Y undergoes a matching transformation.</p><h2><strong>How does this condition extend to time series data where X and Y are indexed over time?</strong></h2><p>When X and Y are time series (X&#8348;, Y&#8348;), we can define the sum and difference at each time t as U&#8348; = X&#8348; + Y&#8348; and V&#8348; = X&#8348; &#8722; Y&#8348;. To analyze uncorrelatedness in a time series context, we must check</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2P92!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7d937a6-7db7-438f-ae89-afcd002c3d78_955x117.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2P92!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7d937a6-7db7-438f-ae89-afcd002c3d78_955x117.png 424w, https://substackcdn.com/image/fetch/$s_!2P92!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7d937a6-7db7-438f-ae89-afcd002c3d78_955x117.png 848w, https://substackcdn.com/image/fetch/$s_!2P92!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7d937a6-7db7-438f-ae89-afcd002c3d78_955x117.png 1272w, https://substackcdn.com/image/fetch/$s_!2P92!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7d937a6-7db7-438f-ae89-afcd002c3d78_955x117.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2P92!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7d937a6-7db7-438f-ae89-afcd002c3d78_955x117.png" width="955" height="117" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d7d937a6-7db7-438f-ae89-afcd002c3d78_955x117.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:117,&quot;width&quot;:955,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:18076,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165179924?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7d937a6-7db7-438f-ae89-afcd002c3d78_955x117.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2P92!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7d937a6-7db7-438f-ae89-afcd002c3d78_955x117.png 424w, https://substackcdn.com/image/fetch/$s_!2P92!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7d937a6-7db7-438f-ae89-afcd002c3d78_955x117.png 848w, https://substackcdn.com/image/fetch/$s_!2P92!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7d937a6-7db7-438f-ae89-afcd002c3d78_955x117.png 1272w, https://substackcdn.com/image/fetch/$s_!2P92!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7d937a6-7db7-438f-ae89-afcd002c3d78_955x117.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>over time. The same algebra shows the instantaneous covariance for each t is Var(X&#8348;) &#8722; Var(Y&#8348;). However, in time series analysis, we also look at autocovariance across different time lags. If we are only requiring pointwise uncorrelatedness (at the same time t), the condition remains Var(X&#8348;)=Var(Y&#8348;) for each t. But if we consider cross-covariances at different lags&#8212;e.g., Cov(U&#8348;, V&#8348;&#8331;&#8343;) for some lag &#8467;&#8212;the condition for uncorrelatedness might be more complicated.</p><p>Another subtlety is whether X and Y are stationary or nonstationary. In a stationary time series, Var(X&#8348;) and Var(Y&#8348;) are the same for all t and might be estimated from a single sample path. If X and Y are nonstationary, their variances can change over time, so you could have Var(X&#8348;)=Var(Y&#8348;) at one point in time but not at another. This can lead to partial or conditional uncorrelatedness at specific intervals. From a practical point of view, you would typically check the stationarity assumption first, then verify if the stationary distributions of X and Y share the same variance.</p><h2><strong>If X and Y are complex random variables, does the condition Var(X)=Var(Y) ensure uncorrelatedness of X+Y and X&#8722;Y?</strong></h2><p>Complex-valued random variables often handle covariance through Hermitian forms and consider quantities like E[(X+Y)(X&#8722;Y)*], where the * denotes complex conjugation. For real-valued variables, that conjugation does not change anything, but for complex variables, the notion of covariance typically generalizes to something akin to:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ddxx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8069f4c4-5831-4bd9-a6f3-d58e738bd618_928x136.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ddxx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8069f4c4-5831-4bd9-a6f3-d58e738bd618_928x136.png 424w, https://substackcdn.com/image/fetch/$s_!Ddxx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8069f4c4-5831-4bd9-a6f3-d58e738bd618_928x136.png 848w, https://substackcdn.com/image/fetch/$s_!Ddxx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8069f4c4-5831-4bd9-a6f3-d58e738bd618_928x136.png 1272w, https://substackcdn.com/image/fetch/$s_!Ddxx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8069f4c4-5831-4bd9-a6f3-d58e738bd618_928x136.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ddxx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8069f4c4-5831-4bd9-a6f3-d58e738bd618_928x136.png" width="928" height="136" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8069f4c4-5831-4bd9-a6f3-d58e738bd618_928x136.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:136,&quot;width&quot;:928,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:15207,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165179924?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8069f4c4-5831-4bd9-a6f3-d58e738bd618_928x136.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Ddxx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8069f4c4-5831-4bd9-a6f3-d58e738bd618_928x136.png 424w, https://substackcdn.com/image/fetch/$s_!Ddxx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8069f4c4-5831-4bd9-a6f3-d58e738bd618_928x136.png 848w, https://substackcdn.com/image/fetch/$s_!Ddxx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8069f4c4-5831-4bd9-a6f3-d58e738bd618_928x136.png 1272w, https://substackcdn.com/image/fetch/$s_!Ddxx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8069f4c4-5831-4bd9-a6f3-d58e738bd618_928x136.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>So you must ensure that the second moments line up appropriately in the complex plane. In many complex-valued random vector treatments (e.g., in signal processing for complex signals), we define separate covariance and pseudo-covariance terms to address real-imaginary correlations.</p><p>In simpler cases, if X and Y are zero-mean circularly symmetric complex Gaussians with identical variances, then X+Y and X&#8722;Y can indeed be uncorrelated in the sense of having zero cross-covariance. However, one subtlety arises if the imaginary parts have different variances or if there is a cross-term correlation between real and imaginary parts. Ensuring complete uncorrelatedness for complex variables might require matching not just the overall magnitude of variance but also the real-real, imag-imag, and real-imag covariance blocks. Hence, if X and Y are purely real or purely imaginary parts, the condition Var(X)=Var(Y) remains sufficient. But in the general complex case, one must be more diligent about how those second moments are structured.</p><h2><strong>What if the data for X and Y is partially missing or corrupted by measurement noise? How do we handle that in practice?</strong></h2><p>Real-world datasets often have missing entries or measurement noise superimposed on the true values of X and Y. If you try to estimate Var(X), Var(Y), and Cov(X+Y, X&#8722;Y) from such data, you face several complications:</p><ol><li><p><strong>Missing Data</strong>: You might have to discard rows where either X or Y is missing, or use an imputation technique. Discarding data can reduce sample size, harming statistical power. Imputing values can bias variance estimates unless done carefully (e.g., multiple imputation methods that preserve second moments).</p></li><li><p><strong>Measurement Noise</strong>: If the observed X_obs = X + noise&#8339; and Y_obs = Y + noise&#7527;, then Var(X_obs) = Var(X) + Var(noise&#8339;) (assuming independence of X and the noise). Similarly for Y_obs. Even if X and Y had the same true variance, the presence of different noise variances can break that equality in the observed domain. That can cause an erroneous conclusion that X+Y and X&#8722;Y are correlated.</p></li></ol><p>A robust approach might be to model noise explicitly, attempt to estimate or calibrate the noise variance, and then correct the observed sample variance accordingly (e.g., subtract out the known or estimated noise variance). Alternatively, use a maximum likelihood estimation for a parametric model that accounts for missingness and noise. A subtlety is ensuring that noise, X, and Y are independent or that we know how they correlate. If measurement noise correlates with X or Y in any way, that further complicates the analysis.</p><h2><strong>In practical scenarios, could boundary or domain constraints on X and Y invalidate the derivation?</strong></h2><p>Yes. If X and Y are defined over restricted domains (e.g., only nonnegative values, bounded intervals, or discrete sets where variance is impacted by a boundary effect), the standard approach to computing Var(X) and Var(Y) might still apply, but the distributions might exhibit strongly non-linear relationships. For example, if both X and Y are nonnegative random variables clipped at zero, there can be a mass at zero that skews the estimation of variance.</p><p>It is still true that the algebraic relationship</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PgvQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21f19468-e93e-450a-acb9-e4d394fe4a82_1080x131.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PgvQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21f19468-e93e-450a-acb9-e4d394fe4a82_1080x131.png 424w, https://substackcdn.com/image/fetch/$s_!PgvQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21f19468-e93e-450a-acb9-e4d394fe4a82_1080x131.png 848w, https://substackcdn.com/image/fetch/$s_!PgvQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21f19468-e93e-450a-acb9-e4d394fe4a82_1080x131.png 1272w, https://substackcdn.com/image/fetch/$s_!PgvQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21f19468-e93e-450a-acb9-e4d394fe4a82_1080x131.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PgvQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21f19468-e93e-450a-acb9-e4d394fe4a82_1080x131.png" width="1080" height="131" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/21f19468-e93e-450a-acb9-e4d394fe4a82_1080x131.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:131,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19089,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165179924?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21f19468-e93e-450a-acb9-e4d394fe4a82_1080x131.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!PgvQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21f19468-e93e-450a-acb9-e4d394fe4a82_1080x131.png 424w, https://substackcdn.com/image/fetch/$s_!PgvQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21f19468-e93e-450a-acb9-e4d394fe4a82_1080x131.png 848w, https://substackcdn.com/image/fetch/$s_!PgvQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21f19468-e93e-450a-acb9-e4d394fe4a82_1080x131.png 1272w, https://substackcdn.com/image/fetch/$s_!PgvQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21f19468-e93e-450a-acb9-e4d394fe4a82_1080x131.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>holds if the second moments exist. But domain constraints can lead to distortions in how one might interpret that covariance in real-world terms. If the domain restrictions lead to degenerate cases (e.g., X is bounded so that Var(X) &#8594; 0 under certain conditions), then the question of uncorrelatedness might reduce to trivial or degenerate outcomes. Always check that the domain constraints do not cause any violation of the assumptions behind computing second moments (finite, well-defined integrals or sums). If everything remains valid, the main formula still holds, but interpreting it requires caution.</p>]]></content:encoded></item><item><title><![CDATA[ML Interview Q Series: Estimating Uniform Distribution Bounds (a, b) using Maximum Likelihood Estimation.]]></title><description><![CDATA[Browse all the Probability Interview Questions here.]]></description><link>https://www.rohan-paul.com/p/ml-interview-q-series-estimating-1bd</link><guid isPermaLink="false">https://www.rohan-paul.com/p/ml-interview-q-series-estimating-1bd</guid><pubDate>Tue, 03 Jun 2025 14:04:02 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!de0O!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc30b043b-474c-411a-be2a-423300eb31ad_1024x573.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!de0O!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc30b043b-474c-411a-be2a-423300eb31ad_1024x573.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!de0O!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc30b043b-474c-411a-be2a-423300eb31ad_1024x573.png 424w, https://substackcdn.com/image/fetch/$s_!de0O!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc30b043b-474c-411a-be2a-423300eb31ad_1024x573.png 848w, https://substackcdn.com/image/fetch/$s_!de0O!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc30b043b-474c-411a-be2a-423300eb31ad_1024x573.png 1272w, https://substackcdn.com/image/fetch/$s_!de0O!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc30b043b-474c-411a-be2a-423300eb31ad_1024x573.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!de0O!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc30b043b-474c-411a-be2a-423300eb31ad_1024x573.png" width="1024" height="573" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c30b043b-474c-411a-be2a-423300eb31ad_1024x573.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:573,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:873028,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165098672?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc30b043b-474c-411a-be2a-423300eb31ad_1024x573.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!de0O!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc30b043b-474c-411a-be2a-423300eb31ad_1024x573.png 424w, https://substackcdn.com/image/fetch/$s_!de0O!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc30b043b-474c-411a-be2a-423300eb31ad_1024x573.png 848w, https://substackcdn.com/image/fetch/$s_!de0O!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc30b043b-474c-411a-be2a-423300eb31ad_1024x573.png 1272w, https://substackcdn.com/image/fetch/$s_!de0O!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc30b043b-474c-411a-be2a-423300eb31ad_1024x573.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Browse all the <strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">Probability Interview Questions here</a></strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">.</a></p><h2><strong>Say you draw n samples from a uniform distribution U(a, b). What is the MLE estimate of a and b?</strong></h2><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://x.com/rohanpaul_ai&quot;,&quot;text&quot;:&quot;Connect with me on X (Twitter)&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://x.com/rohanpaul_ai"><span>Connect with me on X (Twitter)</span></a></p><p>MLE FOR A UNIFORM DISTRIBUTION U(a, b)</p><p>To understand how to derive the Maximum Likelihood Estimators (MLE) for the parameters a and b, consider that we have n i.i.d. samples drawn from a uniform distribution on the interval [a, b]. Let these samples be denoted by x&#8321;, x&#8322;, &#8230;, x&#8345;. The probability density function (pdf) for a single sample x&#7522; under the uniform distribution U(a, b) is</p><ul><li><p>1/(b - a) if a &#8804; x&#7522; &#8804; b</p></li><li><p>0 otherwise</p></li></ul><p>The joint likelihood function for all n samples is the product of individual probabilities. When all x&#7522; lie in [a, b], the likelihood is</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3uFP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2037733-350b-45b6-ae9c-c6df31fd7d3e_812x215.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3uFP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2037733-350b-45b6-ae9c-c6df31fd7d3e_812x215.png 424w, https://substackcdn.com/image/fetch/$s_!3uFP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2037733-350b-45b6-ae9c-c6df31fd7d3e_812x215.png 848w, https://substackcdn.com/image/fetch/$s_!3uFP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2037733-350b-45b6-ae9c-c6df31fd7d3e_812x215.png 1272w, https://substackcdn.com/image/fetch/$s_!3uFP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2037733-350b-45b6-ae9c-c6df31fd7d3e_812x215.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3uFP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2037733-350b-45b6-ae9c-c6df31fd7d3e_812x215.png" width="812" height="215" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c2037733-350b-45b6-ae9c-c6df31fd7d3e_812x215.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:215,&quot;width&quot;:812,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:16939,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165098672?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2037733-350b-45b6-ae9c-c6df31fd7d3e_812x215.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!3uFP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2037733-350b-45b6-ae9c-c6df31fd7d3e_812x215.png 424w, https://substackcdn.com/image/fetch/$s_!3uFP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2037733-350b-45b6-ae9c-c6df31fd7d3e_812x215.png 848w, https://substackcdn.com/image/fetch/$s_!3uFP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2037733-350b-45b6-ae9c-c6df31fd7d3e_812x215.png 1272w, https://substackcdn.com/image/fetch/$s_!3uFP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2037733-350b-45b6-ae9c-c6df31fd7d3e_812x215.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p>However, this expression for the likelihood is valid only if a &#8804; x&#7522; &#8804; b for every i in {1, 2, &#8230;, n}. Otherwise, the likelihood is zero. Therefore, we have the constraints:</p><p>a &#8804; min(x&#8321;, x&#8322;, &#8230;, x&#8345;) b &#8805; max(x&#8321;, x&#8322;, &#8230;, x&#8345;)</p><p>Under these constraints, the factor 1/(b - a) is constant across all samples. Maximizing L(a, b) = 1/(b - a)&#8319; is equivalent to minimizing (b - a). Given that a cannot exceed the smallest sample without invalidating the likelihood, and b cannot be smaller than the largest sample, the maximum likelihood occurs by choosing:</p><p>a&#770; = min(x&#8321;, x&#8322;, &#8230;, x&#8345;) b&#770; = max(x&#8321;, x&#8322;, &#8230;, x&#8345;)</p><p>This choice satisfies the requirement a&#770; &#8804; all samples &#8804; b&#770;, and it keeps the interval [a, b] as small as possible, thereby maximizing 1/(b - a)&#8319;.</p><p>THE REASONING IN DETAIL</p><p>One core principle of MLE is that we want to choose parameter values that maximize the product of the probabilities of observing the data as it was actually observed. For the uniform distribution on [a, b]:</p><ul><li><p>If any sample x&#7522; is less than a or greater than b, the probability (density) for that x&#7522; under U(a, b) is zero, which makes the entire likelihood zero.</p></li><li><p>Therefore, a must be at most the smallest observation, and b must be at least the largest observation. Otherwise, the likelihood is zero.</p></li><li><p>Within the region of parameter space where all observations lie in [a, b], the likelihood is proportional to 1/(b - a)&#8319;.</p></li><li><p>To maximize 1/(b - a)&#8319;, we want to minimize (b - a) while respecting a &#8804; min(x&#7522;) and b &#8805; max(x&#7522;). The unique solution is a = min(x&#7522;) and b = max(x&#7522;).</p></li></ul><p>CODE EXAMPLE (PYTHON)</p><p>Below is a Python snippet to illustrate how to compute these estimates:</p><pre><code><code>import numpy as np

def mle_uniform(samples):
    """
    Returns the MLE estimates a_hat and b_hat for a uniform distribution
    given a list/array of samples.
    """
    a_hat = np.min(samples)
    b_hat = np.max(samples)
    return a_hat, b_hat

# Example usage:
samples = [2.3, 3.7, 2.9, 2.5, 3.1]
a_est, b_est = mle_uniform(samples)
print("MLE for a:", a_est)
print("MLE for b:", b_est)
</code></code></pre><p>This code determines the minimum and maximum of the sample array, which are the MLE estimates for a and b respectively.</p><p>SUBTLE POINTS AND POTENTIAL PITFALLS</p><p>Outliers. Since b is estimated as the maximum sample and a is the minimum sample, any extreme outlier in the dataset directly shifts the MLE estimates. If your dataset has contamination or outliers, the MLE will expand the [a, b] interval to accommodate them.</p><p>Support mismatch. If you incorrectly assume the distribution is uniform when the data is not truly uniform, the MLE estimates can be misleading or might not capture the true underlying distribution.</p><p>Small sample sizes. With very few samples, the gap between min and max might not represent the entire potential range of the true distribution. This can produce a wide confidence interval for the parameters a and b.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.rohan-paul.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">I write everyday for my readers on actionable AI. Subscribe and instantly get a 1300+ page Python book.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2><strong>Are these estimates biased or unbiased?</strong></h2><p>The MLE estimates a&#770; = min(x) and b&#770; = max(x) are biased estimators for the true parameters a and b. For instance, on average, min(x) will tend to be larger than the true a, and max(x) will tend to be smaller than the true b. Intuitively, there is a nonzero chance that you have not sampled the actual extreme ends of the true distribution. In fact, in many statistical texts, you&#8217;ll see unbiased estimators for a and b that involve corrected terms to account for this bias. However, those adjusted estimators come from methods other than pure MLE, such as the method of moments or applying a bias correction to the MLE.</p><h2><strong>Could you derive the likelihood and constraints another way?</strong></h2><p>Yes. One approach is to write the likelihood function and introduce an indicator function I[a &#8804; x&#7522; &#8804; b]. The complete likelihood can be expressed as:</p><p>L(a, b) = &#928; (1/(b - a)) &#8901; I[a &#8804; x&#7522; &#8804; b]</p><p>where I[...] is 1 if the condition is true for all i and 0 otherwise. From this perspective, only the range [a, b] that covers all x&#7522; yields a nonzero likelihood. Minimizing (b - a) subject to covering all data points yields the same conclusion: pick a = min(x&#7522;) and b = max(x&#7522;).</p><h2><strong>What happens if we have prior knowledge about a and b?</strong></h2><p>If we bring Bayesian reasoning into the picture, we would place priors on a and b (e.g., uniform priors or something else). We would then derive the posterior distribution for a and b given the data. The MLE approach ignores priors and simply uses the data likelihood, whereas a Bayesian approach would integrate the likelihood with a prior. Even so, for many simple priors, the maximum a posteriori (MAP) estimate might still look similar to the sample min and max but adjusted by the prior&#8217;s influence.</p><h2><strong>How would the MLE approach be influenced by data scaling or transformations?</strong></h2><p>For a uniform distribution U(a, b), any linear transformation of the data that transforms x to y = c&#183;x + d simply rescales the problem. The MLE for the new distribution&#8217;s parameters would be the corresponding linear transformation of the original min and max. Non-linear transformations would require re-expressing the uniform distribution in the transformed space, which might no longer remain uniform unless the transformation is carefully chosen.</p><h2><strong>How do we implement this in real-world pipelines?</strong></h2><p>In many data workflows, you might do the following in practice:</p><ul><li><p>Gather your dataset into a NumPy array or a similar structure.</p></li><li><p>Ensure that your data is valid and free of anomalies (or handle outliers explicitly).</p></li><li><p>Compute the sample minimum and sample maximum.</p></li><li><p>Assign these as your estimates for a and b.</p></li></ul><p>If outliers are suspected, you might adopt a robust approach, such as ignoring extreme percentiles or applying domain knowledge to clamp your data. However, that approach ceases to be pure MLE but can be more practical in certain real-world applications.</p><p>When you answer real interview questions about the uniform distribution MLE, make sure to emphasize the conceptual reasoning (constrained optimization problem and the nature of the uniform likelihood) and be prepared to discuss biases, alternative estimators, or modifications to handle outliers.</p><div><hr></div><h2><strong>Below are additional follow-up questions</strong></h2><h2><strong>What if we consider discrete uniform distributions instead of continuous ones? How does the MLE estimation for a and b change in the discrete case?</strong></h2><p>In a discrete uniform distribution, the support is a set of integer points from a to b (where a and b are integers, and a &#8804; b). The probability mass function (pmf) for any integer x&#7522; in [a, b] is p(x&#7522;) = 1 / (b &#8722; a + 1), provided x&#7522; is an integer in that range, and 0 otherwise.</p><p>The maximum likelihood principle still applies:</p><ol><li><p>We must have a &#8804; all x&#7522; and b &#8805; all x&#7522; so that no sample falls outside [a, b], otherwise the likelihood is zero.</p></li><li><p>Among all valid intervals [a, b] that contain every sample, the pmf for each x&#7522; is 1 / (b &#8722; a + 1).</p></li><li><p>The joint likelihood is (1 / (b &#8722; a + 1))&#8319;.</p></li><li><p>To maximize that likelihood, we minimize b &#8722; a + 1.</p></li></ol><p>Hence, the MLE remains:</p><p>a&#770; = min(x&#7522;) b&#770; = max(x&#7522;)</p><p>The only difference is we treat these as integer values. If the data are integer-valued, then min and max samples will also be integers, making the interpretation straightforward. However, subtle points can arise if your data might appear integer-valued but actually contain measurement noise or rounding errors.</p><p>Potential pitfalls:</p><p>&#8226; Rounding: If real-valued measurements get truncated or rounded to integers before you model them as a discrete uniform, you might inadvertently shift your estimates. &#8226; Ties: In discrete distributions, having many repeated values at the min or max can cause suspicion about whether your distribution assumption is correct. Still, the MLE formula remains the same.</p><h2><strong>How do we handle multi-dimensional uniform distributions? For example, U in [a&#8321;, b&#8321;] &#215; [a&#8322;, b&#8322;] &#215; &#8230; &#215; [a_d, b_d]?</strong></h2><p>In d dimensions, a uniform distribution on a hyper-rectangle [a&#8321;, b&#8321;] &#215; &#8230; &#215; [a_d, b_d] has a pdf:</p><p>pdf(x&#8321;, x&#8322;, &#8230;, x_d) = 1 / &#8719;(b&#7522; &#8722; a&#7522;) for x&#7522; &#8712; [a&#7522;, b&#7522;] for i in 1..d.</p><p>To apply MLE:</p><ol><li><p>Each dimension must fully contain the observed sample points. In other words, for each dimension j, we need a&#11388; &#8804; x&#7522;&#11388; for every sample i, and b&#11388; &#8805; x&#7522;&#11388; for every sample i.</p></li><li><p>The joint likelihood over n samples is proportional to 1 / &#8719;(b&#11388; &#8722; a&#11388;)&#8319;, where j=1..d.</p></li><li><p>To maximize the likelihood, we minimize each (b&#11388; &#8722; a&#11388;), subject to containing all x&#7522;&#11388;.</p></li></ol><p>Hence the MLE in each dimension j is:</p><p>a&#770;&#11388; = min over all i of x&#7522;&#11388; b&#770;&#11388; = max over all i of x&#7522;&#11388;</p><p>Potential pitfalls:</p><p>&#8226; Sparse data in high dimensions might not adequately represent the full range, leading to underestimation of the true bounding region. &#8226; If the data exhibit correlations in each dimension, a rectangular bounding region might be a poor model. The uniform distribution in a rectangle implies independence and equal density across that entire box. &#8226; Outliers in any single dimension can blow up the volume of the bounding region significantly.</p><h2><strong>How do we interpret the likelihood function when there is measurement error or known data truncation?</strong></h2><p>In real-world scenarios, measurements can be truncated or censored. For instance, if a sensor only reports values above a certain threshold, or there is a known maximum reading limit:</p><ol><li><p>Truncation means you only see samples within [T&#8321;, T&#8322;] even if the true distribution extends beyond that range. In that case, the likelihood for each observed sample changes because you need to account for the conditional probability of seeing that sample given that it falls in [T&#8321;, T&#8322;].</p></li><li><p>You might have to modify the uniform distribution assumption to something like: &#8220;Given that X &#8712; [T&#8321;, T&#8322;], X is uniformly distributed on [a, b].&#8221; But if T&#8321; &gt; a or T&#8322; &lt; b, then your maximum-likelihood approach needs to factor in the probability that you never see anything below T&#8321; or above T&#8322;.</p></li></ol><p>Practical implications:</p><p>&#8226; If T&#8321; &#8804; min(x&#7522;) and T&#8322; &#8805; max(x&#7522;), your truncated data range might not affect the MLE because all data still fit comfortably within [a, b]. &#8226; If T&#8321; &gt; a in reality, you cannot directly observe how far below T&#8321; the true distribution extends; the MLE might push a&#770; closer to T&#8321;. Similarly for b with T&#8322;. &#8226; Standard MLE derivations assume full observability of samples across the entire support. With truncation, you should consider a truncated likelihood approach, leading to more complex parameter estimation equations.</p><h2><strong>What if some samples are identical? How do repeated values affect the MLE?</strong></h2><p>When samples have duplicates:</p><p>&#8226; min(x&#7522;) and max(x&#7522;) remain valid. Even if the min or max value occurs multiple times, it does not change the fact that the MLE is still min for a and max for b. &#8226; Duplicates do not fundamentally alter the uniform-likelihood structure because the uniform pdf or pmf is still constant within [a, b]. &#8226; If the minimum sample value occurs for many data points, that might raise questions about whether the data is truly uniform or if there is a boundary effect. But strictly from the MLE perspective, we simply take the smallest observed value as a&#770; and the largest observed value as b&#770;, regardless of how many times they repeat.</p><p>Potential pitfalls:</p><p>&#8226; Duplicate min and max values reduce variability in the sample, so your interval might look artificially small if you have only a narrow cluster of data. But that is a sample-specific artifact rather than an MLE formula change. &#8226; If the entire dataset is identical (all x&#7522; the same), then min(x) = max(x), making the MLE degenerate (b&#770; = a&#770;). The uniform distribution&#8217;s pdf becomes undefined (division by zero) for that scenario. In practice, you might say the MLE does not exist or that the data do not support a range.</p><h2><strong>Suppose we have partial knowledge: we know the true a but not b. How does that affect the MLE for b?</strong></h2><p>If a is known and fixed, then:</p><ol><li><p>The uniform distribution is U(a, b).</p></li><li><p>The likelihood for n samples x&#7522; is 1 / (b &#8722; a)&#8319;, provided a &#8804; x&#7522; &#8804; b for all i. Otherwise, the likelihood is zero.</p></li><li><p>We only need to estimate b.</p></li><li><p>Since we must cover all data, b &#8805; max(x&#7522;).</p></li><li><p>Minimizing (b &#8722; a) while still covering all data yields b&#770; = max(x&#7522;).</p></li></ol><p>Hence, the MLE for b is max(x&#7522;), given that a is known.</p><p>Potential pitfalls:</p><p>&#8226; You must be absolutely certain about the known a. If that knowledge is incorrect, then the MLE b&#770; may not reflect the true distribution support. &#8226; If a is known but the data includes values less than a (due to measurement or noise), that indicates a mismatch between the assumed model and actual data.</p><h2><strong>How do we perform hypothesis testing on whether a proposed [a, b] is valid compared to the MLE [a&#770;, b&#770;]?</strong></h2><p>You might want to test a hypothesis H&#8320;: [a, b] = [a&#8320;, b&#8320;] vs. H&#8321;: [a, b] &#8800; [a&#8320;, b&#8320;] and see how that compares with the MLE. A straightforward approach:</p><ol><li><p>Compute the likelihood under H&#8320;: L(a&#8320;, b&#8320;). If any sample lies outside [a&#8320;, b&#8320;], then L(a&#8320;, b&#8320;) = 0, so H&#8320; is immediately implausible.</p></li><li><p>Compare that with L(a&#770;, b&#770;).</p></li><li><p>Often a likelihood ratio test (LRT) can be used: &#923; = L(a&#8320;, b&#8320;) / L(a&#770;, b&#770;). Because (b&#8320; &#8722; a&#8320;) &#8805; (b&#770; &#8722; a&#770;), L(a&#8320;, b&#8320;) &#8804; L(a&#770;, b&#770;).</p></li><li><p>The ratio might be used to derive a p-value if you have a relevant asymptotic distribution for the test statistic.</p></li></ol><p>Potential pitfalls:</p><p>&#8226; Uniform distributions yield piecewise-defined likelihoods that can become zero if the proposed [a&#8320;, b&#8320;] does not contain the entire sample. That discontinuity can complicate classical test procedures. &#8226; If [a&#8320;, b&#8320;] strictly contains the entire sample, but is much bigger, the likelihood ratio might be very small. That can make it easy to reject H&#8320; if your sample is large enough.</p><h2><strong>Could we estimate a and b if we apply transformations or normalizations to the samples first?</strong></h2><p>Sometimes, data is better modeled if we transform it to a new variable y = g(x) that might appear more uniform over a known range. Then you can estimate parameters on y and back-transform to x. But for a uniform distribution:</p><ol><li><p>A linear transformation y = c&#183;x + d is straightforward: if x ~ U(a, b), then y ~ U(c&#183;a + d, c&#183;b + d). The MLE for y would simply be min(y&#7522;) and max(y&#7522;), which correspond back to c&#183;min(x&#7522;)+d and c&#183;max(x&#7522;)+d.</p></li><li><p>A non-linear transformation g(x) can distort uniformity. After transformation, the distribution might not remain uniform, so you can&#8217;t just apply the same min&#8211;max approach.</p></li><li><p>If you do want to apply MLE in a transformed space, you need the Jacobian of the transformation for the pdf, which can make the likelihood function more complex.</p></li></ol><p>Potential pitfalls:</p><p>&#8226; Arbitrary transformations might invalidate the uniformity assumption in the transformed space. &#8226; In practice, transformations are usually done to better match a known distribution (like normal or exponential). Doing so to achieve uniformity is less common, unless you&#8217;re looking at probability integral transforms in goodness-of-fit tests.</p><h2><strong>In practical data science, do we often use a uniform distribution to model real-world data?</strong></h2><p>Uniform distributions are usually used as a simplistic model or for bounding scenarios, not typically for intricate real-world phenomena. That said, they are still important:</p><ol><li><p>Sometimes, you have a scenario where every outcome in [a, b] is equally likely (e.g., selecting a random point in an interval).</p></li><li><p>Uniform distributions can serve as building blocks in simulation or as non-informative priors in Bayesian contexts.</p></li><li><p>For real data, the uniform assumption might be a placeholder before you gather deeper insight.</p></li></ol><p>Real-world pitfalls:</p><p>&#8226; Real data rarely has a strictly constant density over a perfect interval. Even if it looks roughly uniform, small deviations from uniformity might matter, especially at the boundaries. &#8226; MLE min&#8211;max is highly sensitive to outliers. One unexpected data point far outside the main cluster can drastically expand the estimated interval.</p><h2><strong>How would you robustify the MLE approach against outliers or data errors?</strong></h2><p>Since the standard MLE includes the min and max samples:</p><ol><li><p>If you suspect outliers, you could consider a robust approach (though that is no longer the pure MLE). For instance, you might decide to discard any data points beyond some quantile threshold. Then estimate a&#770; and b&#770; using those trimmed samples.</p></li><li><p>Alternatively, a Bayesian approach might impose a prior that shrinks the support, penalizing large (b &#8722; a). Then the posterior mode (MAP) might not always expand to accommodate a single extreme outlier.</p></li><li><p>Another possibility is to build a mixture model where most data is uniform on [a, b], plus a small proportion for outliers. That is more complex but can handle contamination better.</p></li></ol><p>Potential pitfalls:</p><p>&#8226; Trimming or ignoring outliers must be justified carefully, or you risk discarding legitimate data. &#8226; Mixture models can become complicated to fit, and identifiability might be an issue if you only have a small dataset.</p><h2><strong>How can we derive confidence intervals for a and b from these MLE estimates?</strong></h2><p>Constructing confidence intervals (CIs) for uniform distribution parameters can be tricky because:</p><ol><li><p>The sampling distribution of (min(X), max(X)) is known: &#8211; min(X) has distribution F_min(t) = 1 &#8722; (1 &#8722; F(t))&#8319;, etc. But turning that into a joint CI for a and b is more nuanced.</p></li><li><p>One classical approach for continuous uniform distributions is using order statistics: &#8211; The distribution of the smallest order statistic X_(1) (the min) and the largest order statistic X_(n) (the max) are well-known. &#8211; If you invert those distributions, you can form intervals that with a certain probability contain the true a and b.</p></li><li><p>Another approach is to use bootstrap methods: sample with replacement from your data, recompute a&#770; and b&#770; each time, and observe the empirical distribution of the estimates. This yields approximate intervals, although they might be optimistic or pessimistic if the sample is not truly uniform.</p></li></ol><p>Potential pitfalls:</p><p>&#8226; If the sample size is small, the distribution of min and max might be highly variable, so your CI could be very wide. &#8226; Analytical formulas often assume perfect uniformity and i.i.d. samples. If the data deviate from that, the nominal coverage of your CI can be incorrect.</p><h2><strong>How does knowledge of sub-samples or stratification affect the MLE?</strong></h2><p>Sometimes, you might split your dataset into subgroups (strata), each presumably uniform with possibly different [a, b]. If you do that:</p><ol><li><p>You might compute MLE separately for each subgroup. For subgroup j, a&#770;&#11388; = min(x&#7522; in subgroup j), b&#770;&#11388; = max(x&#7522; in subgroup j).</p></li><li><p>If there is overlap in the intervals, or if you believe the distribution could be uniform for the entire combined set, you can also check the single-interval MLE for the pooled data. Compare which approach is more appropriate with domain knowledge.</p></li><li><p>If sub-samples come from different underlying distributions, forcing a single [a, b] over all data might be too restrictive.</p></li></ol><p>Potential pitfalls:</p><p>&#8226; You may not have enough samples in each subgroup to estimate an interval reliably, leading to wide intervals or zero-likelihood anomalies if outliers appear in small subgroups. &#8226; Combining subgroups that truly have distinct distributions can produce an MLE that poorly fits each subgroup individually.</p><h2><strong>How does the method of moments estimation compare to the MLE for uniform distributions?</strong></h2><p>Method of moments (MoM) is a different estimation technique where you match sample moments (like mean, variance) to theoretical moments of the distribution. For a uniform distribution U(a, b):</p><p>&#8226; Mean: (a + b) / 2 &#8226; Variance: (b &#8722; a)&#178; / 12</p><p>You can solve the system:</p><p>mean(sample) = (a + b) / 2 var(sample) = (b &#8722; a)&#178; / 12</p><p>In principle, that yields:</p><p>b &#8722; a = &#8730;(12 &#183; var(sample)) (a + b) / 2 = mean(sample)</p><p>One can solve for a and b from these equations. That is an alternative to min&#8211;max:</p><p>a_mom = mean(sample) &#8722; (1/2)&#8730;(12 &#183; var(sample)) b_mom = mean(sample) + (1/2)&#8730;(12 &#183; var(sample))</p><p>Potential pitfalls:</p><p>&#8226; The method of moments can yield intervals [a, b] that do not necessarily contain all data points. In that case, the uniform pdf at any data point outside [a, b] would be zero, conflicting with the data. &#8226; MoM can produce an estimate that is &#8220;in the middle&#8221; of the data rather than pegged at the extremes, which might be nonsensical for an actual uniform distribution over all observed values. &#8226; In general, the MLE for the uniform distribution is min&#8211;max, whereas the MoM is not guaranteed to align with the extremes of the sample, so it can be considered &#8220;invalid&#8221; if any x&#7522; &lt; a_mom or x&#7522; &gt; b_mom.</p><h2><strong>How would you diagnose that the uniform assumption might be incorrect?</strong></h2><p>To diagnose correctness:</p><ol><li><p>Plot a histogram of the data and see if it appears relatively flat across [min(x), max(x)].</p></li><li><p>Use goodness-of-fit tests: one approach is to transform the data to y&#7522; = (x&#7522; &#8722; a&#770;) / (b&#770; &#8722; a&#770;). If the data truly follow U(a, b), then y&#7522; ~ U(0, 1). Check if the empirical distribution of y&#7522; is close to uniform on [0, 1].</p></li><li><p>Look for boundary clustering. If many points cluster at the boundaries, this might be suspicious for a uniform assumption.</p></li></ol><p>Potential pitfalls:</p><p>&#8226; Even if the histogram is roughly flat, small sample sizes can mislead. &#8226; If there is a systematic shape (peaks or troughs), it indicates non-uniformity. &#8226; If you see that a&#770; or b&#770; changes drastically with a single outlier, it might mean your data is not truly uniform but has a heavier tail.</p><h2><strong>How can we handle a scenario where we suspect the data is uniform, but we also suspect noise outside the range [a, b]?</strong></h2><p>This is like a contaminated model:</p><ol><li><p>You might propose that with high probability p, X &#8764; U(a, b), but with small probability (1 &#8722; p), it falls outside [a, b].</p></li><li><p>The likelihood function then becomes a mixture model. You do partial MLE or EM-based fitting to estimate a, b, and p.</p></li><li><p>Alternatively, if you strongly suspect only a handful of points are noise, you might do iterative cleaning: estimate min&#8211;max, remove extreme outliers that deviate too far, and re-estimate. This is no longer the pure MLE but might be more practical.</p></li></ol><p>Potential pitfalls:</p><p>&#8226; Mixture models can be hard to fit if the &#8220;out of range&#8221; data doesn&#8217;t follow a well-defined distribution. &#8226; A small fraction of outliers can dramatically affect the uniform MLE unless you explicitly model that contamination.</p><h2><strong>If a and b are random variables themselves, can we do a hierarchical or Bayesian model?</strong></h2><p>Yes. In a Bayesian setting:</p><ol><li><p>Place priors on a and b (e.g., a prior that expects them to be near certain values).</p></li><li><p>The posterior distribution p(a, b | x&#8321;, &#8230;, x&#8345;) = (likelihood) &#215; (prior).</p></li><li><p>If the prior is conjugate-like or simplified, you can get closed-form posteriors in some special cases, but typically you use sampling methods (MCMC).</p></li></ol><p>Potential pitfalls:</p><p>&#8226; If your prior is too narrow (e.g., you strongly believe a &lt; 0 or b &gt; 10), data that contradicts this might need many samples to override the prior. &#8226; Misspecified priors can skew your posterior, so domain knowledge is crucial.</p><h2><strong>Could the MLE fail in degenerate cases (e.g., all samples are the same single value)?</strong></h2><p>Yes, in a degenerate scenario where all samples x&#7522; = c for some constant c:</p><ol><li><p>min(x&#7522;) = c and max(x&#7522;) = c, so a&#770; = b&#770; = c.</p></li><li><p>Then the likelihood function involves 1 / (b &#8722; a)&#8319;, but (b &#8722; a) = 0, so the pdf is not well-defined.</p></li></ol><p>In strict terms, the MLE does not exist or is infinite for the uniform distribution if all data are identical. The uniform model on an interval of zero length is not a valid pdf. Realistically, you might interpret that the data do not provide any information about the range. One might artificially expand the interval by an infinitesimal amount or consider an alternative model that allows for degenerate distributions.</p><p>Potential pitfalls:</p><p>&#8226; This is a boundary case in uniform distribution theory that reveals how the MLE formula can break down if the data lack variability. &#8226; If there is even a tiny variation in the data, the usual min&#8211;max approach is valid.</p><h2><strong>What are common numerical issues one might encounter when computing the uniform MLE in large-scale applications?</strong></h2><p>Although the actual formula for MLE is straightforward, large-scale or high-dimensional scenarios can lead to:</p><p>&#8226; Floating-point precision: If b &#8722; a is extremely large or extremely small, 1 / (b &#8722; a)&#8319; might overflow or underflow. &#8226; Data storage: Keeping track of min and max in a streaming fashion requires a reliable algorithm but is usually trivial (one pass). However, extreme values might be lost if the data are partially summarized incorrectly. &#8226; Parallelization: If data are distributed across many machines, you need a correct global min and global max. This typically involves a reduce operation over all nodes.</p><p>Potential pitfalls:</p><p>&#8226; Failing to collect the global min and max across all shards can lead to a misestimation of the MLE. &#8226; If min and max are computed in floating-point with rounding, slight inaccuracies are typically inconsequential, but you must be consistent across the pipeline.</p><h2><strong>What if the true distribution is slightly bigger than [min, max], but due to sampling variability we never see the extremes?</strong></h2><p>In reality, if the process truly generated data from [a_true, b_true], but your sample min and max are strictly inside that range, the MLE will estimate a&#770; = min(x&#7522;) &gt; a_true and b&#770; = max(x&#7522;) &lt; b_true. This is expected because the MLE is the best point estimate given your observed sample. However:</p><ol><li><p>The MLE is systematically biased for uniform distributions, especially with small samples.</p></li><li><p>If you need interval estimates that capture a_true and b_true with high probability, you need confidence intervals or Bayesian posterior intervals, which typically expand beyond the sample min and sample max to account for the possibility that you simply haven&#8217;t observed the true boundary extremes.</p></li></ol><p>Potential pitfalls:</p><p>&#8226; Overconfidence in a&#770; and b&#770; for small n can lead to errors in subsequent analysis. For instance, a forecast or simulation that assumes [a&#770;, b&#770;] might incorrectly exclude possible out-of-range future data. &#8226; In many engineering contexts, you might want to build in a safety margin around min and max to handle the possibility of unobserved extremes.</p><h2><strong>If the data comes from a time series, does the MLE formula still apply?</strong></h2><p>If the data are i.i.d. from a uniform distribution, time-series context doesn&#8217;t affect the math. But in many time-series scenarios, the data might exhibit autocorrelation, trends, or non-stationarity. That can break the uniform i.i.d. assumption:</p><ol><li><p>If X&#8348; are correlated across time, the joint likelihood is no longer simply the product of 1 / (b &#8722; a) for each sample.</p></li><li><p>If there is a trend, your min and max might shift over time, so a single [a, b] for all time might be inappropriate.</p></li><li><p>You might choose a rolling min&#8211;max approach or a piecewise uniform model over time segments.</p></li></ol><p>Potential pitfalls:</p><p>&#8226; If the underlying process systematically drifts upward, the sample max in early data might underestimate future extremes. &#8226; Non-stationarity makes the uniform model questionable. You might need additional parameters to describe how the bounds evolve over time.</p>]]></content:encoded></item><item><title><![CDATA[ML Interview Q Series: Modeling Server Wait Times Using a Mixture of Exponential Distributions]]></title><description><![CDATA[Browse all the Probability Interview Questions here.]]></description><link>https://www.rohan-paul.com/p/ml-interview-q-series-modeling-server</link><guid isPermaLink="false">https://www.rohan-paul.com/p/ml-interview-q-series-modeling-server</guid><pubDate>Tue, 03 Jun 2025 14:00:54 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!U32b!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b8460f1-85e5-41dc-8c09-f17162c93dc3_1024x508.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!U32b!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b8460f1-85e5-41dc-8c09-f17162c93dc3_1024x508.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!U32b!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b8460f1-85e5-41dc-8c09-f17162c93dc3_1024x508.png 424w, https://substackcdn.com/image/fetch/$s_!U32b!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b8460f1-85e5-41dc-8c09-f17162c93dc3_1024x508.png 848w, https://substackcdn.com/image/fetch/$s_!U32b!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b8460f1-85e5-41dc-8c09-f17162c93dc3_1024x508.png 1272w, https://substackcdn.com/image/fetch/$s_!U32b!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b8460f1-85e5-41dc-8c09-f17162c93dc3_1024x508.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!U32b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b8460f1-85e5-41dc-8c09-f17162c93dc3_1024x508.png" width="1024" height="508" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9b8460f1-85e5-41dc-8c09-f17162c93dc3_1024x508.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:508,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:648222,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165097797?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b8460f1-85e5-41dc-8c09-f17162c93dc3_1024x508.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!U32b!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b8460f1-85e5-41dc-8c09-f17162c93dc3_1024x508.png 424w, https://substackcdn.com/image/fetch/$s_!U32b!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b8460f1-85e5-41dc-8c09-f17162c93dc3_1024x508.png 848w, https://substackcdn.com/image/fetch/$s_!U32b!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b8460f1-85e5-41dc-8c09-f17162c93dc3_1024x508.png 1272w, https://substackcdn.com/image/fetch/$s_!U32b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b8460f1-85e5-41dc-8c09-f17162c93dc3_1024x508.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Browse all the <strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">Probability Interview Questions here</a></strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">.</a></p><h2><strong>15. Dropbox has just started and there are two servers for users: a faster server and a slower server. A user is routed randomly to either server. The wait time on each server is exponentially distributed but with different parameters. What is the probability density of a random user's waiting time?</strong></h2><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://x.com/rohanpaul_ai&quot;,&quot;text&quot;:&quot;Connect with me on X (Twitter)&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://x.com/rohanpaul_ai"><span>Connect with me on X (Twitter)</span></a></p><p>Understanding The Question</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Qc8X!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a083b01-d667-4991-b58d-2f03c42eba94_912x255.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Qc8X!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a083b01-d667-4991-b58d-2f03c42eba94_912x255.png 424w, https://substackcdn.com/image/fetch/$s_!Qc8X!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a083b01-d667-4991-b58d-2f03c42eba94_912x255.png 848w, https://substackcdn.com/image/fetch/$s_!Qc8X!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a083b01-d667-4991-b58d-2f03c42eba94_912x255.png 1272w, https://substackcdn.com/image/fetch/$s_!Qc8X!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a083b01-d667-4991-b58d-2f03c42eba94_912x255.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Qc8X!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a083b01-d667-4991-b58d-2f03c42eba94_912x255.png" width="912" height="255" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1a083b01-d667-4991-b58d-2f03c42eba94_912x255.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:255,&quot;width&quot;:912,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:57616,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165097797?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a083b01-d667-4991-b58d-2f03c42eba94_912x255.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Qc8X!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a083b01-d667-4991-b58d-2f03c42eba94_912x255.png 424w, https://substackcdn.com/image/fetch/$s_!Qc8X!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a083b01-d667-4991-b58d-2f03c42eba94_912x255.png 848w, https://substackcdn.com/image/fetch/$s_!Qc8X!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a083b01-d667-4991-b58d-2f03c42eba94_912x255.png 1272w, https://substackcdn.com/image/fetch/$s_!Qc8X!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a083b01-d667-4991-b58d-2f03c42eba94_912x255.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The user is routed with probability 1/2 to the faster server and 1/2 to the slower server. Because each server&#8217;s wait time follows an exponential distribution, the resulting overall distribution is a mixture of exponentials. This means that the final probability distribution is the weighted sum of the two exponential pdfs, with weights equal to the probabilities of being routed to each server.</p><p>Core Concept: Mixture of Exponentials</p><p>An exponential distribution with rate parameter &#955;<em> </em>has the pdf:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!f-jq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77062401-3f80-403b-9fd1-7c6d35d6d7f3_349x119.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!f-jq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77062401-3f80-403b-9fd1-7c6d35d6d7f3_349x119.png 424w, https://substackcdn.com/image/fetch/$s_!f-jq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77062401-3f80-403b-9fd1-7c6d35d6d7f3_349x119.png 848w, https://substackcdn.com/image/fetch/$s_!f-jq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77062401-3f80-403b-9fd1-7c6d35d6d7f3_349x119.png 1272w, https://substackcdn.com/image/fetch/$s_!f-jq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77062401-3f80-403b-9fd1-7c6d35d6d7f3_349x119.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!f-jq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77062401-3f80-403b-9fd1-7c6d35d6d7f3_349x119.png" width="349" height="119" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/77062401-3f80-403b-9fd1-7c6d35d6d7f3_349x119.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:119,&quot;width&quot;:349,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:7043,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165097797?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77062401-3f80-403b-9fd1-7c6d35d6d7f3_349x119.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!f-jq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77062401-3f80-403b-9fd1-7c6d35d6d7f3_349x119.png 424w, https://substackcdn.com/image/fetch/$s_!f-jq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77062401-3f80-403b-9fd1-7c6d35d6d7f3_349x119.png 848w, https://substackcdn.com/image/fetch/$s_!f-jq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77062401-3f80-403b-9fd1-7c6d35d6d7f3_349x119.png 1272w, https://substackcdn.com/image/fetch/$s_!f-jq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77062401-3f80-403b-9fd1-7c6d35d6d7f3_349x119.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aNst!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6800736f-d47a-4436-a4d1-cf5d1075f596_886x756.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aNst!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6800736f-d47a-4436-a4d1-cf5d1075f596_886x756.png 424w, https://substackcdn.com/image/fetch/$s_!aNst!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6800736f-d47a-4436-a4d1-cf5d1075f596_886x756.png 848w, https://substackcdn.com/image/fetch/$s_!aNst!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6800736f-d47a-4436-a4d1-cf5d1075f596_886x756.png 1272w, https://substackcdn.com/image/fetch/$s_!aNst!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6800736f-d47a-4436-a4d1-cf5d1075f596_886x756.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aNst!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6800736f-d47a-4436-a4d1-cf5d1075f596_886x756.png" width="886" height="756" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6800736f-d47a-4436-a4d1-cf5d1075f596_886x756.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:756,&quot;width&quot;:886,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:67232,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165097797?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6800736f-d47a-4436-a4d1-cf5d1075f596_886x756.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!aNst!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6800736f-d47a-4436-a4d1-cf5d1075f596_886x756.png 424w, https://substackcdn.com/image/fetch/$s_!aNst!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6800736f-d47a-4436-a4d1-cf5d1075f596_886x756.png 848w, https://substackcdn.com/image/fetch/$s_!aNst!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6800736f-d47a-4436-a4d1-cf5d1075f596_886x756.png 1272w, https://substackcdn.com/image/fetch/$s_!aNst!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6800736f-d47a-4436-a4d1-cf5d1075f596_886x756.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This function describes the probability density of the waiting time a random user experiences when the user is routed with 50% chance to either the faster or the slower server.</p><p>Detailed Reasoning and Explanation</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!i_gQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F060f233f-2a47-4499-942d-10e7c51540e4_931x172.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!i_gQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F060f233f-2a47-4499-942d-10e7c51540e4_931x172.png 424w, https://substackcdn.com/image/fetch/$s_!i_gQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F060f233f-2a47-4499-942d-10e7c51540e4_931x172.png 848w, https://substackcdn.com/image/fetch/$s_!i_gQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F060f233f-2a47-4499-942d-10e7c51540e4_931x172.png 1272w, https://substackcdn.com/image/fetch/$s_!i_gQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F060f233f-2a47-4499-942d-10e7c51540e4_931x172.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!i_gQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F060f233f-2a47-4499-942d-10e7c51540e4_931x172.png" width="931" height="172" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/060f233f-2a47-4499-942d-10e7c51540e4_931x172.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:172,&quot;width&quot;:931,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:33031,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165097797?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F060f233f-2a47-4499-942d-10e7c51540e4_931x172.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!i_gQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F060f233f-2a47-4499-942d-10e7c51540e4_931x172.png 424w, https://substackcdn.com/image/fetch/$s_!i_gQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F060f233f-2a47-4499-942d-10e7c51540e4_931x172.png 848w, https://substackcdn.com/image/fetch/$s_!i_gQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F060f233f-2a47-4499-942d-10e7c51540e4_931x172.png 1272w, https://substackcdn.com/image/fetch/$s_!i_gQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F060f233f-2a47-4499-942d-10e7c51540e4_931x172.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>&#8226; Because routing is random with equal probability, we form a 50&#8211;50 mixture of these two distributions. Mixture distributions arise frequently in queuing theory and practical load-balancing scenarios.</p><p>&#8226; The resulting pdf does not remain strictly exponential because it is a linear combination of two different exponential pdfs. It loses the memoryless property that a single exponential distribution has, because if you discover you are in a &#8220;slower&#8221; server route, the distribution of your waiting time is different from if you are in the &#8220;faster&#8221; server route.</p><p>&#8226; However, from a user&#8217;s perspective, all that matters is which server they happened to land on. If we look at the entire population of users without distinguishing which server they got, we must use this mixture pdf.</p><p>Final Probability Density</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cy_l!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f3fcd2b-87be-4f6d-89a4-9ba8480e2797_997x305.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cy_l!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f3fcd2b-87be-4f6d-89a4-9ba8480e2797_997x305.png 424w, https://substackcdn.com/image/fetch/$s_!cy_l!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f3fcd2b-87be-4f6d-89a4-9ba8480e2797_997x305.png 848w, https://substackcdn.com/image/fetch/$s_!cy_l!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f3fcd2b-87be-4f6d-89a4-9ba8480e2797_997x305.png 1272w, https://substackcdn.com/image/fetch/$s_!cy_l!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f3fcd2b-87be-4f6d-89a4-9ba8480e2797_997x305.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cy_l!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f3fcd2b-87be-4f6d-89a4-9ba8480e2797_997x305.png" width="997" height="305" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1f3fcd2b-87be-4f6d-89a4-9ba8480e2797_997x305.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:305,&quot;width&quot;:997,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:44101,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165097797?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f3fcd2b-87be-4f6d-89a4-9ba8480e2797_997x305.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!cy_l!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f3fcd2b-87be-4f6d-89a4-9ba8480e2797_997x305.png 424w, https://substackcdn.com/image/fetch/$s_!cy_l!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f3fcd2b-87be-4f6d-89a4-9ba8480e2797_997x305.png 848w, https://substackcdn.com/image/fetch/$s_!cy_l!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f3fcd2b-87be-4f6d-89a4-9ba8480e2797_997x305.png 1272w, https://substackcdn.com/image/fetch/$s_!cy_l!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1f3fcd2b-87be-4f6d-89a4-9ba8480e2797_997x305.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This is the direct and complete answer to the question.</p><p>Example Code Snippet for Generating Samples</p><p>Below is a short Python example illustrating how one might sample from this mixture distribution for simulation or testing. The code uses random choices to select which server rate is used, then samples from the corresponding exponential distribution:</p><pre><code><code>import numpy as np

def sample_mixture_exponential(n_samples, lambda_1, lambda_2):
    # n_samples: number of samples to generate
    # lambda_1 : rate parameter for faster server
    # lambda_2 : rate parameter for slower server

    # Step 1: Decide which server gets picked for each user
    # with 50% probability each
    server_choices = np.random.choice(
        [1, 2],
        size=n_samples,
        p=[0.5, 0.5]
    )

    # Step 2: Generate the waiting times
    # For each choice, sample from the corresponding exponential
    wait_times = np.zeros(n_samples)
    mask_server1 = (server_choices == 1)
    mask_server2 = (server_choices == 2)

    wait_times[mask_server1] = np.random.exponential(1.0 / lambda_1, size=np.sum(mask_server1))
    wait_times[mask_server2] = np.random.exponential(1.0 / lambda_2, size=np.sum(mask_server2))

    return wait_times

# Example usage:
samples = sample_mixture_exponential(n_samples=100000, lambda_1=5.0, lambda_2=1.0)
print(np.mean(samples))
</code></code></pre><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_SmH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F927e3909-b502-48be-9362-275ef77c5ef7_859x150.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_SmH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F927e3909-b502-48be-9362-275ef77c5ef7_859x150.png 424w, https://substackcdn.com/image/fetch/$s_!_SmH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F927e3909-b502-48be-9362-275ef77c5ef7_859x150.png 848w, https://substackcdn.com/image/fetch/$s_!_SmH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F927e3909-b502-48be-9362-275ef77c5ef7_859x150.png 1272w, https://substackcdn.com/image/fetch/$s_!_SmH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F927e3909-b502-48be-9362-275ef77c5ef7_859x150.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_SmH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F927e3909-b502-48be-9362-275ef77c5ef7_859x150.png" width="859" height="150" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/927e3909-b502-48be-9362-275ef77c5ef7_859x150.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:150,&quot;width&quot;:859,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:30332,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165097797?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F927e3909-b502-48be-9362-275ef77c5ef7_859x150.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_SmH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F927e3909-b502-48be-9362-275ef77c5ef7_859x150.png 424w, https://substackcdn.com/image/fetch/$s_!_SmH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F927e3909-b502-48be-9362-275ef77c5ef7_859x150.png 848w, https://substackcdn.com/image/fetch/$s_!_SmH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F927e3909-b502-48be-9362-275ef77c5ef7_859x150.png 1272w, https://substackcdn.com/image/fetch/$s_!_SmH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F927e3909-b502-48be-9362-275ef77c5ef7_859x150.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Practical Relevance</p><p>In the real world, especially in load balancing and cloud infrastructure, one often encounters mixtures of exponential (or other) distributions. Understanding that the overall waiting time can be modeled by a mixture helps in calculating average performance, tail probabilities, and other critical metrics for service-level agreements.</p><p>Possible Edge Cases and Subtleties</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FvZZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd846820-99af-45db-a536-1d4ee18fb6d6_928x307.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FvZZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd846820-99af-45db-a536-1d4ee18fb6d6_928x307.png 424w, https://substackcdn.com/image/fetch/$s_!FvZZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd846820-99af-45db-a536-1d4ee18fb6d6_928x307.png 848w, https://substackcdn.com/image/fetch/$s_!FvZZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd846820-99af-45db-a536-1d4ee18fb6d6_928x307.png 1272w, https://substackcdn.com/image/fetch/$s_!FvZZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd846820-99af-45db-a536-1d4ee18fb6d6_928x307.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FvZZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd846820-99af-45db-a536-1d4ee18fb6d6_928x307.png" width="928" height="307" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fd846820-99af-45db-a536-1d4ee18fb6d6_928x307.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:307,&quot;width&quot;:928,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:56827,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165097797?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd846820-99af-45db-a536-1d4ee18fb6d6_928x307.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!FvZZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd846820-99af-45db-a536-1d4ee18fb6d6_928x307.png 424w, https://substackcdn.com/image/fetch/$s_!FvZZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd846820-99af-45db-a536-1d4ee18fb6d6_928x307.png 848w, https://substackcdn.com/image/fetch/$s_!FvZZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd846820-99af-45db-a536-1d4ee18fb6d6_928x307.png 1272w, https://substackcdn.com/image/fetch/$s_!FvZZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd846820-99af-45db-a536-1d4ee18fb6d6_928x307.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.rohan-paul.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">I write everyday for my readers on actionable AI. Subscribe and instantly get a 1300+ page Python book.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2><strong>What if the servers receive different proportions of traffic rather than exactly 50&#8211;50?</strong></h2><p>Even though the original question implies equal probability routing, an interesting extension is to allow a fraction p to be routed to the faster server and 1&#8722;p to the slower server. The resulting pdf is then:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!F32Z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca6d908f-da8c-44e5-beab-e5ee6f66c4e7_905x123.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!F32Z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca6d908f-da8c-44e5-beab-e5ee6f66c4e7_905x123.png 424w, https://substackcdn.com/image/fetch/$s_!F32Z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca6d908f-da8c-44e5-beab-e5ee6f66c4e7_905x123.png 848w, https://substackcdn.com/image/fetch/$s_!F32Z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca6d908f-da8c-44e5-beab-e5ee6f66c4e7_905x123.png 1272w, https://substackcdn.com/image/fetch/$s_!F32Z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca6d908f-da8c-44e5-beab-e5ee6f66c4e7_905x123.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!F32Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca6d908f-da8c-44e5-beab-e5ee6f66c4e7_905x123.png" width="905" height="123" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ca6d908f-da8c-44e5-beab-e5ee6f66c4e7_905x123.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:123,&quot;width&quot;:905,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:15008,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165097797?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca6d908f-da8c-44e5-beab-e5ee6f66c4e7_905x123.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!F32Z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca6d908f-da8c-44e5-beab-e5ee6f66c4e7_905x123.png 424w, https://substackcdn.com/image/fetch/$s_!F32Z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca6d908f-da8c-44e5-beab-e5ee6f66c4e7_905x123.png 848w, https://substackcdn.com/image/fetch/$s_!F32Z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca6d908f-da8c-44e5-beab-e5ee6f66c4e7_905x123.png 1272w, https://substackcdn.com/image/fetch/$s_!F32Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca6d908f-da8c-44e5-beab-e5ee6f66c4e7_905x123.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>All the reasoning remains the same, but with different mixture weights. This can happen in practice if a load balancer is trying to shift more traffic to the faster server.</p><h2><strong>How does the memoryless property get affected in a mixture distribution?</strong></h2><p>The memoryless property of an exponential distribution states that, for an exponential random variable X with rate &#955;,</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pYTl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe35edb6a-18fb-4460-ad8c-8bd04d6afc47_459x70.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pYTl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe35edb6a-18fb-4460-ad8c-8bd04d6afc47_459x70.png 424w, https://substackcdn.com/image/fetch/$s_!pYTl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe35edb6a-18fb-4460-ad8c-8bd04d6afc47_459x70.png 848w, https://substackcdn.com/image/fetch/$s_!pYTl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe35edb6a-18fb-4460-ad8c-8bd04d6afc47_459x70.png 1272w, https://substackcdn.com/image/fetch/$s_!pYTl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe35edb6a-18fb-4460-ad8c-8bd04d6afc47_459x70.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pYTl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe35edb6a-18fb-4460-ad8c-8bd04d6afc47_459x70.png" width="459" height="70" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e35edb6a-18fb-4460-ad8c-8bd04d6afc47_459x70.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:70,&quot;width&quot;:459,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:6302,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165097797?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe35edb6a-18fb-4460-ad8c-8bd04d6afc47_459x70.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!pYTl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe35edb6a-18fb-4460-ad8c-8bd04d6afc47_459x70.png 424w, https://substackcdn.com/image/fetch/$s_!pYTl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe35edb6a-18fb-4460-ad8c-8bd04d6afc47_459x70.png 848w, https://substackcdn.com/image/fetch/$s_!pYTl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe35edb6a-18fb-4460-ad8c-8bd04d6afc47_459x70.png 1272w, https://substackcdn.com/image/fetch/$s_!pYTl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe35edb6a-18fb-4460-ad8c-8bd04d6afc47_459x70.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>When we have a mixture of exponential distributions, the overall random variable does not generally maintain that memoryless property. Once you know you have &#8220;survived&#8221; a certain amount of time (say s), it changes the posterior probability that you are being served by the slower or faster server. Thus, a mixture of two distinct exponentials is not memoryless.</p><h2><strong>Why is this mixture distribution important in load-balancing scenarios?</strong></h2><p>In many real-world systems, not all servers are homogeneous. If you direct incoming requests randomly across machines of varying performance, each machine can be modeled with its own exponential service time parameter (assuming exponential service times). The overall distribution of service times across all machines (if a request can land on any machine) becomes a mixture. Practitioners need to know that mixture distributions behave differently than a single exponential, influencing average waiting times, throughput, and system reliability.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AwHd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a326a43-3fe2-46e0-bb80-27738e497707_983x119.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AwHd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a326a43-3fe2-46e0-bb80-27738e497707_983x119.png 424w, https://substackcdn.com/image/fetch/$s_!AwHd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a326a43-3fe2-46e0-bb80-27738e497707_983x119.png 848w, https://substackcdn.com/image/fetch/$s_!AwHd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a326a43-3fe2-46e0-bb80-27738e497707_983x119.png 1272w, https://substackcdn.com/image/fetch/$s_!AwHd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a326a43-3fe2-46e0-bb80-27738e497707_983x119.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AwHd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a326a43-3fe2-46e0-bb80-27738e497707_983x119.png" width="983" height="119" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4a326a43-3fe2-46e0-bb80-27738e497707_983x119.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:119,&quot;width&quot;:983,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:15627,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165097797?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a326a43-3fe2-46e0-bb80-27738e497707_983x119.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!AwHd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a326a43-3fe2-46e0-bb80-27738e497707_983x119.png 424w, https://substackcdn.com/image/fetch/$s_!AwHd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a326a43-3fe2-46e0-bb80-27738e497707_983x119.png 848w, https://substackcdn.com/image/fetch/$s_!AwHd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a326a43-3fe2-46e0-bb80-27738e497707_983x119.png 1272w, https://substackcdn.com/image/fetch/$s_!AwHd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a326a43-3fe2-46e0-bb80-27738e497707_983x119.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Yes. One practical approach would be:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4zMx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4998f163-c85b-40e4-80bf-915798476eb5_894x174.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4zMx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4998f163-c85b-40e4-80bf-915798476eb5_894x174.png 424w, https://substackcdn.com/image/fetch/$s_!4zMx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4998f163-c85b-40e4-80bf-915798476eb5_894x174.png 848w, https://substackcdn.com/image/fetch/$s_!4zMx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4998f163-c85b-40e4-80bf-915798476eb5_894x174.png 1272w, https://substackcdn.com/image/fetch/$s_!4zMx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4998f163-c85b-40e4-80bf-915798476eb5_894x174.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4zMx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4998f163-c85b-40e4-80bf-915798476eb5_894x174.png" width="894" height="174" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4998f163-c85b-40e4-80bf-915798476eb5_894x174.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:174,&quot;width&quot;:894,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:34750,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165097797?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4998f163-c85b-40e4-80bf-915798476eb5_894x174.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!4zMx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4998f163-c85b-40e4-80bf-915798476eb5_894x174.png 424w, https://substackcdn.com/image/fetch/$s_!4zMx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4998f163-c85b-40e4-80bf-915798476eb5_894x174.png 848w, https://substackcdn.com/image/fetch/$s_!4zMx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4998f163-c85b-40e4-80bf-915798476eb5_894x174.png 1272w, https://substackcdn.com/image/fetch/$s_!4zMx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4998f163-c85b-40e4-80bf-915798476eb5_894x174.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>&#8226; If logs do not specify the server, it becomes more complex since we only see the mixture distribution. In that case, one might use an Expectation-Maximization (EM) algorithm for fitting a mixture of exponentials to the data.</p><h2><strong>What if the question asked about the cumulative distribution function (CDF)?</strong></h2><p>You could find the mixture CDF by taking the weighted sum of each server&#8217;s exponential CDF:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hSPe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fa8cbe6-b5d1-453f-bc6c-0e674a64be8a_919x196.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hSPe!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fa8cbe6-b5d1-453f-bc6c-0e674a64be8a_919x196.png 424w, https://substackcdn.com/image/fetch/$s_!hSPe!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fa8cbe6-b5d1-453f-bc6c-0e674a64be8a_919x196.png 848w, https://substackcdn.com/image/fetch/$s_!hSPe!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fa8cbe6-b5d1-453f-bc6c-0e674a64be8a_919x196.png 1272w, https://substackcdn.com/image/fetch/$s_!hSPe!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fa8cbe6-b5d1-453f-bc6c-0e674a64be8a_919x196.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hSPe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fa8cbe6-b5d1-453f-bc6c-0e674a64be8a_919x196.png" width="919" height="196" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7fa8cbe6-b5d1-453f-bc6c-0e674a64be8a_919x196.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:196,&quot;width&quot;:919,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:28016,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165097797?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fa8cbe6-b5d1-453f-bc6c-0e674a64be8a_919x196.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!hSPe!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fa8cbe6-b5d1-453f-bc6c-0e674a64be8a_919x196.png 424w, https://substackcdn.com/image/fetch/$s_!hSPe!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fa8cbe6-b5d1-453f-bc6c-0e674a64be8a_919x196.png 848w, https://substackcdn.com/image/fetch/$s_!hSPe!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fa8cbe6-b5d1-453f-bc6c-0e674a64be8a_919x196.png 1272w, https://substackcdn.com/image/fetch/$s_!hSPe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fa8cbe6-b5d1-453f-bc6c-0e674a64be8a_919x196.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h2><strong>How might we derive the moment-generating function (MGF) or characteristic function of a mixture?</strong></h2><p>For a mixture distribution, the MGF (moment-generating function) is the weighted sum of the MGFs of each component. For an exponential with rate &#955;, the MGF is:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vY34!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6dbf2ea-c42e-4353-848d-cea45b5e03dc_369x90.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vY34!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6dbf2ea-c42e-4353-848d-cea45b5e03dc_369x90.png 424w, https://substackcdn.com/image/fetch/$s_!vY34!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6dbf2ea-c42e-4353-848d-cea45b5e03dc_369x90.png 848w, https://substackcdn.com/image/fetch/$s_!vY34!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6dbf2ea-c42e-4353-848d-cea45b5e03dc_369x90.png 1272w, https://substackcdn.com/image/fetch/$s_!vY34!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6dbf2ea-c42e-4353-848d-cea45b5e03dc_369x90.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vY34!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6dbf2ea-c42e-4353-848d-cea45b5e03dc_369x90.png" width="369" height="90" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b6dbf2ea-c42e-4353-848d-cea45b5e03dc_369x90.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:90,&quot;width&quot;:369,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:5532,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165097797?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6dbf2ea-c42e-4353-848d-cea45b5e03dc_369x90.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vY34!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6dbf2ea-c42e-4353-848d-cea45b5e03dc_369x90.png 424w, https://substackcdn.com/image/fetch/$s_!vY34!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6dbf2ea-c42e-4353-848d-cea45b5e03dc_369x90.png 848w, https://substackcdn.com/image/fetch/$s_!vY34!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6dbf2ea-c42e-4353-848d-cea45b5e03dc_369x90.png 1272w, https://substackcdn.com/image/fetch/$s_!vY34!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6dbf2ea-c42e-4353-848d-cea45b5e03dc_369x90.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Hence for the mixture:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Hsng!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1b49f7a-5b7f-4ad6-a837-3f21f47606c4_444x84.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Hsng!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1b49f7a-5b7f-4ad6-a837-3f21f47606c4_444x84.png 424w, https://substackcdn.com/image/fetch/$s_!Hsng!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1b49f7a-5b7f-4ad6-a837-3f21f47606c4_444x84.png 848w, https://substackcdn.com/image/fetch/$s_!Hsng!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1b49f7a-5b7f-4ad6-a837-3f21f47606c4_444x84.png 1272w, https://substackcdn.com/image/fetch/$s_!Hsng!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1b49f7a-5b7f-4ad6-a837-3f21f47606c4_444x84.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Hsng!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1b49f7a-5b7f-4ad6-a837-3f21f47606c4_444x84.png" width="444" height="84" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a1b49f7a-5b7f-4ad6-a837-3f21f47606c4_444x84.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:84,&quot;width&quot;:444,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:6946,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165097797?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1b49f7a-5b7f-4ad6-a837-3f21f47606c4_444x84.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Hsng!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1b49f7a-5b7f-4ad6-a837-3f21f47606c4_444x84.png 424w, https://substackcdn.com/image/fetch/$s_!Hsng!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1b49f7a-5b7f-4ad6-a837-3f21f47606c4_444x84.png 848w, https://substackcdn.com/image/fetch/$s_!Hsng!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1b49f7a-5b7f-4ad6-a837-3f21f47606c4_444x84.png 1272w, https://substackcdn.com/image/fetch/$s_!Hsng!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1b49f7a-5b7f-4ad6-a837-3f21f47606c4_444x84.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>This can be used to find moments (like mean and variance) of T.</p><h2><strong>Could this distribution be generalized to more than two servers?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qbgZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed450b1d-a7fb-4b2b-80ad-635e22d8d365_948x328.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qbgZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed450b1d-a7fb-4b2b-80ad-635e22d8d365_948x328.png 424w, https://substackcdn.com/image/fetch/$s_!qbgZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed450b1d-a7fb-4b2b-80ad-635e22d8d365_948x328.png 848w, https://substackcdn.com/image/fetch/$s_!qbgZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed450b1d-a7fb-4b2b-80ad-635e22d8d365_948x328.png 1272w, https://substackcdn.com/image/fetch/$s_!qbgZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed450b1d-a7fb-4b2b-80ad-635e22d8d365_948x328.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qbgZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed450b1d-a7fb-4b2b-80ad-635e22d8d365_948x328.png" width="948" height="328" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ed450b1d-a7fb-4b2b-80ad-635e22d8d365_948x328.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:328,&quot;width&quot;:948,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:51798,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165097797?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed450b1d-a7fb-4b2b-80ad-635e22d8d365_948x328.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!qbgZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed450b1d-a7fb-4b2b-80ad-635e22d8d365_948x328.png 424w, https://substackcdn.com/image/fetch/$s_!qbgZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed450b1d-a7fb-4b2b-80ad-635e22d8d365_948x328.png 848w, https://substackcdn.com/image/fetch/$s_!qbgZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed450b1d-a7fb-4b2b-80ad-635e22d8d365_948x328.png 1272w, https://substackcdn.com/image/fetch/$s_!qbgZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed450b1d-a7fb-4b2b-80ad-635e22d8d365_948x328.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>What are some tricky points an interviewer might emphasize here?</strong></h2><p>&#8226; Recognizing that the overall distribution is a mixture of exponentials, rather than a single exponential. &#8226; Understanding memoryless vs. non-memoryless properties. &#8226; Knowing how to compute the pdf, CDF, MGF, or other statistics from a mixture. &#8226; Understanding how to handle or estimate mixture parameters in practice. &#8226; A potential trick could be the ratio of usage if it&#8217;s not 50&#8211;50, or if the question tries to see if you mistakenly average the rates rather than forming the correct mixture pdf.</p><p>All of these details showcase an in-depth grasp of the subject, which is often tested in high-level machine learning or data science interviews that delve into statistics, probability theory, and the mathematics underlying real-world system performance.</p><h2><strong>Below are additional follow-up questions</strong></h2><h2><strong>What if the arrival process is not purely random, but follows a specific pattern like round-robin or time-based routing?</strong></h2><p>One might initially assume that when the question says "a user is routed randomly," it aligns with a memoryless arrival and assignment process. However, if users are routed in a round-robin fashion or according to any non-random scheme, the overall waiting time distribution might deviate significantly from a simple mixture of exponentials. In round-robin routing, each server receives requests in a specific sequence (for example, first user goes to Server 1, second user goes to Server 2, third user goes back to Server 1, and so on). This deterministic assignment can concentrate bursts of users onto each server in turn and might result in subtle correlations between consecutive arrivals and the state of each server. These correlations can undermine the assumption that each user&#8217;s waiting time is simply an exponential draw from one or the other server.</p><p>Pitfalls and edge cases: &#8226; If arrival rates are high, a server could build up a queue of waiting jobs, and because the routing is round-robin rather than random, the waiting times might grow in a pattern (periodic bursts) that a pure mixture model fails to capture. &#8226; In real systems with dynamic load conditions, a short run of heavy traffic might all be assigned to the same server before switching to the other server, altering the wait distribution from a neat exponential mixture. &#8226; If someone naively attempts to fit an exponential mixture to these waiting times, they might arrive at misleading parameter estimates because the data do not reflect independent random assignments.</p><h2><strong>How do we handle potential hardware failures, where a server becomes unavailable or temporarily overloaded?</strong></h2><p>In practice, one cannot always assume both servers remain operational with stable rates. If the slower server fails for a certain duration, the routing might redirect 100% of users to the faster server. Alternatively, if the faster server is not available, the system temporarily routes everyone to the slower server. This downtime or partial capacity changes the observed wait-time distribution.</p><p>Pitfalls and edge cases: &#8226; If a server goes down intermittently, the mixture proportions can shift drastically over time, invalidating the assumption of a fixed probability for each server. &#8226; Overloaded servers can effectively slow their service rates, so the actual rate parameter may drift outside the initially modeled range (for example, a server that was "faster" might slow to a crawl if it is overloaded). &#8226; Capturing these events might require time-varying mixture distributions or even a phase-type model. Real-world logs would show that the distribution of waiting times changes whenever a server experiences downtime or severe overload.</p><h2><strong>What if the service times on each server are not perfectly exponential, but follow a heavier-tailed or more complex distribution?</strong></h2><p>The assumption of exponential waiting times is often a simplifying one, rooted in the memoryless property. Yet, many empirical measurements in real systems show heavier tails (e.g., lognormal, Pareto) due to caching effects, bursty requests, or user behavior patterns. If each server&#8217;s waiting time distribution is not purely exponential, using a mixture of exponentials may be too simplistic.</p><p>Pitfalls and edge cases: &#8226; A mismatch between real data (which might have outliers or long tails) and an exponential mixture could produce systematically biased estimates for average wait times or tail probabilities (e.g., 95th or 99th percentile latencies). &#8226; The memoryless assumption might lead to underestimation of queue buildup under heavy load, whereas heavier-tailed distributions can cause long queues to form more frequently. &#8226; A robust approach might involve fitting a mixture of lognormal distributions or another parametric form that accommodates heavier tails.</p><h2><strong>What if we are interested in the distribution of waiting times conditional on the wait time already exceeding a certain threshold?</strong></h2><p>In practice, one might care about metrics like: &#8220;Given that a user has already waited 5 seconds, how much longer can they expect to wait?&#8221; With a single exponential distribution, the answer is straightforward due to the memoryless property. However, with a mixture of two different exponentials, the distribution is no longer memoryless. The conditional wait distribution would shift because the likelihood that the user is on the slower server increases if they have already been waiting.</p><p>Pitfalls and edge cases: &#8226; Failing to account for the non-memoryless nature of a mixture distribution can lead to incorrect predictions of how much longer a user might wait past a certain threshold. &#8226; Implementation decisions&#8212;such as reassigning a user to a different server after a certain wait&#8212;become more complex because you need to model the mixture dynamic properly. &#8226; In simulation or queueing analysis, one must condition on the event that the wait already exceeded a certain time, which might require Markov chain or Bayesian approaches to track the likelihood of being in the slow vs. fast server route.</p><h2><strong>How do we ensure the mixture rates and proportions remain consistent under scaling scenarios, such as adding more servers over time?</strong></h2><p>If the system scales up from two servers to many servers, the mixture model might evolve. For instance, one might add a third server that is even faster, or replicate the existing faster server to handle more load. Over time, the distribution of wait times would shift from a two-component mixture to a three- (or more) component mixture. This continuous change in infrastructure can make a static two-component model outdated.</p><p>Pitfalls and edge cases: &#8226; Relying on a fixed two-exponential mixture to analyze waiting times, while the real system keeps adding or removing servers, leads to inaccuracies in capacity planning. &#8226; The likelihood of capturing new states (such as an even faster server) can significantly change the overall waiting-time statistics, making it necessary to retrain or refit the mixture model frequently. &#8226; If one server receives a different fraction of traffic or has dynamic load balancing rules, the effective mixture weights might shift as the system grows, so historical data might not reflect current conditions.</p><h2><strong>Could a priority or reservation system skew the observed mixture distribution?</strong></h2><p>In some real-world systems, certain high-priority jobs or premium users get queued on the faster server preferentially. If a portion of traffic is always assigned to the faster server, the actual routing probabilities might not be uniform. This yields a conditional probability that is different from the naive 50&#8211;50 assumption.</p><p>Pitfalls and edge cases: &#8226; A priority queue might direct high-priority tasks to the faster server, leaving only low-priority tasks in the slower server&#8217;s queue. The resulting data could mislead an analyst trying to estimate a simple 50&#8211;50 mixture. &#8226; Mixed priorities within each server could still be described by an exponential distribution, but the routing logic complicates the mixture proportions. &#8226; The fraction of tasks that go to each server might not remain static over time (e.g., surges in premium usage), and a single stationary mixture model might no longer hold.</p><h2><strong>How would we implement real-time estimation of the mixture distribution parameters when logs only show wait times, not which server they came from?</strong></h2><p>Sometimes, logs only contain a user&#8217;s wait time without identifying the particular server that provided service. In that case, we only see the mixture distribution directly. To infer the mixture rates and weights in real time, one might attempt an online learning or streaming approach to fit the mixture of exponentials.</p><p>Pitfalls and edge cases: &#8226; Estimating mixture parameters from unlabeled data typically requires the Expectation-Maximization (EM) algorithm or a Bayesian approach. This can be computationally intensive for large-scale systems. &#8226; Online parameter updates might become unstable if the system&#8217;s load conditions or server performance changes frequently, causing the parameter estimates to fluctuate. &#8226; If multiple servers end up having very similar rates, numerical estimation can become ill-conditioned, making it difficult to distinguish between them in the mixture model.</p><h2><strong>What if we need to model not only the waiting time but also the server&#8217;s response time distribution under concurrency constraints?</strong></h2><p>If each server can serve multiple users simultaneously (with a maximum concurrency limit), the waiting time for each user depends on how many others are being served at that moment. This can lead to service time interactions that are no longer described well by a pure exponential for each individual user.</p><p>Pitfalls and edge cases: &#8226; Under concurrency, the effective service rate can diminish when many users share the same server, so the exponential parameter might change dynamically. &#8226; The question might pivot from &#8220;What is the distribution of a single user&#8217;s wait?&#8221; to &#8220;How do I model queue lengths or response times under concurrency limits?&#8221; which typically involves more elaborate queueing theory (e.g., Erlang or M/M/c queues). &#8226; If concurrency is high, a small difference in server capabilities might be overshadowed by concurrency effects, making the mixture distribution an oversimplification that misses the queue length buildup.</p><h2><strong>What if the question asks about the long-run steady-state distribution of waiting times in a queueing system?</strong></h2><p>So far, we mostly discussed the distribution of service times when a user is directly routed to an idle server. However, if both servers can develop queues, the waiting time distribution must account for how requests queue up over time. The result can be more complex than a simple mixture of exponentials, especially if arrival rates approach the sum of the servers&#8217; capacities.</p><p>Pitfalls and edge cases: &#8226; In a stable queueing system (arrival rate below total service rate), the steady-state waiting time distribution might be derived using queueing theory like M/M/2 or some variant, which is not just a simple mixture of exponentials. &#8226; If traffic is high enough to saturate the servers, the system may not have a stable steady state, causing the average queue length to grow unbounded. &#8226; Real systems might use extra load balancing strategies (e.g., shortest queue routing), which changes the waiting time distribution dramatically compared to random routing.</p><h2><strong>How can we detect from real-world data that the mixture assumption might be invalid?</strong></h2><p>Sometimes a mixture of two exponentials is a good theoretical model, but actual logs or metrics might show discrepancies. One could compare the empirical distribution of wait times with the theoretical mixture distribution using techniques like the Kolmogorov&#8211;Smirnov test or Q-Q plots.</p><p>Pitfalls and edge cases: &#8226; A significant deviation between empirical data and the fitted mixture distribution might signal that the system is not truly a simple two-rate process (e.g., capacity constraints, concurrency, partial failures, or user behavior changes could all distort the distribution). &#8226; If the data exhibit too many long waits (heavy tail), then an exponential mixture might underpredict rare but extremely large values, suggesting a better fit with generalized Pareto or lognormal distributions. &#8226; Overfitting can occur if the system is dynamic and the user tries to fit a single mixture model to data that spans different operational regimes (peak vs. off-peak).</p><h2><strong>In practical monitoring and alerting, how can we leverage the mixture model for real-time decision-making?</strong></h2><p>Even if a mixture of exponentials is a rough approximation, it can still provide quick estimates of average wait times or tail latencies. Operators might use these estimates to set alert thresholds or auto-scaling triggers. However, they must be aware that a mixture model is only as accurate as its parameters and assumptions.</p><p>Pitfalls and edge cases: &#8226; If the system unexpectedly shifts from one operational mode to another (e.g., a major traffic surge), the previously calibrated mixture rates no longer match reality, causing incorrect alerts or missed alerts. &#8226; Overreliance on the average wait time, as opposed to the tail distributions, can hide service-level violations that occur under bursty conditions. &#8226; Real-time recalibration might be needed to track changes in server performance, so the mixture model does not become stale.</p><h2><strong>How do correlated arrival bursts impact the validity of the mixture distribution assumption?</strong></h2><p>In many real systems, users do not arrive independently; there may be sudden spikes in traffic (e.g., during peak hours or special events). If multiple users arrive nearly simultaneously, each server might receive a burst of requests. The mixture distribution alone cannot capture the subsequent queue buildup if the system was modeled only as &#8220;one user, one exponential wait.&#8221;</p><p>Pitfalls and edge cases: &#8226; Correlation in arrivals means the system can quickly shift from low utilization to very high utilization, affecting the distribution of waiting times in ways that a simple mixture model may fail to capture. &#8226; If the burst happens to route too many users to the slower server in a short time frame, observed waiting times can become skewed, leading to heavy right tails. &#8226; In real-world analytics, special care is needed to segment or cluster traffic by time of arrival so that bursty intervals do not contaminate the assumption of a stable mixture distribution.</p>]]></content:encoded></item><item><title><![CDATA[ML Interview Q Series: Maximum Likelihood Estimation for Exponential Rate λ in Lifetime Modeling]]></title><description><![CDATA[Browse all the Probability Interview Questions here.]]></description><link>https://www.rohan-paul.com/p/ml-interview-q-series-maximum-likelihood-6fb</link><guid isPermaLink="false">https://www.rohan-paul.com/p/ml-interview-q-series-maximum-likelihood-6fb</guid><pubDate>Tue, 03 Jun 2025 13:50:55 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!abcx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6db67648-e76c-4e19-adfb-d877863666f0_1024x573.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!abcx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6db67648-e76c-4e19-adfb-d877863666f0_1024x573.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!abcx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6db67648-e76c-4e19-adfb-d877863666f0_1024x573.png 424w, https://substackcdn.com/image/fetch/$s_!abcx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6db67648-e76c-4e19-adfb-d877863666f0_1024x573.png 848w, https://substackcdn.com/image/fetch/$s_!abcx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6db67648-e76c-4e19-adfb-d877863666f0_1024x573.png 1272w, https://substackcdn.com/image/fetch/$s_!abcx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6db67648-e76c-4e19-adfb-d877863666f0_1024x573.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!abcx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6db67648-e76c-4e19-adfb-d877863666f0_1024x573.png" width="1024" height="573" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6db67648-e76c-4e19-adfb-d877863666f0_1024x573.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:573,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1043126,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165096971?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6db67648-e76c-4e19-adfb-d877863666f0_1024x573.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!abcx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6db67648-e76c-4e19-adfb-d877863666f0_1024x573.png 424w, https://substackcdn.com/image/fetch/$s_!abcx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6db67648-e76c-4e19-adfb-d877863666f0_1024x573.png 848w, https://substackcdn.com/image/fetch/$s_!abcx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6db67648-e76c-4e19-adfb-d877863666f0_1024x573.png 1272w, https://substackcdn.com/image/fetch/$s_!abcx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6db67648-e76c-4e19-adfb-d877863666f0_1024x573.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Browse all the <strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">Probability Interview Questions here</a></strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">.</a></p><h2><strong>14. Say you model the lifetime for a set of customers using an exponential distribution with parameter &#955;, and you have the lifetime history of n customers. What is the MLE for &#955;?</strong></h2><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://x.com/rohanpaul_ai&quot;,&quot;text&quot;:&quot;Connect with me on X (Twitter)&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://x.com/rohanpaul_ai"><span>Connect with me on X (Twitter)</span></a></p><p>Understanding the exponential distribution and its maximum likelihood estimator is a crucial part of many machine learning or statistical modeling scenarios. The exponential distribution is commonly used to model time-to-event data or lifetimes, particularly because of its memoryless property and simplicity. Below is a thorough explanation of how to derive the MLE for &#955;, details on how to interpret it, considerations for edge cases, and follow-up question explorations.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cfhB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ac76943-e2e7-4f4f-9000-75943011c3e0_921x297.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cfhB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ac76943-e2e7-4f4f-9000-75943011c3e0_921x297.png 424w, https://substackcdn.com/image/fetch/$s_!cfhB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ac76943-e2e7-4f4f-9000-75943011c3e0_921x297.png 848w, https://substackcdn.com/image/fetch/$s_!cfhB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ac76943-e2e7-4f4f-9000-75943011c3e0_921x297.png 1272w, https://substackcdn.com/image/fetch/$s_!cfhB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ac76943-e2e7-4f4f-9000-75943011c3e0_921x297.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cfhB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ac76943-e2e7-4f4f-9000-75943011c3e0_921x297.png" width="921" height="297" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9ac76943-e2e7-4f4f-9000-75943011c3e0_921x297.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:297,&quot;width&quot;:921,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:70684,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165096971?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ac76943-e2e7-4f4f-9000-75943011c3e0_921x297.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!cfhB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ac76943-e2e7-4f4f-9000-75943011c3e0_921x297.png 424w, https://substackcdn.com/image/fetch/$s_!cfhB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ac76943-e2e7-4f4f-9000-75943011c3e0_921x297.png 848w, https://substackcdn.com/image/fetch/$s_!cfhB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ac76943-e2e7-4f4f-9000-75943011c3e0_921x297.png 1272w, https://substackcdn.com/image/fetch/$s_!cfhB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ac76943-e2e7-4f4f-9000-75943011c3e0_921x297.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Log-Likelihood and MLE Derivation for &#955; Suppose we have n independent observations of customer lifetimes: t&#8321;, t&#8322;, &#8230;, t&#8345;. We assume each T&#7522; follows the same exponential distribution with parameter &#955;. We want to find the value of &#955; that maximizes the likelihood function. The likelihood L(&#955;) is the product of the individual PDFs evaluated at each observed lifetime:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ZQ_F!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b5e508a-a746-4495-a1d8-72b2a14341d5_264x96.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZQ_F!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b5e508a-a746-4495-a1d8-72b2a14341d5_264x96.png 424w, https://substackcdn.com/image/fetch/$s_!ZQ_F!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b5e508a-a746-4495-a1d8-72b2a14341d5_264x96.png 848w, https://substackcdn.com/image/fetch/$s_!ZQ_F!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b5e508a-a746-4495-a1d8-72b2a14341d5_264x96.png 1272w, https://substackcdn.com/image/fetch/$s_!ZQ_F!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b5e508a-a746-4495-a1d8-72b2a14341d5_264x96.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZQ_F!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b5e508a-a746-4495-a1d8-72b2a14341d5_264x96.png" width="264" height="96" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0b5e508a-a746-4495-a1d8-72b2a14341d5_264x96.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:96,&quot;width&quot;:264,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:5010,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165096971?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b5e508a-a746-4495-a1d8-72b2a14341d5_264x96.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ZQ_F!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b5e508a-a746-4495-a1d8-72b2a14341d5_264x96.png 424w, https://substackcdn.com/image/fetch/$s_!ZQ_F!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b5e508a-a746-4495-a1d8-72b2a14341d5_264x96.png 848w, https://substackcdn.com/image/fetch/$s_!ZQ_F!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b5e508a-a746-4495-a1d8-72b2a14341d5_264x96.png 1272w, https://substackcdn.com/image/fetch/$s_!ZQ_F!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b5e508a-a746-4495-a1d8-72b2a14341d5_264x96.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p>To make it more convenient, we generally take the natural logarithm of the likelihood. This log-likelihood is:</p><p>ln(L(&#955;)) = ln(&#955;&#8319;) - &#955; &#8721;(t&#7522;).</p><p>Because ln(&#955;&#8319;) = n ln(&#955;), the expression becomes:</p><p>ln(L(&#955;)) = n ln(&#955;) - &#955; &#8721;(t&#7522;).</p><p>We want to find the &#955; that maximizes ln(L(&#955;)). To do so, we differentiate with respect to &#955; and set it to zero:</p><p>&#8706;/&#8706;&#955; [ n ln(&#955;) - &#955; &#8721;(t&#7522;) ] = (n / &#955;) - &#8721;(t&#7522;) = 0.</p><p>Rearranging gives:</p><p>n / &#955; = &#8721;(t&#7522;).</p><p>Thus,</p><p>&#955; = n / &#8721;(t&#7522;).</p><p>To confirm that this critical point is indeed a maximum, we can check the second derivative or use standard knowledge of exponential families. The second derivative is negative at that point, which indicates a maximum. Hence, the maximum likelihood estimator for &#955;, denoted &#955;&#770;, is:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pgAK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526ad153-ba59-4bfc-a79f-a2091ba82d1f_427x177.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pgAK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526ad153-ba59-4bfc-a79f-a2091ba82d1f_427x177.png 424w, https://substackcdn.com/image/fetch/$s_!pgAK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526ad153-ba59-4bfc-a79f-a2091ba82d1f_427x177.png 848w, https://substackcdn.com/image/fetch/$s_!pgAK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526ad153-ba59-4bfc-a79f-a2091ba82d1f_427x177.png 1272w, https://substackcdn.com/image/fetch/$s_!pgAK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526ad153-ba59-4bfc-a79f-a2091ba82d1f_427x177.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pgAK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526ad153-ba59-4bfc-a79f-a2091ba82d1f_427x177.png" width="427" height="177" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/526ad153-ba59-4bfc-a79f-a2091ba82d1f_427x177.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:177,&quot;width&quot;:427,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:10119,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165096971?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526ad153-ba59-4bfc-a79f-a2091ba82d1f_427x177.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!pgAK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526ad153-ba59-4bfc-a79f-a2091ba82d1f_427x177.png 424w, https://substackcdn.com/image/fetch/$s_!pgAK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526ad153-ba59-4bfc-a79f-a2091ba82d1f_427x177.png 848w, https://substackcdn.com/image/fetch/$s_!pgAK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526ad153-ba59-4bfc-a79f-a2091ba82d1f_427x177.png 1272w, https://substackcdn.com/image/fetch/$s_!pgAK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526ad153-ba59-4bfc-a79f-a2091ba82d1f_427x177.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>This expression tells us that the estimated rate parameter is the reciprocal of the sample mean lifetime. Intuitively, if you have n independent observed lifetimes t&#8321;, t&#8322;, &#8230;, t&#8345;, and their average is (1/n) &#8721;(t&#7522;), then &#955;&#770; is 1 over that average.</p><p>Practical Examples of Computing the MLE in Python Below is a simple Python snippet showing how one could compute &#955;&#770; given a list (or NumPy array) of observed lifetimes:</p><pre><code><code>import numpy as np

def mle_exponential(data):
    # data is a list or numpy array of lifetimes t_i
    # MLE for &#955; is n / sum of t_i
    n = len(data)
    total_lifetime = np.sum(data)
    lambda_mle = n / total_lifetime
    return lambda_mle

# Example usage:
observed_lifetimes = [2.3, 1.9, 3.2, 4.1, 2.0]
lambda_estimate = mle_exponential(observed_lifetimes)
print("Estimated &#955;:", lambda_estimate)
</code></code></pre><p>In real-world settings, you might use a library function (e.g., in <code>scipy.stats</code>) to fit distributions, but under the hood, this is effectively what it does for the exponential distribution.</p><p>Interpretation of the MLE If we interpret T&#7522; as the lifetime or time-to-event, then &#955;&#770; = n / (&#8721;t&#7522;) can be interpreted in two ways: &#8226; It is the rate parameter of the exponential distribution that best fits the observed data in the likelihood sense. &#8226; The mean lifetime is then 1 / &#955;&#770; = (&#8721;t&#7522;) / n, which is just the sample mean. Because the exponential distribution&#8217;s theoretical mean is 1 / &#955;, the estimator for the mean lifetime is consistent with the sample average.</p><p>Memoryless Property Reminder The exponential distribution is memoryless, meaning P(T &gt; s + t | T &gt; s) = P(T &gt; t). This property can be useful in certain modeling contexts (like queueing or reliability analysis). However, it also implies that if the data do not exhibit a memoryless type of behavior, the exponential model might not fit well. Nevertheless, if the exponential distribution is indeed appropriate, then the MLE formula above is straightforward.</p><p>Potential Issues in Real-World Data In practice, one must be aware that data might have: &#8226; Censoring (some customers may still be &#8220;active&#8221; at the time of data collection, so the total lifetime is not fully observed). &#8226; Reliability concerns (if the exponential assumption does not hold, or lifetimes have a heavier tail, a more general distribution such as Weibull might be more suitable). &#8226; Extreme values or measurement errors.</p><p>Despite these practical scenarios, if we assume fully observed lifetimes from an exponential distribution, the MLE formula above is exact.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.rohan-paul.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">I write everyday for my readers on actionable AI. Subscribe and instantly get a 1300+ page Python book.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2><strong>Follow-up Question 1: Why do we use the log-likelihood instead of directly maximizing the likelihood?</strong></h2><p>We use the log-likelihood for mathematical and computational convenience. The likelihood is the product of individual probability densities, which can become very small and lead to numerical underflow or instability when multiplied. Taking the natural logarithm converts the product into a sum, which is easier to handle computationally and simpler for analytical derivations.</p><p>Additionally, maximizing ln(L(&#955;)) is equivalent to maximizing L(&#955;) because the natural logarithm is a strictly increasing function. Hence, the location of the maximum (the MLE) remains unchanged whether we use L(&#955;) or ln(L(&#955;)).</p><h2><strong>Follow-up Question 2: How do we confirm that the critical point we found is indeed a maximum?</strong></h2><p>The derivative of the log-likelihood with respect to &#955; gave us &#955; = n / &#8721;(t&#7522;). To confirm that this is a maximum, we can evaluate the second derivative of ln(L(&#955;)):</p><p>&#8706;&#178;/&#8706;&#955;&#178; [ n ln(&#955;) - &#955; &#8721;(t&#7522;) ] = -n / &#955;&#178;,</p><p>which is negative for all &#955; &gt; 0. Because &#955; is always positive for an exponential distribution parameter, -n / &#955;&#178; &lt; 0, indicating the function is concave and thus the critical point is a global maximum.</p><h2><strong>Follow-up Question 3: Is this MLE estimator unbiased?</strong></h2><p>For the exponential distribution, the MLE &#955;&#770; = n / &#8721;(t&#7522;) is in fact a biased estimator for &#955;. The expected value of &#955;&#770; is not exactly &#955; but rather E[&#955;&#770;] = (n - 1) / (&#8721;(t&#7522;) / &#955;) &#215; &#955; if we consider the distribution of &#8721;(t&#7522;). The unbiased estimator can be corrected by a factor of (n - 1)/n, though in large n scenarios, the bias is small. Specifically, the unbiased estimator for &#955; can be derived from the fact that &#8721;(t&#7522;) ~ Gamma(n, 1/&#955;) when T&#7522; are i.i.d. exponential(&#955;).</p><p>In practice, the difference is often negligible for larger sample sizes n, and the MLE tends to be favored for its likelihood and asymptotic properties.</p><h2><strong>Follow-up Question 4: How do we handle the situation if there is right-censoring or left-censoring in the data?</strong></h2><p>Censoring means that for some customers, we do not fully observe their lifetime from 0 until the event occurs. For instance, if the customer is still active at the time we stop observing, or if we only started observing them sometime after they became active. The basic MLE formula &#955;&#770; = n / &#8721;(t&#7522;) assumes complete data without censoring.</p><p>In the presence of censoring, we need to modify the likelihood function. For right-censoring (the most common scenario where some lifetimes are only known to exceed a certain value), the likelihood is a product of PDFs for the observed lifetimes and survival functions for the censored lifetimes. The survival function for the exponential distribution is S(t) = P(T &#8805; t) = e^(&#8722;&#955;t). A partial likelihood approach or standard survival analysis techniques (like using the hazard function and partial likelihood for an exponential or Cox model) can be employed. The resulting MLE or maximum partial likelihood estimator might differ from the naive n / &#8721;(t&#7522;) formula.</p><h2><strong>Follow-up Question 5: How does the memoryless property connect with the MLE in real applications?</strong></h2><p>The memoryless property states that the distribution of additional lifetime given survival up to time s is the same as the original distribution. This is one of the defining characteristics of the exponential distribution. When the memoryless property truly holds in a process (e.g., a Poisson arrival process for which times between arrivals are exponential), the exponential distribution is a natural fit, and the MLE formula &#955;&#770; = n / &#8721;(t&#7522;) is very direct.</p><p>However, in many real-world datasets, lifetimes or waiting times can show patterns of aging or wear-out that violate memorylessness (e.g., higher likelihood of failure as time goes on). In such scenarios, the exponential distribution may under-fit or over-fit certain tails of the distribution, prompting a more flexible model like Weibull or Gamma.</p><h2><strong>Follow-up Question 6: Can we use Bayesian methods instead of MLE for estimating &#955;?</strong></h2><p>Yes, we can. In a Bayesian framework, we impose a prior distribution on &#955;, such as a Gamma(&#945;, &#946;) prior (conjugate for the exponential likelihood). Given observed data t&#8321;, t&#8322;, &#8230;, t&#8345;, the posterior distribution of &#955; will also be a Gamma distribution if the prior is Gamma. The posterior mean might then serve as an estimator for &#955;, which can differ slightly from the MLE, especially for small n or if strong prior beliefs are imposed. The MLE is the limit of the Bayesian posterior mode as the prior becomes uninformative.</p><h2><strong>Follow-up Question 7: Are there any computational pitfalls when implementing the MLE for very large datasets?</strong></h2><p>For large n and large &#8721;(t&#7522;), floating-point precision can become a concern when computing sums or exponentials (if one were directly computing the likelihood rather than the log-likelihood). Using the log-likelihood approach helps mitigate underflow or overflow issues. Summation can also be done in a numerically stable way by using techniques like Kahan summation in languages such as C++ or careful use of double precision in Python.</p><p>However, computing &#955;&#770; = n / &#8721;(t&#7522;) itself is generally straightforward even for large n, as long as we are mindful that &#8721;(t&#7522;) is not extremely large or extremely small in floating-point terms. If the dataset is enormous, we often process data in batches or streaming mode, accumulating partial sums carefully.</p><h2><strong>Follow-up Question 8: Why is the exponential distribution popular in reliability and survival analysis?</strong></h2><p>The exponential distribution is often used as a first modeling attempt in reliability because of its simplicity and its memoryless property. In reliability contexts, the parameter &#955; is interpreted as a constant hazard rate. This means the component or system being analyzed does not degrade over time, and the chance of failing in the next instant remains constant, regardless of how long it has already survived. Although many real systems do not have a constant hazard rate, the exponential distribution remains a useful baseline, and the MLE is straightforward.</p><h2><strong>Follow-up Question 9: How would we construct a confidence interval for &#955; once we have the MLE?</strong></h2><p>For large n, the asymptotic properties of the MLE tell us that &#955;&#770; is approximately normally distributed with variance Var(&#955;&#770;) = &#955;&#178; / n. More precisely, we can use the Fisher information. For the exponential distribution, the Fisher information for &#955; is:</p><p>I(&#955;) = n / &#955;&#178;.</p><p>Hence the asymptotic variance for &#955;&#770; is 1 / I(&#955;&#770;) = &#955;&#770;&#178; / n. This means we can construct an approximate 95% confidence interval via:</p><p>&#955;&#770; &#177; z ( &#955;&#770; / &#8730;n ),</p><p>where z is the appropriate quantile of the standard normal distribution (about 1.96 for 95% confidence). However, for more accurate intervals or smaller sample sizes, one might use other approaches such as the likelihood ratio test to construct a profile likelihood interval, or use the gamma distribution properties if the data is strictly exponential.</p><h2><strong>Follow-up Question 10: How does one verify if an exponential model is a good fit for the data?</strong></h2><p>Common checks include: &#8226; Plotting empirical survival function vs. fitted exponential survival function, or using a Q&#8211;Q plot (quantile-quantile plot). &#8226; Using formal statistical tests such as the Kolmogorov&#8211;Smirnov test or likelihood ratio tests compared to more flexible distributions (e.g., Weibull). &#8226; Checking if the rate of occurrence of events is more or less constant over time or if there are time-varying hazard rates.</p><p>If data show strong deviations&#8212;like systematic tail heaviness or initial burn-in periods&#8212;then the exponential distribution might be inadequate. The MLE formula is still valid mathematically if the data truly come from an exponential distribution, but it may not accurately model real behavior if the data do not.</p><h2><strong>Follow-up Question 11: What if any observed t&#7522; is zero or extremely close to zero?</strong></h2><p>In practice, if some t&#7522; are zero (meaning an event occurred immediately when observation started), the PDF technically allows T = 0 with probability density &#955; e^(&#8722;&#955;&#183;0) = &#955;. The MLE formula still holds, but you need to be sure that zero-valued observations make sense in your context. If they do, you will end up with a sum of t&#7522; that might not differ much from the sum of positive lifetimes. As long as the total sum is not zero and you have enough positive lifetimes, there is no infinite estimate for &#955;.</p><p>However, if all t&#7522; were zero&#8212;which is highly unlikely in real data&#8212;then the log-likelihood is not well-defined (sum of t&#7522; = 0) and &#955;&#770; would blow up. This is obviously a pathological case. Usually, real data from an exponential process will not have every observation at exactly zero.</p><h2><strong>Follow-up Question 12: Can we regularize or penalize the MLE if we want more stable estimates?</strong></h2><p>Yes. In practice, a penalized likelihood or Bayesian approach can shrink &#955; estimates. For instance, one might add a penalty term -&#945; ln(&#955;) if you have a prior sense that &#955; should not be too large or too small. In effect, this is reminiscent of adding a Gamma prior in the Bayesian case. Penalized likelihood can be valuable in small-sample or high-variance environments. The unconditional MLE might produce extreme values of &#955; if &#8721;(t&#7522;) is relatively small or if n is small, so a penalized approach helps smooth that out.</p><h2><strong>Follow-up Question 13: How might we interpret the result in terms of a Poisson process perspective?</strong></h2><p>One reason the exponential distribution is so common is that it describes waiting times in a Poisson process. If events occur in a Poisson process at rate &#955;, then the interarrival times between consecutive events are exponentially distributed with parameter &#955;. Fitting &#955; from observed interarrival times using the same MLE formula is directly telling us the rate of the underlying Poisson process.</p><p>In a business context (e.g., modeling time until a customer churns or time until a server fails), if we treat those events as a Poisson process, the MLE suggests how frequently we can expect those events on average. If &#955;&#770; is large, it suggests short average waiting times, meaning churn or failure is frequent.</p><h2><strong>Follow-up Question 14: How do we adapt the code if we want to do a quick check for multiple parameter values?</strong></h2><p>You could do a grid search or a direct numeric optimization over &#955;. Below is a simple code snippet to illustrate computing the log-likelihood for multiple &#955; values, though normally we would just do the analytical solution for the exponential distribution:</p><pre><code><code>import numpy as np
import matplotlib.pyplot as plt

def log_likelihood_exponential(lambda_val, data):
    n = len(data)
    return n * np.log(lambda_val) - lambda_val * np.sum(data)

data = [2.3, 1.9, 3.2, 4.1, 2.0]
lambda_vals = np.linspace(0.01, 2.0, 200)
log_likes = [log_likelihood_exponential(l, data) for l in lambda_vals]

plt.plot(lambda_vals, log_likes, label='Log-Likelihood')
plt.axvline(x=len(data)/np.sum(data), color='r', linestyle='--', label='MLE')
plt.xlabel('&#955;')
plt.ylabel('Log-Likelihood')
plt.legend()
plt.show()
</code></code></pre><p>By visually inspecting this curve, you would see a clear maximum at &#955;&#770; = n / &#8721;(t&#7522;).</p><h2><strong>Follow-up Question 15: What is the intuition behind the reciprocal relationship between the mean lifetime and &#955;?</strong></h2><p>The exponential distribution&#8217;s mean lifetime is 1 / &#955;. When you see that the MLE for &#955; is n / &#8721;(t&#7522;), it matches exactly with thinking about the sample mean lifetime: 1 / &#955;&#770; = (&#8721;(t&#7522;)) / n. This is a hallmark of the exponential distribution&#8217;s simplicity. The rate parameter &#955; is large if you observe many events in a short time (i.e., short lifetimes), and &#955; is small if events occur less frequently (i.e., long lifetimes).</p><p>In effect, by inverting the sample mean, you get a rate that describes how quickly events are occurring on average.</p><h2><strong>Follow-up Question 16: Could there be numerical stability problems if &#8721;(t&#7522;) is extremely large or extremely small?</strong></h2><p>Yes, extremely large sums (e.g., if you have an enormous number of points over a significant time) or extremely small sums (somehow all events occur in very short times) could cause floating-point concerns. In typical double-precision arithmetic, dividing n by a very large &#8721;(t&#7522;) might cause &#955;&#770; to be underflow-level small. Dividing by a very small sum might produce a very large &#955;&#770; that risks overflow, though Python&#8217;s float can handle quite large exponents before producing infinities.</p><p>In real practice, you can mitigate these issues by storing sums in higher precision types (like double precision if your language defaults to single precision). For extremely large data sets, you can consider streaming sums with proper numeric stability or mini-batch approaches.</p><h2><strong>Follow-up Question 17: What if we suspect the data come from a mixture of exponentials (e.g., a mixture model with multiple rates)?</strong></h2><p>If you have a mixture of exponential distributions&#8212;for example, some customers have a short-time rate, others have a long-time rate&#8212;then the standard MLE formula &#955;&#770; = n / &#8721;(t&#7522;) no longer applies directly. Instead, you need to use an EM (Expectation-Maximization) algorithm to estimate the mixture parameters. The EM algorithm iteratively assigns probabilities that each data point belongs to each mixture component, then re-estimates the parameters for those components until convergence.</p><p>In that scenario, you won&#8217;t have a single closed-form solution for &#955;. Instead, each mixture component has its own &#955;, and the data are partitioned probabilistically among the components. That is a more complex scenario but commonly encountered in real data where not everyone can be well-modeled by the same single rate.</p><h2><strong>Follow-up Question 18: Are there well-known transformations that allow us to do simpler linear regressions if we want to incorporate covariates?</strong></h2><p>For parametric survival models such as exponential, a log-linear model approach can be used: we might say &#955;&#7522; = exp(&#946;&#8320; + &#946;&#8321;x&#7522;&#8321; + &#8230;). This leads to a parametric form of a survival model, and we can estimate parameters {&#946;&#8320;, &#946;&#8321;, &#8230;} by maximizing the corresponding likelihood. In the special case of exponential, the hazard is constant for each individual, but it can differ across individuals depending on their covariates. Packages such as <code>lifelines</code> in Python or <code>survival</code> in R implement these types of regression models.</p><p>This is conceptually related to the fact that if T&#7522; is exponential(&#955;&#7522;), the log-likelihood can incorporate the dependence of &#955;&#7522; on covariates, typically using a link function (like log link for the rate).</p><h2><strong>Follow-up Question 19: Could the MLE be used directly if we only have aggregated data (e.g., a histogram of lifetimes)?</strong></h2><p>If we only have aggregated data, say we know how many customers fall into time bins [0, 1), [1, 2), etc., we would not have the exact t&#7522; for each individual. In that case, you need to approximate the likelihood function by using the distribution function over those intervals or treat each bin count as a separate portion of the likelihood. The MLE derivation would not be as straightforward because we lose the individual data points. Instead, we would compute a binned likelihood. The result can still be found numerically, but it is typically not as simple as n / &#8721;(t&#7522;), unless you have reasoned carefully about how you treat the midpoints or endpoints of your bins.</p><h2><strong>Follow-up Question 20: What are the main takeaways for a data scientist or ML engineer?</strong></h2><p>The exponential distribution with parameter &#955; is among the simplest continuous distributions for nonnegative data. Its MLE can be written in a straightforward closed-form expression:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!X5Tc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26807895-65af-4ed5-8fdf-9bdae8d3c26b_457x191.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!X5Tc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26807895-65af-4ed5-8fdf-9bdae8d3c26b_457x191.png 424w, https://substackcdn.com/image/fetch/$s_!X5Tc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26807895-65af-4ed5-8fdf-9bdae8d3c26b_457x191.png 848w, https://substackcdn.com/image/fetch/$s_!X5Tc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26807895-65af-4ed5-8fdf-9bdae8d3c26b_457x191.png 1272w, https://substackcdn.com/image/fetch/$s_!X5Tc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26807895-65af-4ed5-8fdf-9bdae8d3c26b_457x191.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!X5Tc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26807895-65af-4ed5-8fdf-9bdae8d3c26b_457x191.png" width="457" height="191" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/26807895-65af-4ed5-8fdf-9bdae8d3c26b_457x191.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:191,&quot;width&quot;:457,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:10429,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165096971?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26807895-65af-4ed5-8fdf-9bdae8d3c26b_457x191.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!X5Tc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26807895-65af-4ed5-8fdf-9bdae8d3c26b_457x191.png 424w, https://substackcdn.com/image/fetch/$s_!X5Tc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26807895-65af-4ed5-8fdf-9bdae8d3c26b_457x191.png 848w, https://substackcdn.com/image/fetch/$s_!X5Tc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26807895-65af-4ed5-8fdf-9bdae8d3c26b_457x191.png 1272w, https://substackcdn.com/image/fetch/$s_!X5Tc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26807895-65af-4ed5-8fdf-9bdae8d3c26b_457x191.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The logic behind this estimator is that the likelihood function is a product of exponentials, whose log-likelihood is easiest to maximize by focusing on the sum of observed lifetimes. This yields a direct relationship between the estimated rate and the average observation.</p><p>In practice, data scientists often use this as a baseline model for time-to-event problems. If the fit is good, it can be a powerful tool due to its simplicity. If the data show stronger or weaker tail behavior, or we have censoring or multiple subpopulations, we might move to more sophisticated distributions or mixture models.</p><p>In any event, the MLE approach remains the cornerstone of parametric inference for exponential distributions and is widely used across reliability engineering, queueing theory, churn analysis, medical survival analysis, and more.</p><div><hr></div><h2><strong>Below are additional follow-up questions</strong></h2><h2><strong>Follow-up Question: How does the method of moments estimator for &#955; compare to the MLE for an exponential distribution?</strong></h2><p>When fitting an exponential distribution with parameter &#955;, one common alternative to the MLE is the method of moments estimator. In the method of moments, we equate the theoretical mean of the distribution to the sample mean. For an exponential distribution with parameter &#955;, the theoretical mean is 1 / &#955;. Hence, the method of moments estimator &#955;&#8344;&#8338;&#8344; is found by setting:</p><p>1 / &#955;&#8344;&#8338;&#8344; = (1 / n) &#8721;(t&#7522;).</p><p>Thus,</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2iaR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e6c1f21-e0b3-4c68-ad19-42b5a9ecce86_751x207.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2iaR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e6c1f21-e0b3-4c68-ad19-42b5a9ecce86_751x207.png 424w, https://substackcdn.com/image/fetch/$s_!2iaR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e6c1f21-e0b3-4c68-ad19-42b5a9ecce86_751x207.png 848w, https://substackcdn.com/image/fetch/$s_!2iaR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e6c1f21-e0b3-4c68-ad19-42b5a9ecce86_751x207.png 1272w, https://substackcdn.com/image/fetch/$s_!2iaR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e6c1f21-e0b3-4c68-ad19-42b5a9ecce86_751x207.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2iaR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e6c1f21-e0b3-4c68-ad19-42b5a9ecce86_751x207.png" width="751" height="207" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2e6c1f21-e0b3-4c68-ad19-42b5a9ecce86_751x207.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:207,&quot;width&quot;:751,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:15047,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165096971?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e6c1f21-e0b3-4c68-ad19-42b5a9ecce86_751x207.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2iaR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e6c1f21-e0b3-4c68-ad19-42b5a9ecce86_751x207.png 424w, https://substackcdn.com/image/fetch/$s_!2iaR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e6c1f21-e0b3-4c68-ad19-42b5a9ecce86_751x207.png 848w, https://substackcdn.com/image/fetch/$s_!2iaR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e6c1f21-e0b3-4c68-ad19-42b5a9ecce86_751x207.png 1272w, https://substackcdn.com/image/fetch/$s_!2iaR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e6c1f21-e0b3-4c68-ad19-42b5a9ecce86_751x207.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Interestingly, for the exponential distribution, the method of moments estimator matches the MLE exactly. This is a special coincidence for exponential (and some other one-parameter distributions where the first raw moment uniquely identifies the parameter and the likelihood leads to the same requirement). As a result, there is no practical difference between the two estimators in terms of their point estimate.</p><p>However, in more complex or multi-parameter distributions, the method of moments estimator may differ from the MLE. But for this single-parameter exponential case, the equality holds, which also means there is no tension between these two methods of estimation.</p><p>Potential pitfalls and subtleties: &#8226; In more complex models (e.g., mixture distributions, multi-parameter survival models), the method of moments might not coincide with the MLE and can sometimes produce estimates that are not even valid (like negative estimates if the parameter must be positive). &#8226; For larger parameter spaces, the MLE generally has stronger asymptotic properties, but the method of moments can be simpler to calculate and interpret in certain distributions. For the exponential distribution, those concerns vanish because the two methods coincide.</p><h2><strong>Follow-up Question: What if the data includes nonpositive lifetimes (i.e., zero or negative values that are not physically valid)?</strong></h2><p>The exponential distribution models lifetimes t &#8805; 0. If you observe negative values in the dataset (which can happen due to data entry errors, clock synchronization issues, or other anomalies), it poses a direct violation of the assumption that T &#8805; 0.</p><p>Dealing with such values typically involves: &#8226; Data Cleaning: Investigate and remove or correct entries that are negative due to errors. If such values are small but nonnegative (like -0.0001 due to numerical issues), you might clamp them to zero or a very small positive epsilon. &#8226; Modeling Shifted Data: In some rare cases where negative values might represent times before a reference point, you might shift all times so they are nonnegative. But that changes the interpretation of &#955;. &#8226; Checking Model Appropriateness: If too many values are effectively zero, it might hint the process has an instantaneous event probability at time 0, which could indicate the exponential assumption is incomplete or the data collection scheme is flawed.</p><p>Because the exponential distribution is only defined for t &#8805; 0, the presence of negative data automatically invalidates the standard MLE derivation. Typically, you cannot apply the standard formula &#955; = n / &#8721;(t&#7522;) without discarding or otherwise reconciling negative observations.</p><p>Pitfall: &#8226; Blindly including negative or zero values in the sum &#8721;(t&#7522;) might lead to nonsensical estimates or extremely large &#955; (if the sum is too small). Always check data validity before applying the MLE formula.</p><h2><strong>Follow-up Question: How do we handle missing data that are not simply censored, but truly absent?</strong></h2><p>In some real-world scenarios, a subset of customer lifetimes might be missing entirely for various reasons (lost records, data corruption, etc.). This is different from right-censoring, where you know the customer lifetime exceeded a certain threshold but not the exact value. Here, you simply do not have the data at all.</p><p>Standard MLE with complete case analysis (i.e., only using the subset of data that is fully observed) assumes the missingness is completely random (MCAR&#8212;Missing Completely at Random). If that assumption holds, focusing on the subset with observed lifetimes is a valid approach, yielding the MLE:</p><h2><strong>ParseError: KaTeX parse error: Double subscript at position 63: &#8230;m_of_observed_t_&#818;i )</strong></h2><p>However, if the data are not missing completely at random&#8212;for example, short lifetimes might be more (or less) likely to be recorded&#8212;your estimate will be biased. More sophisticated methods of dealing with missing data include: &#8226; Multiple imputation: You create plausible replacements for missing values based on an assumed model, then average over several imputed datasets. &#8226; Model-based methods: If you have partial knowledge about which data are missing and why, you might build that knowledge into the likelihood or use an EM algorithm adapted for missing data. &#8226; Sensitivity analysis: You can test different assumptions about the missingness mechanism and see how the resulting &#955; estimate changes.</p><p>Pitfall:</p><p>&#8226; Incorrect assumptions about the missingness can lead to systematically biased &#955; estimates. If short-lifetime or long-lifetime customers are systematically missing, the naive MLE approach will not reflect the true underlying distribution.</p><h2><strong>Follow-up Question: Can we still apply the exponential MLE formula if data points are correlated rather than i.i.d.?</strong></h2><p>The derivation for the exponential MLE relies on the assumption that T&#8321;, T&#8322;, &#8230;, T&#8345; are independent and identically distributed. If there is correlation (e.g., the lifetime of one customer influences or is influenced by the lifetime of another customer), the standard likelihood factorization as a simple product of individual densities does not strictly apply.</p><p>In correlated settings, the correct likelihood is a joint distribution that might be significantly more complex. Applying the i.i.d. formula &#955; = n / &#8721;(t&#7522;) can be viewed as an approximation. Whether it yields a reasonable estimate depends on how strong the correlation is: &#8226; If correlation is weak or can be ignored for practical purposes, the MLE derived under an i.i.d. assumption might still be used as a near-approximation. &#8226; If correlation is strong, ignoring it can lead to systematic bias or incorrect inference about &#955;.</p><p>Real-world correlation examples: &#8226; Grouped or clustered data, such as customers from the same household or region. They might share characteristics affecting their lifetime distribution. &#8226; Dependence introduced by real-world events (e.g., a shared external event causing simultaneous churn).</p><p>Pitfall: &#8226; Overlooking correlation can result in underestimated variance of &#955;&#770;. The standard confidence intervals that assume i.i.d. data might be overly optimistic.</p><h2><strong>Follow-up Question: How do we use information criteria like AIC or BIC to compare the exponential model with more complex models?</strong></h2><p>AIC (Akaike Information Criterion) and BIC (Bayesian Information Criterion) provide a penalized measure of model fit:</p><p>&#8226; AIC = -2 ln(L) + 2k &#8226; BIC = -2 ln(L) + k ln(n)</p><p>where ln(L) is the maximized log-likelihood and k is the number of parameters in the model. For a single-parameter exponential distribution, k = 1. For more complex distributions (like Weibull or Gamma), k might be 2 or more.</p><p>Using these criteria: &#8226; Compute the MLE for each candidate model and record the maximum log-likelihood. &#8226; Calculate AIC or BIC for each model. &#8226; Compare the scores; lower AIC or BIC typically indicates a better balance of model fit and complexity.</p><p>Even though exponential is simpler (k = 1), if the data exhibits a shape that a Weibull distribution with an extra shape parameter can better capture, the improvement in log-likelihood might outweigh the penalty for additional parameters. BIC typically favors simpler models more heavily than AIC, especially with large n.</p><p>Pitfall: &#8226; Overfitting or underfitting can occur if you rely solely on these criteria without also examining the residuals or domain context. The exponential model might pass a basic test but still systematically misfit the tail behavior of the data.</p><h2><strong>Follow-up Question: How can we perform a parametric bootstrap to assess the variability of the MLE for &#955;?</strong></h2><p>A parametric bootstrap is a simulation-based technique used to approximate the sampling distribution of an estimator. For the exponential MLE:</p><ol><li><p>Compute the MLE &#955;&#770; = n / &#8721;(t&#7522;) from the observed data.</p></li><li><p>Generate B bootstrap samples, each of size n, from an exponential distribution with parameter &#955;&#770;.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8Kq0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d4cbee7-2d54-4aff-b3a6-8d10612068a5_921x297.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8Kq0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d4cbee7-2d54-4aff-b3a6-8d10612068a5_921x297.png 424w, https://substackcdn.com/image/fetch/$s_!8Kq0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d4cbee7-2d54-4aff-b3a6-8d10612068a5_921x297.png 848w, https://substackcdn.com/image/fetch/$s_!8Kq0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d4cbee7-2d54-4aff-b3a6-8d10612068a5_921x297.png 1272w, https://substackcdn.com/image/fetch/$s_!8Kq0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d4cbee7-2d54-4aff-b3a6-8d10612068a5_921x297.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8Kq0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d4cbee7-2d54-4aff-b3a6-8d10612068a5_921x297.png" width="921" height="297" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1d4cbee7-2d54-4aff-b3a6-8d10612068a5_921x297.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:297,&quot;width&quot;:921,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:67515,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165096971?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d4cbee7-2d54-4aff-b3a6-8d10612068a5_921x297.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8Kq0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d4cbee7-2d54-4aff-b3a6-8d10612068a5_921x297.png 424w, https://substackcdn.com/image/fetch/$s_!8Kq0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d4cbee7-2d54-4aff-b3a6-8d10612068a5_921x297.png 848w, https://substackcdn.com/image/fetch/$s_!8Kq0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d4cbee7-2d54-4aff-b3a6-8d10612068a5_921x297.png 1272w, https://substackcdn.com/image/fetch/$s_!8Kq0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d4cbee7-2d54-4aff-b3a6-8d10612068a5_921x297.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div></li></ol><p>Pitfalls: &#8226; The bootstrap can be computationally intensive for very large datasets, though the exponential distribution is fast to sample from. &#8226; The method assumes that the parametric form (exponential) is correct. If it is not, bootstrapping around that assumption might be misleading.</p><h2><strong>Follow-up Question: What if &#955; itself varies over time, violating the assumption of a constant rate?</strong></h2><p>In many real-world applications (e.g., customer churn over a product lifecycle, machine failure rates over aging cycles), the rate parameter may not be constant. The exponential model assumes a constant hazard &#955;, which might not match time-varying hazard rates.</p><p>To handle time-varying rates: &#8226; Piecewise Exponential Model: Partition the timeline into segments (e.g., [0, 1), [1, 2), etc.), each with its own rate parameter &#955;&#7522;. In each segment, assume an exponential distribution with parameter &#955;&#7522;. You then estimate multiple &#955;&#7522; values, effectively creating a stepwise hazard function. &#8226; Weibull or Cox Proportional Hazards: These are more flexible survival analysis frameworks that allow for time-varying hazard functions or incorporate covariates that can change the effective rate. &#8226; Nonparametric Methods: Kaplan-Meier estimates can be used for analyzing the survival function without strictly assuming an exponential form.</p><p>Pitfall: &#8226; Using a single &#955; for data that clearly have changing rates over time leads to biased or poor fits. The memoryless property is specifically for constant rate processes. If that property is evidently broken, the exponential assumption is no longer valid.</p><h2><strong>Follow-up Question: Could we employ robust estimation techniques if the data has outliers?</strong></h2><p>Although outliers in lifetime data might be less common than in other contexts, occasionally you see extremely long or short lifetimes that do not fit the typical distribution pattern. MLE for exponential distributions can be sensitive to outliers, especially if n is small. If a single or few extremely large lifetimes appear, the sum &#8721;(t&#7522;) becomes much larger, pushing &#955;&#770; downward.</p><p>Robust estimation approaches: &#8226; Winsorizing or trimming extreme values to reduce their undue influence. &#8226; Bayesian approach with a prior that limits how extremely large or small &#955; can become. &#8226; Using a heavier-tailed distribution (like a Gamma distribution) if outliers are genuine and indicate tail behavior not compatible with an exponential form.</p><p>Pitfall: &#8226; Blindly removing or trimming outliers might remove genuine extreme observations. This might improve the &#8220;fit&#8221; but degrade real predictive performance if, indeed, true rare but large lifetimes occur in the real process.</p><h2><strong>Follow-up Question: How do we connect continuous exponential models to their discrete-time analogs?</strong></h2><p>In discrete time settings, the geometric distribution is the analogue to the continuous exponential distribution in that both exhibit the memoryless property. In continuous time, the exponential distribution is memoryless; in discrete time, the geometric distribution is memoryless.</p><p>If you observe data in discrete intervals (e.g., each day or week you check if a customer churned), you might approximate the time-to-event using a geometric distribution with parameter p. The relationship between &#955; and p can be made by considering: &#8226; p &#8776; 1 &#8722; e^(&#8722;&#955;&#916;t), where &#916;t is the length of each discrete time step.</p><p>When &#916;t is small, p is small, and the geometric distribution&#8217;s parameter p is roughly &#955; times the time-step length. Estimating p via MLE in a geometric model leads to p&#770; = number_of_events / total_trials_in_which_they_could_occur. This parallels &#955; = n / &#8721;(t&#7522;), though the details differ due to discrete vs. continuous formulations.</p><p>Pitfall: &#8226; Mixing up discrete and continuous data can produce misleading interpretations. If you treat effectively discrete data as continuous, or vice versa, your estimates might not align with how the process actually operates.</p><h2><strong>Follow-up Question: How do we reconcile domain expertise with purely data-driven estimation of &#955;?</strong></h2><p>Sometimes domain knowledge about the process generating the lifetimes can be a powerful guide. For instance, engineering experts might know that a particular machine part has an expected lifetime around 50 hours, or marketing experts might suspect that most churn happens within the first month of subscription.</p><p>Ways to incorporate domain expertise: &#8226; Use a Bayesian approach with a prior distribution on &#955; that reflects expert beliefs. &#8226; Impose constraints on &#955;, e.g., you might rule out extremely large or small values based on physical or business constraints. &#8226; Check the fit visually (e.g., using survival plots) and see if it aligns with known domain patterns (like an initial &#8220;burn-in&#8221; or &#8220;honeymoon&#8221; period).</p><p>Pitfall: &#8226; Overly strong prior beliefs can drown out the data, leading to a mismatch if the real process differs from expectations. On the other hand, ignoring well-established domain insights can also produce suboptimal or nonsensical models, particularly with small sample sizes.</p><h2><strong>Follow-up Question: How might we implement a mini-batch or streaming approach to estimating &#955; for large-scale data?</strong></h2><p>In massive or streaming data scenarios, storing all lifetimes and computing &#8721;(t&#7522;) directly might be impractical. A mini-batch or streaming approach processes data in chunks. The running formula for &#955; in a streaming sense can be updated with each new batch of lifetimes:</p><ol><li><p>Keep track of a running sum of all observed lifetimes, S, and a running count of the total number of observations, N.</p></li><li><p>Each time a new batch arrives with lifetimes t&#7522;^(batch): &#8226; Update S &#8592; S + &#8721;(t&#7522;^(batch)). &#8226; Update N &#8592; N + (batch size). &#8226; Recompute &#955;&#770; &#8592; N / S.</p></li></ol><p>Because the exponential distribution MLE only depends on the sum of all t&#7522; and the total count, this approach is straightforward. You do not need to store individual data points&#8212;just aggregated statistics.</p><p>Pitfall: &#8226; Ensure data integrity if partial lifetimes or out-of-order data appear in the stream. Also, if the data are not stationary (i.e., &#955; changes over time), simply aggregating all data might &#8220;average out&#8221; different underlying regimes. A sliding window or time-weighted approach might be more appropriate in nonstationary scenarios.</p><h2><strong>Follow-up Question: How do we implement or fine-tune the exponential MLE in modern deep learning frameworks like PyTorch or TensorFlow?</strong></h2><p>While we typically do not train just a single exponential distribution in deep learning frameworks, there are scenarios in which one might do so&#8212;for instance, to parameterize certain components of a probabilistic model or a survival model.</p><p>Implementation details: &#8226; Represent &#955; as a learnable parameter (often the network outputs log(&#955;) to ensure positivity). &#8226; Define the negative log-likelihood for the observed data t&#7522; as:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VV4G!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72918a18-699f-4311-8b1f-087b0737fef5_391x118.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VV4G!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72918a18-699f-4311-8b1f-087b0737fef5_391x118.png 424w, https://substackcdn.com/image/fetch/$s_!VV4G!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72918a18-699f-4311-8b1f-087b0737fef5_391x118.png 848w, https://substackcdn.com/image/fetch/$s_!VV4G!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72918a18-699f-4311-8b1f-087b0737fef5_391x118.png 1272w, https://substackcdn.com/image/fetch/$s_!VV4G!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72918a18-699f-4311-8b1f-087b0737fef5_391x118.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VV4G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72918a18-699f-4311-8b1f-087b0737fef5_391x118.png" width="391" height="118" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/72918a18-699f-4311-8b1f-087b0737fef5_391x118.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:118,&quot;width&quot;:391,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:6804,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165096971?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72918a18-699f-4311-8b1f-087b0737fef5_391x118.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!VV4G!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72918a18-699f-4311-8b1f-087b0737fef5_391x118.png 424w, https://substackcdn.com/image/fetch/$s_!VV4G!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72918a18-699f-4311-8b1f-087b0737fef5_391x118.png 848w, https://substackcdn.com/image/fetch/$s_!VV4G!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72918a18-699f-4311-8b1f-087b0737fef5_391x118.png 1272w, https://substackcdn.com/image/fetch/$s_!VV4G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72918a18-699f-4311-8b1f-087b0737fef5_391x118.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>which is simply &#8722;ln(L(&#955;)). &#8226; Use automatic differentiation to optimize this negative log-likelihood w.r.t. the parameter &#955; (or log(&#955;)). &#8226; Because &#955; must remain positive, applying a softplus or exponential activation can ensure positivity. A common choice is:</p><p>&#955; = exp(&#952;),</p><p>where &#952; is an unconstrained real parameter learned by gradient-based methods.</p><p>Pitfall: &#8226; Convergence might be trivial in this case if it&#8217;s purely for a single parameter. For more complex architectures involving an exponential distribution as part of a bigger network, you might see gradient issues if the times t&#7522; have large ranges. Proper scaling or normalization of t&#7522; can help maintain stable gradients. &#8226; If partial or censored data is included in the training procedure, you must incorporate the survival term in the loss function (i.e., the negative log survival for censored observations), which complicates the code but is still feasible in frameworks like PyTorch or TensorFlow.</p><h2><strong>Follow-up Question: Can the exponential MLE approach be used if we aggregate events at the group level rather than the individual level?</strong></h2><p>Sometimes, the data is not at the granularity of individual lifetimes. Instead, you might have group-level counts of how many customers died (churned) in each time interval but not the exact individual times. In such aggregated data: &#8226; You lose the exact T&#7522;. You only know how many events occurred in each bin. &#8226; The standard formula &#955;&#770; = n / &#8721;(t&#7522;) no longer directly applies, because we do not have the sum of individual lifetimes.</p><p>One approach is to write down the likelihood (or log-likelihood) for grouped or binned data using the fact that the number of events in a time interval is Poisson(&#955; &#215; length_of_interval) if you assume a Poisson process perspective. Then, you can sum the log probabilities for each bin. The resulting MLE might not have a closed form and would need to be solved numerically.</p><p>Pitfall: &#8226; If the time intervals are wide, you lose a lot of resolution about exactly when events occurred. The fit might be coarse, or the exponential assumption might fail within each interval. In extreme cases, you may need a piecewise constant approach or a more detailed modeling approach (e.g., maximum likelihood estimation for a Poisson process with intervals).</p><h2><strong>Follow-up Question: Are there any concerns regarding identifiability when using only a few data points?</strong></h2><p>Identifiability means the parameter &#955; can be uniquely determined given the likelihood and the data. Technically, for the exponential distribution with complete, nonzero data, &#955; is identifiable even from a small sample. However, a very small n (e.g., n=1 or n=2) can lead to: &#8226; High variance in the MLE, since &#8721;(t&#7522;) might be driven by very few observations. &#8226; Sensitivity to outliers or unusual observations; for instance, with a single data point t&#8321;, the MLE is &#955;&#770; = 1 / t&#8321;, which could be quite large or small if t&#8321; is short or long.</p><p>Pitfall: &#8226; Overconfidence in a single or handful of data points leads to naive extrapolation. In real practice, if n is very small, you should incorporate prior beliefs or consider a more robust or Bayesian approach for additional stability. &#8226; If any data point is zero or extremely close to zero, the sum might be tiny, pushing &#955;&#770; to an implausibly large value, which might not reflect underlying reality.</p><h2><strong>Follow-up Question: Is there a connection between MLE for &#955; in an exponential distribution and partial likelihoods in proportional hazards models?</strong></h2><p>In survival analysis, especially with the Cox proportional hazards model, we do not assume a particular baseline hazard function&#8217;s parametric form; we only assume that covariates multiply the hazard. However, if we specifically assume the baseline hazard is constant, that is effectively an exponential model.</p><p>With no covariates, the partial likelihood in a Cox model collapses to the standard likelihood for the exponential distribution. So the MLE for &#955; in that simplified scenario is the same as what we derive using the standard exponential approach. When covariates are present, the partial likelihood estimates the coefficient vector &#946; for covariates, while the baseline hazard (in a purely exponential baseline scenario) is also estimated.</p><p>Pitfall: &#8226; When covariates are included, the hazard might no longer be constant across all individuals, even if the baseline hazard is constant. Failing to consider relevant covariates might produce a biased or incomplete view of &#955; if subgroups have systematically different hazard rates. &#8226; The partial likelihood does not always yield a closed-form solution once we incorporate covariates, requiring numerical maximization. But for the simple exponential case, you still have the closed-form expression for &#955;.</p><h2><strong>Follow-up Question: Do we need to worry about boundary solutions for &#955;, such as &#955; &#8594; 0?</strong></h2><p>In principle, &#955; &gt; 0. The exponential distribution is undefined at &#955; = 0. However, in practice, if the data show extremely long lifetimes or possibly no observed events in a time window, you might see the likelihood function push &#955; to a very small value.</p><p>&#8226; With standard i.i.d. data and all t&#7522; being finite, the MLE formula &#955;&#770; = n / &#8721;(t&#7522;) will never be exactly zero. &#8226; If you had some data that implied extremely long lifetimes (or if the total sum is very large), &#955;&#770; can become very small but still positive. &#8226; In incomplete data scenarios (e.g., no events observed at all over a certain timescale), it might appear that &#955; = 0 is the best &#8220;fit.&#8221; In a strict parametric sense, though, &#955; = 0 is invalid for an exponential distribution. You would either gather more data or incorporate prior knowledge that real events eventually occur.</p><p>Pitfall: &#8226; Misinterpretation of a near-zero rate can occur if you are analyzing a partial timeframe in which no events happened. This might lead to incorrectly concluding that &#955; is effectively 0, while in a longer timeframe events might happen. Always check whether the observation period is sufficient to capture the phenomenon.</p><h2><strong>Follow-up Question: How does the MLE generalize if we have a shifted exponential distribution?</strong></h2><p>A shifted exponential distribution introduces a shift parameter &#948; &#8805; 0, meaning the distribution is:</p><p>f(t; &#955;, &#948;) = &#955; e^(&#8722;&#955;(t &#8722; &#948;)) for t &#8805; &#948;,</p><p>and 0 for t &lt; &#948;. This might model scenarios where no event is possible before time &#948;. In that case, we have two unknown parameters: &#955; and &#948;.</p><p>The MLE derivation for the two-parameter scenario is more involved. Intuitively:</p><ol><li><p>&#948;&#770; is often the minimum observed lifetime t&#8344;&#7522;&#8345; because shifting any further to the left wouldn&#8217;t increase the likelihood, but a shift to the right must not exclude any observed data. This is reminiscent of how location parameters can be handled in certain distributions (like a shifted exponential or Gumbel).</p></li><li><p>Once &#948;&#770; is determined, you effectively fit an exponential distribution with parameter &#955; to the data t&#7522; &#8722; &#948;&#770;.</p></li></ol><p>Pitfall: &#8226; If the data actually does not have a clear lower bound or if some times are genuinely 0, forcing a shift &#948; &gt; 0 might degrade model accuracy. You need to ensure the concept of a shift parameter aligns with the domain scenario (e.g., a waiting period before a device can fail). &#8226; The shift parameter might be confounded with measurement issues or rounding, leading to overfitting if you treat &#948; as a free parameter for small sample sizes.</p><h2><strong>Follow-up Question: In practice, could we transform the data to improve numerical stability when computing the MLE?</strong></h2><p>Sometimes for large or very small t&#7522;, summation can be numerically unstable. While the MLE &#955;&#770; = n / &#8721;(t&#7522;) is straightforward, you may: &#8226; Work in log-space for partial sums, though that&#8217;s less common for a direct ratio. &#8226; Use stable summation algorithms (like Kahan summation) to handle large n or wide dynamic ranges of t&#7522;. This ensures minimal floating-point rounding errors.</p><p>Pitfall: &#8226; In typical double-precision arithmetic, you rarely run into catastrophic issues with a single sum, but for extremely large-scale data streams (millions or billions of records with widely varying magnitudes), floating-point accumulation errors can become nonnegligible. &#8226; Over-engineering the summation might not be necessary if your data&#8217;s range is well within what double precision can handle, but do be mindful if your lifetimes can go from extremely small fractions of a unit to extremely large values.</p><h2><strong>Follow-up Question: What if the data is heavily skewed, but we still suspect an exponential distribution?</strong></h2><p>The exponential distribution itself is already right-skewed. If you observe extreme skewness, it might still be consistent with an exponential model, but sometimes the data could be even heavier-tailed than exponential suggests. For instance, you might have a few extremely large values that skew the average significantly.</p><p>Tests: &#8226; Compare exponential vs. heavier-tailed alternatives (like Pareto or lognormal). &#8226; Check Q&#8211;Q plots or residual plots to see if the largest lifetimes deviate from the exponential line.</p><p>If the tails are significantly heavier than exponential, you may see that a portion of the data is well fit by &#955;&#770;, but the largest observations are systematically under-modeled. The MLE formula does not &#8220;break,&#8221; but the model might be inadequate in describing tail risk or high-lifetime probability.</p><p>Pitfall: &#8226; Overfitting might occur if you keep trying to adjust &#955; to capture the tail, but the exponential distribution has only a single parameter. You may systematically underpredict the probability of extremely large observations, leading to misestimation of risk or reliability in practical scenarios.</p><h2><strong>Follow-up Question: Could the exponential MLE be extended or adapted if you only measure discrete times but treat them as if continuous?</strong></h2><p>Sometimes data is recorded at discrete intervals (e.g., daily or weekly checks). In principle, this is a discrete-time setting, but you might approximate it as continuous. The question is whether this approximation is valid: &#8226; If the sampling frequency is high enough compared to the scale of lifetimes, treating the data as continuous might be a reasonable approximation. &#8226; If the data are truly coarse (e.g., only measured once a month, while typical lifetimes are a few days), the approximation might be poor.</p><p>You can proceed with &#955;&#770; = n / &#8721;(t&#7522;) if you treat each recorded event time as continuous. This might yield a biased or approximate estimate if the distribution within each discrete bin is not well captured.</p><p>Pitfall: &#8226; Larger bin sizes can mask the memoryless property if events always appear to occur &#8220;just before&#8221; the next measurement interval. Ensure your sampling rate is fine-grained enough that continuous-time assumptions are not drastically violated.</p><h2><strong>Follow-up Question: How do we implement a simple hypothesis test to check if a proposed &#955; is plausible?</strong></h2><p>One might want to test a null hypothesis H&#8320;: &#955; = &#955;&#8320; for some known value &#955;&#8320;:</p><ol><li><p>Compute the likelihood of the data under H&#8320;: L(&#955;&#8320;).</p></li><li><p>Compute the maximum of the likelihood, L(&#955;&#770;).</p></li><li><p>Form a likelihood ratio test statistic: &#8722;2 ln[L(&#955;&#8320;) / L(&#955;&#770;)].</p></li></ol><p>Under certain conditions (large n, regularity of the exponential family), this statistic approximately follows a chi-square distribution with 1 degree of freedom (because there&#8217;s one parameter under test). If the statistic exceeds the critical value for that chi-square distribution (or the p-value is below the chosen threshold), we reject H&#8320; in favor of &#955; &#8800; &#955;&#8320;.</p><p>Pitfall: &#8226; For small sample sizes, the asymptotic chi-square approximation might be inaccurate. In that case, one might prefer exact or simulation-based methods. &#8226; If H&#8320; is on the boundary (e.g., &#955;&#8320; &#8594; 0), the usual chi-square approximations can fail. You might need specialized boundary-based or exact tests.</p><h2><strong>Follow-up Question: Do we need to consider spurious local maxima in the likelihood for the exponential distribution?</strong></h2><p>For the standard exponential distribution with an i.i.d. sample, the likelihood is a concave function in &#955; (when viewed in the log-likelihood space), so there is a single global maximum at &#955; = n / &#8721;(t&#7522;). Unlike more complex distributions or mixture models, spurious local maxima do not arise in the single-parameter exponential setting.</p><p>However, in more complex expansions (like a mixture of exponentials or a shifted exponential with multiple parameters), local maxima can appear in the parameter space. Then, the simple derivative approach might not yield the unique global maximum, and one typically uses the EM algorithm or advanced optimization methods that can locate multiple local maxima.</p><p>Pitfall: &#8226; If you incorrectly assume a single global maximum for a mixture of distributions, you might get stuck in a local maximum. Good initialization or multiple random restarts in the EM algorithm helps mitigate that risk for mixture models. For the single-parameter exponential, this concern does not apply in the standard setting.</p><h2><strong>Follow-up Question: How do we reconcile the interpretation of &#955; as a rate with actual time units?</strong></h2><p>If the dataset is in days, then &#955; has units of &#8220;per day.&#8221; If it&#8217;s in hours, &#955; is &#8220;per hour.&#8221; It&#8217;s easy to conflate them if you do not keep the units consistent. Always keep track of the time scale.</p><p>Example: If we measure the average lifetime of a component in hours, and find &#955;&#770; = 0.02, then the implied mean lifetime is 1 / 0.02 = 50 hours. If we switch to a measurement in days (1 day = 24 hours), the rate in &#8220;per day&#8221; terms would be &#955;&#8242; = &#955; * 24 = 0.48, giving a mean lifetime of about 2.083 days.</p><p>Pitfall: &#8226; Inconsistent units lead to confusion or incorrectly comparing rates. Domain knowledge might specify lifetimes in months or years for business contexts. Always double-check that you&#8217;re applying the correct time scale.</p><h2><strong>Follow-up Question: Does the exponential distribution&#8217;s memoryless property cause any practical paradoxes or misunderstandings?</strong></h2><p>Yes, a common misunderstanding is the &#8220;waiting time paradox&#8221; or related illusions where people observe that &#8220;since I&#8217;ve already waited a while, the chance of waiting much longer should be higher or lower.&#8221; For an exponential distribution, the memoryless property states the distribution of the remaining time does not depend on how long you have already waited.</p><p>Practical confusion: &#8226; In real life, many processes are not strictly memoryless. If you have already waited a long time for a bus, it might indicate that something unusual is happening (breakdown, schedule disruption), so the chance of waiting even longer might be higher than what an exponential assumption would suggest. &#8226; In some contexts (like random phone calls in a telecommunication system under stable conditions), the exponential assumption might be a good approximation and the memoryless property holds fairly well in practice.</p><p>Pitfall: &#8226; Relying on an exponential assumption can lead to underestimation or overestimation of event timing if the real process is not truly memoryless. For instance, mechanical parts might degrade over time, making the hazard rate increase with age&#8212;contrary to the exponential distribution&#8217;s constant hazard assumption.</p><h2><strong>Follow-up Question: How to interpret the hazard function and survival function in an exponential distribution context?</strong></h2><p>For an exponential distribution, the hazard function is constant: h(t) = &#955;. This means the instantaneous risk of the event happening at time t is the same, regardless of whether you are at t = 0 or t = 10 hours.</p><p>The survival function is S(t) = P(T &gt; t) = e^(&#8722;&#955;t). So the fraction of items still &#8220;alive&#8221; (or customers still active) decays exponentially with rate &#955;.</p><p>In business terms, if you are modeling churn with an exponential distribution, the hazard rate &#955; is the constant per-unit-time chance of a customer leaving. If &#955; = 0.1 per week, it means any given week, there is a 10% chance the customer churns in that week, independent of how many weeks they have already stayed.</p><p>Pitfall: &#8226; Real churn processes might exhibit a decreasing hazard (customers that survive the initial onboarding phase are less likely to churn) or an increasing hazard (customers lose interest over time). Thus, a constant hazard might be too simplistic in many real business applications, even though it is a good baseline or starting assumption.</p>]]></content:encoded></item><item><title><![CDATA[ML Interview Q Series: Evaluating Driver App UI Impact on Ride Volume via A/B Testing]]></title><description><![CDATA[Browse all the Probability Interview Questions here.]]></description><link>https://www.rohan-paul.com/p/ml-interview-q-series-evaluating-00f</link><guid isPermaLink="false">https://www.rohan-paul.com/p/ml-interview-q-series-evaluating-00f</guid><pubDate>Tue, 03 Jun 2025 13:42:09 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Pb-b!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbceb9df-a2c0-4c33-bbe7-39f9c1f781d6_1024x573.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Pb-b!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbceb9df-a2c0-4c33-bbe7-39f9c1f781d6_1024x573.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Pb-b!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbceb9df-a2c0-4c33-bbe7-39f9c1f781d6_1024x573.png 424w, https://substackcdn.com/image/fetch/$s_!Pb-b!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbceb9df-a2c0-4c33-bbe7-39f9c1f781d6_1024x573.png 848w, https://substackcdn.com/image/fetch/$s_!Pb-b!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbceb9df-a2c0-4c33-bbe7-39f9c1f781d6_1024x573.png 1272w, https://substackcdn.com/image/fetch/$s_!Pb-b!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbceb9df-a2c0-4c33-bbe7-39f9c1f781d6_1024x573.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Pb-b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbceb9df-a2c0-4c33-bbe7-39f9c1f781d6_1024x573.png" width="1024" height="573" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dbceb9df-a2c0-4c33-bbe7-39f9c1f781d6_1024x573.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:573,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1029687,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165096176?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbceb9df-a2c0-4c33-bbe7-39f9c1f781d6_1024x573.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Pb-b!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbceb9df-a2c0-4c33-bbe7-39f9c1f781d6_1024x573.png 424w, https://substackcdn.com/image/fetch/$s_!Pb-b!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbceb9df-a2c0-4c33-bbe7-39f9c1f781d6_1024x573.png 848w, https://substackcdn.com/image/fetch/$s_!Pb-b!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbceb9df-a2c0-4c33-bbe7-39f9c1f781d6_1024x573.png 1272w, https://substackcdn.com/image/fetch/$s_!Pb-b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdbceb9df-a2c0-4c33-bbe7-39f9c1f781d6_1024x573.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Browse all the <strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">Probability Interview Questions here</a></strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">.</a></p><h2><strong>Your team wants to see if a new driver app with extra UI features will increase the number of rides. How would you test that these extra features make it better than the original version?</strong></h2><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://x.com/rohanpaul_ai&quot;,&quot;text&quot;:&quot;Connect with me on X (Twitter)&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://x.com/rohanpaul_ai"><span>Connect with me on X (Twitter)</span></a></p><p>Planning and executing a well-structured online experiment or A/B test is generally the most direct approach to assess whether the new UI features actually result in more rides. Below is a detailed discussion of the entire process, potential pitfalls, and the depth of reasoning behind each step.</p><p>Designing The Experiment</p><p>You want to set up a controlled experiment that compares two versions of the driver app:</p><p>&#8226; Control version is the existing driver app. &#8226; Treatment version is the new driver app that has extra UI features.</p><p>The fundamental idea is to split your driver population randomly so that you assign some drivers to the control group and the rest to the treatment group. The random assignment ensures that, on average, both groups are comparable in all aspects apart from the new UI features. Then you measure how many rides each group logs over a specified time period.</p><p>Key Points In Designing The Experiment</p><p>Random Assignment Randomization is the foundation of a valid experiment. You might randomly assign a fraction (for example, 50%) of your driver population to experience the new UI. The remainder sees the original UI. Because assignment is random, the only systematic difference between the two groups should be the presence or absence of the new UI.</p><p>Avoiding Leakage or Contamination Some drivers could inadvertently see multiple versions if they have multiple devices or if your system inadvertently toggles them between versions. Ensuring consistent exposure (e.g., once assigned to the new UI, you always see it) is critical for clean data.</p><p>Choosing Proper Metrics The question specifically focuses on the number of rides. However, you might also want to track other operational metrics like average ride duration, drop-off rates during ride matching, or driver retention. The primary metric (key performance indicator) is total number of rides per driver in the treatment group versus control group, averaged over the experimental period.</p><p>Length and Timing of the Test An experiment generally runs until you have collected enough data to make a statistically significant decision. This depends on your typical traffic (i.e., how many rides are logged daily), the expected effect size (how big an improvement you anticipate), and the desired statistical power.</p><p>Hypothesis and Statistical Testing</p><p>Formulate The Hypothesis Set up a null hypothesis and an alternative hypothesis:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-YVv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38877c2b-47c0-493e-9ba7-194c027c3f1b_619x285.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-YVv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38877c2b-47c0-493e-9ba7-194c027c3f1b_619x285.png 424w, https://substackcdn.com/image/fetch/$s_!-YVv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38877c2b-47c0-493e-9ba7-194c027c3f1b_619x285.png 848w, https://substackcdn.com/image/fetch/$s_!-YVv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38877c2b-47c0-493e-9ba7-194c027c3f1b_619x285.png 1272w, https://substackcdn.com/image/fetch/$s_!-YVv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38877c2b-47c0-493e-9ba7-194c027c3f1b_619x285.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-YVv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38877c2b-47c0-493e-9ba7-194c027c3f1b_619x285.png" width="619" height="285" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/38877c2b-47c0-493e-9ba7-194c027c3f1b_619x285.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:285,&quot;width&quot;:619,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:24454,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165096176?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38877c2b-47c0-493e-9ba7-194c027c3f1b_619x285.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!-YVv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38877c2b-47c0-493e-9ba7-194c027c3f1b_619x285.png 424w, https://substackcdn.com/image/fetch/$s_!-YVv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38877c2b-47c0-493e-9ba7-194c027c3f1b_619x285.png 848w, https://substackcdn.com/image/fetch/$s_!-YVv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38877c2b-47c0-493e-9ba7-194c027c3f1b_619x285.png 1272w, https://substackcdn.com/image/fetch/$s_!-YVv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38877c2b-47c0-493e-9ba7-194c027c3f1b_619x285.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Here,</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jz-g!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffee577fc-6934-4f93-a8f7-0f557ddf5811_132x59.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jz-g!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffee577fc-6934-4f93-a8f7-0f557ddf5811_132x59.png 424w, https://substackcdn.com/image/fetch/$s_!jz-g!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffee577fc-6934-4f93-a8f7-0f557ddf5811_132x59.png 848w, https://substackcdn.com/image/fetch/$s_!jz-g!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffee577fc-6934-4f93-a8f7-0f557ddf5811_132x59.png 1272w, https://substackcdn.com/image/fetch/$s_!jz-g!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffee577fc-6934-4f93-a8f7-0f557ddf5811_132x59.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jz-g!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffee577fc-6934-4f93-a8f7-0f557ddf5811_132x59.png" width="132" height="59" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fee577fc-6934-4f93-a8f7-0f557ddf5811_132x59.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:59,&quot;width&quot;:132,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2694,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165096176?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffee577fc-6934-4f93-a8f7-0f557ddf5811_132x59.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!jz-g!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffee577fc-6934-4f93-a8f7-0f557ddf5811_132x59.png 424w, https://substackcdn.com/image/fetch/$s_!jz-g!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffee577fc-6934-4f93-a8f7-0f557ddf5811_132x59.png 848w, https://substackcdn.com/image/fetch/$s_!jz-g!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffee577fc-6934-4f93-a8f7-0f557ddf5811_132x59.png 1272w, https://substackcdn.com/image/fetch/$s_!jz-g!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffee577fc-6934-4f93-a8f7-0f557ddf5811_132x59.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>is the average number of rides per driver for the treatment group, and</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rLcQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F936a0555-2acf-42af-9d96-507eb2b67c19_106x57.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rLcQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F936a0555-2acf-42af-9d96-507eb2b67c19_106x57.png 424w, https://substackcdn.com/image/fetch/$s_!rLcQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F936a0555-2acf-42af-9d96-507eb2b67c19_106x57.png 848w, https://substackcdn.com/image/fetch/$s_!rLcQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F936a0555-2acf-42af-9d96-507eb2b67c19_106x57.png 1272w, https://substackcdn.com/image/fetch/$s_!rLcQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F936a0555-2acf-42af-9d96-507eb2b67c19_106x57.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rLcQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F936a0555-2acf-42af-9d96-507eb2b67c19_106x57.png" width="106" height="57" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/936a0555-2acf-42af-9d96-507eb2b67c19_106x57.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:57,&quot;width&quot;:106,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2123,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165096176?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F936a0555-2acf-42af-9d96-507eb2b67c19_106x57.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rLcQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F936a0555-2acf-42af-9d96-507eb2b67c19_106x57.png 424w, https://substackcdn.com/image/fetch/$s_!rLcQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F936a0555-2acf-42af-9d96-507eb2b67c19_106x57.png 848w, https://substackcdn.com/image/fetch/$s_!rLcQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F936a0555-2acf-42af-9d96-507eb2b67c19_106x57.png 1272w, https://substackcdn.com/image/fetch/$s_!rLcQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F936a0555-2acf-42af-9d96-507eb2b67c19_106x57.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>is that of the control group. The null hypothesis states there is no difference, while the alternative states the new UI features yield a higher average number of rides.</p><p>Statistical Significance And Confidence Interval You might use a standard two-sample t-test or a non-parametric test to compare the means. Or you might use a proportion test if the outcome can be modeled in a certain way (e.g., rides taken or not). If you want to approach the problem from a more distribution-agnostic perspective, you could use a bootstrap approach.</p><p>Sample Size And Power Considerations You need enough users in each group to reliably detect a difference, if one truly exists. If the change in the new UI is expected to produce only a small (but valuable) percentage increase in rides, you must plan for a correspondingly larger sample size to detect that small difference with statistical significance. Tools or formulas exist to compute the minimum sample size. If</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mgVm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd20ce730-7788-41d6-b8c6-40062762ce2b_79x48.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mgVm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd20ce730-7788-41d6-b8c6-40062762ce2b_79x48.png 424w, https://substackcdn.com/image/fetch/$s_!mgVm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd20ce730-7788-41d6-b8c6-40062762ce2b_79x48.png 848w, https://substackcdn.com/image/fetch/$s_!mgVm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd20ce730-7788-41d6-b8c6-40062762ce2b_79x48.png 1272w, https://substackcdn.com/image/fetch/$s_!mgVm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd20ce730-7788-41d6-b8c6-40062762ce2b_79x48.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mgVm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd20ce730-7788-41d6-b8c6-40062762ce2b_79x48.png" width="79" height="48" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d20ce730-7788-41d6-b8c6-40062762ce2b_79x48.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:48,&quot;width&quot;:79,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:821,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165096176?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd20ce730-7788-41d6-b8c6-40062762ce2b_79x48.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!mgVm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd20ce730-7788-41d6-b8c6-40062762ce2b_79x48.png 424w, https://substackcdn.com/image/fetch/$s_!mgVm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd20ce730-7788-41d6-b8c6-40062762ce2b_79x48.png 848w, https://substackcdn.com/image/fetch/$s_!mgVm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd20ce730-7788-41d6-b8c6-40062762ce2b_79x48.png 1272w, https://substackcdn.com/image/fetch/$s_!mgVm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd20ce730-7788-41d6-b8c6-40062762ce2b_79x48.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>is the significance level (e.g., 0.05) and</p><p>&#946;=1&#8722;power</p><p>(e.g., 0.8 or 0.9), typical sample size formulas revolve around the effect size and standard deviations.</p><p>Practical Implementation Considerations</p><p>Rollout Strategy Depending on organizational culture, you can do a 1% pilot test first to spot potential issues and limit risk. Once stable, you scale the test to a larger percentage of your driver population.</p><p>Data Collection Pipeline You need robust instrumentation in the app to track how many rides are completed by each driver, whether that driver is in control or treatment, and how often they actually engage with the new UI features.</p><p>Segmentation It might be useful to segment by geography, driver tenure, platform type (Android vs. iOS), or usage patterns. This helps you see if the new UI disproportionately benefits certain groups.</p><p>Analyzing Results</p><p>Comparing Means Or Proportions A typical approach is to compute the average number of rides in each group:</p><ul><li><p>ParseError: KaTeX parse error: Can't use function '$' in math mode at position 30: &#8230;ext{treatment} $&#818;$ = average rid&#8230;</p></li></ul><p>Then measure the difference</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MeJd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cd2460c-d4ac-470c-9530-f3b76579ec2c_374x70.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MeJd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cd2460c-d4ac-470c-9530-f3b76579ec2c_374x70.png 424w, https://substackcdn.com/image/fetch/$s_!MeJd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cd2460c-d4ac-470c-9530-f3b76579ec2c_374x70.png 848w, https://substackcdn.com/image/fetch/$s_!MeJd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cd2460c-d4ac-470c-9530-f3b76579ec2c_374x70.png 1272w, https://substackcdn.com/image/fetch/$s_!MeJd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cd2460c-d4ac-470c-9530-f3b76579ec2c_374x70.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MeJd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cd2460c-d4ac-470c-9530-f3b76579ec2c_374x70.png" width="374" height="70" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7cd2460c-d4ac-470c-9530-f3b76579ec2c_374x70.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:70,&quot;width&quot;:374,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:6170,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165096176?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cd2460c-d4ac-470c-9530-f3b76579ec2c_374x70.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!MeJd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cd2460c-d4ac-470c-9530-f3b76579ec2c_374x70.png 424w, https://substackcdn.com/image/fetch/$s_!MeJd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cd2460c-d4ac-470c-9530-f3b76579ec2c_374x70.png 848w, https://substackcdn.com/image/fetch/$s_!MeJd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cd2460c-d4ac-470c-9530-f3b76579ec2c_374x70.png 1272w, https://substackcdn.com/image/fetch/$s_!MeJd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cd2460c-d4ac-470c-9530-f3b76579ec2c_374x70.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>. Use a hypothesis test to assess if</p><p>&#948;</p><p>is statistically significant.</p><p>Confidence Interval A confidence interval for</p><p>&#948;</p><p>can provide more interpretability. If the 95% confidence interval for</p><p>&#948;</p><p>is, for example, [1.5, 2.0], you have evidence that the new UI leads to between 1.5 and 2.0 additional rides on average per driver in the test period.</p><p>Assessing Practical Significance Even if a difference is statistically significant, it is important to see whether it is big enough in practical or financial terms. For instance, if you see a statistically significant improvement of 0.01 additional rides per driver, that may or may not be important depending on ride volume and margins.</p><p>Potential Pitfalls And Edge Cases</p><p>Adoption Lag Drivers might need time to adapt to the new interface. A short test might not capture the real long-term impact. Consider measuring how the effect evolves over days/weeks.</p><p>Seasonality Or External Factors If you run the experiment during a holiday season, or in particularly slow periods, that might skew the results. Randomization usually helps, but you should be aware of unusual external factors.</p><p>Interaction With Other Features If other new app features or promotions roll out concurrently, it becomes harder to isolate the effect of the new driver UI. Coordination across product teams is key to preserve the &#8220;all else being equal&#8221; principle.</p><p>Observational Biases If some part of your driver population is inadvertently excluded or included in a skewed manner, it can bias your estimate. For example, if older devices cannot support the new UI, then your randomization is effectively compromised. You need to ensure equal chance of assignment at the device or driver ID level.</p><p>Implementation Example (High-Level Python Pseudocode)</p><pre><code><code>import numpy as np
from scipy import stats

# Suppose you have arrays of daily rides for each driver in the treatment and control groups
treatment_rides = np.array([/* daily rides per driver for treatment group */])
control_rides   = np.array([/* daily rides per driver for control group */])

# Perform a two-sample t-test
t_stat, p_value = stats.ttest_ind(treatment_rides, control_rides, equal_var=False)

print("T-statistic:", t_stat)
print("P-value:", p_value)

# You might also construct confidence intervals manually or using your stats library
# For demonstration, let's do a basic example for difference of means
mean_diff = treatment_rides.mean() - control_rides.mean()
std_treat = np.std(treatment_rides, ddof=1)
std_ctrl  = np.std(control_rides, ddof=1)
n_treat   = len(treatment_rides)
n_ctrl    = len(control_rides)

# Standard error for difference of two independent means
# Use Welch's approximation for standard error (assuming unequal variances)
se_diff = np.sqrt((std_treat**2 / n_treat) + (std_ctrl**2 / n_ctrl))

# 95% confidence interval
z = 1.96  # for 95%
ci_lower = mean_diff - z * se_diff
ci_upper = mean_diff + z * se_diff

print("Mean difference:", mean_diff)
print(f"95% CI: [{ci_lower}, {ci_upper}]")
</code></code></pre><p>This snippet is a simplistic demonstration of comparing two sets of data using a two-sample t-test and then constructing a confidence interval around the difference of means.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.rohan-paul.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">I write everyday for my readers on actionable AI. Subscribe and instantly get a 1300+ page Python book.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2><strong>What If The Measured Metric Is Very Noisy?</strong></h2><p>If ride counts vary widely across drivers and the distribution is highly skewed, you can consider a log transformation of the metric or apply a non-parametric test (like the Mann-Whitney U test). Alternatively, a bootstrap approach can robustly estimate confidence intervals without strong distributional assumptions. The main idea remains that you compare the metric between control and treatment in a consistent and unbiased manner.</p><h2><strong>How Would You Handle Multiple Experimental Variations?</strong></h2><p>Sometimes, you might want to compare more than two variations of the driver UI (for example, different UI layouts or color schemes). One approach is to expand the design to an A/B/C test and ensure you have enough participants in each arm to detect differences. Another approach is to use multi-armed bandit techniques that adaptively allocate more users to the variation that appears to be performing best so far. However, if you do pure multi-armed bandits, you should be careful with how you compute final significance. Frequentist bandit approaches are trickier in maintaining a simple interpretation of p-values, while Bayesian bandit methods can incorporate prior distributions more smoothly.</p><h2><strong>How Would You Account For Covariates?</strong></h2><p>You might discover that some drivers have distinct usage patterns. For example, high-volume drivers (who drive 6-8 hours a day) might respond differently to the new UI than casual drivers. You can run a stratified analysis or incorporate regression-based methods where you include relevant covariates (like driver experience level or region) to isolate the effect of the UI. A typical approach might be:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QT9M!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80180066-9b3c-4d70-8ee5-3e038406f5e3_1308x92.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QT9M!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80180066-9b3c-4d70-8ee5-3e038406f5e3_1308x92.png 424w, https://substackcdn.com/image/fetch/$s_!QT9M!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80180066-9b3c-4d70-8ee5-3e038406f5e3_1308x92.png 848w, https://substackcdn.com/image/fetch/$s_!QT9M!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80180066-9b3c-4d70-8ee5-3e038406f5e3_1308x92.png 1272w, https://substackcdn.com/image/fetch/$s_!QT9M!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80180066-9b3c-4d70-8ee5-3e038406f5e3_1308x92.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QT9M!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80180066-9b3c-4d70-8ee5-3e038406f5e3_1308x92.png" width="1308" height="92" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/80180066-9b3c-4d70-8ee5-3e038406f5e3_1308x92.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:92,&quot;width&quot;:1308,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:18521,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165096176?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80180066-9b3c-4d70-8ee5-3e038406f5e3_1308x92.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!QT9M!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80180066-9b3c-4d70-8ee5-3e038406f5e3_1308x92.png 424w, https://substackcdn.com/image/fetch/$s_!QT9M!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80180066-9b3c-4d70-8ee5-3e038406f5e3_1308x92.png 848w, https://substackcdn.com/image/fetch/$s_!QT9M!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80180066-9b3c-4d70-8ee5-3e038406f5e3_1308x92.png 1272w, https://substackcdn.com/image/fetch/$s_!QT9M!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F80180066-9b3c-4d70-8ee5-3e038406f5e3_1308x92.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Here, UI_treatment is a binary indicator variable (0 for control, 1 for treatment). The coefficient</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dUoq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2dfea94-dece-4b3e-9a36-8c2f29ad7ee1_48x71.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dUoq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2dfea94-dece-4b3e-9a36-8c2f29ad7ee1_48x71.png 424w, https://substackcdn.com/image/fetch/$s_!dUoq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2dfea94-dece-4b3e-9a36-8c2f29ad7ee1_48x71.png 848w, https://substackcdn.com/image/fetch/$s_!dUoq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2dfea94-dece-4b3e-9a36-8c2f29ad7ee1_48x71.png 1272w, https://substackcdn.com/image/fetch/$s_!dUoq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2dfea94-dece-4b3e-9a36-8c2f29ad7ee1_48x71.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dUoq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2dfea94-dece-4b3e-9a36-8c2f29ad7ee1_48x71.png" width="48" height="71" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c2dfea94-dece-4b3e-9a36-8c2f29ad7ee1_48x71.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:71,&quot;width&quot;:48,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1164,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165096176?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2dfea94-dece-4b3e-9a36-8c2f29ad7ee1_48x71.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dUoq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2dfea94-dece-4b3e-9a36-8c2f29ad7ee1_48x71.png 424w, https://substackcdn.com/image/fetch/$s_!dUoq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2dfea94-dece-4b3e-9a36-8c2f29ad7ee1_48x71.png 848w, https://substackcdn.com/image/fetch/$s_!dUoq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2dfea94-dece-4b3e-9a36-8c2f29ad7ee1_48x71.png 1272w, https://substackcdn.com/image/fetch/$s_!dUoq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2dfea94-dece-4b3e-9a36-8c2f29ad7ee1_48x71.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>measures the adjusted impact of the new UI on the number of rides, controlling for other factors in the model.</p><h2><strong>How Do You Decide If You Can Roll Out The Changes?</strong></h2><p>You look at both statistical significance (is the result real, not due to random chance?) and practical significance (does it move the needle enough to justify the engineering and rollout costs?). You also weigh any potential negative impacts discovered in your metrics (e.g., driver satisfaction issues, increased app load times, or complicated UX in corner cases).</p><p>If the experiment data demonstrates that the new UI significantly increases the average number of rides per driver and you see no detrimental effects on other important metrics, that supports rolling out the features more broadly. If the data shows no improvement, or even some degradation, you&#8217;d investigate possible reasons and possibly scrap or refine the new features.</p><div><hr></div><h2><strong>Below are additional follow-up questions</strong></h2><h2><strong>What if the new UI has a learning curve for drivers and initial usage drops before eventually improving?</strong></h2><p>A new user interface can be intimidating or unfamiliar at first, causing drivers to be less efficient initially, resulting in fewer rides. Over time, as they grow accustomed to the new layout and features, their engagement and ride volume may rebound or surpass the baseline. This learning-curve effect can mask the true benefit of the new UI if the experiment is not run long enough or if early negative signals cause premature termination of the test.</p><p>One way to handle this is to run the experiment for a sufficient duration to capture the entire adoption curve. You can plot ride volume over time (for both the control group and the treatment group) to see how the metric evolves. If there is an initial dip, you may detect it by observing that the treatment group&#8217;s metrics start below control but later cross over and increase. Segmenting by drivers&#8217; exposure time to the new UI (e.g., days since first exposure) can help quantify how quickly users adapt. It is common in UI-related experiments for the &#8220;time since assignment&#8221; factor to affect performance outcomes.</p><p>In real-world scenarios, you might mitigate the shock by providing tutorials or tooltips within the new UI. You might also consider rolling out the new UI gradually to smaller cohorts, observe how quickly they adapt, then extrapolate to the broader population. This ensures you do not risk widespread adoption of a UI that has an irreversible negative impact if the learning curve is too steep.</p><h2><strong>How do we avoid confusing A/B test results with normal seasonal variations or large external events?</strong></h2><p>External factors like holidays, severe weather, local festivals, or global events can significantly change ride patterns. Even well-randomized experiments can get confounded by these events if they occur after the experiment has launched but before completion. Although randomization helps distribute typical day-to-day variance across control and treatment, large or unusual disruptions can still cause interpretive challenges.</p><p>To mitigate this:</p><p>&#8226; Plan experiments around major known events. Avoid starting or stopping tests during major holidays. &#8226; Monitor both groups&#8217; metrics closely for parallel changes. If both groups experience the same spike or dip, then the difference between them might still remain valid. &#8226; Extend the testing period to allow enough observations before and after any such events. &#8226; If you have historical data that shows typical seasonal patterns, compare your observed metrics to what is normally expected. For instance, if you know ride demand is generally 30% higher during holiday seasons, make sure to calibrate or run the test sufficiently before or after that spike. &#8226; If an unexpected major event occurs mid-test, you might need to pause or re-run the experiment depending on severity. For a short-term but severe disruption, you can potentially exclude that period from the analysis (with caution) if it&#8217;s clear that this period was extraordinary and equally impacted both groups.</p><h2><strong>How do you handle drivers who frequently switch between multiple devices or accounts?</strong></h2><p>Some drivers may have multiple smartphones or switch between personal and shared devices. This can lead to inconsistent exposure if your experiment assignment is not carefully enforced at the account or device level. If you randomize based on driver ID (account-based), but the user occasionally logs into a different account that might be in the opposite experimental group, you risk contamination.</p><p>To address this:</p><p>&#8226; Assign treatment at the unique driver ID level rather than device level, ensuring that, no matter which device the driver logs in from, they see the same UI version. &#8226; Implement checks to detect drivers who appear to maintain multiple active accounts. Such behavior might violate your platform&#8217;s terms of service or might signal an edge case that requires separate handling. &#8226; If a driver does somehow have multiple valid accounts for legitimate reasons (e.g., multiple fleet affiliations), randomization may have to ensure both accounts are placed in the same group if that driver is indeed a single individual.</p><p>You also want robust logging that can track which UI version was actually served to that driver at each usage event. If you detect a mismatch, you can remove or flag that usage data to avoid muddling your results.</p><h2><strong>What if the new UI changes driver acceptance rates for certain ride requests rather than strictly increasing overall volume?</strong></h2><p>Even if the total number of rides does not change drastically, the new UI might prompt drivers to accept certain types of rides they previously avoided (long-distance, surge areas, complex routes). Consequently, the distribution of ride types in the treatment group might be different from the control group. This does not necessarily reflect an absolute increase in total rides but could alter the nature of those rides.</p><p>You can investigate by segmenting rides based on:</p><p>&#8226; Ride duration &#8226; Profitability or surge factor &#8226; Time-of-day acceptance patterns</p><p>If you notice that the new UI causes a shift in which rides are accepted, it could still be beneficial (e.g., more profitable rides) even if total rides remain similar or only slightly increased. To measure overall impact, you might incorporate additional metrics like revenue per driver, ride acceptance ratio, or driver satisfaction scores.</p><p>Statistically, you could perform a difference-in-differences style comparison on subcategories of rides to see where the impact is largest. If your main goal remains &#8220;total rides,&#8221; you should still track how behavior changes across ride types, because it might highlight that the new UI is more or less effective in different ride contexts and that your success criteria need to account for this complexity.</p><h2><strong>How do you handle a situation where a sub-population of drivers responds negatively while others respond positively, netting out to a near-zero overall effect?</strong></h2><p>Sometimes, an overall average hides significant heterogeneity: the new UI might work very well for certain demographics (e.g., tech-savvy drivers) but is detrimental for another segment (e.g., drivers using older devices or less familiar with advanced features). This can cause the net impact to look negligible even though there are strong positive and negative sub-trends.</p><p>You can address this by:</p><p>&#8226; Breaking down your data by relevant covariates such as driver experience, the device&#8217;s operating system version, or region. &#8226; Comparing each subgroup&#8217;s difference in ride volume separately to identify which sub-populations thrive and which struggle. &#8226; Using an interaction term in a regression framework that captures the effect of the new UI for different subgroups. For instance, you could model:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jJzc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1534d2b9-55f8-4016-957d-a6f3a2e5efdd_1333x65.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jJzc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1534d2b9-55f8-4016-957d-a6f3a2e5efdd_1333x65.png 424w, https://substackcdn.com/image/fetch/$s_!jJzc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1534d2b9-55f8-4016-957d-a6f3a2e5efdd_1333x65.png 848w, https://substackcdn.com/image/fetch/$s_!jJzc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1534d2b9-55f8-4016-957d-a6f3a2e5efdd_1333x65.png 1272w, https://substackcdn.com/image/fetch/$s_!jJzc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1534d2b9-55f8-4016-957d-a6f3a2e5efdd_1333x65.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jJzc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1534d2b9-55f8-4016-957d-a6f3a2e5efdd_1333x65.png" width="1333" height="65" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1534d2b9-55f8-4016-957d-a6f3a2e5efdd_1333x65.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:65,&quot;width&quot;:1333,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:20555,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165096176?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1534d2b9-55f8-4016-957d-a6f3a2e5efdd_1333x65.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!jJzc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1534d2b9-55f8-4016-957d-a6f3a2e5efdd_1333x65.png 424w, https://substackcdn.com/image/fetch/$s_!jJzc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1534d2b9-55f8-4016-957d-a6f3a2e5efdd_1333x65.png 848w, https://substackcdn.com/image/fetch/$s_!jJzc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1534d2b9-55f8-4016-957d-a6f3a2e5efdd_1333x65.png 1272w, https://substackcdn.com/image/fetch/$s_!jJzc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1534d2b9-55f8-4016-957d-a6f3a2e5efdd_1333x65.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Here, the interaction coefficient</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Bg22!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4546ab75-6b9e-4f70-b57a-b3aaef5d7f1c_65x56.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Bg22!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4546ab75-6b9e-4f70-b57a-b3aaef5d7f1c_65x56.png 424w, https://substackcdn.com/image/fetch/$s_!Bg22!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4546ab75-6b9e-4f70-b57a-b3aaef5d7f1c_65x56.png 848w, https://substackcdn.com/image/fetch/$s_!Bg22!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4546ab75-6b9e-4f70-b57a-b3aaef5d7f1c_65x56.png 1272w, https://substackcdn.com/image/fetch/$s_!Bg22!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4546ab75-6b9e-4f70-b57a-b3aaef5d7f1c_65x56.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Bg22!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4546ab75-6b9e-4f70-b57a-b3aaef5d7f1c_65x56.png" width="65" height="56" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4546ab75-6b9e-4f70-b57a-b3aaef5d7f1c_65x56.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:56,&quot;width&quot;:65,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1387,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165096176?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4546ab75-6b9e-4f70-b57a-b3aaef5d7f1c_65x56.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Bg22!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4546ab75-6b9e-4f70-b57a-b3aaef5d7f1c_65x56.png 424w, https://substackcdn.com/image/fetch/$s_!Bg22!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4546ab75-6b9e-4f70-b57a-b3aaef5d7f1c_65x56.png 848w, https://substackcdn.com/image/fetch/$s_!Bg22!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4546ab75-6b9e-4f70-b57a-b3aaef5d7f1c_65x56.png 1272w, https://substackcdn.com/image/fetch/$s_!Bg22!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4546ab75-6b9e-4f70-b57a-b3aaef5d7f1c_65x56.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>shows how different the effect of the new UI is for drivers in that subgroup.</p><p>By identifying these sub-populations, you might either create specialized UI variants or provide targeted training resources to help those who respond negatively. It also informs whether the overall launch strategy should involve partial rollouts or customizing the UI for different segments.</p><h2><strong>If the new UI includes advanced features, how do you measure whether drivers in the treatment group actually used those features?</strong></h2><p>When your treatment variant offers new capabilities, some drivers may opt to continue using it in the same way as the old UI, effectively not accessing the additional tools. This partial adoption can dilute the measured treatment effect if you simply compare average rides in treatment vs. control, because many &#8220;treatment&#8221; drivers never truly engage with the new functionality.</p><p>To handle this, you can track feature usage within the new UI group. For instance, log every tap or navigation that specifically relates to the new features. Then, segment the treatment group into &#8220;engaged&#8221; (those who use the new UI features significantly) vs. &#8220;unengaged&#8221; (those who do not). Compare these subgroups to the control group. You might find that the new features are extremely beneficial for those who adopt them, while the aggregated average effect is muddied by drivers who never tried them.</p><p>This approach can also help you plan next steps: if the new features are valuable only to a small fraction of drivers, you might decide to refine the UI introduction or tutorials to encourage broader usage. Conversely, you might discover that minimal usage is due to the features not being intuitive or beneficial enough.</p><h2><strong>How do you adjust your analysis if the main success metric changes over time or if the app experiences general trending improvements unrelated to the UI?</strong></h2><p>Some ride platforms experience steady growth or cyclical fluctuation over time. Even if you have a randomized control group, both groups might see an upward or downward trend in ride volume due to marketing campaigns, expansions into new areas, or parallel platform enhancements.</p><p>A typical method to handle trending data is to use a &#8220;pre-post&#8221; design combined with control. If you have baseline data for each driver before the experiment starts, you can measure the change from baseline for each group, rather than just raw values in the treatment period. This can help isolate the incremental effect of the UI from broader platform-wide or time-based trends. Another approach is difference-in-differences:</p><p>&#8226; For each driver, measure the difference between their rides in the pre-experiment window and in the experiment window. &#8226; Compare those differences between treatment and control.</p><p>If the entire driver population is improving by some background rate, difference-in-differences helps remove that common lift. You can also run more sophisticated time-series analysis if the background trend is strong and you have historical data to model typical growth.</p><h2><strong>How do you handle concurrency with other ongoing experiments that might affect driver behavior?</strong></h2><p>In large-scale systems, multiple product teams may simultaneously run experiments. These concurrent tests could impact the same driver base&#8212;perhaps there&#8217;s an incentive campaign or surge-pricing algorithm experiment in parallel. This can lead to confounded measurements where you can&#8217;t isolate which experiment caused changes in ride volume.</p><p>To mitigate these issues:</p><p>&#8226; Coordinate with other teams to ensure that the same driver population is not subject to overlapping experiments that affect the same key metrics. &#8226; Use a mutually exclusive holdout approach, where each experiment draws from distinct sets of drivers, ensuring no overlap. &#8226; If concurrency is unavoidable, track which experiments each driver is part of and incorporate that as a factor in your analysis model. For example, add an indicator variable for &#8220;driver is in a concurrent incentive campaign.&#8221; This keeps partial confounding from overshadowing the effect of the UI.</p><h2><strong>If the A/B test shows no significant improvement, is there a systematic way to investigate &#8220;why&#8221; and possibly iterate on the new UI?</strong></h2><p>Finding a null result can be disheartening, but it is often a springboard for deeper inquiry:</p><p>&#8226; Review Logs And Clickstreams Check how drivers interact with the new UI. Maybe some elements are never clicked, or the new feature is hidden or misunderstood. Understanding usage patterns can reveal whether the UI design needs rearranging or better labeling.</p><p>&#8226; Check Feature Discovery If drivers claim they did not even notice the new capabilities, you might need more visible prompts or in-app messages to guide them.</p><p>&#8226; Run Follow-up Surveys Or Interviews A small set of qualitative interviews or a short survey inside the app can highlight pain points or confusion that is not obvious from raw data.</p><p>&#8226; Analyze Subgroups Even if the overall effect is null, specific subgroups might have positive or negative outcomes. That is a clue for focusing on those who actually benefit most.</p><p>&#8226; Iterate If the new UI was not significantly better, you can refine the design and test again. This might involve small adjustments (e.g., new color scheme for buttons, improved menu placement) or major conceptual changes (e.g., rethinking the entire workflow).</p><p>When re-running experiments, be mindful that repeated testing can inflate the chance of false positives or false negatives unless statistical techniques are adjusted for multiple comparisons and repeated experimentation.</p>]]></content:encoded></item><item><title><![CDATA[ML Interview Q Series: Bayesian Assessment of Content Rater Diligence Using Labeling Data]]></title><description><![CDATA[Browse all the Probability Interview Questions here.]]></description><link>https://www.rohan-paul.com/p/ml-interview-q-series-bayesian-assessment</link><guid isPermaLink="false">https://www.rohan-paul.com/p/ml-interview-q-series-bayesian-assessment</guid><pubDate>Tue, 03 Jun 2025 13:32:45 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!rqfr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01d51501-45ad-4cf1-a016-b7ac8e05d6a4_1920x1080.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rqfr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01d51501-45ad-4cf1-a016-b7ac8e05d6a4_1920x1080.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rqfr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01d51501-45ad-4cf1-a016-b7ac8e05d6a4_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!rqfr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01d51501-45ad-4cf1-a016-b7ac8e05d6a4_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!rqfr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01d51501-45ad-4cf1-a016-b7ac8e05d6a4_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!rqfr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01d51501-45ad-4cf1-a016-b7ac8e05d6a4_1920x1080.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rqfr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01d51501-45ad-4cf1-a016-b7ac8e05d6a4_1920x1080.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/01d51501-45ad-4cf1-a016-b7ac8e05d6a4_1920x1080.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1912337,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165095620?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01d51501-45ad-4cf1-a016-b7ac8e05d6a4_1920x1080.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rqfr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01d51501-45ad-4cf1-a016-b7ac8e05d6a4_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!rqfr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01d51501-45ad-4cf1-a016-b7ac8e05d6a4_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!rqfr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01d51501-45ad-4cf1-a016-b7ac8e05d6a4_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!rqfr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01d51501-45ad-4cf1-a016-b7ac8e05d6a4_1920x1080.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Browse all the <strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">Probability Interview Questions here</a></strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">.</a></p><h2><strong>12. Facebook has a content team that labels pieces of content as spam or not spam. 90% of them are diligent (labeling 20% spam, 80% non-spam), and 10% are non-diligent (labeling 0% spam, 100% non-spam). Assume labels are independent. Given that a rater labeled 4 pieces of content as good (non-spam), what is the probability they are diligent?</strong></h2><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://x.com/rohanpaul_ai&quot;,&quot;text&quot;:&quot;Connect with me on X (Twitter)&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://x.com/rohanpaul_ai"><span>Connect with me on X (Twitter)</span></a></p><p>Solution Explanation</p><p>Bayes' Theorem is generally applied to update the probability of a hypothesis (that a rater is diligent) after observing some evidence (all 4 labeled as non-spam).</p><p>To formalize:</p><p>Let D = event that a rater is diligent Let ND = event that a rater is non-diligent</p><p>P(D) = 0.9 (prior probability that a rater is diligent) P(ND) = 0.1</p><p>If someone is diligent, the probability of labeling a single piece of content as non-spam is 0.8. If someone is non-diligent, they label everything non-spam with probability 1.</p><p>We observe 4 pieces of content all labeled as non-spam. Denote this event as E. The goal is to find P(D | E), the probability of being diligent given that all 4 items were labeled as non-spam.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vAmO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff8590dd-b117-4722-99fb-318a966899f3_1098x172.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vAmO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff8590dd-b117-4722-99fb-318a966899f3_1098x172.png 424w, https://substackcdn.com/image/fetch/$s_!vAmO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff8590dd-b117-4722-99fb-318a966899f3_1098x172.png 848w, https://substackcdn.com/image/fetch/$s_!vAmO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff8590dd-b117-4722-99fb-318a966899f3_1098x172.png 1272w, https://substackcdn.com/image/fetch/$s_!vAmO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff8590dd-b117-4722-99fb-318a966899f3_1098x172.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vAmO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff8590dd-b117-4722-99fb-318a966899f3_1098x172.png" width="1098" height="172" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ff8590dd-b117-4722-99fb-318a966899f3_1098x172.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:172,&quot;width&quot;:1098,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:26325,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165095620?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff8590dd-b117-4722-99fb-318a966899f3_1098x172.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vAmO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff8590dd-b117-4722-99fb-318a966899f3_1098x172.png 424w, https://substackcdn.com/image/fetch/$s_!vAmO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff8590dd-b117-4722-99fb-318a966899f3_1098x172.png 848w, https://substackcdn.com/image/fetch/$s_!vAmO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff8590dd-b117-4722-99fb-318a966899f3_1098x172.png 1272w, https://substackcdn.com/image/fetch/$s_!vAmO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff8590dd-b117-4722-99fb-318a966899f3_1098x172.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Where P(E | D) = (0.8)^4 P(E | ND) = (1)^4 = 1</p><p>So:</p><p>P(E | D) = 0.8^4 = 0.4096 P(E | ND) = 1</p><p>Now substitute:</p><p>P(D | E) = [0.9 * 0.4096] / [0.9 * 0.4096 + 0.1 * 1]</p><p>Numerator = 0.9 * 0.4096 = 0.36864 Denominator = 0.36864 + 0.1 = 0.46864</p><p>Final result:</p><p>P(D | E) = 0.36864 / 0.46864 &#8776; 0.787</p><p>Hence, the probability is about 78.7% that the rater is diligent, given they labeled 4 pieces of content as good (non-spam).</p><p>Implementation Example in Python</p><pre><code><code>import math

p_dil = 0.9          # Probability rater is diligent
p_non_dil = 0.1      # Probability rater is non-diligent

p_good_if_dil = 0.8
p_good_if_non_dil = 1.0

# All 4 labeled as non-spam
p_all_good_if_dil = p_good_if_dil**4
p_all_good_if_non_dil = p_good_if_non_dil**4

posterior_dil = (p_dil * p_all_good_if_dil) / (p_dil * p_all_good_if_dil + p_non_dil * p_all_good_if_non_dil)
print(posterior_dil)  # ~0.787
</code></code></pre><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.rohan-paul.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">I write everyday for my readers on actionable AI. Subscribe and instantly get a 1300+ page Python book.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>Deep Dive into Potential Follow-up Questions</p><h2><strong>What assumptions are made about independence, and why is that crucial here?</strong></h2><p>In this setup, we assume each of the 4 labeling events is conditionally independent given whether the rater is diligent or not. That means once we know the rater&#8217;s status (diligent vs. non-diligent), the probability distribution of each label does not depend on how the other pieces of content were labeled. This independence assumption is crucial because it lets us multiply the probabilities for each piece of content when computing P(E | D). If dependencies existed (e.g., the rater changes behavior after seeing certain types of content), the calculation would need a more complex joint probability model that incorporates those dependencies.</p><p>A subtlety here is that in many real-world labeling tasks, independence can be questionable. A rater&#8217;s fatigue, content similarity, or time constraints might cause them to label consistently or inconsistently across multiple items. Yet for a straightforward application of Bayes&#8217; Theorem in an interview or textbook scenario, the conditional independence assumption is very common and simplifies calculations significantly.</p><h2><strong>How might this result change if the diligent raters also sometimes label spam incorrectly?</strong></h2><p>If a diligent rater sometimes incorrectly labels spam as non-spam, we would adjust the probability of labeling any piece of content as non-spam. In the original scenario, we assume a single probability (0.8) of labeling content as non-spam for diligent raters. If in a real scenario, &#8220;diligent&#8221; means a certain accuracy level for both spam and non-spam, one would need a confusion matrix:</p><ul><li><p>Probability of labeling spam as spam</p></li><li><p>Probability of labeling spam as non-spam</p></li><li><p>Probability of labeling non-spam as spam</p></li><li><p>Probability of labeling non-spam as non-spam</p></li></ul><p>In that case, the problem might be more nuanced because the data we see (the 4 pieces labeled as good) could each be spam or not spam in an unknown distribution. The original question effectively simplifies by stating that 20% spam, 80% non-spam labeling is the ratio for a diligent rater, ignoring potential mistakes or differences in the content&#8217;s ground truth. If the &#8220;20% spam&#8221; means the rater is labeling everything with a certain distribution regardless of the true content, the question remains consistent with the stated probabilities. But in a scenario modeling true positives/negatives, you would have to incorporate the underlying distribution of spam vs. not spam as well.</p><h2><strong>Why does the posterior probability increase as we see repeated evidence of non-spam labeling?</strong></h2><p>The posterior probability that the rater is diligent increases as they label multiple items as non-spam because the diligent rater has a smaller but still significant probability (0.8) of labeling each item as non-spam. The non-diligent rater, on the other hand, will always label items as non-spam with 100% probability. Intuitively, if we observe a lot of consistent labeling of non-spam, that might seem to support the hypothesis that the rater could be non-diligent (since they always say &#8220;non-spam&#8221;). However, because the prior heavily favors being diligent (0.9 vs. 0.1), the repeated observation of non-spam still leads us to believe the rater is likely diligent, though the evidence is less decisive than if diligent raters were far more likely to mark spam (e.g., 50% spam vs. 100% spam).</p><p>In fact, if a rater labeled everything as non-spam all the time, the resulting posterior might eventually shift to favor them being non-diligent&#8212;particularly if the prior wasn&#8217;t as strong or if we saw many more items labeled. But with only four items and a large prior in favor of diligence, the probability remains in favor of a diligent rater.</p><h2><strong>Could the result be different if the prior were not 90%?</strong></h2><p>Yes. The prior assumption P(D) = 0.9 significantly influences the posterior. If, for example, we had a uniform prior (50% for diligence, 50% for non-diligence), then the posterior would change:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_0LZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9841e0c3-8993-45eb-aaaa-82f9e0cbed48_920x213.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_0LZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9841e0c3-8993-45eb-aaaa-82f9e0cbed48_920x213.png 424w, https://substackcdn.com/image/fetch/$s_!_0LZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9841e0c3-8993-45eb-aaaa-82f9e0cbed48_920x213.png 848w, https://substackcdn.com/image/fetch/$s_!_0LZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9841e0c3-8993-45eb-aaaa-82f9e0cbed48_920x213.png 1272w, https://substackcdn.com/image/fetch/$s_!_0LZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9841e0c3-8993-45eb-aaaa-82f9e0cbed48_920x213.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_0LZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9841e0c3-8993-45eb-aaaa-82f9e0cbed48_920x213.png" width="920" height="213" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9841e0c3-8993-45eb-aaaa-82f9e0cbed48_920x213.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:213,&quot;width&quot;:920,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:26929,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165095620?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9841e0c3-8993-45eb-aaaa-82f9e0cbed48_920x213.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_0LZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9841e0c3-8993-45eb-aaaa-82f9e0cbed48_920x213.png 424w, https://substackcdn.com/image/fetch/$s_!_0LZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9841e0c3-8993-45eb-aaaa-82f9e0cbed48_920x213.png 848w, https://substackcdn.com/image/fetch/$s_!_0LZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9841e0c3-8993-45eb-aaaa-82f9e0cbed48_920x213.png 1272w, https://substackcdn.com/image/fetch/$s_!_0LZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9841e0c3-8993-45eb-aaaa-82f9e0cbed48_920x213.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>This would typically yield a lower probability for diligence, because seeing all non-spam is more in line with the non-diligent rater who never labels spam. Thus, a strong prior for diligence is the main factor that keeps the posterior above 50% in the original question.</p><h2><strong>How does this relate to real-world spam detection tasks at scale?</strong></h2><p>In a large-scale setting like Facebook&#8217;s, many raters with varied behaviors come into play, and the system might attempt to assess each rater&#8217;s reliability. When aggregated across thousands of labeled items, the platform could build confidence scores for each rater. In practice:</p><p>They might use a more comprehensive statistical or machine learning model (e.g., an expectation-maximization approach that simultaneously learns the accuracy of raters and labels for content). They could integrate multiple labels from different raters on the same content to reduce noise. They might consider more nuanced mistakes, weighting the cost of false positives vs. false negatives.</p><p>These real-world systems typically go beyond a single application of Bayes&#8217; Theorem, but the principle of updating beliefs about rater accuracy (or &#8220;diligence&#8221;) remains grounded in the same probabilistic approach.</p><h2><strong>What if the labels are not truly independent?</strong></h2><p>Non-independence can be introduced if a rater changes their strategy over time, learns from previous examples, or is influenced by the nature of the content. For example, after labeling a certain piece of content as spam, they might be more lenient on subsequent items to avoid marking too many items as spam in a single session. Another form of dependence arises if there&#8217;s an external factor, such as UI cues that show how other raters have labeled similar content. Handling such dependence usually requires a more complex model, possibly a hidden Markov model if the transitions matter, or some hierarchical Bayesian approach that captures correlations between items. In many high-stakes real-world scenarios, capturing these correlations is critical to obtaining unbiased and accurate estimates of rater performance.</p><h2><strong>Are there any practical tips for implementing a Bayesian approach to rater reliability in a production system?</strong></h2><p>One typical approach is to maintain a beta distribution over each rater&#8217;s probability of labeling content correctly. As each new labeling event arrives, the system updates that rater&#8217;s alpha and beta parameters:</p><p>If the rater&#8217;s labeling aligns with the consensus or ground truth, increment alpha. If it disagrees, increment beta.</p><p>This approach is especially common when the labeled items have known ground-truth. In scenarios like spam detection, though, &#8220;ground truth&#8221; can be murky, so you might rely on consensus, machine learning predictions, or other signals. Over time, each rater&#8217;s distribution tightens around their true reliability. If a rater always marks items as non-spam regardless of content, the system will detect that pattern once enough items are labeled. The question&#8217;s simplified model (0.9 vs. 0.1 prior, etc.) is a narrower version of the real-world processes that use repeated Bayesian updates across many labeling events.</p><h2><strong>Could we extend this to find the probability that a rater is diligent if they labeled a certain number of spam items and a certain number of non-spam items?</strong></h2><p>Yes. More generally, if a rater labeled X pieces of content as spam and Y pieces of content as non-spam, one could apply Bayes&#8217; Theorem with:</p><p>P(E | D) = (p_spam_if_dil)^X * (p_non_spam_if_dil)^Y P(E | ND) = (p_spam_if_non_dil)^X * (p_non_spam_if_non_dil)^Y</p><p>Then use the same formula to compute the posterior. In the current question, X=0, Y=4 for the non-spam-labeled items. Changing these values is straightforward by substituting the appropriate exponents.</p><h2><strong>How might a real interview delve deeper into this problem?</strong></h2><p>Interviewers often explore your understanding of:</p><p>Why the independence assumption matters How to handle partial knowledge of rater bias What if the ratio (20% spam, 80% non-spam) doesn&#8217;t match real data or changes over time How many pieces of labeled content are needed before you become confident in your inference of a rater&#8217;s diligence How to incorporate more complicated distributions for labeling behavior</p><p>They also might ask how you&#8217;d implement ongoing monitoring for each rater. A typical advanced approach is some combination of Bayesian updating or weighting plus cross-checking with higher-trust raters.</p><p>By addressing these points and clearly explaining how Bayes&#8217; Theorem was applied to reach approximately 78.7%, you can show your depth of knowledge in both probabilistic inference and practical considerations for large-scale data labeling tasks.</p><div><hr></div><h2><strong>Below are additional follow-up questions</strong></h2><h2><strong>How would the analysis change if the actual distribution of spam vs. non-spam in the real content differs from the rater&#8217;s labeling distribution?</strong></h2><p>If the real-world prevalence of spam vs. non-spam content is significantly different from the labeling tendencies described (20% spam vs. 80% non-spam for diligent raters, and 0% spam vs. 100% non-spam for non-diligent), then the observed labels might not match the underlying ground truth distribution. This means:</p><p>Diligent raters are not necessarily labeling 20% of the actual content as spam because maybe the real proportion of spam is 40%. If we rely strictly on the 20%-spam-labeled assumption, we might under- or overestimate the rater&#8217;s diligence. Non-diligent raters label everything as non-spam, so if real spam prevalence is higher, we would likely see a mismatch between the underlying content and what&#8217;s labeled.</p><p>Incorporating the actual prevalence of spam vs. non-spam in the model usually requires more advanced statistical methods. One could adjust the likelihood function to incorporate the probability that the content itself is spam (or not) and the probability that a diligent rater catches it as spam. In a real-world scenario, we often don&#8217;t observe the true label for each piece of content (that&#8217;s precisely the reason we rely on raters). But if the platform has partial ground truth&#8212;for instance, from certain high-accuracy classification systems or from dedicated &#8220;expert&#8221; reviewers&#8212;then we can build a more accurate Bayesian model. If that ground truth reveals that the rater is labeling a drastically different proportion than the actual data distribution, we can detect a mismatch sooner.</p><p>A subtle pitfall arises if you assume all rater-labeled &#8220;non-spam&#8221; is correct in a setting where true spam is more common. You might be systematically overestimating how diligent a rater is simply because your baseline assumption about the content&#8217;s spam frequency is off. This leads to updating your posterior probabilities incorrectly. In practice, you&#8217;d carefully model the prior distribution over content types and the confusion matrix for each type of rater.</p><h2><strong>What if there is a gray area where some raters are partially diligent rather than purely diligent or purely non-diligent?</strong></h2><p>Real human labelers often fall on a spectrum. The assumption that 90% are diligent (labeling 20% spam, 80% non-spam consistently) and 10% are completely non-diligent (labeling 0% spam, 100% non-spam) might be an oversimplification. In practice, you can have:</p><p>Raters who might be diligent 70% of the time but slip into &#8220;quick labeling&#8221; 30% of the time. Raters who start diligent, then as they grow tired, end up labeling everything as non-spam.</p><p>To handle partial diligence, you could generalize the model such that each rater has a personal probability p of labeling an item as spam. Then &#8220;purely diligent&#8221; might mean p &#8776; 0.2, while &#8220;purely non-diligent&#8221; might mean p &#8776; 0.0, and partial diligence would fall somewhere in between (e.g., p = 0.1 or p = 0.25). You might represent rater diligence with a distribution over p (for example, a Beta prior). After observing labeled items, you&#8217;d update that Beta distribution&#8217;s parameters to reflect your posterior belief about that rater&#8217;s spam-labeling probability.</p><p>The pitfall here is ignoring that real raters are not strictly one of two categories. If you treat them as purely binary, you risk misclassifying partially diligent raters as fully non-diligent or vice versa. This can be especially problematic if a rater&#8217;s spam labeling rate changes over time. Without a flexible model, you could systematically draw incorrect inferences about their performance.</p><h2><strong>What if a rater can label spam as non-spam or vice versa by accident, rather than following a fixed proportion?</strong></h2><p>When we say a diligent rater has a &#8220;20% spam vs. 80% non-spam&#8221; labeling distribution, we&#8217;re implicitly saying that for any random piece of content, they have some probability of labeling it spam or non-spam. In reality, &#8220;diligent&#8221; might mean the person tries to label content accurately to the best of their ability. This implies the rater has a certain probability of correctly identifying spam (true positive rate) and a certain probability of correctly identifying non-spam (true negative rate). These rates might be well below 100%, especially if the distinction is not always crystal clear.</p><p>If the rater occasionally labels spam as non-spam by accident (a false negative) or labels non-spam as spam by accident (a false positive), the overall distribution of spam vs. non-spam in their labels becomes a result of both the actual prevalence of spam in the content and their personal accuracy. A more realistic approach might be:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sEAs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9053a597-1830-4d3a-8501-0818f9a5623c_756x511.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sEAs!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9053a597-1830-4d3a-8501-0818f9a5623c_756x511.png 424w, https://substackcdn.com/image/fetch/$s_!sEAs!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9053a597-1830-4d3a-8501-0818f9a5623c_756x511.png 848w, https://substackcdn.com/image/fetch/$s_!sEAs!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9053a597-1830-4d3a-8501-0818f9a5623c_756x511.png 1272w, https://substackcdn.com/image/fetch/$s_!sEAs!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9053a597-1830-4d3a-8501-0818f9a5623c_756x511.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sEAs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9053a597-1830-4d3a-8501-0818f9a5623c_756x511.png" width="756" height="511" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9053a597-1830-4d3a-8501-0818f9a5623c_756x511.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:511,&quot;width&quot;:756,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:27075,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165095620?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9053a597-1830-4d3a-8501-0818f9a5623c_756x511.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!sEAs!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9053a597-1830-4d3a-8501-0818f9a5623c_756x511.png 424w, https://substackcdn.com/image/fetch/$s_!sEAs!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9053a597-1830-4d3a-8501-0818f9a5623c_756x511.png 848w, https://substackcdn.com/image/fetch/$s_!sEAs!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9053a597-1830-4d3a-8501-0818f9a5623c_756x511.png 1272w, https://substackcdn.com/image/fetch/$s_!sEAs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9053a597-1830-4d3a-8501-0818f9a5623c_756x511.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>are the true positive and true negative rates, respectively, for a diligent rater. Non-diligent raters could then have drastically lower values for these rates or simply not vary their labeling at all. The complexity arises when the actual spam prevalence is unknown, forcing us to model that aspect as well.</p><p>Pitfalls include oversimplifying real rater behavior, which can lead to large estimation errors. If you consistently assume a single fixed labeling distribution but a rater is systematically better or worse at identifying spam, your posterior estimates for that rater&#8217;s diligence will be skewed.</p><h2><strong>How might time-of-day or session-length effects alter the assumption of consistent labeling behavior?</strong></h2><p>A rater&#8217;s labeling pattern might change over the course of a work session. Early in the session, they might carefully read each piece of content, but as fatigue sets in, they might start defaulting to marking items as non-spam without thorough inspection. Alternatively, a rater might begin the day lenient but become more strict later on. These temporal or session-based effects break the independence assumption across items. The probability of labeling any given item as spam or non-spam might shift after a certain threshold of labeled items.</p><p>A more sophisticated model could incorporate time-based or session-based variables that capture a rater&#8217;s &#8220;fatigue factor,&#8221; incrementally adjusting the probability of labeling spam. For example, you could model a drift in the rater&#8217;s probability of labeling spam as they continue through a large batch of tasks. Or you could track and isolate short sessions to see if the rater&#8217;s labeling behavior is consistent across shorter labeling sessions.</p><p>Edge cases include a rater who is perfectly diligent for the first 100 items but nearly non-diligent for the next 100. If you lump all 200 items together and assume a single constant probability of spam labeling, you might incorrectly conclude that the rater is partially diligent. A time-based or chunked approach can reveal such changes in behavior.</p><h2><strong>Could there be external incentives that change a rater&#8217;s behavior, and how would you detect those?</strong></h2><p>If the rater is paid per item labeled (without regard to accuracy), they might be motivated to get through items as fast as possible. Another scenario is if the rater is penalized for false positives (labeling something as spam when it&#8217;s not) but not penalized for false negatives. Such incentives can skew their labeling pattern toward labeling everything as non-spam.</p><p>Detecting this usually involves correlating the rater&#8217;s labeling decisions with known ground-truth subsets, or comparing the rater&#8217;s pattern to the consensus of multiple other raters who have historically high accuracy. If you see someone systematically deviating from the consensus&#8212;and especially if that deviation aligns with known spam that they are letting through&#8212;it might indicate they are optimizing for speed rather than accuracy.</p><p>A subtle pitfall is that a rater might appear diligent at first if you evaluate them on trivial content that&#8217;s mostly non-spam, but once they hit a batch of borderline or more complicated content, their performance might degrade. If your sampling for quality checks is not representative, you&#8217;ll fail to catch these shifts in behavior.</p><h2><strong>How do you handle cases where the content is extremely ambiguous, and even experts disagree on whether it is spam?</strong></h2><p>Some content can have borderline characteristics. Maybe it&#8217;s promotional but also has legitimate information. Or it&#8217;s user-generated content that uses suspicious language but has an acceptable reason to do so. In these cases, even highly trained raters might disagree. The notion of &#8220;diligent&#8221; becomes murky if the labeling itself isn&#8217;t perfectly well-defined. Some real-world content guidelines include subjective interpretations (e.g., what constitutes &#8220;harmful,&#8221; &#8220;misleading,&#8221; or &#8220;spammy&#8221;).</p><p>One approach is to incorporate inter-rater agreement statistics, such as Cohen&#8217;s Kappa or Krippendorff&#8217;s Alpha, across multiple raters. If the content is ambiguous, you might see high disagreement among even so-called &#8220;diligent&#8221; raters. You&#8217;d then need a more nuanced label, like &#8220;possibly spam,&#8221; or you&#8217;d need a second-level escalation to experts.</p><p>The pitfall is to assume that if multiple raters differ, one is diligent and the other is not. It might simply be that the classification itself is subjective. This can lead you to incorrectly label a truly diligent rater as non-diligent or vice versa. In a Bayesian framework, you could incorporate a confusion matrix that includes ambiguous or uncertain judgments and track how each rater handles these &#8220;gray area&#8221; pieces of content.</p><h2><strong>What role might multi-annotator agreement or consensus play in refining our belief about diligence?</strong></h2><p>Instead of relying on a single rater&#8217;s sequence of labels, many real systems aggregate labels from multiple raters. If you have a scenario where each piece of content is independently labeled by several raters, you can observe the patterns of agreement or disagreement. For instance, if a rater typically agrees with the majority consensus on items known (or strongly believed) to be spam, that suggests diligence. Conversely, if they always disagree with the consensus, that&#8217;s suspicious behavior.</p><p>In a Bayesian sense, you might:</p><p>Combine the raters&#8217; labels to form a consensus distribution of spam vs. non-spam for each item. Compare each individual rater&#8217;s labels to that consensus, weighting rater confidence over time. Update your posterior belief about each rater&#8217;s diligence as more consensus-labeled data accumulates.</p><p>A subtle edge case arises if there is collusion among certain raters, or if the &#8220;consensus&#8221; is heavily influenced by a large group of less accurate raters. A handful of incompetent raters can tilt the consensus in the wrong direction, which might incorrectly implicate a truly diligent rater as an outlier. This is why real systems sometimes weigh raters by their estimated reliability rather than using a simple majority vote.</p><h2><strong>How can we account for the possibility that even a &#8220;diligent&#8221; rater might occasionally label content randomly?</strong></h2><p>Human raters might label an item randomly if they&#8217;re uncertain or if they clicked the wrong button by accident. This random error probability can be integrated into the model by saying: even a diligent rater has a small probability</p><p>&#1013;</p><p>of labeling an item incorrectly in a purely random fashion. Over many items, those random mistakes might slightly reduce the correlation between a &#8220;diligent&#8221; rater&#8217;s labels and the expected distribution.</p><p>Including a small</p><p>&#1013;</p><p>for random mistakes can prevent us from overfitting the assumption that diligent means &#8220;exactly 20% spam.&#8221; Realistically, we might say a diligent rater has a mean spam-labeled fraction of 20% but with some variance. If we treat</p><p>&#1013;</p><p>as part of a distribution around that 20% figure, we can keep updating it using new data. Failing to account for this small random labeling factor could lead you to incorrectly classify a rater as partially or fully non-diligent when in fact they just occasionally make a random error.</p><h2><strong>How does sample size impact the confidence in classifying a rater as diligent vs. non-diligent?</strong></h2><p>If you&#8217;ve observed only 4 labels from a rater, that&#8217;s a very small sample. Even if they label all 4 as non-spam, you have limited evidence to confidently distinguish between a truly non-diligent rater (who never labels spam) and a diligent rater who might label ~20% of items as spam. The posterior (about 78.7%) is still influenced heavily by the prior (90% for diligence).</p><p>As the number of labeled items grows, your posterior probability for a rater&#8217;s diligence typically stabilizes. For instance, if you observed 100 items, and the rater labeled 0 of them as spam, you would be much more suspicious that they might be non-diligent, despite the 90% prior. The Bayesian update would accumulate evidence over time, gradually overpowering the prior if the observed behavior consistently deviates from the diligent expectation.</p><p>Edge cases: if the rater is assigned a batch of unusually &#8220;clean&#8221; content that truly has little to no spam, you might incorrectly conclude from that batch that they&#8217;re either non-diligent or extremely spam-lenient. Proper randomization or ensuring each rater sees a wide variety of content can mitigate this pitfall.</p><h2><strong>How would you handle real-time updating of a rater&#8217;s diligence probability as new labels arrive?</strong></h2><p>A production system might want to constantly update each rater&#8217;s diligence score. After each newly labeled item, or after a small batch, you&#8217;d perform a Bayesian update to incorporate the new evidence. This can be computationally efficient if you maintain a running count of how many items were labeled spam vs. non-spam, or you store the relevant hyperparameters (if using Beta distributions for spam labeling probability).</p><p>One challenge is deciding how quickly to adjust. If you see an anomaly in a single batch (e.g., the rater labels no spam for 20 items in a row), do you drastically reduce their diligence probability? Or do you give them the benefit of the doubt and wait for more data? Real systems often use a moving window approach, factoring in only the last N items, or they apply decay factors so that older data is down-weighted. This allows you to capture recent changes in behavior without discarding the entire labeling history.</p><p>An edge case is if a rater&#8217;s labeling style changes abruptly, perhaps due to a new policy or personal choice. If your update mechanism is too slow (overly trusting past data), you won&#8217;t catch the shift quickly. If it&#8217;s too fast, you might overreact to random fluctuations in small batches of data.</p><h2><strong>How do you handle scenario analysis, such as testing how sensitive the result is to changes in assumptions?</strong></h2><p>Sensitivity analysis is crucial. You might not be certain that 90% of raters are diligent. Perhaps you only have a rough guess for that prior. Or maybe you suspect that diligent raters label 25% spam instead of 20%. In these cases, you can re-run the Bayesian calculation under different priors and see how the posterior changes. If small changes in the prior drastically alter the posterior, it indicates your data doesn&#8217;t strongly constrain the result.</p><p>In a real system, you might systematically vary:</p><p>P(D) (the prior on diligence) The probability of labeling spam vs. non-spam for diligent raters The fraction of spam in the content itself</p><p>Then record how the posterior for rater diligence shifts. If you find that the posterior remains fairly stable across a range of plausible assumptions, you can be more confident in the result. The pitfall is ignoring this step, which might cause you to place unwarranted confidence in an answer that is highly dependent on uncertain inputs.</p><h2><strong>How might adversarial raters or spammers try to exploit this system to appear diligent?</strong></h2><p>In a scenario where being flagged as non-diligent has consequences, a rater could adapt. For instance, a malicious rater who doesn&#8217;t want to be detected might occasionally label content as spam to mimic the expected distribution of a diligent rater. They might follow a simple strategy: &#8220;label 80% of items as non-spam and 20% as spam,&#8221; matching the known &#8216;diligent&#8217; pattern. This strategic labeling could fool a naive Bayesian approach that simply looks at the proportion.</p><p>One way to detect such adversarial behavior is to insert known test items (a practice commonly known as gold data or honey pots). These items have carefully verified labels (spam or non-spam). If the rater continues to mislabel them systematically, you can catch the deception. Alternatively, you can dynamically vary the expected proportion or refine your model to track labeling accuracy on known test items separately from unlabeled real items.</p><p>A pitfall in many large-scale systems is that when labelers realize they can pass a simple test by conforming to an expected pattern, they do so mechanically. The solution is to use less predictable checks, random spot checks, or advanced ML models that spot suspicious patterns in the sequence of labels.</p><h2><strong>How might cultural or language differences affect a rater&#8217;s labeling decisions?</strong></h2><p>If content is in multiple languages or references specific cultural elements, a rater who lacks the language proficiency or cultural context might struggle to label spam accurately. They could unintentionally label everything as non-spam or spam. In a global platform like Facebook, you might see differences in labeling behavior across different markets, especially if the concept of &#8220;spam&#8221; is somewhat context-dependent.</p><p>For example, certain promotional content might be normal in one country but considered spammy in another. If your model lumps all raters together under the same prior distributions, you might fail to account for these regional or cultural differences. You could handle this by having separate Bayesian models or separate prior probabilities for raters who operate in different linguistic or geographic contexts. Alternatively, you might define local guidelines or calibrate labelers with localized examples.</p><p>A major edge case arises when you fail to adapt your model to local contexts. You might incorrectly categorize a genuinely diligent rater as non-diligent because they&#8217;re labeling items in a language where the notion of spam differs. Or you might incorrectly trust a rater who is missing cultural cues that content is spam.</p><h2><strong>How might psychological or emotional factors come into play for the rater&#8217;s consistency?</strong></h2><p>Labeling spam can be emotionally taxing if the content includes offensive or disturbing material. Some raters might become desensitized and eventually click &#8220;non-spam&#8221; just to avoid dealing with it. Others might become overly cautious and label borderline content as spam. Over time, these emotional responses can lead to systematic biases.</p><p>Detecting these biases can be challenging because they&#8217;re not always consistent or predictable. You might see them manifest in a time series: for example, the rater&#8217;s labeling pattern changes after encountering shocking content. Capturing such patterns might require a model that looks at the content type and the rater&#8217;s labeling trajectory, perhaps in a temporal or session-based framework.</p><p>The pitfall is ignoring human factors and treating raters as if they&#8217;re purely rational and consistent. Real humans have cognitive and emotional limits. If the system does not account for these changes in rater behavior, it might label a previously diligent rater as &#8220;suddenly non-diligent&#8221; when in fact they&#8217;re experiencing emotional burnout or other challenges.</p><h2><strong>What if we need to incorporate the cost of misclassification into the Bayesian decision process?</strong></h2><p>Sometimes, it&#8217;s not just about finding the posterior probability that a rater is diligent. It&#8217;s about deciding if we should treat them as diligent or remove them from the labeling pool. In such scenarios, we might incorporate a decision-theoretic approach:</p><p>If we incorrectly classify a diligent rater as non-diligent, we lose a valuable resource. If we incorrectly classify a non-diligent rater as diligent, we get poor-quality labels.</p><p>We can define a cost function:</p><p>Cost(dismissing a diligent rater) = some value C_d Cost(keeping a non-diligent rater) = some value C_nd</p><p>Then, after computing the posterior, we weigh these costs to decide the best course of action. If P(D | E) is high enough, we might keep the rater; otherwise, we might remove them from the pool. Alternatively, we might place them on a &#8220;probation&#8221; period. This approach is common in production systems that want to minimize the overall cost rather than just rely on a threshold of P(D | E).</p><p>The subtlety is that these cost assignments can vary by business needs. For instance, if spam is extremely costly for the platform, the cost of incorrectly allowing a non-diligent rater to continue might outweigh the cost of dismissing a few borderline diligent raters.</p><h2><strong>How would you manage a feedback loop between automatic spam detection algorithms and human rater judgments?</strong></h2><p>Many spam-detection systems are hybrid. An automated classifier handles the bulk of content, and only a fraction is sent to human raters for verification. Over time, the rater labels might be fed back to retrain or fine-tune the classifier. If the classifier&#8217;s predictions are used as partial ground truth, and you&#8217;re also trying to evaluate the rater&#8217;s diligence, a feedback loop emerges. If the classifier is inaccurate in certain niches, diligent raters who correctly label those edge cases might appear to deviate from the classifier&#8217;s labels.</p><p>One method is to maintain separate reliability measures for both the automated system and each rater. You might do a cross-check: when the classifier and rater disagree, see how often the rater is right based on more authoritative evidence (like final adjudication by a super-reviewer or a second-level classifier). Over many such disagreements, you gain evidence about both the rater&#8217;s diligence and the classifier&#8217;s accuracy in that content domain.</p><p>Pitfalls include adopting the classifier&#8217;s decision as a gold standard prematurely. A truly diligent rater might appear &#8220;non-diligent&#8221; if they repeatedly contradict a flawed model. You have to ensure that your system isolates true gold labels (or near-gold from a highly trusted source) to break the loop and avoid systematically punishing correct but &#8220;inconvenient&#8221; rater labels.</p><h2><strong>How do you mitigate the risk of overfitting a particular distribution of labeling behavior?</strong></h2><p>If your Bayesian model is heavily tailored to the assumption that diligent raters label exactly 20% spam, 80% non-spam, you risk overfitting to that prior distribution. In reality, even a conscientious rater may fluctuate around these proportions, and the actual distribution might shift over time. Overfitting can cause your model to incorrectly classify normal variation as signs of non-diligence or random noise.</p><p>Mitigation strategies include:</p><p>Using a more flexible prior, such as a Beta distribution for each rater&#8217;s spam probability, rather than a fixed 20%. Allowing hierarchical models that learn an overall distribution for &#8220;diligent&#8221; raters but permit individual-level variations. Periodically recalibrating the priors to reflect changes in content. If spam campaigns evolve, the proportion of truly spammy content might rise or fall. Diligent raters adapt to the new distribution, but a fixed model might not.</p><p>The edge case is if you rely on the original, rigid prior without updates. As real-world behavior shifts, your model&#8217;s inferences become stale, leading to erroneous classification of raters.</p><h2><strong>How do you handle extremely small or extremely large values of the prior?</strong></h2><p>If the prior P(D) is extremely close to 1 (say 0.999), then it&#8217;s very difficult for a small number of observations to shift the posterior away from diligence. Conversely, if the prior is extremely small (say 0.01), you&#8217;d need a large number of spam-labeled items to overcome that prior and conclude the rater is diligent. This leads to issues such as:</p><p>Overconfidence in minimal data. If P(D) = 0.999, seeing the rater label 4 non-spam pieces might be deemed almost certain diligence, even though that evidence alone is limited. Over-skepticism if P(D) = 0.01, making it extremely difficult to classify a rater as diligent unless we gather a lot of contradictory evidence.</p><p>Real systems typically avoid using extremely skewed priors unless they have strong evidence that such a distribution accurately represents the population. Otherwise, a moderate prior (like 0.9) or even 0.5 might be used initially, then refined as more data accumulates.</p><p>A subtle pitfall occurs if you keep an extreme prior constant and never allow new data to sufficiently shift it. This leaves you blind to changes in the actual ratio of diligent vs. non-diligent raters. Over time, the system might fail to adapt to an influx of newly hired raters who are less thorough.</p><h2><strong>How can you integrate domain expertise or heuristics about spam detection into the Bayesian framework?</strong></h2><p>Beyond raw probabilities, domain experts might say: &#8220;A truly diligent rater typically flags certain pattern-based spam,&#8221; or &#8220;A non-diligent rater almost never flags borderline content.&#8221; You can encode these heuristics by adjusting the likelihood function or by defining a richer feature set for each labeled item. For example, you could track how the rater labels suspicious phrases or links. If a rater consistently fails to flag items with known spam indicators, that&#8217;s stronger evidence of non-diligence than merely looking at overall spam vs. non-spam percentages.</p><p>This multi-dimensional approach might say for each piece of content, we have a feature vector capturing its spam-likelihood signals. We then track how the rater responded. If the rater consistently fails on high-spam-likelihood items, that strongly indicates non-diligence. A simpler one-dimensional model that only checks &#8220;spam&#8221; vs. &#8220;non-spam&#8221; might miss these nuances.</p><p>The challenge is ensuring your heuristics are correct and up to date. Spam patterns evolve, so a rater might appear non-diligent if they don&#8217;t flag newly emerging patterns that your heuristics consider suspicious. Conversely, a rater might look overly spam-happy if they incorrectly label new forms of content as spam just because it resembles older patterns.</p><p></p>]]></content:encoded></item><item><title><![CDATA[ML Interview Q Series: Detecting Unfair Coin Bias: Sample Size Calculation via Hypothesis Testing]]></title><description><![CDATA[Browse all the Probability Interview Questions here.]]></description><link>https://www.rohan-paul.com/p/ml-interview-q-series-detecting-unfair</link><guid isPermaLink="false">https://www.rohan-paul.com/p/ml-interview-q-series-detecting-unfair</guid><pubDate>Tue, 03 Jun 2025 13:25:30 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!O40f!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde4ba82f-1688-491e-8d29-ad6aef74c6c0_1024x509.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!O40f!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde4ba82f-1688-491e-8d29-ad6aef74c6c0_1024x509.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!O40f!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde4ba82f-1688-491e-8d29-ad6aef74c6c0_1024x509.png 424w, https://substackcdn.com/image/fetch/$s_!O40f!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde4ba82f-1688-491e-8d29-ad6aef74c6c0_1024x509.png 848w, https://substackcdn.com/image/fetch/$s_!O40f!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde4ba82f-1688-491e-8d29-ad6aef74c6c0_1024x509.png 1272w, https://substackcdn.com/image/fetch/$s_!O40f!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde4ba82f-1688-491e-8d29-ad6aef74c6c0_1024x509.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!O40f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde4ba82f-1688-491e-8d29-ad6aef74c6c0_1024x509.png" width="1024" height="509" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/de4ba82f-1688-491e-8d29-ad6aef74c6c0_1024x509.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:509,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:911106,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde4ba82f-1688-491e-8d29-ad6aef74c6c0_1024x509.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!O40f!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde4ba82f-1688-491e-8d29-ad6aef74c6c0_1024x509.png 424w, https://substackcdn.com/image/fetch/$s_!O40f!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde4ba82f-1688-491e-8d29-ad6aef74c6c0_1024x509.png 848w, https://substackcdn.com/image/fetch/$s_!O40f!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde4ba82f-1688-491e-8d29-ad6aef74c6c0_1024x509.png 1272w, https://substackcdn.com/image/fetch/$s_!O40f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde4ba82f-1688-491e-8d29-ad6aef74c6c0_1024x509.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Browse all the <strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">Probability Interview Questions here</a></strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">.</a></p><h2><strong>11. Say you have an unfair coin which will land on heads 60% of the time. How many coin flips are needed to detect that the coin is unfair?</strong></h2><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://x.com/rohanpaul_ai&quot;,&quot;text&quot;:&quot;Connect with me on X (Twitter)&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://x.com/rohanpaul_ai"><span>Connect with me on X (Twitter)</span></a></p><p>Understanding the question in a rigorous way involves classical statistical hypothesis testing. We want to know the sample size (number of coin flips) required so that, with high probability, we can conclude the coin's true probability of landing heads is 0.6 (as opposed to the fair coin assumption of 0.5). This typically means setting up a null hypothesis that the coin is fair (p = 0.5) and an alternative hypothesis that p &#8800; 0.5 or p &gt; 0.5. We then specify a significance level (often denoted</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Nag0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c74082d-a4aa-4392-9f86-c5704e8f39a4_54x46.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Nag0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c74082d-a4aa-4392-9f86-c5704e8f39a4_54x46.png 424w, https://substackcdn.com/image/fetch/$s_!Nag0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c74082d-a4aa-4392-9f86-c5704e8f39a4_54x46.png 848w, https://substackcdn.com/image/fetch/$s_!Nag0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c74082d-a4aa-4392-9f86-c5704e8f39a4_54x46.png 1272w, https://substackcdn.com/image/fetch/$s_!Nag0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c74082d-a4aa-4392-9f86-c5704e8f39a4_54x46.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Nag0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c74082d-a4aa-4392-9f86-c5704e8f39a4_54x46.png" width="54" height="46" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7c74082d-a4aa-4392-9f86-c5704e8f39a4_54x46.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:46,&quot;width&quot;:54,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:765,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c74082d-a4aa-4392-9f86-c5704e8f39a4_54x46.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Nag0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c74082d-a4aa-4392-9f86-c5704e8f39a4_54x46.png 424w, https://substackcdn.com/image/fetch/$s_!Nag0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c74082d-a4aa-4392-9f86-c5704e8f39a4_54x46.png 848w, https://substackcdn.com/image/fetch/$s_!Nag0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c74082d-a4aa-4392-9f86-c5704e8f39a4_54x46.png 1272w, https://substackcdn.com/image/fetch/$s_!Nag0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c74082d-a4aa-4392-9f86-c5704e8f39a4_54x46.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p>) and a desired statistical power (often denoted</p><p>1&#8722;&#946;<br>). Once these are fixed, we can estimate the required number of coin flips using well-known formulas or direct simulation.</p><p>Detecting &#8220;unfairness&#8221; precisely depends on thresholds for statistical significance (the probability of a Type I error, rejecting a fair coin when it is actually fair) and power (the probability of detecting that the coin is unfair when it is indeed biased). Although there is no single universal answer unless we specify these thresholds, it is standard to assume something like a 5% Type I error rate (</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-Mpd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d780270-754f-4fa3-8b84-ba3e5dd4181a_133x54.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-Mpd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d780270-754f-4fa3-8b84-ba3e5dd4181a_133x54.png 424w, https://substackcdn.com/image/fetch/$s_!-Mpd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d780270-754f-4fa3-8b84-ba3e5dd4181a_133x54.png 848w, https://substackcdn.com/image/fetch/$s_!-Mpd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d780270-754f-4fa3-8b84-ba3e5dd4181a_133x54.png 1272w, https://substackcdn.com/image/fetch/$s_!-Mpd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d780270-754f-4fa3-8b84-ba3e5dd4181a_133x54.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-Mpd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d780270-754f-4fa3-8b84-ba3e5dd4181a_133x54.png" width="133" height="54" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1d780270-754f-4fa3-8b84-ba3e5dd4181a_133x54.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:54,&quot;width&quot;:133,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2368,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d780270-754f-4fa3-8b84-ba3e5dd4181a_133x54.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!-Mpd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d780270-754f-4fa3-8b84-ba3e5dd4181a_133x54.png 424w, https://substackcdn.com/image/fetch/$s_!-Mpd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d780270-754f-4fa3-8b84-ba3e5dd4181a_133x54.png 848w, https://substackcdn.com/image/fetch/$s_!-Mpd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d780270-754f-4fa3-8b84-ba3e5dd4181a_133x54.png 1272w, https://substackcdn.com/image/fetch/$s_!-Mpd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d780270-754f-4fa3-8b84-ba3e5dd4181a_133x54.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>) and 80% power (</p><p>1&#8722;&#946;=0.80<br>). Under these assumptions, the required sample size to detect a shift from p = 0.5 to p = 0.6 often falls roughly in the ballpark of 100&#8211;200 flips. We will walk through the reasoning and provide a more precise normal-approximation-based calculation below.</p><p>Hypothesis Testing Approach</p><p>First, to set up the hypothesis test, we consider:</p><ul><li><p>Null hypothesis</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!StSm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa62827cf-b841-455b-8c56-5b67efbb7289_185x59.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!StSm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa62827cf-b841-455b-8c56-5b67efbb7289_185x59.png 424w, https://substackcdn.com/image/fetch/$s_!StSm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa62827cf-b841-455b-8c56-5b67efbb7289_185x59.png 848w, https://substackcdn.com/image/fetch/$s_!StSm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa62827cf-b841-455b-8c56-5b67efbb7289_185x59.png 1272w, https://substackcdn.com/image/fetch/$s_!StSm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa62827cf-b841-455b-8c56-5b67efbb7289_185x59.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!StSm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa62827cf-b841-455b-8c56-5b67efbb7289_185x59.png" width="185" height="59" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a62827cf-b841-455b-8c56-5b67efbb7289_185x59.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:59,&quot;width&quot;:185,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:3150,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa62827cf-b841-455b-8c56-5b67efbb7289_185x59.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!StSm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa62827cf-b841-455b-8c56-5b67efbb7289_185x59.png 424w, https://substackcdn.com/image/fetch/$s_!StSm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa62827cf-b841-455b-8c56-5b67efbb7289_185x59.png 848w, https://substackcdn.com/image/fetch/$s_!StSm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa62827cf-b841-455b-8c56-5b67efbb7289_185x59.png 1272w, https://substackcdn.com/image/fetch/$s_!StSm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa62827cf-b841-455b-8c56-5b67efbb7289_185x59.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Alternative hypothesis</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!IVad!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd43b6ab7-c5db-4e4d-a290-1a4a15e58516_178x74.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!IVad!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd43b6ab7-c5db-4e4d-a290-1a4a15e58516_178x74.png 424w, https://substackcdn.com/image/fetch/$s_!IVad!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd43b6ab7-c5db-4e4d-a290-1a4a15e58516_178x74.png 848w, https://substackcdn.com/image/fetch/$s_!IVad!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd43b6ab7-c5db-4e4d-a290-1a4a15e58516_178x74.png 1272w, https://substackcdn.com/image/fetch/$s_!IVad!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd43b6ab7-c5db-4e4d-a290-1a4a15e58516_178x74.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!IVad!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd43b6ab7-c5db-4e4d-a290-1a4a15e58516_178x74.png" width="178" height="74" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d43b6ab7-c5db-4e4d-a290-1a4a15e58516_178x74.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:74,&quot;width&quot;:178,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:3058,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd43b6ab7-c5db-4e4d-a290-1a4a15e58516_178x74.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!IVad!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd43b6ab7-c5db-4e4d-a290-1a4a15e58516_178x74.png 424w, https://substackcdn.com/image/fetch/$s_!IVad!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd43b6ab7-c5db-4e4d-a290-1a4a15e58516_178x74.png 848w, https://substackcdn.com/image/fetch/$s_!IVad!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd43b6ab7-c5db-4e4d-a290-1a4a15e58516_178x74.png 1272w, https://substackcdn.com/image/fetch/$s_!IVad!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd43b6ab7-c5db-4e4d-a290-1a4a15e58516_178x74.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>(or more generally p &#8800; 0.5)</p></li></ul><p>We want to control the probability of a false alarm (Type I error) at</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!BL_s!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d13512-e439-4a4c-9496-7eebff99ec11_141x52.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BL_s!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d13512-e439-4a4c-9496-7eebff99ec11_141x52.png 424w, https://substackcdn.com/image/fetch/$s_!BL_s!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d13512-e439-4a4c-9496-7eebff99ec11_141x52.png 848w, https://substackcdn.com/image/fetch/$s_!BL_s!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d13512-e439-4a4c-9496-7eebff99ec11_141x52.png 1272w, https://substackcdn.com/image/fetch/$s_!BL_s!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d13512-e439-4a4c-9496-7eebff99ec11_141x52.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BL_s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d13512-e439-4a4c-9496-7eebff99ec11_141x52.png" width="141" height="52" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/13d13512-e439-4a4c-9496-7eebff99ec11_141x52.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:52,&quot;width&quot;:141,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2354,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d13512-e439-4a4c-9496-7eebff99ec11_141x52.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!BL_s!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d13512-e439-4a4c-9496-7eebff99ec11_141x52.png 424w, https://substackcdn.com/image/fetch/$s_!BL_s!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d13512-e439-4a4c-9496-7eebff99ec11_141x52.png 848w, https://substackcdn.com/image/fetch/$s_!BL_s!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d13512-e439-4a4c-9496-7eebff99ec11_141x52.png 1272w, https://substackcdn.com/image/fetch/$s_!BL_s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d13512-e439-4a4c-9496-7eebff99ec11_141x52.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>. We also want a reasonable probability (power)</p><p>1&#8722;&#946;</p><p>of detecting the difference p = 0.6 from p = 0.5 if it truly exists (often power is set at 0.80 or 0.90).</p><p>Using a Normal Approximation</p><p>A common way to approximate the number of required coin flips n is via the normal approximation to the binomial distribution. For a single-proportion z-test, we can use a formula that takes into account both the significance level</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!R2Sp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd66f3926-eac2-4e27-a03f-1e16ad651bf8_60x34.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!R2Sp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd66f3926-eac2-4e27-a03f-1e16ad651bf8_60x34.png 424w, https://substackcdn.com/image/fetch/$s_!R2Sp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd66f3926-eac2-4e27-a03f-1e16ad651bf8_60x34.png 848w, https://substackcdn.com/image/fetch/$s_!R2Sp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd66f3926-eac2-4e27-a03f-1e16ad651bf8_60x34.png 1272w, https://substackcdn.com/image/fetch/$s_!R2Sp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd66f3926-eac2-4e27-a03f-1e16ad651bf8_60x34.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!R2Sp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd66f3926-eac2-4e27-a03f-1e16ad651bf8_60x34.png" width="60" height="34" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d66f3926-eac2-4e27-a03f-1e16ad651bf8_60x34.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:34,&quot;width&quot;:60,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:746,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd66f3926-eac2-4e27-a03f-1e16ad651bf8_60x34.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!R2Sp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd66f3926-eac2-4e27-a03f-1e16ad651bf8_60x34.png 424w, https://substackcdn.com/image/fetch/$s_!R2Sp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd66f3926-eac2-4e27-a03f-1e16ad651bf8_60x34.png 848w, https://substackcdn.com/image/fetch/$s_!R2Sp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd66f3926-eac2-4e27-a03f-1e16ad651bf8_60x34.png 1272w, https://substackcdn.com/image/fetch/$s_!R2Sp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd66f3926-eac2-4e27-a03f-1e16ad651bf8_60x34.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>and the power</p><p>1&#8722;&#946;</p><p>. Denote:</p><ul><li><p>ParseError: KaTeX parse error: Can't use function '$' in math mode at position 17: &#8230;_{1 - \alpha/2}$&#818;$ as the critic&#8230;</p></li></ul><p>Under the null hypothesis, we assume p = 0.5 with variance 0.5 * 0.5 = 0.25. Under the alternative, p = 0.6 with variance 0.6 * 0.4 = 0.24. A commonly used form of the sample size formula for detecting a difference between two proportions p&#8320; and p&#8321; is adapted here for the special case of p&#8320; = 0.5 and p&#8321; = 0.6:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0JyM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc22e7225-92f3-42de-8f8a-eda1e46ca8cc_1054x191.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0JyM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc22e7225-92f3-42de-8f8a-eda1e46ca8cc_1054x191.png 424w, https://substackcdn.com/image/fetch/$s_!0JyM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc22e7225-92f3-42de-8f8a-eda1e46ca8cc_1054x191.png 848w, https://substackcdn.com/image/fetch/$s_!0JyM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc22e7225-92f3-42de-8f8a-eda1e46ca8cc_1054x191.png 1272w, https://substackcdn.com/image/fetch/$s_!0JyM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc22e7225-92f3-42de-8f8a-eda1e46ca8cc_1054x191.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0JyM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc22e7225-92f3-42de-8f8a-eda1e46ca8cc_1054x191.png" width="1054" height="191" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c22e7225-92f3-42de-8f8a-eda1e46ca8cc_1054x191.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:191,&quot;width&quot;:1054,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:23814,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc22e7225-92f3-42de-8f8a-eda1e46ca8cc_1054x191.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!0JyM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc22e7225-92f3-42de-8f8a-eda1e46ca8cc_1054x191.png 424w, https://substackcdn.com/image/fetch/$s_!0JyM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc22e7225-92f3-42de-8f8a-eda1e46ca8cc_1054x191.png 848w, https://substackcdn.com/image/fetch/$s_!0JyM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc22e7225-92f3-42de-8f8a-eda1e46ca8cc_1054x191.png 1272w, https://substackcdn.com/image/fetch/$s_!0JyM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc22e7225-92f3-42de-8f8a-eda1e46ca8cc_1054x191.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Substitute p&#8320; = 0.5, p&#8321; = 0.6,</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sZn7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff584f525-a578-4eb0-aeae-3ed3c86a4f6e_878x763.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sZn7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff584f525-a578-4eb0-aeae-3ed3c86a4f6e_878x763.png 424w, https://substackcdn.com/image/fetch/$s_!sZn7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff584f525-a578-4eb0-aeae-3ed3c86a4f6e_878x763.png 848w, https://substackcdn.com/image/fetch/$s_!sZn7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff584f525-a578-4eb0-aeae-3ed3c86a4f6e_878x763.png 1272w, https://substackcdn.com/image/fetch/$s_!sZn7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff584f525-a578-4eb0-aeae-3ed3c86a4f6e_878x763.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sZn7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff584f525-a578-4eb0-aeae-3ed3c86a4f6e_878x763.png" width="878" height="763" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f584f525-a578-4eb0-aeae-3ed3c86a4f6e_878x763.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:763,&quot;width&quot;:878,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:77263,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff584f525-a578-4eb0-aeae-3ed3c86a4f6e_878x763.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!sZn7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff584f525-a578-4eb0-aeae-3ed3c86a4f6e_878x763.png 424w, https://substackcdn.com/image/fetch/$s_!sZn7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff584f525-a578-4eb0-aeae-3ed3c86a4f6e_878x763.png 848w, https://substackcdn.com/image/fetch/$s_!sZn7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff584f525-a578-4eb0-aeae-3ed3c86a4f6e_878x763.png 1272w, https://substackcdn.com/image/fetch/$s_!sZn7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff584f525-a578-4eb0-aeae-3ed3c86a4f6e_878x763.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Hence</p><p>n&#8776;194</p><p>coin flips. This is under typical assumptions of a two-sided test at 5% significance and 80% power. If you wanted a one-sided test (for instance, you suspect p &gt; 0.5, not just p &#8800; 0.5), the value of</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aSdF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34b2bae6-f857-4b9f-a75a-6afaa3a0136c_118x74.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aSdF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34b2bae6-f857-4b9f-a75a-6afaa3a0136c_118x74.png 424w, https://substackcdn.com/image/fetch/$s_!aSdF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34b2bae6-f857-4b9f-a75a-6afaa3a0136c_118x74.png 848w, https://substackcdn.com/image/fetch/$s_!aSdF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34b2bae6-f857-4b9f-a75a-6afaa3a0136c_118x74.png 1272w, https://substackcdn.com/image/fetch/$s_!aSdF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34b2bae6-f857-4b9f-a75a-6afaa3a0136c_118x74.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aSdF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34b2bae6-f857-4b9f-a75a-6afaa3a0136c_118x74.png" width="118" height="74" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/34b2bae6-f857-4b9f-a75a-6afaa3a0136c_118x74.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:74,&quot;width&quot;:118,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2132,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34b2bae6-f857-4b9f-a75a-6afaa3a0136c_118x74.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!aSdF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34b2bae6-f857-4b9f-a75a-6afaa3a0136c_118x74.png 424w, https://substackcdn.com/image/fetch/$s_!aSdF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34b2bae6-f857-4b9f-a75a-6afaa3a0136c_118x74.png 848w, https://substackcdn.com/image/fetch/$s_!aSdF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34b2bae6-f857-4b9f-a75a-6afaa3a0136c_118x74.png 1272w, https://substackcdn.com/image/fetch/$s_!aSdF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34b2bae6-f857-4b9f-a75a-6afaa3a0136c_118x74.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>might be replaced by</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rHVl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2867e376-6356-4eb3-bdaf-f12271027492_114x71.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rHVl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2867e376-6356-4eb3-bdaf-f12271027492_114x71.png 424w, https://substackcdn.com/image/fetch/$s_!rHVl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2867e376-6356-4eb3-bdaf-f12271027492_114x71.png 848w, https://substackcdn.com/image/fetch/$s_!rHVl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2867e376-6356-4eb3-bdaf-f12271027492_114x71.png 1272w, https://substackcdn.com/image/fetch/$s_!rHVl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2867e376-6356-4eb3-bdaf-f12271027492_114x71.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rHVl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2867e376-6356-4eb3-bdaf-f12271027492_114x71.png" width="114" height="71" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2867e376-6356-4eb3-bdaf-f12271027492_114x71.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:71,&quot;width&quot;:114,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1542,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2867e376-6356-4eb3-bdaf-f12271027492_114x71.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rHVl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2867e376-6356-4eb3-bdaf-f12271027492_114x71.png 424w, https://substackcdn.com/image/fetch/$s_!rHVl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2867e376-6356-4eb3-bdaf-f12271027492_114x71.png 848w, https://substackcdn.com/image/fetch/$s_!rHVl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2867e376-6356-4eb3-bdaf-f12271027492_114x71.png 1272w, https://substackcdn.com/image/fetch/$s_!rHVl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2867e376-6356-4eb3-bdaf-f12271027492_114x71.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>, leading to a slightly smaller required n. If you demanded a higher power like 0.90 or a stricter significance like</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sxje!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1c12cd5-e6e3-4a04-809b-80aa52de7d07_187x68.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sxje!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1c12cd5-e6e3-4a04-809b-80aa52de7d07_187x68.png 424w, https://substackcdn.com/image/fetch/$s_!sxje!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1c12cd5-e6e3-4a04-809b-80aa52de7d07_187x68.png 848w, https://substackcdn.com/image/fetch/$s_!sxje!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1c12cd5-e6e3-4a04-809b-80aa52de7d07_187x68.png 1272w, https://substackcdn.com/image/fetch/$s_!sxje!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1c12cd5-e6e3-4a04-809b-80aa52de7d07_187x68.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sxje!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1c12cd5-e6e3-4a04-809b-80aa52de7d07_187x68.png" width="187" height="68" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e1c12cd5-e6e3-4a04-809b-80aa52de7d07_187x68.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:68,&quot;width&quot;:187,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2530,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1c12cd5-e6e3-4a04-809b-80aa52de7d07_187x68.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!sxje!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1c12cd5-e6e3-4a04-809b-80aa52de7d07_187x68.png 424w, https://substackcdn.com/image/fetch/$s_!sxje!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1c12cd5-e6e3-4a04-809b-80aa52de7d07_187x68.png 848w, https://substackcdn.com/image/fetch/$s_!sxje!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1c12cd5-e6e3-4a04-809b-80aa52de7d07_187x68.png 1272w, https://substackcdn.com/image/fetch/$s_!sxje!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1c12cd5-e6e3-4a04-809b-80aa52de7d07_187x68.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>, the required n would increase.</p><p>Simpler Approximation for Rough Estimation</p><p>Another simpler approach is to treat 0.5 as the center of a normal distribution with standard error</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!88CL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F758cd265-1cd9-45a8-a3ee-b29bcb0f0641_221x130.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!88CL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F758cd265-1cd9-45a8-a3ee-b29bcb0f0641_221x130.png 424w, https://substackcdn.com/image/fetch/$s_!88CL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F758cd265-1cd9-45a8-a3ee-b29bcb0f0641_221x130.png 848w, https://substackcdn.com/image/fetch/$s_!88CL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F758cd265-1cd9-45a8-a3ee-b29bcb0f0641_221x130.png 1272w, https://substackcdn.com/image/fetch/$s_!88CL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F758cd265-1cd9-45a8-a3ee-b29bcb0f0641_221x130.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!88CL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F758cd265-1cd9-45a8-a3ee-b29bcb0f0641_221x130.png" width="221" height="130" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/758cd265-1cd9-45a8-a3ee-b29bcb0f0641_221x130.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:130,&quot;width&quot;:221,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:5005,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F758cd265-1cd9-45a8-a3ee-b29bcb0f0641_221x130.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!88CL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F758cd265-1cd9-45a8-a3ee-b29bcb0f0641_221x130.png 424w, https://substackcdn.com/image/fetch/$s_!88CL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F758cd265-1cd9-45a8-a3ee-b29bcb0f0641_221x130.png 848w, https://substackcdn.com/image/fetch/$s_!88CL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F758cd265-1cd9-45a8-a3ee-b29bcb0f0641_221x130.png 1272w, https://substackcdn.com/image/fetch/$s_!88CL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F758cd265-1cd9-45a8-a3ee-b29bcb0f0641_221x130.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>. Under p = 0.5, that standard error becomes</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!kO9I!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45d3c7ec-360b-4bc0-96db-9478f6d0d88d_220x108.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kO9I!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45d3c7ec-360b-4bc0-96db-9478f6d0d88d_220x108.png 424w, https://substackcdn.com/image/fetch/$s_!kO9I!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45d3c7ec-360b-4bc0-96db-9478f6d0d88d_220x108.png 848w, https://substackcdn.com/image/fetch/$s_!kO9I!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45d3c7ec-360b-4bc0-96db-9478f6d0d88d_220x108.png 1272w, https://substackcdn.com/image/fetch/$s_!kO9I!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45d3c7ec-360b-4bc0-96db-9478f6d0d88d_220x108.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kO9I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45d3c7ec-360b-4bc0-96db-9478f6d0d88d_220x108.png" width="220" height="108" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/45d3c7ec-360b-4bc0-96db-9478f6d0d88d_220x108.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:108,&quot;width&quot;:220,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:4675,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45d3c7ec-360b-4bc0-96db-9478f6d0d88d_220x108.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!kO9I!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45d3c7ec-360b-4bc0-96db-9478f6d0d88d_220x108.png 424w, https://substackcdn.com/image/fetch/$s_!kO9I!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45d3c7ec-360b-4bc0-96db-9478f6d0d88d_220x108.png 848w, https://substackcdn.com/image/fetch/$s_!kO9I!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45d3c7ec-360b-4bc0-96db-9478f6d0d88d_220x108.png 1272w, https://substackcdn.com/image/fetch/$s_!kO9I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45d3c7ec-360b-4bc0-96db-9478f6d0d88d_220x108.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>. If we want to detect a shift of 0.1 (from 0.5 to 0.6) at roughly 2 standard errors (for a quick approximate 95% confidence region), we would solve:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ZeKH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8852fd40-bff5-4577-811c-8fb5f295fcf3_460x255.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZeKH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8852fd40-bff5-4577-811c-8fb5f295fcf3_460x255.png 424w, https://substackcdn.com/image/fetch/$s_!ZeKH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8852fd40-bff5-4577-811c-8fb5f295fcf3_460x255.png 848w, https://substackcdn.com/image/fetch/$s_!ZeKH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8852fd40-bff5-4577-811c-8fb5f295fcf3_460x255.png 1272w, https://substackcdn.com/image/fetch/$s_!ZeKH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8852fd40-bff5-4577-811c-8fb5f295fcf3_460x255.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZeKH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8852fd40-bff5-4577-811c-8fb5f295fcf3_460x255.png" width="460" height="255" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8852fd40-bff5-4577-811c-8fb5f295fcf3_460x255.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:255,&quot;width&quot;:460,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:13518,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8852fd40-bff5-4577-811c-8fb5f295fcf3_460x255.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ZeKH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8852fd40-bff5-4577-811c-8fb5f295fcf3_460x255.png 424w, https://substackcdn.com/image/fetch/$s_!ZeKH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8852fd40-bff5-4577-811c-8fb5f295fcf3_460x255.png 848w, https://substackcdn.com/image/fetch/$s_!ZeKH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8852fd40-bff5-4577-811c-8fb5f295fcf3_460x255.png 1272w, https://substackcdn.com/image/fetch/$s_!ZeKH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8852fd40-bff5-4577-811c-8fb5f295fcf3_460x255.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Which simplifies to:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ln12!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9f5170a-a4d9-4958-a469-bf6fa541d083_374x227.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ln12!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9f5170a-a4d9-4958-a469-bf6fa541d083_374x227.png 424w, https://substackcdn.com/image/fetch/$s_!Ln12!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9f5170a-a4d9-4958-a469-bf6fa541d083_374x227.png 848w, https://substackcdn.com/image/fetch/$s_!Ln12!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9f5170a-a4d9-4958-a469-bf6fa541d083_374x227.png 1272w, https://substackcdn.com/image/fetch/$s_!Ln12!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9f5170a-a4d9-4958-a469-bf6fa541d083_374x227.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ln12!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9f5170a-a4d9-4958-a469-bf6fa541d083_374x227.png" width="374" height="227" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f9f5170a-a4d9-4958-a469-bf6fa541d083_374x227.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:227,&quot;width&quot;:374,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:11677,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9f5170a-a4d9-4958-a469-bf6fa541d083_374x227.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Ln12!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9f5170a-a4d9-4958-a469-bf6fa541d083_374x227.png 424w, https://substackcdn.com/image/fetch/$s_!Ln12!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9f5170a-a4d9-4958-a469-bf6fa541d083_374x227.png 848w, https://substackcdn.com/image/fetch/$s_!Ln12!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9f5170a-a4d9-4958-a469-bf6fa541d083_374x227.png 1272w, https://substackcdn.com/image/fetch/$s_!Ln12!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9f5170a-a4d9-4958-a469-bf6fa541d083_374x227.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Hence</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sZW_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67b1c489-2fa4-4387-85dd-5fcde578d61b_841x245.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sZW_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67b1c489-2fa4-4387-85dd-5fcde578d61b_841x245.png 424w, https://substackcdn.com/image/fetch/$s_!sZW_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67b1c489-2fa4-4387-85dd-5fcde578d61b_841x245.png 848w, https://substackcdn.com/image/fetch/$s_!sZW_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67b1c489-2fa4-4387-85dd-5fcde578d61b_841x245.png 1272w, https://substackcdn.com/image/fetch/$s_!sZW_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67b1c489-2fa4-4387-85dd-5fcde578d61b_841x245.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sZW_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67b1c489-2fa4-4387-85dd-5fcde578d61b_841x245.png" width="841" height="245" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/67b1c489-2fa4-4387-85dd-5fcde578d61b_841x245.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:245,&quot;width&quot;:841,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:17877,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67b1c489-2fa4-4387-85dd-5fcde578d61b_841x245.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!sZW_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67b1c489-2fa4-4387-85dd-5fcde578d61b_841x245.png 424w, https://substackcdn.com/image/fetch/$s_!sZW_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67b1c489-2fa4-4387-85dd-5fcde578d61b_841x245.png 848w, https://substackcdn.com/image/fetch/$s_!sZW_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67b1c489-2fa4-4387-85dd-5fcde578d61b_841x245.png 1272w, https://substackcdn.com/image/fetch/$s_!sZW_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67b1c489-2fa4-4387-85dd-5fcde578d61b_841x245.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>So</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0nIy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb7aefbc-c518-418a-90cb-9e1539af5f48_295x127.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0nIy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb7aefbc-c518-418a-90cb-9e1539af5f48_295x127.png 424w, https://substackcdn.com/image/fetch/$s_!0nIy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb7aefbc-c518-418a-90cb-9e1539af5f48_295x127.png 848w, https://substackcdn.com/image/fetch/$s_!0nIy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb7aefbc-c518-418a-90cb-9e1539af5f48_295x127.png 1272w, https://substackcdn.com/image/fetch/$s_!0nIy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb7aefbc-c518-418a-90cb-9e1539af5f48_295x127.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0nIy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb7aefbc-c518-418a-90cb-9e1539af5f48_295x127.png" width="295" height="127" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fb7aefbc-c518-418a-90cb-9e1539af5f48_295x127.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:127,&quot;width&quot;:295,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:6229,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb7aefbc-c518-418a-90cb-9e1539af5f48_295x127.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!0nIy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb7aefbc-c518-418a-90cb-9e1539af5f48_295x127.png 424w, https://substackcdn.com/image/fetch/$s_!0nIy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb7aefbc-c518-418a-90cb-9e1539af5f48_295x127.png 848w, https://substackcdn.com/image/fetch/$s_!0nIy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb7aefbc-c518-418a-90cb-9e1539af5f48_295x127.png 1272w, https://substackcdn.com/image/fetch/$s_!0nIy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb7aefbc-c518-418a-90cb-9e1539af5f48_295x127.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>This is a rough estimate ignoring power in a formal sense, but it gives the general scale that around 100 coin flips might often be enough to demonstrate unfairness. A more precise calculation, as shown earlier, usually yields a slightly higher value when we strictly enforce both a 5% false alarm rate and 80% power.</p><p>Practical Simulation Approach</p><p>A data-driven practitioner might prefer running a simulation to see how many coin flips it takes, on average, to reject the fair coin hypothesis when the coin is actually p = 0.6. Below is an illustrative Python snippet that simulates repeated experiments, each with a certain number of flips, to see how often we correctly conclude the coin is not fair:</p><pre><code><code>import numpy as np
from statsmodels.stats.proportion import proportions_ztest

def simulation_unfair_coin_detection(num_flips, prob_heads=0.6, alpha=0.05, trials=100000):
    rejections = 0
    for _ in range(trials):
        flips = np.random.rand(num_flips) &lt; prob_heads
        heads_count = flips.sum()
        # We do a 2-sided test: H0: p=0.5, H1: p != 0.5
        # proportions_ztest expects count of "successes" and sample size
        stat, pval = proportions_ztest(heads_count, num_flips, value=0.5, alternative='two-sided')
        if pval &lt; alpha:
            rejections += 1
    return rejections / trials

# Example usage: check detection rate for different n
for n in [50, 100, 150, 200]:
    power_est = simulation_unfair_coin_detection(n)
    print(f"{n} flips -&gt; Estimated power = {power_est:.3f}")
</code></code></pre><p>In this simulation:</p><ul><li><p>We generate Bernoulli trials with success probability p = 0.6.</p></li><li><p>We do a two-sided test at</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4MxR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8c3b083-f597-4fdc-8c9f-e6fce4745d1d_127x55.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4MxR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8c3b083-f597-4fdc-8c9f-e6fce4745d1d_127x55.png 424w, https://substackcdn.com/image/fetch/$s_!4MxR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8c3b083-f597-4fdc-8c9f-e6fce4745d1d_127x55.png 848w, https://substackcdn.com/image/fetch/$s_!4MxR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8c3b083-f597-4fdc-8c9f-e6fce4745d1d_127x55.png 1272w, https://substackcdn.com/image/fetch/$s_!4MxR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8c3b083-f597-4fdc-8c9f-e6fce4745d1d_127x55.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4MxR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8c3b083-f597-4fdc-8c9f-e6fce4745d1d_127x55.png" width="127" height="55" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b8c3b083-f597-4fdc-8c9f-e6fce4745d1d_127x55.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:55,&quot;width&quot;:127,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2391,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8c3b083-f597-4fdc-8c9f-e6fce4745d1d_127x55.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!4MxR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8c3b083-f597-4fdc-8c9f-e6fce4745d1d_127x55.png 424w, https://substackcdn.com/image/fetch/$s_!4MxR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8c3b083-f597-4fdc-8c9f-e6fce4745d1d_127x55.png 848w, https://substackcdn.com/image/fetch/$s_!4MxR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8c3b083-f597-4fdc-8c9f-e6fce4745d1d_127x55.png 1272w, https://substackcdn.com/image/fetch/$s_!4MxR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8c3b083-f597-4fdc-8c9f-e6fce4745d1d_127x55.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>for the hypothesis p = 0.5.</p></li><li><p>We see how frequently we reject the null hypothesis. This frequency is our estimate of the power (probability of detection).</p></li><li><p>As we increase the number of flips n, we expect the power to approach 1, meaning it becomes very likely we detect the coin is biased.</p></li></ul><p>You would typically see that around n = 100 or n = 150, the power becomes meaningfully high to detect the difference between 0.6 and 0.5.</p><p>Confidence Intervals as Another View</p><p>Instead of a hypothesis test, you can look at the 95% confidence interval for the estimated probability of heads. If the coin is truly 0.6, your observed sample proportion after n flips is likely (though not guaranteed) to be near 0.6. Once that observed estimate is sufficiently different from 0.5 in a statistically significant way, you can say that 0.5 no longer lies within your confidence interval. In practice, the length of the confidence interval shrinks roughly with</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6mfM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2de80be8-7253-4d85-ad37-d4ae7502e655_105x63.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6mfM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2de80be8-7253-4d85-ad37-d4ae7502e655_105x63.png 424w, https://substackcdn.com/image/fetch/$s_!6mfM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2de80be8-7253-4d85-ad37-d4ae7502e655_105x63.png 848w, https://substackcdn.com/image/fetch/$s_!6mfM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2de80be8-7253-4d85-ad37-d4ae7502e655_105x63.png 1272w, https://substackcdn.com/image/fetch/$s_!6mfM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2de80be8-7253-4d85-ad37-d4ae7502e655_105x63.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6mfM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2de80be8-7253-4d85-ad37-d4ae7502e655_105x63.png" width="105" height="63" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2de80be8-7253-4d85-ad37-d4ae7502e655_105x63.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:63,&quot;width&quot;:105,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1902,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2de80be8-7253-4d85-ad37-d4ae7502e655_105x63.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!6mfM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2de80be8-7253-4d85-ad37-d4ae7502e655_105x63.png 424w, https://substackcdn.com/image/fetch/$s_!6mfM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2de80be8-7253-4d85-ad37-d4ae7502e655_105x63.png 848w, https://substackcdn.com/image/fetch/$s_!6mfM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2de80be8-7253-4d85-ad37-d4ae7502e655_105x63.png 1272w, https://substackcdn.com/image/fetch/$s_!6mfM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2de80be8-7253-4d85-ad37-d4ae7502e655_105x63.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>, so the more flips, the more precisely you can pinpoint the coin&#8217;s bias.</p><p>Real-World Considerations</p><p>There are subtle issues:</p><ul><li><p>If we use a two-sided test, we might &#8220;waste&#8221; some significance on the possibility that the coin is p &lt; 0.5, even if we strongly suspect p &gt; 0.5. If we use a one-sided test p &gt; 0.5, we can reduce the sample size a bit. But if the real coin were biased to p &lt; 0.5, a one-sided test might fail to detect that.</p></li><li><p>If we require extremely high confidence (e.g.,</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2Ogx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36ee3944-0bfa-49ca-84f2-80569e0fed39_188x54.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2Ogx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36ee3944-0bfa-49ca-84f2-80569e0fed39_188x54.png 424w, https://substackcdn.com/image/fetch/$s_!2Ogx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36ee3944-0bfa-49ca-84f2-80569e0fed39_188x54.png 848w, https://substackcdn.com/image/fetch/$s_!2Ogx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36ee3944-0bfa-49ca-84f2-80569e0fed39_188x54.png 1272w, https://substackcdn.com/image/fetch/$s_!2Ogx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36ee3944-0bfa-49ca-84f2-80569e0fed39_188x54.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2Ogx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36ee3944-0bfa-49ca-84f2-80569e0fed39_188x54.png" width="188" height="54" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/36ee3944-0bfa-49ca-84f2-80569e0fed39_188x54.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:54,&quot;width&quot;:188,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2478,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36ee3944-0bfa-49ca-84f2-80569e0fed39_188x54.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2Ogx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36ee3944-0bfa-49ca-84f2-80569e0fed39_188x54.png 424w, https://substackcdn.com/image/fetch/$s_!2Ogx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36ee3944-0bfa-49ca-84f2-80569e0fed39_188x54.png 848w, https://substackcdn.com/image/fetch/$s_!2Ogx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36ee3944-0bfa-49ca-84f2-80569e0fed39_188x54.png 1272w, https://substackcdn.com/image/fetch/$s_!2Ogx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36ee3944-0bfa-49ca-84f2-80569e0fed39_188x54.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>) or extremely high power (e.g., 99%), the number of required flips can become quite large, often in the hundreds or more.</p></li><li><p>If the coin&#8217;s bias were less pronounced (say 0.52 vs. 0.5), many more flips would be required.</p></li><li><p>If the coin is subject to mechanical or environmental changes during flipping (e.g., changes in flick strength or environment), the assumption of identical and independent flips might be violated.</p></li></ul><p>Summary of the Core Idea</p><p>In general, to detect a moderate bias of 0.6 with a standard 5% significance and 80% power, you often need on the order of 100&#8211;200 coin flips. A more precise calculation via the normal approximation to the binomial distribution typically yields around 190&#8211;200 flips for a strict two-sided test with the above parameters, but a simpler approximate rule suggests that around 100 flips is often enough to at least start to see evidence of bias.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.rohan-paul.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">I write everyday for my readers on actionable AI. Subscribe and instantly get a 1300+ page Python book.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2><strong>What if the interviewer asks: &#8220;Why is there no single universal answer without specifying the significance level and power?&#8221;</strong></h2><p>A direct reason is that statistical hypothesis testing always involves controlling two types of errors: Type I (false positives) and Type II (false negatives). Significance level</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Xet9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a60c854-321e-4e68-b91b-92c70e3fd21a_68x54.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Xet9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a60c854-321e-4e68-b91b-92c70e3fd21a_68x54.png 424w, https://substackcdn.com/image/fetch/$s_!Xet9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a60c854-321e-4e68-b91b-92c70e3fd21a_68x54.png 848w, https://substackcdn.com/image/fetch/$s_!Xet9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a60c854-321e-4e68-b91b-92c70e3fd21a_68x54.png 1272w, https://substackcdn.com/image/fetch/$s_!Xet9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a60c854-321e-4e68-b91b-92c70e3fd21a_68x54.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Xet9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a60c854-321e-4e68-b91b-92c70e3fd21a_68x54.png" width="68" height="54" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5a60c854-321e-4e68-b91b-92c70e3fd21a_68x54.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:54,&quot;width&quot;:68,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:816,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a60c854-321e-4e68-b91b-92c70e3fd21a_68x54.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Xet9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a60c854-321e-4e68-b91b-92c70e3fd21a_68x54.png 424w, https://substackcdn.com/image/fetch/$s_!Xet9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a60c854-321e-4e68-b91b-92c70e3fd21a_68x54.png 848w, https://substackcdn.com/image/fetch/$s_!Xet9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a60c854-321e-4e68-b91b-92c70e3fd21a_68x54.png 1272w, https://substackcdn.com/image/fetch/$s_!Xet9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a60c854-321e-4e68-b91b-92c70e3fd21a_68x54.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>controls the maximum allowed probability of a false positive (concluding the coin is unfair when it is actually fair). Power</p><p>1&#8722;&#946;</p><p>controls how likely we are to detect the unfairness if it truly exists. Depending on how strictly or loosely one sets</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NUTD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa127dda-71fd-41e8-866c-0593bcd6951f_62x43.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NUTD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa127dda-71fd-41e8-866c-0593bcd6951f_62x43.png 424w, https://substackcdn.com/image/fetch/$s_!NUTD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa127dda-71fd-41e8-866c-0593bcd6951f_62x43.png 848w, https://substackcdn.com/image/fetch/$s_!NUTD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa127dda-71fd-41e8-866c-0593bcd6951f_62x43.png 1272w, https://substackcdn.com/image/fetch/$s_!NUTD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa127dda-71fd-41e8-866c-0593bcd6951f_62x43.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NUTD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa127dda-71fd-41e8-866c-0593bcd6951f_62x43.png" width="62" height="43" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fa127dda-71fd-41e8-866c-0593bcd6951f_62x43.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:43,&quot;width&quot;:62,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:752,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa127dda-71fd-41e8-866c-0593bcd6951f_62x43.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!NUTD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa127dda-71fd-41e8-866c-0593bcd6951f_62x43.png 424w, https://substackcdn.com/image/fetch/$s_!NUTD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa127dda-71fd-41e8-866c-0593bcd6951f_62x43.png 848w, https://substackcdn.com/image/fetch/$s_!NUTD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa127dda-71fd-41e8-866c-0593bcd6951f_62x43.png 1272w, https://substackcdn.com/image/fetch/$s_!NUTD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa127dda-71fd-41e8-866c-0593bcd6951f_62x43.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>and</p><p>&#946;</p><p>, the required sample size changes. Without clarifying these criteria, any number we quote is missing an essential part of the problem&#8217;s specification.</p><p>The significance level and power reflect real-world trade-offs. In a real experiment, you might accept a higher chance of a false positive if you need fewer coin flips. Or you might be more cautious and set</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!b2Nb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb8ba3ad-016d-4ac5-98e2-61d5b644a9e7_43x48.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!b2Nb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb8ba3ad-016d-4ac5-98e2-61d5b644a9e7_43x48.png 424w, https://substackcdn.com/image/fetch/$s_!b2Nb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb8ba3ad-016d-4ac5-98e2-61d5b644a9e7_43x48.png 848w, https://substackcdn.com/image/fetch/$s_!b2Nb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb8ba3ad-016d-4ac5-98e2-61d5b644a9e7_43x48.png 1272w, https://substackcdn.com/image/fetch/$s_!b2Nb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb8ba3ad-016d-4ac5-98e2-61d5b644a9e7_43x48.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!b2Nb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb8ba3ad-016d-4ac5-98e2-61d5b644a9e7_43x48.png" width="43" height="48" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bb8ba3ad-016d-4ac5-98e2-61d5b644a9e7_43x48.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:48,&quot;width&quot;:43,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:759,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb8ba3ad-016d-4ac5-98e2-61d5b644a9e7_43x48.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!b2Nb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb8ba3ad-016d-4ac5-98e2-61d5b644a9e7_43x48.png 424w, https://substackcdn.com/image/fetch/$s_!b2Nb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb8ba3ad-016d-4ac5-98e2-61d5b644a9e7_43x48.png 848w, https://substackcdn.com/image/fetch/$s_!b2Nb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb8ba3ad-016d-4ac5-98e2-61d5b644a9e7_43x48.png 1272w, https://substackcdn.com/image/fetch/$s_!b2Nb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb8ba3ad-016d-4ac5-98e2-61d5b644a9e7_43x48.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>to be extremely small. The question&#8217;s answer heavily depends on these parameters. That is why standard practice is to fix them (commonly</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0CxM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc751d149-f56c-467e-9775-8275793feb01_139x43.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0CxM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc751d149-f56c-467e-9775-8275793feb01_139x43.png 424w, https://substackcdn.com/image/fetch/$s_!0CxM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc751d149-f56c-467e-9775-8275793feb01_139x43.png 848w, https://substackcdn.com/image/fetch/$s_!0CxM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc751d149-f56c-467e-9775-8275793feb01_139x43.png 1272w, https://substackcdn.com/image/fetch/$s_!0CxM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc751d149-f56c-467e-9775-8275793feb01_139x43.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0CxM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc751d149-f56c-467e-9775-8275793feb01_139x43.png" width="139" height="43" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c751d149-f56c-467e-9775-8275793feb01_139x43.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:43,&quot;width&quot;:139,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2331,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc751d149-f56c-467e-9775-8275793feb01_139x43.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!0CxM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc751d149-f56c-467e-9775-8275793feb01_139x43.png 424w, https://substackcdn.com/image/fetch/$s_!0CxM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc751d149-f56c-467e-9775-8275793feb01_139x43.png 848w, https://substackcdn.com/image/fetch/$s_!0CxM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc751d149-f56c-467e-9775-8275793feb01_139x43.png 1272w, https://substackcdn.com/image/fetch/$s_!0CxM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc751d149-f56c-467e-9775-8275793feb01_139x43.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>and power = 80%) to get a recommended range of n.</p><h2><strong>What if the interviewer then asks: &#8220;Why use a normal approximation rather than the exact binomial test?&#8221;</strong></h2><p>Using the exact binomial test is more accurate for small samples because it does not rely on the asymptotic normal distribution assumption. However, for large n, the binomial distribution can be approximated quite well by a normal distribution under the Central Limit Theorem. The normal approximation offers closed-form formulas for quick estimates, making it easy to solve for n explicitly. If n is small, you can do an exact computation or rely on tables or iterative methods. In practice, for sample sizes above roughly 30&#8211;40 flips, the normal approximation is often quite reasonable for a quick calculation, though modern statistical packages can handle the exact binomial test easily.</p><h2><strong>What if the interviewer challenges: &#8220;What if your real estimate after n flips is not exactly 0.6 but something slightly below or above?&#8221;</strong></h2><p>Random sampling error means we typically won&#8217;t get exactly the true p in our sample proportion. Even if the coin is truly p = 0.6, the empirical proportion in a finite sample might be 0.57, 0.63, 0.64, 0.54, and so on. What truly matters is whether our observed result is sufficiently far from 0.5 to reject the hypothesis that p = 0.5. The larger n is, the smaller the standard error of the sample proportion, and the easier it is to conclude that 0.6 is not 0.5.</p><p>If in a given sample of n flips we get an empirical proportion</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2UEF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7244ac65-e901-4e9f-9d69-736fe3b716de_44x61.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2UEF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7244ac65-e901-4e9f-9d69-736fe3b716de_44x61.png 424w, https://substackcdn.com/image/fetch/$s_!2UEF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7244ac65-e901-4e9f-9d69-736fe3b716de_44x61.png 848w, https://substackcdn.com/image/fetch/$s_!2UEF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7244ac65-e901-4e9f-9d69-736fe3b716de_44x61.png 1272w, https://substackcdn.com/image/fetch/$s_!2UEF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7244ac65-e901-4e9f-9d69-736fe3b716de_44x61.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2UEF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7244ac65-e901-4e9f-9d69-736fe3b716de_44x61.png" width="44" height="61" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7244ac65-e901-4e9f-9d69-736fe3b716de_44x61.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:61,&quot;width&quot;:44,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:988,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7244ac65-e901-4e9f-9d69-736fe3b716de_44x61.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2UEF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7244ac65-e901-4e9f-9d69-736fe3b716de_44x61.png 424w, https://substackcdn.com/image/fetch/$s_!2UEF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7244ac65-e901-4e9f-9d69-736fe3b716de_44x61.png 848w, https://substackcdn.com/image/fetch/$s_!2UEF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7244ac65-e901-4e9f-9d69-736fe3b716de_44x61.png 1272w, https://substackcdn.com/image/fetch/$s_!2UEF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7244ac65-e901-4e9f-9d69-736fe3b716de_44x61.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>that&#8217;s close to 0.5, we might fail to reject the null hypothesis for that particular experiment. However, as n grows and we keep seeing about 60% heads overall, the test statistic will drift away from 0.5 in a more consistently significant way.</p><h2><strong>Potential Pitfalls and Real-World Nuances</strong></h2><p>One subtlety is that the coin flips must be i.i.d. (independent and identically distributed). If flipping mechanisms or flipping strength change over time, or if the coin gets physically altered, the distribution might shift. Another subtlety is p-hacking or repeated significance testing. If someone flips the coin 10 times, sees 6 heads, claims significance, flips more times, etc., the procedure becomes complicated because repeated inferences inflate the false positive rate.</p><p>In a real setting, you must define in advance how many coin flips you plan to do and what test you will apply. This pre-specification is the standard approach in well-designed experiments to ensure valid p-values.</p><h2><strong>Conclusion of the Discussion</strong></h2><p>By setting typical standards for significance (</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!26ak!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8068078c-1d62-4f2e-8751-77574dbf9693_152x56.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!26ak!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8068078c-1d62-4f2e-8751-77574dbf9693_152x56.png 424w, https://substackcdn.com/image/fetch/$s_!26ak!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8068078c-1d62-4f2e-8751-77574dbf9693_152x56.png 848w, https://substackcdn.com/image/fetch/$s_!26ak!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8068078c-1d62-4f2e-8751-77574dbf9693_152x56.png 1272w, https://substackcdn.com/image/fetch/$s_!26ak!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8068078c-1d62-4f2e-8751-77574dbf9693_152x56.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!26ak!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8068078c-1d62-4f2e-8751-77574dbf9693_152x56.png" width="152" height="56" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8068078c-1d62-4f2e-8751-77574dbf9693_152x56.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:56,&quot;width&quot;:152,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2398,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8068078c-1d62-4f2e-8751-77574dbf9693_152x56.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!26ak!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8068078c-1d62-4f2e-8751-77574dbf9693_152x56.png 424w, https://substackcdn.com/image/fetch/$s_!26ak!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8068078c-1d62-4f2e-8751-77574dbf9693_152x56.png 848w, https://substackcdn.com/image/fetch/$s_!26ak!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8068078c-1d62-4f2e-8751-77574dbf9693_152x56.png 1272w, https://substackcdn.com/image/fetch/$s_!26ak!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8068078c-1d62-4f2e-8751-77574dbf9693_152x56.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>) and power (</p><p>1&#8722;<em>&#946;</em>=0.8</p><p>), we arrive at roughly 100&#8211;200 coin flips required to detect the difference between p = 0.5 and p = 0.6 with a reasonably high chance of success. A more exact normal-approximation-based formula yields close to 194 flips for a two-sided test at 5% significance with 80% power. However, around 100 flips is often a good rough estimate to begin seeing a statistically significant bias if the true probability is 0.6. Once you specify all your testing parameters (exact or approximate test, one-sided or two-sided, your</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AnCJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90249f0b-bb49-4714-bf5f-9277ae72e10d_39x50.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AnCJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90249f0b-bb49-4714-bf5f-9277ae72e10d_39x50.png 424w, https://substackcdn.com/image/fetch/$s_!AnCJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90249f0b-bb49-4714-bf5f-9277ae72e10d_39x50.png 848w, https://substackcdn.com/image/fetch/$s_!AnCJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90249f0b-bb49-4714-bf5f-9277ae72e10d_39x50.png 1272w, https://substackcdn.com/image/fetch/$s_!AnCJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90249f0b-bb49-4714-bf5f-9277ae72e10d_39x50.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AnCJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90249f0b-bb49-4714-bf5f-9277ae72e10d_39x50.png" width="39" height="50" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/90249f0b-bb49-4714-bf5f-9277ae72e10d_39x50.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:50,&quot;width&quot;:39,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:745,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90249f0b-bb49-4714-bf5f-9277ae72e10d_39x50.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!AnCJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90249f0b-bb49-4714-bf5f-9277ae72e10d_39x50.png 424w, https://substackcdn.com/image/fetch/$s_!AnCJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90249f0b-bb49-4714-bf5f-9277ae72e10d_39x50.png 848w, https://substackcdn.com/image/fetch/$s_!AnCJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90249f0b-bb49-4714-bf5f-9277ae72e10d_39x50.png 1272w, https://substackcdn.com/image/fetch/$s_!AnCJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90249f0b-bb49-4714-bf5f-9277ae72e10d_39x50.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>and</p><p><em>&#946;</em></p><p>), the sample size question can be answered precisely.</p><h2><strong>Below are additional follow-up questions</strong></h2><h2><strong>How would we approach this if we do not know in advance that the coin has a bias of 0.6, but we suspect it might be greater than 0.5?</strong></h2><p>One might suspect that the coin is biased above 0.5 but not know exactly how large the bias is. Instead of specifying a single alternative hypothesis like p = 0.6, you might set up the problem as a one-sided test where the alternative is p &gt; 0.5. In this case, you usually need to define a minimum detectable effect size that you care about. For instance, you could say that you want to detect p &#8805; 0.55 versus the null hypothesis p = 0.5. The required number of flips then depends on how large a difference from 0.5 you want to reliably detect, as well as how stringent your significance and power requirements are.</p><p>A practical pitfall arises if the coin&#8217;s true probability is only slightly above 0.5, such as p = 0.51. Detecting such a small deviation from fairness requires a much larger sample size than detecting p = 0.6. The normal-approximation formulas still apply, but the difference p&#8321; &#8211; p&#8320; in the denominator becomes smaller, so the required sample size grows rapidly. Another subtlety is that if you do not have a good guess about the magnitude of bias, you might end up overestimating or underestimating the required sample size. A typical approach is to choose a minimal clinically (or practically) relevant effect size, then compute the number of flips needed to detect that difference with reasonable power.</p><p>From an implementation standpoint, you might do an initial small pilot experiment to estimate the coin&#8217;s probability of heads. Then you use that pilot estimate to decide how many additional flips to conduct to achieve a final conclusion. This approach can lead to complexities around repeated testing, multiple comparisons, and the need to adjust your significance level to maintain control of the Type I error rate.</p><h2><strong>What about using Bayesian methods instead of frequentist hypothesis testing?</strong></h2><p>A Bayesian approach would treat the coin&#8217;s probability of heads p as a random variable with a prior distribution, often Beta(&#945;, &#946;). You then perform flips, each time updating your posterior distribution for p using the Beta-Binomial conjugacy. Eventually, the posterior mass might shift far enough away from 0.5 that you consider it &#8220;practically impossible&#8221; for p to be 0.5.</p><p>In a Bayesian setting, you do not use p-values or significance levels in the same sense. Instead, you might define a threshold for your posterior probability, such as &#8220;the posterior probability that p &gt; 0.5 is at least 0.95.&#8221; You then keep flipping until that criterion is met, or until you conclude there is insufficient evidence for a bias. Another Bayesian strategy is to look at high-density posterior intervals for p. If the interval no longer contains 0.5, you can conclude the coin is likely not fair. Or conversely, if 0.5 remains fully inside that interval, you do not have enough evidence yet.</p><p>A hidden pitfall is that you must specify a prior, which might bias your inference if chosen poorly. A very skeptical prior that strongly favors p = 0.5 requires more data to shift the posterior away from 0.5. An uninformative prior, such as Beta(1,1), might lead you to adapt your estimate more quickly toward the data. Real-world Bayesian analyses must justify the prior choice based on subject-matter knowledge or a desire to remain as uninformative as possible.</p><h2><strong>Could we apply a sequential testing approach to reduce the expected number of flips?</strong></h2><p>Yes. Instead of deciding in advance to flip the coin exactly n times, you can use a sequential test such as a Sequential Probability Ratio Test (SPRT) or a more modern group sequential design. These methods allow you to flip the coin in stages. After each stage, you check whether you have enough evidence to reject the null hypothesis (coin is fair) or to accept it (no evidence of bias). If neither stopping criterion is met, you continue flipping.</p><p>The advantage is you might detect an extreme bias quickly. If the coin is strongly biased, an early series of flips might overwhelmingly suggest it is not fair, so you can stop. The risk is that repeated checking inflates the chance of a Type I error unless you carefully control the boundaries for stopping. This requires a more advanced approach to define the stopping rules in a way that preserves an overall Type I error rate.</p><p>A subtle edge case is when the coin is only slightly biased, so the test might take many stages to reach a conclusion. Also, in practice, if you decide to stop early, there might be real-world implications, such as lost opportunity to gather more information. On the other hand, if you keep flipping indefinitely, you must be mindful of potential changes over time (the coin might wear out, or flipping conditions might change) which violate the assumption of identical flips.</p><h2><strong>How does the answer change if we have a strong suspicion that the coin is biased, but not necessarily toward heads? Could the coin be heavier on tails?</strong></h2><p>If you do not know the direction of bias, a typical approach is to use a two-sided test. That means your null hypothesis is p = 0.5 and the alternative hypothesis is p &#8800; 0.5. The required number of flips is slightly larger for a two-sided test at the same</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!eQYB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a9b577-e48d-48d5-9eca-5cb5fe2f804b_81x38.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!eQYB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a9b577-e48d-48d5-9eca-5cb5fe2f804b_81x38.png 424w, https://substackcdn.com/image/fetch/$s_!eQYB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a9b577-e48d-48d5-9eca-5cb5fe2f804b_81x38.png 848w, https://substackcdn.com/image/fetch/$s_!eQYB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a9b577-e48d-48d5-9eca-5cb5fe2f804b_81x38.png 1272w, https://substackcdn.com/image/fetch/$s_!eQYB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a9b577-e48d-48d5-9eca-5cb5fe2f804b_81x38.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!eQYB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a9b577-e48d-48d5-9eca-5cb5fe2f804b_81x38.png" width="81" height="38" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/11a9b577-e48d-48d5-9eca-5cb5fe2f804b_81x38.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:38,&quot;width&quot;:81,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:805,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a9b577-e48d-48d5-9eca-5cb5fe2f804b_81x38.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!eQYB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a9b577-e48d-48d5-9eca-5cb5fe2f804b_81x38.png 424w, https://substackcdn.com/image/fetch/$s_!eQYB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a9b577-e48d-48d5-9eca-5cb5fe2f804b_81x38.png 848w, https://substackcdn.com/image/fetch/$s_!eQYB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a9b577-e48d-48d5-9eca-5cb5fe2f804b_81x38.png 1272w, https://substackcdn.com/image/fetch/$s_!eQYB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a9b577-e48d-48d5-9eca-5cb5fe2f804b_81x38.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>level than for a one-sided test, because you split your alpha across both tails of the distribution. For a difference of 0.1 (like 0.6 vs. 0.5), the difference in sample size is often not enormous, but it is still a factor to keep in mind.</p><p>A real-world edge case is if you have reason to suspect that p &lt; 0.5. You might run a one-sided test in that direction. However, if it turns out that the coin is actually biased in the other direction (p &gt; 0.5), a one-sided test that only checks for p &lt; 0.5 might miss that or fail to detect it. This mismatch between test direction and actual bias is a well-known pitfall if you have incorrectly specified the one-sided alternative.</p><h2><strong>Could practical significance differ from statistical significance in this scenario?</strong></h2><p>Yes. Even if you find that the coin is biased, you might decide that the difference between 0.5 and 0.51 is too small to matter for real-world applications. This distinction between statistical significance (detecting that p is not exactly 0.5) and practical significance (detecting a difference large enough to matter for your use case) is crucial. You can have a very large number of flips that yields a p-value &lt; 0.05 even if the coin&#8217;s bias is only 0.51 vs. 0.5. Yet, from a practical point of view, a 1% shift might be negligible.</p><p>In many real scenarios, you define a smallest effect size of interest. For example, if you only care about biases of at least 5 percentage points (p &#8805; 0.55 or p &#8804; 0.45), then you set up your hypothesis test accordingly. If the coin&#8217;s actual bias is smaller than that, you might treat it effectively as fair. A pitfall is failing to make this distinction, leading to an overly large experiment that flags &#8220;unfairness&#8221; even though the difference from 0.5 has no meaningful impact.</p><h2><strong>What if the coin&#8217;s probability of heads can change over time, or is not constant from flip to flip?</strong></h2><p>All the standard calculations assume identically distributed flips, where p remains constant. If the coin changes its behavior over time (for instance, if the coin&#8217;s surface wears down in a way that affects how it lands), or if the way you flip it changes systematically, then the flips are no longer identically distributed. A naive hypothesis test that assumes a single fixed p can give misleading conclusions.</p><p>If p drifts slowly over time, you might see a sample proportion that does not match either 0.5 or 0.6 in a straightforward way. A real-world approach could be to segment the flips into batches (for example, 10 flips at a time) and see if the proportion changes across batches. Another approach is a time-series model that treats p as evolving stochastically. These complexities make the problem more difficult, requiring extended modeling or real-time adaptation to confirm the coin&#8217;s fairness.</p><p>A subtlety is that you can easily be misled if you assume stationarity (constant p) when the data is actually nonstationary. You might incorrectly detect &#8220;bias&#8221; because in earlier flips p was near 0.52 while in later flips it was near 0.49. Aggregating them might produce an overall average near 0.505 that is not significantly different from 0.5, yet a time-based analysis might show interesting shifts.</p><h2><strong>Could physical constraints influence the validity of the test?</strong></h2><p>Physical factors such as how consistently you flip the coin, the type of surface it lands on, or how the coin is balanced can all introduce variations. A real-world coin might not be perfectly uniform; the distribution of mass can shift slightly if the coin is worn or damaged. The flipping technique matters too. If you always flip it with the same force and rotation, some coins can demonstrate a stable bias.</p><p>A pitfall is that a laboratory setup might yield a different p than everyday usage. You might detect a 60% bias under carefully controlled flips, but it could be different in casual flipping conditions. This introduces concerns about generalizing from your experimental result to the real world. If your ultimate goal is to see how the coin behaves in real usage, you need to sample under realistic conditions. Otherwise, you risk concluding something about fairness that does not apply to actual usage.</p><h2><strong>What if the coin shows a 60% heads probability in a pilot test of 20 flips, but then returns to near 50% in subsequent flips?</strong></h2><p>Short-run fluctuations can appear just by chance, especially with small samples. In 20 flips, seeing 12 heads out of 20 is not that surprising even for a fair coin. You might incorrectly conclude an &#8220;unfair&#8221; coin if you rely on a small sample. Then, once you gather more data, the sample proportion might revert to near 0.5, suggesting there was no significant bias.</p><p>This can lead to the pitfall of &#8220;sampling error&#8221; or &#8220;regression to the mean,&#8221; where an initially extreme outcome drifts back to the average as more data arrives. It reinforces the idea that you typically want a predetermined sample size or a robust sequential stopping rule. Another subtlety arises if you run the test repeatedly every few flips, thereby inflating your chance of incorrectly concluding an unfair coin at some point in the process (multiple testing problem). These complexities illustrate why a disciplined experiment design is crucial for sound conclusions.</p><h2><strong>How does knowledge of confidence intervals help interpret results?</strong></h2><p>Confidence intervals give a range of plausible values for the true p based on the observed data. If you flip the coin n times and observe</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rpcD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05c1a95b-4a40-412d-ae5f-f4423ce8c6ed_61x52.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rpcD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05c1a95b-4a40-412d-ae5f-f4423ce8c6ed_61x52.png 424w, https://substackcdn.com/image/fetch/$s_!rpcD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05c1a95b-4a40-412d-ae5f-f4423ce8c6ed_61x52.png 848w, https://substackcdn.com/image/fetch/$s_!rpcD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05c1a95b-4a40-412d-ae5f-f4423ce8c6ed_61x52.png 1272w, https://substackcdn.com/image/fetch/$s_!rpcD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05c1a95b-4a40-412d-ae5f-f4423ce8c6ed_61x52.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rpcD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05c1a95b-4a40-412d-ae5f-f4423ce8c6ed_61x52.png" width="61" height="52" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/05c1a95b-4a40-412d-ae5f-f4423ce8c6ed_61x52.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:52,&quot;width&quot;:61,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:989,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05c1a95b-4a40-412d-ae5f-f4423ce8c6ed_61x52.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rpcD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05c1a95b-4a40-412d-ae5f-f4423ce8c6ed_61x52.png 424w, https://substackcdn.com/image/fetch/$s_!rpcD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05c1a95b-4a40-412d-ae5f-f4423ce8c6ed_61x52.png 848w, https://substackcdn.com/image/fetch/$s_!rpcD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05c1a95b-4a40-412d-ae5f-f4423ce8c6ed_61x52.png 1272w, https://substackcdn.com/image/fetch/$s_!rpcD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05c1a95b-4a40-412d-ae5f-f4423ce8c6ed_61x52.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>as the empirical proportion of heads, you can compute a 95% confidence interval around</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2Ewj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ef086b4-9a60-49c0-a097-da0fce4f137e_56x61.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2Ewj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ef086b4-9a60-49c0-a097-da0fce4f137e_56x61.png 424w, https://substackcdn.com/image/fetch/$s_!2Ewj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ef086b4-9a60-49c0-a097-da0fce4f137e_56x61.png 848w, https://substackcdn.com/image/fetch/$s_!2Ewj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ef086b4-9a60-49c0-a097-da0fce4f137e_56x61.png 1272w, https://substackcdn.com/image/fetch/$s_!2Ewj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ef086b4-9a60-49c0-a097-da0fce4f137e_56x61.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2Ewj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ef086b4-9a60-49c0-a097-da0fce4f137e_56x61.png" width="56" height="61" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3ef086b4-9a60-49c0-a097-da0fce4f137e_56x61.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:61,&quot;width&quot;:56,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:998,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ef086b4-9a60-49c0-a097-da0fce4f137e_56x61.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2Ewj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ef086b4-9a60-49c0-a097-da0fce4f137e_56x61.png 424w, https://substackcdn.com/image/fetch/$s_!2Ewj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ef086b4-9a60-49c0-a097-da0fce4f137e_56x61.png 848w, https://substackcdn.com/image/fetch/$s_!2Ewj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ef086b4-9a60-49c0-a097-da0fce4f137e_56x61.png 1272w, https://substackcdn.com/image/fetch/$s_!2Ewj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ef086b4-9a60-49c0-a097-da0fce4f137e_56x61.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>. If that interval excludes 0.5, it is evidence (at the corresponding confidence level) that the coin may not be fair. If 0.5 is inside that interval, you cannot rule out fairness.</p><p>A subtlety arises with small samples: the usual normal-approximation confidence interval might not be accurate. Exact binomial confidence intervals or other corrected intervals (like the Wilson interval) might be more reliable. Another complication is that if the coin&#8217;s true p is very close to 0.5, you need many flips to narrow the interval enough to exclude 0.5 with high confidence. Real-world usage of intervals also involves practical significance, because an interval such as [0.49, 0.53] might include 0.5, but even if it did not, a shift to 0.53 might be negligible depending on context.</p><h2><strong>Could measurement errors or mislabeled outcomes affect the conclusion?</strong></h2><p>If someone records each flip by hand, they might accidentally mark heads as tails or vice versa. Even if the error rate is small, it could bias the observed proportion. Suppose the true coin is p = 0.5 but there is a 2% labeling error in favor of heads. That effectively shifts the observed proportion above 0.5. Similarly, if the coin is truly biased at 0.6 but you have random labeling mistakes, your observed proportion could drift closer to 0.5.</p><p>A potential pitfall is ignoring these misclassifications. When measurement error exists, you might need to model that explicitly or conduct high-precision measurement (e.g., automated flipping and detection) to ensure your inferences are correct. Another pitfall is that inconsistent labeling might inflate variance, making it harder to detect real bias.</p><h2><strong>How might real business or operational constraints affect the decision about how many flips to do?</strong></h2><p>In an industrial or commercial setting, flipping a coin many times might be costly or time-consuming. You might only have a limited budget of flips before you must decide. This could lead to accepting a higher chance of failing to detect a bias (a higher</p><p>&#946;</p><p>) or accepting a higher chance of a false alarm (a higher</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!E-qi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f36940e-4290-4bb1-a7bb-9a826bf45937_59x59.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!E-qi!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f36940e-4290-4bb1-a7bb-9a826bf45937_59x59.png 424w, https://substackcdn.com/image/fetch/$s_!E-qi!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f36940e-4290-4bb1-a7bb-9a826bf45937_59x59.png 848w, https://substackcdn.com/image/fetch/$s_!E-qi!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f36940e-4290-4bb1-a7bb-9a826bf45937_59x59.png 1272w, https://substackcdn.com/image/fetch/$s_!E-qi!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f36940e-4290-4bb1-a7bb-9a826bf45937_59x59.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!E-qi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f36940e-4290-4bb1-a7bb-9a826bf45937_59x59.png" width="59" height="59" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8f36940e-4290-4bb1-a7bb-9a826bf45937_59x59.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:59,&quot;width&quot;:59,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:778,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165094046?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f36940e-4290-4bb1-a7bb-9a826bf45937_59x59.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!E-qi!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f36940e-4290-4bb1-a7bb-9a826bf45937_59x59.png 424w, https://substackcdn.com/image/fetch/$s_!E-qi!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f36940e-4290-4bb1-a7bb-9a826bf45937_59x59.png 848w, https://substackcdn.com/image/fetch/$s_!E-qi!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f36940e-4290-4bb1-a7bb-9a826bf45937_59x59.png 1272w, https://substackcdn.com/image/fetch/$s_!E-qi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f36940e-4290-4bb1-a7bb-9a826bf45937_59x59.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>).</p><p>For example, if each flip took significant time or had a real cost, you might be forced to choose a smaller sample size. In that case, you are more prone to inconclusive results. Alternatively, if your context demands near certainty (for example, a critical application where fairness is essential), you might plan a very large number of flips to reduce uncertainty. A real-world pitfall is ignoring these constraints and applying a purely theoretical approach. At a certain point, the marginal benefit of an extra coin flip in reducing uncertainty might not justify the added cost or time.</p>]]></content:encoded></item><item><title><![CDATA[ML Interview Q Series: Real-Time A/B Testing for Streaming: Metrics, Data Pipelines & Evaluation Strategies]]></title><description><![CDATA[Browse all the Probability Interview Questions here.]]></description><link>https://www.rohan-paul.com/p/ml-interview-q-series-real-time-ab</link><guid isPermaLink="false">https://www.rohan-paul.com/p/ml-interview-q-series-real-time-ab</guid><pubDate>Tue, 03 Jun 2025 13:03:29 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!FPMM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde01426c-29ff-4b11-a809-db391f75e13e_1920x1080.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FPMM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde01426c-29ff-4b11-a809-db391f75e13e_1920x1080.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FPMM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde01426c-29ff-4b11-a809-db391f75e13e_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!FPMM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde01426c-29ff-4b11-a809-db391f75e13e_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!FPMM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde01426c-29ff-4b11-a809-db391f75e13e_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!FPMM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde01426c-29ff-4b11-a809-db391f75e13e_1920x1080.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FPMM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde01426c-29ff-4b11-a809-db391f75e13e_1920x1080.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/de01426c-29ff-4b11-a809-db391f75e13e_1920x1080.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1911170,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165093734?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde01426c-29ff-4b11-a809-db391f75e13e_1920x1080.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!FPMM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde01426c-29ff-4b11-a809-db391f75e13e_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!FPMM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde01426c-29ff-4b11-a809-db391f75e13e_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!FPMM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde01426c-29ff-4b11-a809-db391f75e13e_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!FPMM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde01426c-29ff-4b11-a809-db391f75e13e_1920x1080.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Browse all the <strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">Probability Interview Questions here</a></strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">.</a></p><h2><strong>10. In the streaming context, for A/B testing, what metrics and data would you track, and how might it differ from traditional A/B testing?</strong></h2><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://x.com/rohanpaul_ai&quot;,&quot;text&quot;:&quot;Connect with me on X (Twitter)&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://x.com/rohanpaul_ai"><span>Connect with me on X (Twitter)</span></a></p><p>In streaming scenarios, real-time user interaction and dynamic session-based behavior become critical, so A/B testing must address events that continuously arrive. While traditional A/B testing focuses on batch-collected data and a stable user experience over a fixed period, the streaming context introduces unique considerations such as constantly shifting viewer contexts, concurrency spikes, and session-based user interactions. Below is an exhaustive discussion of the core principles, specific metrics, how data is collected, and why it differs from standard offline A/B testing.</p><p>Streaming Context Demands</p><p>One key difference in streaming A/B tests is that data arrives in continuous streams (e.g., live events data). This means metrics must be computed in near real-time, requiring robust data pipelines that can handle rapid ingestion, event time windows, and near real-time updates to performance statistics. Observers typically care about how a certain variant performs moment-to-moment&#8212;especially if the streaming platform is, for example, a video streaming service, an online multiplayer game with real-time analytics, or a live content feed.</p><p>Metrics of Interest</p><p>In streaming, the nature of user interaction focuses on measuring immediate behavior patterns that reflect user satisfaction, engagement, and reliability:</p><p>&#8226; Watch Time This measures how long users spend watching. In streaming scenarios (e.g., live sports, real-time content feeds), total watch time may be aggregated by user session or aggregated across a sliding window.</p><p>&#8226; Concurrency and Drop-Off Rate Streaming concurrency is how many viewers are concurrently tuned to a channel/variant. Drop-off rate is the proportion of users who abandon the stream at any point. In a streaming A/B test, you might compare concurrency trends over time, or how quickly watchers drop off in variant A vs. variant B.</p><p>&#8226; Buffering Rate / Latency Metrics Since streaming depends on delivering content smoothly, the frequency of buffering events, average re-buffer durations, and any streaming latency differences are essential. Observing how often a viewer experiences stalls or high startup latency can reveal which variant leads to a better quality of service.</p><p>&#8226; Time to First Frame and Startup Failures Particularly for streaming, how quickly content starts playing for the user is extremely important. A/B variants may implement different data fetching or caching techniques, so measuring how quickly the first frame is displayed after the user initiates the stream is critical.</p><p>&#8226; Network/Throughput Statistics For video streaming or other high-bandwidth streaming services, the average bitrate, adaptation quality (e.g., whether the stream is auto-switching between HD/SD), and the presence of throttling can be essential performance indicators.</p><p>&#8226; Engagement-based Interactions (Chat, Likes, Comments) Many streaming platforms (game streaming, live Q&amp;A, real-time events) include interactive elements. You can measure how actively the chat is used, how quickly chat messages appear, the sentiment or the frequency of user interactions. In an A/B test, you might compare whether the new UI or feature leads to more chat engagement.</p><p>&#8226; Session-based Retention Rather than standard daily or weekly retention, streaming retention is often session-based or event-based. You can measure how long users stay in a session, how often they return to a particular channel, or how many concurrent sessions occur within a short time window.</p><p>&#8226; Ad View Completion for Monetization If the platform is ad-supported, it&#8217;s key to measure ad impression rates, completion rates, and whether viewer drop-off correlates strongly with ad breaks or new ad placements. Differences in ad insertion logic might be tested for improved user experience vs. revenue outcomes.</p><p>Data Collection and Real-Time Infrastructure</p><p>&#8226; Distributed Event Logging Logs from multiple servers and user devices arrive continuously, requiring robust ingestion (like Kafka, Kinesis, or Pub/Sub). You need the ability to handle large volumes of near-real-time events, especially during peak concurrency. Data is often appended with timestamps and session identifiers.</p><p>&#8226; Windowing To compare performance for different streaming segments, one often uses time-windowed aggregations (e.g., fixed windows, sliding windows, session windows). This is different from offline batch A/B testing, which might rely on a single fixed test period after which final metrics are computed.</p><p>&#8226; Data Consistency and Late Arrivals Because streaming data can arrive out of order or late, you need strategies to handle late-arriving data. Tools such as Flink, Spark Streaming, or Beam help define &#8220;event time&#8221; windows and manage updates to aggregated metrics when new or delayed events appear.</p><p>&#8226; Real-Time Dashboards Stakeholders typically want near real-time dashboards that show how variant A vs. variant B is performing. This differs from a traditional A/B test, which might wait until the full test window ends to compute final metrics. In streaming, partial results are usually displayed with caution, often annotated as &#8220;preliminary.&#8221;</p><p>Differences from Traditional A/B Testing</p><p>&#8226; Ongoing Evaluations with Dynamic User Population Instead of a stable user sample, streaming content often sees new users continuously arriving. The user base might be highly ephemeral (joining or leaving quickly). The A/B test approach in streaming must adapt to these ephemeral user sessions rather than waiting for stable cohorts.</p><p>&#8226; Shorter Session Durations and Immediate Feedback Because users might join a stream for a short burst and leave, you gain faster feedback cycles about that user&#8217;s experience. You measure micro metrics (like buffering frequency) that wouldn&#8217;t be as prominent in a more static, page-based environment.</p><p>&#8226; Need for Session Partitioning In streaming A/B tests, you typically route each user session consistently to one variant. With real-time streaming, it&#8217;s crucial to avoid flipping the user between A/B mid-session, as that might degrade the user experience. Typically, a session-level ID is used to ensure consistent assignment across the entire session.</p><p>&#8226; Real-Time Statistical Significance Confidence intervals and significance tests in streaming contexts need frequent updating with partial data. You might apply sequential testing methods or time-series-based analyses to handle continuous monitoring. Some adopt Bayesian updating, while others use repeated significance tests with alpha-spending corrections.</p><p>&#8226; Scalability and Fault-Tolerance Due to potentially high concurrency, the test infrastructure must scale horizontally to handle surges in viewer counts. This is typically more demanding than offline scenarios, requiring careful architecture for distributed data processing and highly available, fault-tolerant data pipelines.</p><p>&#8226; Incremental Rollouts In a streaming A/B test, you might do smaller incremental rollouts to ensure the new streaming technology does not catastrophically fail at scale. Traditional web-based A/B tests can also do incremental rollouts, but in streaming, the real-time user experience is particularly sensitive to performance changes.</p><p>Why This Matters</p><p>The streaming context demands that you collect specialized metrics (concurrency, buffering, latency, real-time engagement) at scale. The dynamic and ephemeral nature of streaming sessions means real-time test evaluation methods must be robust, giving you the ability to adapt or halt a test quickly if it negatively impacts user experience. Moreover, it changes how you compute, store, and interpret data, since session-based windows and real-time dashboards become paramount to measuring user satisfaction immediately.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.rohan-paul.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">I write everyday for my readers on actionable AI. Subscribe and instantly get a 1300+ page Python book.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2><strong>How would you handle data freshness and alignment in a real-time streaming A/B test?</strong></h2><p>Data freshness is crucial because decisions about test performance often need to be made quickly to avoid negatively impacting user experiences. At the same time, data in streaming environments can arrive late or out of order, and partial aggregator updates might lead to inaccurate real-time metrics.</p><p>To handle data freshness and alignment:</p><p>Use Event-Time Windows Event-time windowing ensures that metrics are grouped by the actual time of the user event rather than the arrival time. Systems like Apache Beam, Flink, or Spark Structured Streaming allow specifying watermarks and triggers that indicate when to consider a window complete or when to re-evaluate it if late data arrives.</p><p>Maintain Partial Aggregations and Revisions Real-time dashboards can show partial aggregations that are updated as data comes in. If new data arrives for a past window, the system revises the previous aggregates. This ensures alignment even if some events arrived late.</p><p>Use Watermarking Strategies A watermark is a threshold of event-time that the pipeline uses to say &#8220;we believe we have seen all events up to time T.&#8221; Once data arrives with timestamps less than T, it can still update your aggregates, but in practice, you tune watermarks to balance timeliness with accuracy.</p><p>Apply Exactly-Once or Idempotent Processing Use robust processing semantics to minimize duplicates or data skew. Many modern streaming frameworks ensure exactly-once or at-least-once processing; for A/B testing, you must carefully handle deduplication at the data ingestion stage to avoid inflating metrics.</p><h2><strong>What are potential pitfalls if user sessions frequently switch variants or if the user base is not consistently segmented?</strong></h2><p>Frequent variant switching during a user&#8217;s session or inconsistent user segmentation can compromise the validity of the A/B test. Common pitfalls include:</p><p>Contamination of Metrics When a user experiences both variant A and variant B during the same session, you can&#8217;t attribute changes in metrics to a single version. This leads to muddled results, making it impossible to isolate which version caused the observed behavior.</p><p>User Confusion and Negative Impact Mid-session switching might confuse or frustrate the user if the interface or streaming logic changes abruptly. This can artificially inflate churn or drop-off rates.</p><p>Biased or Unrepresentative Samples If session assignment is not random or is not consistently enforced, some user segments might receive a disproportionate share of one variant, leading to sampling biases. Real-time streaming often sees user surges (e.g., a sudden influx of viewers for a breaking event), so random assignment must be robust even during surges.</p><p>Workarounds Use session-level IDs to assign a user consistently to one variant for the entire session. For multi-day tests, you can decide whether to keep that assignment persistent across days. That consistency ensures each user gets a stable experience and your metrics reflect a clear version-based impact.</p><h2><strong>How do you determine when enough data has been collected to declare a winner in a streaming A/B test?</strong></h2><p>Deciding when you have sufficient data in a continuous streaming environment can be more complex than offline tests. Traditional A/B testing might rely on a predetermined test duration or a power analysis to find a required sample size. In streaming:</p><p>Sequential or Continuous Monitoring You can monitor significance continuously with repeated significance testing techniques, such as group sequential methods or alpha spending. A new sample of events arrives constantly, so you might adopt a repeated testing approach or Bayesian updating to incorporate incoming data in real time.</p><p>Contextual Bandit Approaches Some streaming platforms use multi-armed bandit or contextual bandit strategies to adaptively allocate traffic to the better-performing variant based on real-time performance metrics. This approach continuously updates beliefs about which variant is best.</p><p>Confidence Intervals and Effect Size Even in real time, you can compute confidence intervals for metrics (like watch time or buffering rate) for variants A and B. Once these intervals rarely overlap or the effect size meets your threshold for practical significance, you can declare a winner. This might happen sooner than a fixed sample size if the difference is very large, or you might choose to wait if differences are small.</p><p>Practical Constraints In a streaming environment, if a new variant severely degrades the user experience, you might stop it almost immediately. Conversely, if the difference is modest but beneficial for a large user base, you might run the test longer for higher confidence. The ultimate decision point is typically a balance among statistical significance, operational risk, and business priorities.</p><h2><strong>How might you architect the data pipeline for real-time A/B testing in a streaming environment?</strong></h2><p>You can build a streaming A/B testing data pipeline using modern frameworks that incorporate real-time ingestion, processing, and storage layers:</p><p>Real-Time Ingestion Use a pub/sub or messaging system, such as Apache Kafka, Amazon Kinesis, or Google Pub/Sub. All user events&#8212;start stream, buffer, exit stream, ad watch, chat interactions&#8212;are published with relevant metadata (timestamp, user/session ID, variant ID).</p><p>Stream Processing Consume from the ingestion layer with a framework like Apache Flink, Apache Spark Structured Streaming, or Apache Beam. This layer is responsible for: &#8226; Filtering and validating events &#8226; Applying windowing logic (sliding or session windows) &#8226; Joining with user metadata if needed &#8226; Aggregating metrics, computing average watch time, buffering counts, concurrency</p><p>Storage For quick lookups, store partial aggregates in fast NoSQL or in-memory data stores like Redis or Cassandra. Longer-term data can be warehoused in systems like BigQuery, Snowflake, or a data lake for historical analysis.</p><p>Visualization and Alerting Use real-time dashboards (e.g., Kibana, Grafana, Superset) to display aggregated metrics. Alerting systems can notify engineers or product owners if certain KPIs degrade.</p><p>Variant Assignment Layer To ensure consistent assignment, the user or session is mapped to a variant at the edge (e.g., CDN or load balancer) or application layer. This assignment can be hashed using a consistent approach. The assignment data is passed downstream in the event metadata.</p><h2><strong>How do you mitigate false positives or Type I errors when constantly monitoring a streaming A/B test?</strong></h2><p>The main risk of continuous, real-time monitoring is that a random fluctuation in metrics might be interpreted as a statistically significant difference if you keep peeking at the data. In streaming contexts, this can be mitigated by:</p><p>Alpha Spending or Sequential Testing An alpha-spending approach allocates a total alpha (false-positive rate) across multiple sequential looks at the data, adjusting critical values accordingly. This way, you don&#8217;t inflate the overall error rate by repeated checks.</p><p>Bayesian Approach A Bayesian approach uses posterior distributions that get updated in real time. Rather than strictly relying on p-values, you interpret the probability that one variant is better. This helps reduce false positives by requiring sufficient posterior evidence before concluding a difference.</p><p>Pre-Specified Stop Conditions Define clear criteria for stopping early (e.g., if the difference in average watch time remains above X for Y hours with at least Z number of events). Having these pre-stated cutoffs prevents &#8220;p-value fishing&#8221; or spur-of-the-moment decisions.</p><p>Practical vs. Statistical Significance Specify a threshold for practical significance. Even if the difference is statistically significant, it may be too small to warrant rolling out if the effect is negligible in practice. This ensures real differences that are relevant to business or user experience are targeted, reducing false positives on trivial changes.</p><h2><strong>How do you handle user privacy and compliance (e.g., GDPR, CCPA) in real-time streaming A/B tests?</strong></h2><p>In streaming environments, real-time data collection can involve granular user actions, location data, or device info. You must ensure:</p><p>Minimized Data Collection Gather only the metrics necessary for the experiment. Avoid storing personal data not essential for computing key KPIs.</p><p>Anonymized or Pseudonymized Identifiers Use hashed IDs for user or session tracking so that raw personally identifiable information (PII) is never streamed or stored.</p><p>Compliance with Retention and Consent Ensure that retention policies comply with regulations (e.g., if a user opts out, their data should no longer be collected). Obtain user consent for data usage if mandated by the region&#8217;s privacy laws.</p><p>Encryption in Transit and At Rest Data pipelines in streaming contexts can produce large volumes of sensitive information. Encrypt data at rest (in storage) and in transit (TLS) to ensure unauthorized parties do not intercept it.</p><p>Auditable Logs and Deletion Mechanisms Maintain an audit trail to show compliance and provide a mechanism to delete or exclude user data promptly if required by user requests.</p><h2><strong>How would you apply advanced modeling (e.g., user segmentation or real-time personalization) alongside A/B testing in a streaming platform?</strong></h2><p>Real-time personalization or advanced modeling in a streaming platform often goes hand in hand with standard A/B frameworks. Examples include:</p><p>Contextual Bandits for Content Recommendation You might use a contextual bandit algorithm that dynamically chooses which content or streaming variant to show, factoring in user context features (e.g., location, device, time of day, content preference). This approach continuously updates the probability of selecting each variant.</p><p>Segmented Analysis After or during an A/B test, you might discover certain user subgroups respond differently. In streaming, you can further segment by device type, connection speed, region, or content genre. This segmentation can guide more tailored experiences in future tests or bandit approaches.</p><p>Real-Time Feature Stores For advanced personalization, you often store user or session features in a low-latency feature store. The streaming A/B test logic can incorporate these features to route traffic or interpret results, ensuring you account for differences among user segments.</p><h2><strong>How would you validate that the real-time metrics in your dashboard closely match the final offline-truth data?</strong></h2><p>In streaming contexts, real-time dashboards are subject to potential partial ingestion, late data arrivals, or data drops. To validate:</p><p>Periodic Offline Reconciliation Batch processing on the raw log data can confirm final metrics for a given time window. Compare those metrics to the aggregated real-time values to check that the real-time system is producing accurate enough estimates.</p><p>Sampling and Checksums Take random samples of event messages or user sessions and verify they are represented correctly in the real-time aggregates. Compare checksums on key metrics between real-time computations and offline computations for matched time windows.</p><p>Iterative Improvement If discrepancies are found, investigate whether windowing, watermarks, or data duplication might be causing over- or undercounting. Adjust the real-time pipeline to better align with offline truth.</p><p>Tolerance Thresholds Define acceptable thresholds for differences in metrics. The real-time system might consistently run 0.5% under or over due to certain approximation methods or sampling. As long as it is consistent and the difference is within a known margin, you can trust real-time results for decision-making.</p><h2><strong>How do you address the risk of model drift or data drift for extended streaming A/B tests?</strong></h2><p>Over time, user behavior, content types, or external factors might change significantly. In a live streaming environment, an A/B test might run for longer than typical web-based tests, raising the possibility that the environment changes mid-test. For example, a new show might drive a different demographic audience, or global events might spike concurrency.</p><p>Continuous Monitoring of Input Distributions Monitor how input variables (e.g., user device types, geographical distribution, time zone distribution) shift over time. If the distribution drifts significantly, the test results might be confounded.</p><p>Adaptive Testing Intervals Shorter test windows might mitigate drift risk, but if you need a long test, set up methods to detect if user metrics change in ways that suggest a different population mix. You can segment the data by time slices to see if the effect is consistent over sub-periods.</p><p>Retraining or Recalibration If part of the tested system uses machine learning (e.g., a streaming recommendation system), you may need to retrain or recalibrate your models. This ensures that the variant you are testing remains optimized for the current data distribution.</p><p>Hold-Out Groups Maintain a stable control group that is not exposed to certain changes. This helps you detect external shifts (e.g., if both the control and the new variant degrade or improve simultaneously due to a platform-wide event).</p><h2><strong>How do you incorporate confidence or credibility intervals in real-time streaming for near-instant decision-making?</strong></h2><p>Confidence intervals (frequentist) or credibility intervals (Bayesian) can be updated in real-time. Key steps:</p><p>Efficient Incremental Updating Maintain rolling counts of success/failure or sums and sums of squares (for continuous metrics). You can then compute mean and variance incrementally. This allows near-instant updates to the intervals.</p><p>Streaming Statistical Tests Methods like the Welford&#8217;s algorithm or online variance calculations allow you to keep track of necessary statistical properties on the fly. For ratio metrics like average watch time, you might track streaming estimates of means and standard errors.</p><p>Confidence Bounds At any given moment, display an interval for the difference in metrics between variant A and B. If these intervals do not overlap, that suggests a robust difference. But remember to account for multiple comparisons or repeated checks.</p><p>Bayesian Updating In Bayesian settings, you can use conjugate priors (e.g., Beta distribution for Bernoulli metrics). For streaming watch times, normal or gamma-based approximations can be used. The posterior distributions get updated as events arrive, offering a real-time probability that one variant is superior.</p><h2><strong>How do you ensure that infrastructure failures or partial outages do not compromise the A/B test results in a streaming setting?</strong></h2><p>High concurrency and real-time ingestion can make a streaming platform more vulnerable to partial outages. To ensure the test validity:</p><p>Redundant Logging Pipelines Log data to multiple regions or clusters so that if one pipeline goes down, another can keep capturing events. This redundancy reduces data loss.</p><p>Retry and Backfill Mechanisms If the pipeline fails briefly, events might be buffered on the client side or in edge caches, then replayed when the system is back up. This ensures minimal data loss and no major gaps for either variant.</p><p>Consistent Assignment Even During Failover Use a robust service for variant assignment that is replicated across data centers. If one region fails, the assignment logic remains consistent in the backup region.</p><p>Monitoring and Alerts Set up real-time monitors for data ingestion rates, concurrency, error counts, and so forth. If a pipeline experiences anomalies, address them quickly and note them in the test timeline. If a large portion of data is lost, consider that test window invalid and re-run or adjust your analysis accordingly.</p><h2><strong>What about edge cases like extremely short sessions or users with sporadic connectivity?</strong></h2><p>Short sessions and sporadic connectivity are common in streaming contexts (e.g., a user just checks a live feed for a few seconds or has poor network connectivity causing frequent reconnections).</p><p>Measurement Strategies You can define a minimum threshold for a valid session to reduce noise (e.g., a session must last at least X seconds to be included in watch-time metrics). Alternatively, you might keep all sessions but handle extremely short sessions as a separate segment.</p><p>Attribution of Metrics For sporadic connectivity, a user&#8217;s session might span multiple partial connections. You can either unify them under the same session ID or handle them as separate sessions if the interruption is too long.</p><p>Performance vs. Experience Even short sessions can reveal crucial signals about buffering or startup latency. If a user opens a stream, sees a long load time, and leaves, that negative experience is important. You may weigh short session data differently in your final metrics, but it&#8217;s unwise to discard them entirely.</p><p>Bias Risk If your test variant inadvertently causes short sessions (e.g., it has poor startup times leading to immediate drop-off), ignoring short sessions would artificially inflate your perceived watch time for that variant. Always ensure that however you handle these edge cases, it applies uniformly across all variants.</p><h2><strong>How can advanced analytics (like time-series analysis or anomaly detection) improve the interpretation of streaming A/B results?</strong></h2><p>Time-series analysis and anomaly detection can highlight moment-to-moment changes that might be lost in aggregate metrics:</p><p>Event-Time Series By plotting concurrency, average watch time, or drop-off rates over the timeline of the stream, you can see if one variant&#8217;s advantage holds steadily or if it fluctuates due to external events (e.g., interesting game moments, or high concurrency spikes).</p><p>Breakdown by Content Segments Use time-series analysis to break down performance by segment boundaries (e.g., ad breaks vs. actual content). This can reveal if a new ad insertion strategy drastically increases drop-off.</p><p>Anomaly Detection If either variant experiences a sudden spike in buffering or errors, anomaly detection can trigger an alert. This might indicate an infrastructure glitch or an unexpected usage pattern, preventing you from prematurely concluding that the variant is inferior.</p><p>Adaptive Strategies Once anomalies are detected, you can adapt your test design (pause the test, reroute new traffic, or revert changes) to prevent widespread user impact.</p><h2><strong>How would you incorporate user feedback or qualitative signals in a streaming A/B test?</strong></h2><p>In addition to quantitative metrics like watch time or concurrency, streaming platforms sometimes solicit direct user feedback:</p><p>In-App Surveys or Quick Prompts After a user ends a stream (or if they watch for a certain duration), you can prompt them with a brief question about quality or satisfaction. Make sure you randomly sample a subset of users to avoid survey fatigue.</p><p>Sentiment Analysis on Chat or Social Media If the streaming service has a social feed or chat, sentiment analysis on user messages can help gauge immediate reactions. Although messy and unstructured, it provides direct insight into user experience and can corroborate watch-time data.</p><p>Support Ticket Volume Track whether your support or customer service sees a spike in complaints or error reports correlated with the variant. This indirect measure can confirm if a new streaming logic is causing real user pain.</p><p>Combining Qualitative and Quantitative Insights Even if the metrics are positive, user feedback might reveal usability frustrations or requests for improvements. In streaming contexts, these might revolve around buffering, UI layout, or ad frequency. A/B tests that incorporate both metrics and feedback can lead to a more complete picture of success.</p><h2><strong>How do you handle repeated or multi-day sessions from the same user in a streaming A/B context?</strong></h2><p>Some streaming platforms see daily repeated usage, such as a viewer who tunes in each day at a similar time or a recurring user who only watches weekend sports:</p><p>Consistent User Assignment Across Days If you want to measure the long-term effect, you might keep the user on the same variant across multiple days, ensuring continuity and preventing confusion.</p><p>Session vs. User-Level Observations Decide whether your primary metrics are session-based or user-based. If user-based, you aggregate multiple sessions from the same user over the test period. If session-based, each user might contribute multiple session data points. Both approaches can be valid, but they measure slightly different outcomes.</p><p>Potential &#8220;Carryover&#8221; Effects If you switch a user from variant B to variant A mid-week, the user&#8217;s prior experiences might bias how they perceive the new variant. For a fair test, keep them on the same variant for the test&#8217;s duration or plan a washout period if a switch is necessary.</p><p>Longitudinal Analysis If your product usage naturally spans multiple days, you might want to track retention, cumulative hours watched, or net churn over a longer test window, observing how each variant affects repeated engagement.</p><h2><strong>How do you choose between standard A/B testing vs. multi-armed bandits or advanced reinforcement learning in a streaming context?</strong></h2><p>In a streaming environment, you typically decide based on:</p><p>Stability vs. Adaptability If you want a stable, controlled experiment to measure the impact of a single change with high confidence, use standard A/B. If you want to continuously adapt to user responses (e.g., choosing which bitrates or recommended content to serve), a multi-armed bandit or reinforcement learning approach is often more appropriate.</p><p>Business Constraints Standard A/B is simple, interpretable, and better for official product launches requiring an auditable test process. Multi-armed bandits are dynamic but can be more complex to explain and might shift traffic allocations unpredictably.</p><p>Variance in Performance If the difference between variants is large, a bandit can quickly exploit the better variant, benefiting user experience. But if you require a strict apples-to-apples comparison, a bandit approach might complicate interpretability because the distribution of user contexts changes over time.</p><h2><strong>How do you handle simultaneous A/B tests for multiple streaming features without cross-test interference?</strong></h2><p>Complex systems might require testing the player&#8217;s buffering logic, new UI design, ad insertion strategy, etc., all at once. For streaming:</p><p>Experimental Design Use a factorial design if feasible, so that each user session belongs to a unique combination of tested factors. But this can explode in complexity if you have many features.</p><p>Mutually Exclusive Pools Partition users into separate test pools for each feature if the tests could interfere with each other. This ensures clarity of results but reduces the available user pool per test.</p><p>Hierarchy of Experiments Prioritize certain features or tests. If one test is critical for immediate business outcomes, keep it isolated from other experiments. Less critical tests might run in parallel in a separate user segment.</p><p>Unified Logging and Metrics All tests log to the same pipeline, but you must carefully tag events with which feature variant the user is seeing. This ensures you can isolate the effect of each test in the final analysis.</p><h2><strong>How would you finalize and roll out the winning variant in a streaming environment?</strong></h2><p>When you identify a winning variant, you can:</p><p>Gradual Rollout Incrementally increase the winning variant&#8217;s traffic share while monitoring key metrics closely. If any issues appear at scale, you can quickly roll back.</p><p>Full Deployment Once validated, the new configuration is deployed to all users. The feature flag or test assignment logic is removed or simplified so that all new sessions receive the winning variant.</p><p>Post-Rollout Verification Continue monitoring for a designated period to confirm that the expected metrics remain stable under full load. If you see unexpected negative trends, revert or investigate.</p><p>Archiving Results Document your final decision and keep detailed logs or dashboards of the test&#8217;s data. In streaming contexts, it&#8217;s important to have historical references because you might revisit or replicate a similar test in the future.</p><h2><strong>Handling unexpected surges of new users in a streaming A/B test?</strong></h2><p>In streaming, external factors like large sporting events or breaking news might drive a massive surge in concurrency. That surge can skew test results if the user population changes drastically:</p><p>Auto-Scaling Infrastructure Ensure your data pipeline and front-end assignment logic can handle sudden spikes. Otherwise, you risk partial data or assignment failures.</p><p>Adaptive Sampling If your pipeline is near saturation, consider sampling user events (e.g., only log events for X% of sessions). Make sure sampling is random and consistent across variants.</p><p>Segment Surges Separately During major surges, you might isolate these new user segments for separate analysis, as they can have different behavior patterns. Or ensure your test design includes these surges so it reflects real-world extremes.</p><p>Graceful Degradation If the system becomes overloaded, degrade gracefully. For instance, you might pause the introduction of new test participants until capacity is recovered, preserving data integrity for the test participants already assigned.</p><h2><strong>Could you provide a simple Python snippet that demonstrates how real-time data might be aggregated for an A/B test in a streaming framework?</strong></h2><p>Below is a conceptual (and simplified) Python snippet using PySpark&#8217;s Structured Streaming API to illustrate how you might compute a streaming metric (e.g., average watch time) for variant A vs. variant B. This is not exhaustive, but gives an overview:</p><pre><code><code>from pyspark.sql import SparkSession
from pyspark.sql.functions import col, window, avg, sum as _sum

spark = SparkSession.builder.appName("StreamingABTest").getOrCreate()

# Read streaming data from a Kafka source (for example).
# Each message includes user_id, variant_id, event_type, watch_time, timestamp.
df = spark \
    .readStream \
    .format("kafka") \
    .option("kafka.bootstrap.servers", "kafka-server:9092") \
    .option("subscribe", "streaming_events") \
    .load()

# Assume the value is in JSON format, so parse JSON to get structured columns.
from pyspark.sql.functions import from_json, schema_of_json

schema_str = """
{
  "type": "struct",
  "fields": [
    {"name": "user_id", "type": "string"},
    {"name": "variant_id", "type": "string"},
    {"name": "event_type", "type": "string"},
    {"name": "watch_time", "type": "double"},
    {"name": "timestamp", "type": "string"}
  ]
}
"""

data_schema = schema_of_json(schema_str)
parsed_df = df.select(from_json(col("value").cast("string"), data_schema).alias("parsed_value"))

exploded_df = parsed_df.select(
    col("parsed_value.user_id").alias("user_id"),
    col("parsed_value.variant_id").alias("variant_id"),
    col("parsed_value.event_type").alias("event_type"),
    col("parsed_value.watch_time").alias("watch_time"),
    col("parsed_value.timestamp").cast("timestamp").alias("event_time")
)

# Compute average watch_time by variant over a tumbling window of 1 minute
agg_df = exploded_df \
    .groupBy(
        window(col("event_time"), "1 minute"),
        col("variant_id")
    ) \
    .agg(
        avg("watch_time").alias("avg_watch_time"),
        _sum("watch_time").alias("total_watch_time")
    )

# Write results to console or a real-time sink.
query = agg_df \
    .writeStream \
    .outputMode("update") \
    .format("console") \
    .option("truncate", "false") \
    .start()

query.awaitTermination()
</code></code></pre><p>This snippet demonstrates how a streaming system might process data in near real time, group by variant, and compute metrics (average watch time here). In real scenarios, you&#8217;d incorporate more complexity like user session logic, handling late data, or custom watermarks.</p><h2><strong>How might you do a final offline analysis to confirm the real-time findings?</strong></h2><p>After collecting real-time data, you can do a more refined offline analysis:</p><p>Gather the Raw Logs Retrieve the raw streaming events from a durable storage location (e.g., HDFS, data lake, or cloud storage), ensuring you capture all events, including any that arrived late or had retries.</p><p>Run an Offline ETL Clean and join events with relevant metadata. Filter out test participants who had incomplete sessions or anomalies. Ensure session continuity and reassign events if they arrived out of order.</p><p>Detailed Statistical Tests Use offline tools (e.g., Python pandas, R, or a data warehouse) to compute final aggregated metrics and run advanced statistical tests. Offline analysis can incorporate more thorough data cleaning and user-level segmentation.</p><p>Cross-Validation of Real-Time Aggregates Compare real-time aggregates with offline aggregates for each variant. If they match closely, your pipeline is validated. If they diverge, investigate potential streaming pipeline quirks.</p><h2><strong>Final Thoughts</strong></h2><p>In summary, A/B testing in the streaming context involves sophisticated metrics (such as watch time, concurrency, buffering rate) and real-time data handling. The dynamic and ephemeral nature of streaming sessions creates unique challenges around data ingestion, consistency, session-based segmentation, continuous monitoring for significance, and reliability of test results. Compared to traditional offline or batch-based A/B tests, streaming experiments typically demand specialized infrastructure and real-time analytics frameworks to ensure accurate, actionable outcomes.</p><p>Always approach streaming A/B tests with meticulous attention to assignment consistency, windowing strategies, late-arriving data, real-time significance monitoring, and potential user confusion from mid-test changes. When implemented thoughtfully, streaming A/B tests help refine user experiences, reduce churn, and drive product innovation in a continuously evolving, real-time environment.</p><div><hr></div><h2><strong>Below are additional follow-up questions</strong></h2><h2><strong>What are best practices for selecting the control group vs. the test group in a streaming environment when audience size fluctuates continuously?</strong></h2><p>Assigning users to control or test variants in a streaming context can be more challenging than in traditional web A/B tests because user influx is not constant and can vary dramatically depending on the content, time of day, or unexpected events. The key best practices include:</p><p>Consistent Assignment per Session Even if audiences surge, a user should remain in the same group for the duration of their session. You can enforce this using a session ID. Once a session is tagged with either &#8220;control&#8221; or &#8220;test,&#8221; that user stays with it until they exit or the session naturally terminates.</p><p>Randomization at Session Start When a user begins a session, use a randomization mechanism that ensures the probability of being assigned to control vs. test is stable (e.g., 50/50). The random seed might be derived from a hash of user or session IDs. This ensures that even if user traffic spikes at particular moments, overall randomization remains intact.</p><p>Capacity-Based Throttling If you want a smaller portion of users to see the test variant (say 10% in early rollouts), you can incorporate capacity-based assignment logic. The key is to ensure you do not bias who ends up in the test. For instance, avoid assigning the test variant only to users in certain regions or on certain devices unless you specifically want to run a segmented test. Always randomize within the subset allocated to the test.</p><p>Avoiding Overlap with Other Tests If your platform runs multiple concurrent experiments, ensure that the assignment logic for control vs. test remains isolated to avoid cross-contamination. Using a consistent &#8220;experiment hashing&#8221; approach can help. For example, you can designate a portion of the user base exclusively for one experiment so that results remain unbiased.</p><p>Pitfalls and Edge Cases &#8226; Sudden Surges: If a highly popular event starts, ensure your system handles the volume so that random assignment does not fail or degrade (e.g., leading to defaulting everyone to the control). &#8226; Varying Engagement Windows: A user might watch for just a few seconds or many hours. Ensure short-session data is handled correctly in both test and control groups to avoid skewing results. &#8226; Mid-Session Changes to Allocation Rules: If you change the percentage of traffic going to test vs. control in the middle of the day, make sure the assignment algorithm still keeps existing session assignments stable.</p><h2><strong>How do you handle scenarios where a user might watch from multiple devices or frequently switch devices within the same streaming session?</strong></h2><p>In streaming services, it&#8217;s not uncommon for a user to start watching on a TV, switch to a phone while on the move, and then resume on a tablet later. This device switching can complicate an A/B test because:</p><p>Session Continuity Across Devices If your platform allows users to resume their session seamlessly across devices, you likely have a user ID that persists across platforms. In that case, you can keep them in the same test variant by reusing their existing assignment. This ensures the user&#8217;s overall experience is coherent and that your metrics accurately reflect a single experiment path.</p><p>Potential for Partial Data Some devices might fail to transmit certain events (e.g., older smart TVs with limited analytics capabilities). You may see incomplete metrics if the user frequently switches between device types. One approach is to unify all device-generated events by user ID. If the TV does not capture certain metrics (like advanced buffering data), you can at least track watch time consistently across all devices.</p><p>Concurrency vs. Single Session If a user is actually watching on two devices concurrently (e.g., phone and TV at the same time), decide whether that counts as one session or multiple sessions. Typically, if the same user is logged in twice, you might consider them separate session IDs but still bound to the same variant assignment. This can be tracked by combining (user_id, session_id, device_id) to ensure uniqueness yet consistency of variant assignment.</p><p>Pitfalls and Edge Cases &#8226; Device Mismatch: Some older devices may not fully support the test features, or they may degrade performance. If you do not segment these devices out, they might artificially bring down the test&#8217;s metrics. &#8226; Overcounting: If your analytics pipeline is not deduplicating events properly, the user might show up multiple times. Ensure you have a robust deduplication or session unification mechanism. &#8226; Privacy Considerations: Persisting cross-device user IDs must comply with privacy policies. In certain regions, you may need user consent for tracking usage across multiple devices.</p><h2><strong>How do you test new streaming protocols or encoding strategies (e.g., HLS vs. DASH) in a real-time A/B experiment?</strong></h2><p>Many streaming services support multiple protocols or encoding profiles to deliver content. Testing a new protocol in production involves:</p><p>Protocol-Specific Performance Metrics When you test a new protocol or encoding (like HLS vs. DASH), measure buffering rate, average bitrate delivered, latency to first frame, and success/failure rates in stream initialization. These are often the most critical user experience metrics for protocol changes.</p><p>Consistent Content Delivery Ensure the same content is available in both protocols so that differences come purely from the protocol, not from content variations. Some streaming services might deliver slightly different bitrates or quality levels, so confirm alignment of resolution/bitrate across variants.</p><p>Infrastructure Requirements Ensure your CDN or content infrastructure can handle traffic for both protocols. Sometimes the new protocol is only served from specific edges or has partial coverage in certain regions. That might introduce geographical or device-based biases if not handled carefully.</p><p>Gradual Rollout by Device Type In practice, not all devices support every protocol. You might test the new protocol on only those devices that are known to be compatible. Over time, you can expand coverage as you verify stability.</p><p>Pitfalls and Edge Cases &#8226; Multi-CDN Complexity: If you use multiple CDNs, each might handle the new protocol differently. You should isolate that variable or at least track it as a factor in your analysis. &#8226; Versioning: Certain versions of a streaming client library might behave differently. Collect enough device and software version metadata to segment your analysis if needed. &#8226; Bandwidth Constraints: If the new protocol attempts to deliver higher quality by default, it might cause more buffering for users on slower connections. This can skew the test results if your randomization does not account for connection speed distribution.</p><h2><strong>How do you measure and interpret concurrency metrics when running an A/B test on a live stream?</strong></h2><p>Concurrency&#8212;how many simultaneous viewers are tuned to the same live event or channel&#8212;is a key metric in live streaming. But concurrency can fluctuate significantly during the event:</p><p>Capturing Concurrent Viewers You might capture concurrency by taking frequent &#8220;snapshots&#8221; of active sessions every few seconds or minutes. Each snapshot records how many sessions are currently in variant A vs. variant B.</p><p>Comparing Spikes and Drops Analyze concurrency patterns over time. A typical live stream may have a ramp-up period, a peak concurrent moment, and a tail-off. You can overlay concurrency curves for variant A and variant B to see if one variant consistently retains more viewers.</p><p>Combining Concurrency with Other Metrics Concurrency alone does not reveal why users stay or leave. Pair concurrency measurements with drop-off rate, rejoin rate, buffering frequency, and total watch time. For instance, if variant B has slightly higher concurrency but much more buffering, the concurrency advantage might vanish in extended watch-time metrics.</p><p>Pitfalls and Edge Cases &#8226; Partial Overlap: Some users switch from variant A to B mid-stream if your assignment logic is not session-based. This contaminates concurrency metrics. Always ensure consistent assignment. &#8226; Time-Zone Clusters: If your test includes a global audience, concurrency might vary by region and time zone, possibly skewing concurrency distribution if random assignment is not globally uniform. &#8226; Very Short Live Events: Some events might last only a few minutes. Concurrency can spike and disappear quickly, making it hard to gather enough data to interpret the differences.</p><h2><strong>How do you handle scenarios where the user&#8217;s network conditions (e.g., bandwidth, latency) vary widely and may overshadow the effect of the tested feature?</strong></h2><p>Network conditions are a major determinant of streaming quality, and these can vary unpredictably:</p><p>Segment Users by Network Quality One approach is to segment by measured bandwidth or by automatically detected &#8220;poor&#8221; vs. &#8220;good&#8221; network conditions. You can compare test vs. control within each segment to see if the tested feature yields improvements that hold consistently across network types.</p><p>Adaptive Bitrate vs. Static Quality Modern streaming players often employ adaptive bitrate streaming (ABR). If variant B changes how ABR logic is performed, then the difference might be overshadowed if the user&#8217;s network is extremely constrained. You might see minimal differences at very low bandwidth.</p><p>Use Real-Time Telemetry Continuously collect data about average throughput, packet loss, or ping times to differentiate whether performance problems arise from the test change or from a user&#8217;s poor connection. In real-time dashboards, you can filter metrics by connection quality.</p><p>Pitfalls and Edge Cases &#8226; Incomplete Telemetry: Some devices might not report detailed network stats. If that data is missing for large swaths of users, you lose the ability to segment effectively. &#8226; Correlation with Device Type: Lower-end devices and poor network connectivity might correlate, leading to confounding. For example, older phones might always have weaker Wi-Fi connections. &#8226; Overcompensation: ABR might keep quality low to avoid buffering, so your test might show minimal differences in these segments, while in higher bandwidth segments, the difference might be more pronounced. You could mistakenly generalize results if you don&#8217;t separate these segments.</p><h2><strong>How do you define session boundaries in streaming services that offer continuous content or auto-play for the next item?</strong></h2><p>Some streaming platforms automatically play next content (e.g., series episodes, auto-queued videos), leading to a continuous watching behavior:</p><p>Session Timeout One common approach is to define a session timeout. For instance, if no user activity (playback or navigation events) is observed for X minutes, you conclude the session ended. The next playback event starts a new session. This approach avoids artificially long sessions when the user steps away or leaves the app open.</p><p>User-Initiated Actions Alternatively, you could break sessions at each user-initiated action, such as explicitly selecting new content. However, auto-play might not trigger a new session if the user passively continues watching. You must decide whether each new piece of content is a new &#8220;session&#8221; or part of the same continuous session.</p><p>Variant Consistency If you define session boundaries too loosely, a user might cross from variant A to variant B mid-watch without actually leaving the platform. For an A/B test, you typically want to keep them locked to the same variant until they truly end a session. You can store a session token that remains valid for the entire watch period, including auto-play sequences.</p><p>Pitfalls and Edge Cases &#8226; Very Long Binge Sessions: A user might watch multiple episodes or entire seasons. Do you consider this all one session? If so, you might reduce your sample size of &#8220;unique sessions&#8221; but gain deeper data on user watch-time. &#8226; Edge Cases in Auto-Play: The platform might show an interstitial or short ad break between episodes that resets some logic. Ensure that does not inadvertently trigger a re-randomization. &#8226; Partial Engagement: The user might skip forward or jump episodes. If the platform logic treats each jump as a new session, you could fragment data. Consistent session definition is crucial.</p><h2><strong>How do you isolate the effect of a change in the recommendation algorithm when testing in a streaming environment with many content choices?</strong></h2><p>Recommendation changes can affect what content users discover and watch, and it can be tricky to separate that from the changes in streaming performance:</p><p>Hold-Out Content or Random Baseline Sometimes, streaming platforms use a random subset of items or a stable &#8220;control&#8221; recommendation model. This baseline helps you measure how differently users behave with the new recommendations. If you simply compare two evolving recommendation algorithms, you might miss the stable reference point.</p><p>User-Level or Session-Level Assignment If a recommendation system has a new feature (e.g., improved personalization), you might randomly assign half of the users to see the new model. In streaming contexts, it&#8217;s essential to ensure a user consistently sees the same recommendation approach throughout their usage period, or you risk mixing experiences.</p><p>Measuring Engagement vs. Performance A new recommendation algorithm might drive users to watch more or different content, changing concurrency patterns. This can also shift how many ads they see, or how frequently they experience buffering. Carefully break down the effect on discovery metrics (click-through rates on recommended content) vs. streaming QoS metrics (buffer events).</p><p>Pitfalls and Edge Cases &#8226; Popular Titles Domination: If a new recommendation system heavily promotes popular titles, concurrency might spike on fewer titles. This can cause bottlenecks or degrade streaming performance. &#8226; Confounding with Seasonal Content: If you roll out the new recommendation engine around a big show&#8217;s release, user behavior might drastically change for reasons unrelated to the algorithm. &#8226; Cold Start for the New Algorithm: Early in the test, the new algorithm might not have enough data about the user. This can skew the first days of the test. Consider separate analyses for short-term vs. longer-term user interactions.</p><h2><strong>How do you manage extremely large-scale global events in a streaming A/B test where concurrency might reach millions simultaneously?</strong></h2><p>When you have a global event (e.g., a World Cup match, major awards show) with potentially millions of concurrent viewers:</p><p>Pre-Test Load Testing Before the real event, run synthetic load tests to ensure the data pipeline and assignment logic can handle the surge. If your system fails under scale, you risk losing critical test data and negatively impacting the user experience.</p><p>Pre-Assigned Buckets To avoid last-minute surges, you can pre-assign variants to user buckets (e.g., by user ID hashing) well before the event begins. This ensures that when users join the stream, they already know which variant they&#8217;ll receive, preventing on-the-fly randomization overhead.</p><p>Real-Time Monitoring Escalation Set up a war-room or dedicated dashboard for crucial events. If concurrency grows exponentially, you might see unexpected behaviors in buffering or CDN load distribution. Real-time alerts can prompt an immediate rollback of the test variant if issues arise.</p><p>Pitfalls and Edge Cases &#8226; Single Event Duration: Some global events might only last a few hours. You have a narrow time window to collect data, and any network glitch can sabotage your entire test. &#8226; Regional Surges: Different countries might tune in at different times. The concurrency could spike in a rolling wave across time zones, complicating direct A/B comparisons if certain variants are more popular in specific regions. &#8226; Fallback Mechanisms: If the test variant fails under load, a fallback approach should seamlessly direct new traffic to the stable variant. Ensure your system can handle that transition instantly.</p><h2><strong>How do you consider churn or unsubscription rates in a streaming platform&#8217;s A/B test?</strong></h2><p>Many streaming services rely on subscriptions or membership sign-ups. Testing changes that might impact user churn requires a longer-term perspective:</p><p>Longitudinal Tracking Churn is typically a longer-term metric compared to ephemeral watch events. You might need to track users over weeks or even months to see if a new feature (e.g., improved streaming quality or a new UI) reduces churn or unsubscriptions.</p><p>Incremental Churn Indicators Instead of waiting for a formal unsubscribe event, you can monitor leading indicators: drop in watch time, reduction in daily usage frequency, or negative changes in user rating surveys. These might signal an impending churn decision.</p><p>Retention Cohorts Segment your user base into cohorts based on when they joined the test. Compare the churn rates of these cohorts in test vs. control after a certain time frame. This requires robust data engineering to link short-term streaming behavior with eventual subscription status.</p><p>Pitfalls and Edge Cases &#8226; Confounding Promotions: If marketing runs a big promotional campaign or discount for certain users, churn data might be impacted independently of your A/B test. &#8226; Seasonal Patterns: Users might churn seasonally (e.g., after a sports season ends), overshadowing the effect of your test. Incorporate historical churn patterns in your analysis. &#8226; Partial Exposure: If a user was tested only briefly (e.g., they unsubscribed quickly), your metrics might not reflect the full experience. You may need separate metrics for short-term churn vs. long-term churn.</p><h2><strong>How do you ensure data quality and prevent duplications or missing events in real-time streaming A/B tests?</strong></h2><p>Real-time streaming pipelines are prone to data quality issues&#8212;events can arrive late, get duplicated, or fail to arrive:</p><p>Idempotent Event Ingestion Use a unique event ID or a compound key (session_id + timestamp + event_type) to ensure that any replays or retries of the same event do not inflate your metrics. In frameworks like Kafka or Kinesis, the consumer can detect duplicates and discard them if you maintain a small state store.</p><p>Schema Validation and Versioning Enforce strict schema checks on incoming data to catch malformed messages. If you push out a new client version that changes the event format, version your schema in the ingestion pipeline. This avoids silent ingestion errors.</p><p>Late-Arriving Data Handling Adopt watermarking and triggers that can re-aggregate windows if new data arrives. This is essential for ensuring final aggregates accurately reflect all events that occurred in the time window&#8212;even if they arrived late.</p><p>Pitfalls and Edge Cases &#8226; High-Throughput Bottlenecks: If your pipeline is overloaded, it might start dropping messages or falling behind real-time. This can create systematic gaps in your test metrics. &#8226; Network Partitions: A cluster partition might cause lost data in one region, skewing the test results if that region had a large share of one variant. &#8226; Over-Reliance on Real-Time Aggregates: If you only keep real-time aggregates, you might lose the ability to do detailed offline re-analysis. Always store raw events in a durable, replayable system.</p><h2><strong>How can you incorporate multi-language or localization considerations into a streaming A/B test?</strong></h2><p>Global streaming platforms often deliver content in multiple languages or localized user interfaces:</p><p>Localized UI Variants If your test includes UI changes, you might need to replicate the new UI for multiple languages. This ensures that the test variant is consistent for all language settings, preventing a partial or broken user experience for certain locales.</p><p>Segmented Analysis by Region/Language User behavior can differ drastically by region or language preferences. A test that works well in English might have different outcomes for non-English speaking audiences. After collecting data, segment by language or region to ensure the test doesn&#8217;t degrade performance for specific localities.</p><p>Content Metadata For certain A/B tests, the new variant might alter how localized metadata is shown (e.g., subtitles, localized titles, or search listings). Carefully track user engagement with localized features to see if the new approach helps or hinders discovery and watch-time.</p><p>Pitfalls and Edge Cases &#8226; Missing Localized Elements: If the test variant&#8217;s UI is only partially localized, users in certain regions might see placeholder text or revert to an English fallback. This can artificially harm user metrics. &#8226; Government or Regional Regulations: Some regions have strict guidelines on data usage or feature changes. The new variant might need separate approvals or compliance checks. &#8226; Cultural Differences in Engagement: The same design or content strategy might resonate differently across cultures, so consider that the test&#8217;s overall global average might mask local user patterns.</p><h2><strong>How do you validate the scalability of the real-time analytics layer without risking user-facing performance?</strong></h2><p>It&#8217;s critical to confirm that the real-time analytics system can scale to handle production loads for an A/B test. At the same time, you don&#8217;t want to degrade the user experience by saturating system resources:</p><p>Shadow Traffic One approach is to replicate production events to a &#8220;shadow&#8221; pipeline that processes the data in parallel. The primary pipeline remains stable, while the shadow pipeline is tested under load. You can run performance and stress tests on this shadow system to confirm it can handle spikes.</p><p>Synthetic Load Generators Before launching the real test, generate synthetic user events that mimic real patterns. Tools or custom scripts can push large volumes of events into the pipeline, verifying that ingestion and processing keep pace.</p><p>Resource Autoscaling If using a cloud-based solution like AWS Kinesis or GCP Dataflow, confirm your autoscaling policies are tuned to ramp up quickly under bursts. If you rely on on-premises clusters, you might need to pre-provision enough computing resources to handle potential concurrency spikes.</p><p>Pitfalls and Edge Cases &#8226; Partial Observability: If your shadow traffic differs from real user behavior, you could be misled about actual performance bottlenecks (e.g., complex user flows that synthetic tests don&#8217;t replicate). &#8226; Scaling Costs: Autoscaling might incur steep costs if the test triggers resource expansions in multiple regions. Balance cost constraints with the need for accurate metrics at scale. &#8226; Overlooked Aggregation Complexity: Even if ingestion can handle the volume, downstream aggregations or writes to a data store might choke if poorly optimized. Always test the full pipeline from ingestion to final storage.</p><h2><strong>How do you adapt your streaming A/B framework to test multiple features simultaneously that might interact with each other?</strong></h2><p>When multiple teams want to test new features at once, or when a single feature has multiple variations:</p><p>Multifactorial Designs A factorial or multivariable design can systematically test each combination of features (e.g., Feature1: On/Off, Feature2: Legacy/New). This approach helps detect interaction effects but can explode in complexity if you have many features.</p><p>Mutually Exclusive Buckets Create separate user buckets or segments for each experiment to avoid overlap. For instance, 10% of users belong to Experiment A, 10% to Experiment B, and so on. The remaining 80% remain in control. This eliminates interactions but reduces the sample size for each test.</p><p>Tag Each Event with All Active Variants In complex systems, a single user might be in multiple experiments. When logging an event, record which combination of variants the user is experiencing. This allows you to do post-hoc analysis of interactions. However, it raises the burden of more complex data pipelines and analysis.</p><p>Pitfalls and Edge Cases &#8226; Confounded Results: If Feature A significantly impacts buffering time, and Feature B modifies the player UI, the combination might lead to unexpected synergy or conflict. You can&#8217;t interpret each feature&#8217;s effect in isolation. &#8226; Sample Dilution: Each additional experiment further segments the audience, slowing your time to achieve statistical significance. &#8226; Overhead for Implementation: Each new feature might require separate assignment logic, logging, and data transformations. The pipeline complexity can grow exponentially if not carefully managed.</p><h2><strong>How do you incorporate user reward mechanics (such as loyalty points or gamification) in a streaming A/B test without biasing the streaming metrics?</strong></h2><p>Some streaming platforms reward users with points or achievements for watching content or completing certain actions:</p><p>Clearly Separate the Feature from Core Streaming Metrics If you&#8217;re primarily testing changes to video quality or playback, the addition of loyalty points can skew watch times artificially as users chase rewards. If you want to include a rewards element, define separate KPIs (e.g., &#8220;points redeemed,&#8221; &#8220;streak completions&#8221;) and still track watch-time as usual.</p><p>Different Reward Systems for Control vs. Test If you&#8217;re testing a new reward mechanic in the test group, the control group should have the standard or no reward system. Measure the difference in user engagement to see if the new rewards significantly extend watch time or user satisfaction.</p><p>Avoid Double Counting A user might repeatedly start and stop streams just to farm rewards. You can enforce rules that require a minimum watch threshold for the reward event to be triggered (e.g., user must watch at least 10 minutes). This ensures more authentic engagement data.</p><p>Pitfalls and Edge Cases &#8226; Inflated Engagement: Users might watch more frequently but also accelerate dissatisfaction if they find the reward mechanic shallow or repetitive. &#8226; Untargeted Rewards: If the reward system is not personalized, it might disproportionately benefit certain user segments. E.g., heavy watchers might exploit the system, leading to skewed results. &#8226; Cannibalization of Other Features: If you have a recommendation test running simultaneously, introducing rewards might overshadow the effect of improved recommendations.</p><h2><strong>How do you measure brand impact or long-term user perception from a real-time streaming A/B test?</strong></h2><p>Beyond immediate streaming metrics, some changes might affect how users perceive your brand or platform long-term:</p><p>Survey-Based Brand Metrics You could incorporate post-session surveys or random pop-ups asking about brand perception, user satisfaction, or net promoter score (NPS). Over time, compare these scores for test vs. control cohorts.</p><p>Social Media Listening Monitor sentiment on social platforms or public forums. If the new variant leads to negative chatter about frequent buffering or interface confusion, that can be an early warning sign. Conversely, a positive buzz might correlate with brand lift.</p><p>Correlation to Renewal or Re-Subscription Over multiple billing cycles, see if the test group&#8217;s renewal rate is higher (or churn rate is lower) than the control. This aligns brand impact with tangible user retention.</p><p>Pitfalls and Edge Cases &#8226; Survey Bias: Only a subset of users respond to surveys, and they might be unrepresentative. &#8226; External Market Forces: Broader brand perception can be influenced by competitor actions, advertising, or negative press unrelated to your A/B test. &#8226; Delayed Effects: Brand-level perception often moves slowly. A short test window might not detect a significant brand impression shift, requiring repeated or extended measurement.</p><h2><strong>How do you test critical features (like a major payment or subscription flow change) in a streaming platform without risking large revenue losses during the experiment?</strong></h2><p>Some changes, such as altering the subscription flow, can have high stakes:</p><p>Staged Rollouts Begin by testing on a very small percentage of new sign-ups. If sign-ups remain healthy, gradually expand to a larger share. This approach mitigates the risk of a major revenue drop if the new flow is flawed.</p><p>Parallel Sandboxes You can direct a small group of users to a &#8220;sandbox&#8221; environment for sign-ups or payments. This sandbox might mirror production but with additional safeguards or support staff on alert for issues.</p><p>Key Metrics for Payment or Subscription In addition to standard streaming QoS metrics, track conversion rate, average revenue per user (ARPU), subscription completion times, and user support ticket rates. If any of these degrade significantly in the test group, consider reverting quickly.</p><p>Pitfalls and Edge Cases &#8226; Payment Processor Dependencies: Third-party payment gateways can cause subtle differences. Ensure the test flow is thoroughly tested for all payment methods. &#8226; Fraud or Chargeback Risk: Changes in payment flows might inadvertently open new fraud vectors or lead to user confusion and chargebacks. Monitor these metrics closely. &#8226; Edge Cases with Existing Subscribers: If the flow changes for upgrades or add-ons, be mindful of how it affects loyal, long-time users who have built certain habits with the old flow.</p><h2><strong>How do you manage the situation where the streaming service has partners or affiliates that require separate data reporting and might not align with your A/B test?</strong></h2><p>In many streaming platforms, third-party affiliates might deliver content or handle certain user segments:</p><p>Partner-Based Exclusions If the partner insists on a consistent experience, you might need to exclude that entire affiliate or region from the A/B test. This can reduce your sample size but maintains your partner&#8217;s contractual requirements.</p><p>Separate Partner Dashboards If the partner must see real-time metrics but does not align with your variant assignment, consider building a separate data flow or aggregated view. They might only see control group metrics if the test group data is irrelevant or not contractually allowed.</p><p>Hybrid Approaches For some affiliates who are open to collaboration, you can design a co-branded experiment. They might be eager to see if a new streaming approach benefits both parties. In such cases, define clear roles: who controls the assignment logic, who collects data, and how that data is shared.</p><p>Pitfalls and Edge Cases &#8226; Fragmented Data: Splitting analytics across multiple partners or affiliates might create incomplete global pictures. You&#8217;ll have partial insights unless you unify the data eventually. &#8226; Contractual Violations: Some partners might not allow changes that could degrade user experience in their region. Surprising them with test-driven performance dips can breach trust. &#8226; Extra Compliance Layers: If affiliates operate in different legal jurisdictions, you must ensure your test respects each region&#8217;s privacy and data-handling laws.</p><h2><strong>How do you handle advanced security requirements, such as DRM or user authentication flows, when testing streaming changes?</strong></h2><p>Streaming services often protect content using DRM (Digital Rights Management) and require secure authentication workflows:</p><p>Consistent DRM Experience If the test variant modifies how DRM keys are requested or renewed, you must ensure it&#8217;s functionally equivalent in security. A minor flaw could break content decryption for users or introduce vulnerabilities.</p><p>Authentication/Authorization In some scenarios, the test variant might change the login or token verification flow. Keep a close watch on authentication failure rates, time to login, and user drop-off at login prompts. These metrics reflect direct friction introduced by the test.</p><p>Load on License Servers DRM systems rely on license servers that might see increased load if your new logic polls or renews licenses more frequently. Monitor error rates and response times from these servers. A meltdown in DRM could cause the entire test variant to fail quickly.</p><p>Pitfalls and Edge Cases &#8226; Region-Specific DRM Rules: Some countries have different DRM requirements. If the new variant is not fully compatible, you risk blackouts or legal issues. &#8226; Testing with Incomplete Credential Data: If users have partially expired tokens, or if the test inadvertently triggers new token requests, it can create a spike in failures that you misattribute to streaming logic. &#8226; Performance vs. Security: A more secure approach might slow down initial playback. You need to weigh potential performance regressions against the security improvement.</p><h2><strong>How do you prioritize which streaming feature or improvement to test first when multiple teams are submitting proposals?</strong></h2><p>Large streaming platforms can have many potential changes&#8212;protocol optimizations, new UI layouts, advanced recommendation algorithms, monetization strategies, etc. Determining which gets tested first involves:</p><p>Business Impact Analysis Estimate potential user or revenue impact. For example, a feature that might improve watch times by 10% is more critical than a UI cosmetic tweak that might have minimal effect.</p><p>Technical Risk If a proposed test is technically risky (e.g., a major player overhaul that could break on many devices), you might want to test smaller changes first or run that major test in a small &#8220;internal pilot.&#8221;</p><p>Dependencies Sometimes a new feature relies on back-end changes or data models that other teams are still building. You must sequence your tests so you don&#8217;t test a half-finished or partially integrated feature.</p><p>Pitfalls and Edge Cases &#8226; Overcrowded Roadmap: Teams might push to test everything concurrently. But that can lead to confusion and cross-test contamination. &#8226; Biased Prioritization: Senior management might favor certain changes even if their potential impact is unclear. Ideally, you use data-driven criteria (expected ROI, user value). &#8226; Shifting Priorities Mid-Test: If business priorities change, you might halt an ongoing test to free capacity for a more urgent one. This can lead to incomplete data and wasted effort.</p><h2><strong>How do you incorporate user psychographics or advanced audience segmentation (like casual watchers vs. hardcore fans) into the analysis of test results?</strong></h2><p>Beyond demographic or device-based segmentation, streaming platforms might want to look at deeper audience preferences:</p><p>Tagging Users with Behavior Profiles Use past viewing history, genre preferences, or frequency of engagement to label users as &#8220;casual watchers,&#8221; &#8220;binge-watchers,&#8221; or &#8220;sports fans.&#8221; This classification can come from an internal ML model or heuristic rules.</p><p>Applying Segmentation Post-Test After random assignment, break down test vs. control metrics within each segment. For instance, see if hardcore fans respond differently to a new live-streaming UI compared to casual watchers. This can highlight variant benefits or drawbacks that only manifest in specific groups.</p><p>Pitfalls and Edge Cases &#8226; Segment Leakage: If your segmentation logic is not fully consistent, some users might appear in multiple segments or move between them over time. &#8226; Self-Fulfilling Bias: If the new feature specifically aims at hardcore fans (e.g., advanced stats overlay), casual watchers might find it irrelevant or confusing, dragging overall results down. Summaries that don&#8217;t separate segments might mask a strong improvement for the intended group. &#8226; Dynamic Preferences: A casual watcher might become a hardcore fan after discovering new favorite content. This fluidity complicates static segmentation approaches.</p><h2><strong>How do you detect and address &#8220;bot watchers&#8221; or automated streams that could inflate metrics in a streaming A/B test?</strong></h2><p>Some environments face automated watchers, either malicious (e.g., scraping or invalid ad views) or benign (e.g., monitoring streams for official purposes):</p><p>Anomaly Detection Monitor for unusual watch patterns: extremely high concurrency from a small set of IPs, 24/7 view times with no breaks, or an abnormally consistent pattern that doesn&#8217;t match human behavior.</p><p>Verification Checks Implement periodic checks such as user interaction prompts or CAPTCHAs for suspicious sessions. If these sessions never respond, you can flag them as bots or automated.</p><p>Segregated Metrics If you suspect certain traffic is automated, segregate that traffic from the main metrics. You can do a deeper investigation to confirm if it&#8217;s legitimate third-party monitoring or malicious bot activity.</p><p>Pitfalls and Edge Cases &#8226; Legitimate Monitoring Tools: Some affiliates or partners run stream monitoring to ensure quality. These watchers might appear bot-like but serve a real function. Excluding them might hide legitimate data about stream uptime and performance. &#8226; Region-Specific Bot Attacks: Certain regions might experience more frequent large-scale bot traffic. If your random assignment is global, you could see variant B receiving more bot traffic purely by chance, skewing results. &#8226; Evasion: Bots evolve to appear more human-like. You might need advanced detection methods (heuristics, ML) to differentiate real from fake sessions.</p><h2><strong>How do you compare the impact of user interface changes on connected TVs vs. mobile apps in a single streaming A/B test?</strong></h2><p>Connected TV apps often have very different UX constraints than mobile. If your test involves a major UI overhaul:</p><p>Device-Specific UI Implementation You might create a specialized test variant for TV vs. a separate one for mobile that follows the same overall design principles. This ensures that each device type receives a properly adapted interface.</p><p>Combined vs. Separate Analysis You can run the same experiment ID but log the device type. In your analysis, you do an overall comparison (all devices) plus a separate breakdown by device category. Differences might be stark: some improvements on mobile might be detrimental on TV.</p><p>Pitfalls and Edge Cases &#8226; Navigation Differences: TVs typically rely on remote controls, so a UI change that&#8217;s good on touchscreens might be cumbersome with directional pad inputs. If you lump them together in analysis, you can get confused signals. &#8226; Divergent Codebases: The mobile app might implement the new UI differently from the TV app. If so, you effectively have two different tests. &#8226; Inconsistent Feature Availability: Some devices might not support advanced transitions or overlays. If you partially implement the new UI on older TV devices, the user experience might degrade.</p><h2><strong>How do you handle real-time error or crash analytics in a streaming A/B test to catch silent failures?</strong></h2><p>Sometimes the user&#8217;s streaming app might crash or encounter errors not always reflected in buffering metrics:</p><p>Instrument Crash and Exception Logging Send device-side crash reports (with user consent) in real time to the analytics pipeline. Tag them with the test variant. This reveals if variant B is causing significantly higher crash rates.</p><p>Heartbeat or Keep-Alive Signals Have the client periodically send &#8220;I&#8217;m still alive&#8221; pings. If these pings stop unexpectedly, it might indicate a crash or abrupt disconnection. Cross-reference with normal user exit events to see if the departure was abrupt.</p><p>Real-Time Alert Thresholds Define thresholds for error rates. For instance, if the crash rate in variant B goes 3X above baseline over a 5-minute window, automatically trigger an alert or revert to the control variant to protect user experience.</p><p>Pitfalls and Edge Cases &#8226; Incomplete Crash Data: Crashes might prevent the app from sending logs. If you see large numbers of silent sessions with no explicit crash report, it might still indicate an underlying issue. &#8226; Network vs. App Crashes: A user disconnection from the network might be indistinguishable from an app crash unless you differentiate them carefully. &#8226; Data Privacy: Crash logs can contain sensitive information, so ensure compliance with data privacy regulations if you gather stack traces or device details.</p><h2><strong>How do you measure the success of an A/B test that focuses on user interface accessibility enhancements in a streaming context?</strong></h2><p>Accessibility features (e.g., screen reader compatibility, closed-caption improvements, high-contrast UI) can be subtle to measure:</p><p>Accessibility Usage Metrics Track how many users enable closed captions, subtitles, audio descriptions, or high-contrast modes. If the new design or features lead to increased adoption of accessibility settings, that&#8217;s a strong signal of success.</p><p>Qualitative Feedback from Users with Disabilities Engage with specialized user groups or run targeted surveys. They can provide direct feedback if the new changes truly improved their viewing experience.</p><p>Indirect Engagement Indicators Users requiring accessibility features might historically have short watch sessions or high drop-off if the content was hard to navigate. After the test, measure changes in watch length or concurrency among that subset.</p><p>Pitfalls and Edge Cases &#8226; Low Sample Size: The subset of users needing advanced accessibility features may be relatively small. Achieving statistical significance requires planning or a longer test duration. &#8226; Potential for Overlapping Gains: Even users without disabilities might appreciate some aspects of high-contrast UI or simplified navigation, so the effect might appear beyond the intended audience. &#8226; Device Constraints: Some older devices do not fully support accessibility APIs. If your test variant relies on them, those devices might fail to benefit from the new features, diluting your measured impact.</p><h2><strong>How do you manage long-run experiments in streaming platforms where the test might last for months, and the underlying technology stack evolves during that time?</strong></h2><p>Some experiments, particularly those measuring churn or brand perception, might run for extended periods:</p><p>Version Lock Avoid making mid-experiment code changes that affect the test variant. If you must update the streaming player or other code paths, do so in ways that keep the test&#8217;s logic stable, or clearly document the changes so you can segment pre- vs. post-update data.</p><p>Rolling Recalibration If you rely on a machine learning model in the test variant (e.g., advanced recommendation or bandwidth estimation), you might need to retrain that model periodically. Treat these retrain points as potential breakpoints in your data analysis.</p><p>Check for Drifts Over Time User behavior might shift due to seasonality, new competitors, or new content releases. Segment your data by time windows (e.g., monthly slices) to detect changes in test vs. control performance that might appear mid-experiment.</p><p>Pitfalls and Edge Cases &#8226; Test Fatigue: If the test is very long, some users might lose interest or become frustrated if the feature is not polished. This can artificially skew results if your test experience is incomplete. &#8226; Platform Migrations: The underlying pipeline or data storage might change. You must ensure you continue capturing consistent metrics throughout the migration. &#8226; Confusion in Tracking: Over months, multiple analytics schema updates or logging changes can occur. Carefully unify these changes so you don&#8217;t end up with incompatible data sets for pre- vs. post-change.</p><h2><strong>How can you test alternative monetization models (e.g., subscription tiers, pay-per-view) within a single streaming service without alienating the user base?</strong></h2><p>Monetization experiments can be sensitive because they directly impact user costs:</p><p>Limited Cohort Testing Start by offering the new monetization model to a small, randomly selected portion of new users only. Existing subscribers remain unaffected, avoiding backlash from a sudden pricing or payment model change.</p><p>Incentivized Trials Offer a free or discounted trial period for the test group so that you can measure user acceptance of the new payment model. This approach can reduce friction but might also bias results if the discount is too generous.</p><p>Metric Focus &#8226; Conversion Rate (from free trial to paid) &#8226; Average Revenue Per User (ARPU) &#8226; Churn Rate among test group Balance these metrics with user experience measures like watch time or satisfaction surveys.</p><p>Pitfalls and Edge Cases &#8226; Negative Brand Impact: Users who discover they are paying differently than others might feel cheated if the test&#8217;s existence becomes public knowledge. &#8226; Payment Processing Complexity: Handling partial pay-per-view events and subscription logic in parallel can introduce billing errors if not carefully implemented. &#8226; Regulatory Constraints: Some regions have laws about promotional offers or variable pricing. Make sure the test variant does not violate local regulations.</p><h2><strong>How do you handle SLOs (Service Level Objectives) or SLAs (Service Level Agreements) during an A/B test that might impact the streaming platform&#8217;s performance guarantees?</strong></h2><p>Certain streaming platforms have service-level obligations, for instance promising a certain uptime or maximum buffering ratio:</p><p>Test with Safeguards If the new feature or variant might degrade performance, define strict thresholds. For example, if the buffering ratio exceeds a set percentage or if error rates climb, automatically halt the test or revert to the control variant to maintain SLAs.</p><p>Real-Time SLO Monitoring You might already have SLO dashboards. Integrate your test assignment so you can see if the test group is inching closer to breaching performance targets. This requires fine-grained data so you can separate test from control performance.</p><p>Pitfalls and Edge Cases &#8226; Enforcement of Penalties: Some enterprise partners might impose monetary penalties if SLAs are breached. The test could inadvertently trigger these penalties. &#8226; Partial Rollback: If the test is breaching SLOs in one region but not others, you might consider partial rollbacks to isolate the problematic region while continuing the experiment elsewhere. &#8226; Transient Incidents: A short outage might cause temporary SLA dips. If it&#8217;s unrelated to the test variant (e.g., a CDN glitch), be careful not to blame the variant prematurely.</p><h2><strong>How do you handle user-initiated preference changes mid-test (e.g., user opts into or out of certain experimental features)?</strong></h2><p>Some streaming platforms allow advanced users to toggle beta features on or off:</p><p>Respecting User Choice If a user explicitly opts out of an experimental feature, you typically remove them from the test to avoid negative user sentiment. This can, however, reduce your test sample.</p><p>Mark Data as &#8220;User-Overridden&#8221; If a user toggles the feature off mid-session, that portion of the session no longer reflects the test variant. You can separate that data out or treat it as partial exposure.</p><p>Pitfalls and Edge Cases &#8226; Skewed Results: Enthusiastic users who opt in might not represent the average user, making your test results unrepresentative. &#8226; Complex Logging Requirements: Each toggle event must be logged with timestamp and variant status to accurately interpret watch-time or engagement for the partial exposure intervals. &#8226; Multi-Session Behavior: A user might opt out for one session but forget to do so next time, or they might re-enable the feature. This creates complicated sub-sessions that need careful analysis.</p><h2><strong>How do you test emergent social streaming features like watch parties or real-time user interactions where groups of users share the same session?</strong></h2><p>Some platforms allow watch parties, where users synchronize viewing, chat together, or share reactions in real time:</p><p>Group-Based Assignment If users form a watch party, you typically assign the entire group to a single variant. Mixing variants within a shared session can cause synchronization or UI mismatches that degrade the experience.</p><p>Measuring Social Engagement Beyond standard watch-time metrics, measure group chat activity, reaction frequency, or invites. If the new feature fosters more group interactions, that could be a big success indicator.</p><p>Pitfalls and Edge Cases &#8226; Partial Group Joins: If one user from an existing watch party leaves and a new user joins, that new user must inherit the group&#8217;s variant to maintain consistency. &#8226; Low Adoption: If watch parties are a niche feature, your test sample might be too small for robust statistical confidence. You may need a longer test or incentives to encourage usage. &#8226; Network Complexities: Real-time synchronization demands stable connectivity. If the new approach introduces too much overhead, watch parties might suffer from out-of-sync experiences, overshadowing any potential benefits of the test variant.</p><h2><strong>How do you manage real-time experiments across multiple subsidiaries or brands under the same parent streaming company?</strong></h2><p>Large media conglomerates might operate multiple streaming apps or services:</p><p>Unified Experimentation Platform A centralized system can handle random assignment, logging, and analytics, ensuring consistent methodology. Each subsidiary can still customize its test but uses a shared backbone.</p><p>Cross-Brand Metrics Some users might subscribe to multiple brands. If the test is brand-specific, watch out for cross-brand user overlap that might create confusion about which variant they see. You can unify user identities if they log in with the same credentials.</p><p>Pitfalls and Edge Cases &#8226; Brand-Specific Content: A test that improves buffering for sports streams might not apply to a children&#8217;s content brand. Avoid mixing results if the content is fundamentally different. &#8226; Conflicting Schedules: Different subsidiaries might have their own release calendars. A major event for one brand might overshadow a smaller test in another brand. &#8226; Data Silos: Some subsidiaries might keep their data entirely separate for legal or operational reasons. You need a robust approach to partial or aggregated data sharing without violating contracts or user privacy.</p><h2><strong>How do you plan for a fallback strategy if a streaming A/B test significantly worsens user KPIs?</strong></h2><p>Even with thorough planning, a test can backfire and degrade performance:</p><p>Automated Fallback or Kill-Switch Implement a mechanism that continually monitors critical KPIs (buffer ratio, error rates, concurrency drops). If the test variant passes a negative threshold, automatically disable it or revert to control in real time.</p><p>Graceful Degradation If the test variant includes advanced features (e.g., high-bitrate streaming), degrade those features slowly if performance dips. This approach can preserve some improvements without fully rolling back.</p><p>Post-Rollback Analysis After rolling back, analyze logs to pinpoint the cause: was it device incompatibility, a bug in the new encoding pipeline, or something else? Use that information to fix the issue before any subsequent retest.</p><p>Pitfalls and Edge Cases &#8226; Rapid Reaction Times: A big concurrency spike might cause performance meltdown quickly. If your fallback logic isn&#8217;t responsive enough, you might lose user trust. &#8226; Incomplete Data after Rollback: Once the test is shut down, you can&#8217;t gather further data, so your analysis might rely on partial metrics up until the failure. &#8226; Negative User Sentiment: A meltdown test can generate bad PR or user complaints, so part of fallback planning is managing communication to the user base.</p><h2><strong>How do you educate stakeholders (e.g., product managers, marketing teams) about interpreting real-time streaming A/B results that change frequently?</strong></h2><p>Real-time dashboards and near-instant metrics can cause overreactions if stakeholders don&#8217;t understand the nuances:</p><p>Training on Statistical Variation Explain that metrics can fluctuate day-to-day or hour-to-hour, especially in streaming contexts with dynamic concurrency. Emphasize confidence intervals or Bayesian credible intervals so stakeholders see the uncertainty around estimates.</p><p>Lock-In Periods or Reporting Cadences To reduce panic from minor fluctuations, define intervals (e.g., a daily or 6-hourly summary) for official reporting. The real-time dashboard is for quick checks, while decisions require waiting for the aggregated data at the end of each interval.</p><p>Pitfalls and Edge Cases &#8226; Cherry-Picking Moments: Some stakeholders might highlight a single time window (e.g., 8-9 PM spike) to justify decisions. Stress the importance of overall or time-segmented analysis. &#8226; Pressure to Stop/Scale Early: If the test looks promising in the first few hours, marketing might push to roll it out. If it looks bad, they might demand a rollback. Teach them about statistical significance thresholds to avoid impulsive decisions. &#8226; Mixed Messages: Different teams may interpret partial data differently if they focus on only one KPI. Have a single source of truth that shows multiple KPIs in context.</p><h2><strong>How do you handle test results when the streaming platform changes underlying hardware or CPU resources (e.g., migrating to new servers or upgrading codecs) mid-test?</strong></h2><p>Sometimes the infrastructure itself changes independently of the experiment:</p><p>Time-Partition the Results If an infrastructure change occurred on day 10 of the experiment, split the test data into before-change and after-change segments. This way, you can see if the new infrastructure impacted test vs. control differently.</p><p>Control for Infrastructure in the Analysis If possible, roll out the infrastructure change to both test and control groups simultaneously so that any baseline shifts affect them equally. This ensures the difference between test and control remains the meaningful variable.</p><p>Pitfalls and Edge Cases &#8226; Unplanned Migrations: If the hardware upgrade is urgent (e.g., to fix a critical bug), you might have to accept the partial data you gathered before the change. &#8226; Confounding Effects: A hardware upgrade might drastically improve buffering for everyone, diluting the effect of the new feature. If you fail to account for that, you might incorrectly conclude your test variant had no impact. &#8226; Rolling Upgrades: If the migration is done region-by-region, the test vs. control distribution might be unbalanced across old vs. new infrastructure. Log which infrastructure version each user session used.</p><h2><strong>How do you ensure that your streaming A/B test meets ethical guidelines, especially if you&#8217;re testing experimental features that might affect vulnerable populations?</strong></h2><p>Ethical testing becomes critical if the platform is widely used by children, or if certain features could inadvertently disadvantage specific user groups:</p><p>Institutional Review or Ethics Committee Some large organizations have internal review boards that examine experiments affecting user privacy or well-being. Submitting the test design to such a body can help ensure compliance with ethical standards.</p><p>Opt-In for Potentially Sensitive Features If the feature might cause discomfort or confusion (e.g., explicit content filters, mental-health-related messages), consider an opt-in approach for test participants rather than forced assignment.</p><p>User-First Fail-Safes If the test leads to negative user experiences, provide easy ways to revert or opt out. Disclose in your terms or user notices that the platform continuously tests improvements to ensure transparency.</p><p>Pitfalls and Edge Cases &#8226; Unintended Bias: An algorithmic recommendation test might inadvertently disadvantage certain groups if the data used has historical biases. &#8226; Child Safety: If minors use the platform, you might need stricter controls on what kind of experiments are run and how data is collected (COPPA compliance in the U.S., for example). &#8226; Reputational Risk: A poorly conceived experiment can result in public outcry and harm brand trust if it&#8217;s perceived as manipulative or harmful.</p><h2><strong>How do you finalize decisions in a scenario where real-time metrics and offline analysis disagree?</strong></h2><p>Occasionally, the real-time streaming metrics differ from a subsequent detailed offline analysis:</p><p>Investigate Data Pipeline Discrepancies Check if the real-time pipeline missed events or if the offline analysis used different filtering rules. Often, a mismatch arises from how late or out-of-order data is handled.</p><p>Time Synchronization Ensure event timestamps are consistently interpreted. Real-time systems might use ingestion time, while offline analysis might rely on event time. Aligning these can resolve discrepancies.</p><p>Decision Criteria If offline analysis is deemed more accurate (due to comprehensive data), that often takes precedence. However, if you rely on real-time metrics for immediate product decisions, you might weigh them more heavily for short-term actions.</p><p>Pitfalls and Edge Cases &#8226; Overconfidence in Offline Data: Offline analysis might also have biases, especially if it includes a different subset of events or uses outdated user info. &#8226; Real-Time Approximation: Some real-time platforms use approximations or sampling to handle high throughput. If the sampling is not carefully managed, it could skew results. &#8226; Communication with Stakeholders: Mismatches can cause confusion. Clarify how each data set was generated and which you trust more for final decisions.</p><h2><strong>What strategies can you use to re-run or replicate a streaming A/B test if the initial results are inconclusive?</strong></h2><p>Occasionally, the test might fail to yield clear insights or might be confounded by external events:</p><p>Extended Testing Simply run the test longer, especially if you suspect you didn&#8217;t gather enough data or if the concurrency patterns varied unpredictably. Over a longer period, ephemeral anomalies might average out.</p><p>Refined Scope If the initial design was too broad, consider a narrower test that focuses on a specific region, device type, or time window where you have more consistent data. This can reduce noise and yield clearer results.</p><p>Re-Calibrated Hypothesis If you suspect your metrics didn&#8217;t capture the real benefit, refine your success criteria. Maybe you initially measured only watch time, but the real improvement might be in decreased buffering or positive user feedback.</p><p>Pitfalls and Edge Cases &#8226; Testing Fatigue: If you repeatedly run inconclusive tests, your user base may experience test &#8220;churn,&#8221; leading to confusion. &#8226; Confounding Variables Remain: You might re-run the test but fail again if you haven&#8217;t identified the root cause (e.g., poor randomization, external factors). &#8226; Resource Constraints: Re-running a large-scale test can be expensive in terms of engineering effort and opportunity cost. Ensure that repeating the test is justified by potential insights.</p><h2><strong>How can anomaly detection be integrated more deeply into the streaming A/B test to proactively flag suspicious data trends before the test ends?</strong></h2><p>Rather than waiting until the post-test analysis, incorporate automated anomaly detection during the experiment:</p><p>Automated Threshold Alerts Define normal operating ranges for your key metrics (e.g., buffering rate &lt; 5%) and set dynamic thresholds. If the test group&#8217;s buffering rate doubles, trigger an alert for immediate investigation.</p><p>Time-Series Models Use specialized algorithms (e.g., ARIMA, Holt-Winters, or ML-based anomaly detection) on real-time metric streams. These models can detect unusual spikes or drops in concurrency, watch time, or error rates for the test variant.</p><p>Pitfalls and Edge Cases &#8226; False Alarms: Real-time anomaly detection can be sensitive, triggering false positives due to normal random fluctuations or ephemeral surges. &#8226; Over-Correction: If you act too quickly on every anomaly, you might terminate promising experiments prematurely. Combine anomaly alerts with domain knowledge before deciding. &#8226; Model Drift: If user behavior changes significantly (e.g., a new season of a popular show), the anomaly detection model might misjudge normal usage spikes as anomalies. Periodically retrain or recalibrate the model.</p><h2><strong>How do you manage resource constraints if your real-time A/B test requires heavy computation (e.g., advanced analytics or machine learning inference for each user event)?</strong></h2><p>Some advanced test designs might run real-time inference or complex business logic:</p><p>Edge vs. Centralized Computation If possible, push some logic to the edge (CDN or client devices) to reduce the load on the central cluster. For instance, you can do lightweight computations or sampling at the client level before sending summarized events to the back-end.</p><p>Batch-Like Hybrid Approach For metrics that require expensive computation (e.g., advanced ML scoring), you might do near-real-time or micro-batch processing with a slight delay (e.g., every 5 minutes). This balances the real-time need with computational feasibility.</p><p>Cost Monitoring Continuously track the resource usage (CPU, memory, GPU if relevant) and associated costs. If the test infrastructure cost spikes unacceptably, consider reducing sampling rates or applying simpler proxy metrics as a short-term measure.</p><p>Pitfalls and Edge Cases &#8226; Overloaded ML Model: Real-time inference pipelines can get bogged down if the user concurrency is huge. Model queries might queue, causing delayed data or timeouts. &#8226; Partial Feature Availability: The ML model might need fresh user features from a feature store. If the store lags or is unavailable, you might produce stale or incomplete inference. &#8226; Regressions from Throttling: If you throttle or degrade the test pipeline, it might artificially reduce the test group&#8217;s concurrency or watch time, skewing results.</p><h2><strong>How do you address randomization fairness in a streaming environment where certain user segments (e.g., premium subscribers vs. free users) might come online at different times or with different frequencies?</strong></h2><p>Randomization fairness means that each user (or session) should have an equal likelihood of being assigned to test or control, but user segments might appear at different rates:</p><p>Stratified Randomization Split users first by subscription type (premium vs. free). Within each stratum, randomly assign half to test vs. control. This ensures both subgroups are proportionally and fairly represented in each variant.</p><p>Dynamic Rebalancing If the ratio of premium to free signups changes drastically during the experiment, you might re-check your assignment distribution and adjust new assignments to maintain an overall 50/50 distribution. But be cautious&#8212;don&#8217;t reassign existing sessions.</p><p>Pitfalls and Edge Cases &#8226; Over-Segmentation: If you stratify on too many factors (location, subscription type, device), you can complicate your assignment logic. Keep it manageable. &#8226; Changing Subscription Status: A user might upgrade from free to premium mid-test. If they remain in the same variant, you can still track them; if your analysis requires them to move strata, you need a coherent approach to avoid data contamination. &#8226; Time-Zone Disparities: If premium users are more likely to watch at prime time, while free users watch sporadically, you might see concurrency spikes in only one segment. Proper segmentation ensures each segment is compared fairly.</p><h2><strong>How do you ensure that organizational best practices for code reviews and QA testing don&#8217;t slow down the rapid iteration cycles often needed in real-time streaming A/B tests?</strong></h2><p>Balancing the need for thorough QA with the desire for quick experiment turnaround is tricky:</p><p>Feature Flags and Small, Incremental Releases Use feature flags to separate experimental code from core production code. This allows you to merge small changes frequently without fully exposing them to the user base. QA can focus on the new code path behind the flag.</p><p>Automated Testing Pipelines Implement robust CI/CD with automated tests (unit, integration, end-to-end) that quickly validate functionality. Automated load tests can catch performance regressions before the experiment goes live.</p><p>Pitfalls and Edge Cases &#8226; Incomplete QA for Edge Cases: Real-time streaming has many device-specific or concurrency edge cases that automated tests might not fully cover. &#8226; Slow Sign-Off Processes: Some organizations require multiple approvals. Streamline sign-offs for small experimental changes, while major overhauls still go through deeper scrutiny. &#8226; Testing in Production: &#8220;Testing in production&#8221; is common in streaming contexts, but you need guardrails (kill-switches, canary releases) to mitigate risk.</p><h2><strong>How do you measure success if your streaming platform uses ephemeral or disappearing content (e.g., live streaming that is never archived, or short-lived stories)?</strong></h2><p>With ephemeral content, the user can only watch it during a brief window:</p><p>Time-Windowed Approach Your entire experiment might happen within a specific timeframe for each piece of content (e.g., a live event from 7 PM to 9 PM). You gather as much data in that window. Once it&#8217;s gone, that content is no longer watchable.</p><p>Immediate Feedback Metrics Because the content disappears, you rely heavily on real-time signals: concurrency, immediate watch duration, drop-off points, or chat interactions. There is no long-tail viewing to measure afterwards.</p><p>Pitfalls and Edge Cases &#8226; Short Window for Statistical Significance: If ephemeral content is short, you might not accumulate enough user sessions to reliably detect differences. &#8226; Variation in Content Popularity: Different ephemeral events might differ drastically in popularity. If your test variant was assigned to a less popular event time, that can confound your results. &#8226; Repeated Ephemeral Events: If you have daily ephemeral content, you can replicate the test over multiple days, aggregating results for better confidence.</p><h2><strong>How do you manage final knowledge transfer and documentation for future experiments?</strong></h2><p>Many insights from streaming A/B tests can inform future designs:</p><p>Centralized Knowledge Base Maintain detailed documentation: test hypothesis, how randomization was done, key metrics, final results, anomalies, and rollback triggers. This helps future teams avoid repeating mistakes.</p><p>Versioned Experiment Tracking Use a system to track the version of each experiment, code commits, and analytics queries. This ensures that months or years later, you can still reconstruct how the test was set up.</p><p>Pitfalls and Edge Cases &#8226; Staff Turnover: If the team that ran the experiment disbands, poorly documented tests lose their value. &#8226; Rapid Feature Evolution: If the streaming UI or protocols change drastically, old test results might not apply directly, though they still provide historical context. &#8226; Overconfidence in Past Results: Each test is run in a specific environment. Future changes might invalidate some assumptions. Always treat past tests as references, not absolute truths.</p><h2><strong>How do you approach a scenario where the test variant seems beneficial for new users but detrimental for returning or long-time users?</strong></h2><p>Sometimes, analyses show a beneficial effect in one subset and a negative effect in another:</p><p>Segmented Decision Making You might choose to roll out the feature only to new users if that&#8217;s where it performs well, or develop a refined version for returning users. This partial rollout can optimize overall user satisfaction.</p><p>Further Investigation Discover why returning users are negatively impacted. Perhaps the new UI disrupts established habits. Qualitative feedback from returning users might pinpoint friction points.</p><p>Pitfalls and Edge Cases &#8226; Conflicting Stakeholder Goals: The growth team might want to improve new user onboarding, while the retention team focuses on keeping loyal subscribers happy. You must reconcile these priorities. &#8226; Rolling Updates vs. Cohort Isolation: If you decide to keep returning users on the old experience, be prepared to manage multiple code paths or UI versions. This adds maintenance overhead. &#8226; Long-Term Shifts: Over time, today&#8217;s &#8220;new users&#8221; become &#8220;returning users.&#8221; If the new experience is fundamentally better, you might see the returning user negativity diminish once they adapt.</p><h2><strong>How can you incorporate advanced forecasting methods to predict the potential impact of a streaming A/B test&#8217;s outcome beyond the immediate data?</strong></h2><p>Some decisions require forecasting future user growth, subscriber revenue, or bandwidth usage:</p><p>Modeling and Projection Use the current test data (e.g., improvements in watch time) as an input to a forecasting model that projects the impact over weeks or months. You can incorporate user growth rates, churn probabilities, seasonal fluctuations, etc.</p><p>Scenarios Analysis Consider best-case, average-case, and worst-case scenarios. For example, if watch time improves by 5% now, that might translate to a 2% improvement in retention next quarter, but only if external factors remain stable.</p><p>Pitfalls and Edge Cases &#8226; Uncertain Extrapolation: A short-term test result might not hold in the long term, especially if user behavior evolves. &#8226; External Influences: Forecasts might be thrown off by competitor moves, new content deals, or global events (e.g., major sporting tournaments). &#8226; Overreliance on Projections: Forecasting helps with strategic planning, but do not treat it as definitive. Continually check actual performance against the forecast and update your assumptions.</p><h2><strong>How do you handle data retention policies when you need user-level detail for streaming A/B test analysis, but also must comply with strict data deletion requirements?</strong></h2><p>Data retention policies or GDPR &#8220;right to be forgotten&#8221; requests can complicate analyses:</p><p>Anonymized Aggregates Whenever possible, store aggregated metrics that do not contain personal identifiers. You can still analyze watch times or buffering rates without user-level data beyond the necessary time window.</p><p>Tokenization or Pseudonymization Use ephemeral user IDs that can be purged or rotated. If a user requests deletion, you can remove the ID mapping from your system. The aggregated data remains, but it&#8217;s no longer traceable to that user.</p><p>Pitfalls and Edge Cases &#8226; Post-Hoc Analysis Requiring Detailed Data: If you rely too heavily on anonymized aggregates, you might lose flexibility for deeper segmentation or debugging. &#8226; Non-Compliance Risks: A complicated experiment pipeline might inadvertently retain personal data beyond the permitted timeframe, leading to regulatory fines. &#8226; Rolling Windows: Some streaming services keep user-level data for 30 days. If your test runs longer, you must ensure the necessary data is aggregated before older logs are purged.</p><h2><strong>How do you operationalize the lessons learned from an A/B test so that other teams or future projects can benefit?</strong></h2><p>Finally, after completing a thorough streaming A/B test, it&#8217;s crucial to spread knowledge:</p><p>Cross-Functional Debriefs Host post-experiment reviews with engineering, product management, analytics, and marketing. Present findings, mistakes, and key lessons so future experiments do not repeat known pitfalls.</p><p>Public Experiment Catalog Maintain an internal wiki or catalog of experiments, including methodology, results, data analysis code, and recommended next steps. This &#8220;institutional memory&#8221; helps onboard new team members and fosters a culture of data-driven decisions.</p><p>Pitfalls and Edge Cases &#8226; Lack of Accountability: If no one follows up on recommended next steps, the lessons might be ignored. Ensure each learning is assigned an owner. &#8226; Documentation Overhead: Detailed documentation can be time-consuming. Encourage teams to write succinct but meaningful summaries rather than incomplete or overly long reports with no clear structure. &#8226; Divergent Interpretations: Different teams might interpret the same results in conflicting ways. Having a single documented conclusion or statement of findings helps unify the narrative.</p>]]></content:encoded></item><item><title><![CDATA[ML Interview Q Series: Boosting Site Signups: Validating Feature Impact with A/B Testing and Proportion Tests.]]></title><description><![CDATA[Browse all the Probability Interview Questions here.]]></description><link>https://www.rohan-paul.com/p/ml-interview-q-series-boosting-site</link><guid isPermaLink="false">https://www.rohan-paul.com/p/ml-interview-q-series-boosting-site</guid><pubDate>Tue, 03 Jun 2025 12:59:03 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!dORy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74b03ca3-ac5d-4934-8d6a-3c8b9d8eee05_1024x572.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dORy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74b03ca3-ac5d-4934-8d6a-3c8b9d8eee05_1024x572.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dORy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74b03ca3-ac5d-4934-8d6a-3c8b9d8eee05_1024x572.png 424w, https://substackcdn.com/image/fetch/$s_!dORy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74b03ca3-ac5d-4934-8d6a-3c8b9d8eee05_1024x572.png 848w, https://substackcdn.com/image/fetch/$s_!dORy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74b03ca3-ac5d-4934-8d6a-3c8b9d8eee05_1024x572.png 1272w, https://substackcdn.com/image/fetch/$s_!dORy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74b03ca3-ac5d-4934-8d6a-3c8b9d8eee05_1024x572.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dORy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74b03ca3-ac5d-4934-8d6a-3c8b9d8eee05_1024x572.png" width="1024" height="572" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/74b03ca3-ac5d-4934-8d6a-3c8b9d8eee05_1024x572.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:572,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:996044,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165093205?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74b03ca3-ac5d-4934-8d6a-3c8b9d8eee05_1024x572.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dORy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74b03ca3-ac5d-4934-8d6a-3c8b9d8eee05_1024x572.png 424w, https://substackcdn.com/image/fetch/$s_!dORy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74b03ca3-ac5d-4934-8d6a-3c8b9d8eee05_1024x572.png 848w, https://substackcdn.com/image/fetch/$s_!dORy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74b03ca3-ac5d-4934-8d6a-3c8b9d8eee05_1024x572.png 1272w, https://substackcdn.com/image/fetch/$s_!dORy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74b03ca3-ac5d-4934-8d6a-3c8b9d8eee05_1024x572.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Browse all the <strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">Probability Interview Questions here</a></strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">.</a></p><h2><strong>9. Assume you want to test whether a new feature increases signups to the site. How would you run this experiment? What statistical test(s) would you use?</strong></h2><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://x.com/rohanpaul_ai&quot;,&quot;text&quot;:&quot;Connect with me on X (Twitter)&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://x.com/rohanpaul_ai"><span>Connect with me on X (Twitter)</span></a></p><p>To rigorously determine if introducing a new feature increases the signups on a site, the typical approach involves designing and executing an A/B experiment (also referred to as a split test). The primary goal is to compare the signup rate of a control group (users who see the old version) against a treatment group (users who see the new feature). The fundamental rationale is that, if randomization is done correctly and all other conditions are kept consistent, any difference in signups between the two groups can be attributed to the new feature.</p><p>Designing the experiment begins with defining the success metric (the proportion of users who sign up) and the hypothesis you want to test. Typically, you set up the null hypothesis that there is no difference in signup rates (control vs. treatment) and an alternative hypothesis that the new feature changes (increases or decreases) the signup rate. A typical approach is to use a two-tailed test if you are concerned about any significant change, or a one-tailed test if you specifically only care about an increase (though in practice many organizations still default to two-tailed to detect unexpected negative impacts as well).</p><p>A standard approach, if the metric of interest is a binary success/fail outcome (signup or not), is to use a test for difference of proportions (such as a Z-test for two proportions). If the underlying distribution or sample size is small or uncertain, other methods may be considered, but generally for large-scale user experiments, a two-proportion Z-test is the classic choice.</p><p>There are variations, such as Chi-square tests for independence, which are mathematically related to two-proportion Z-tests. In many practical analytics libraries, a proportions_ztest or a Chi-square test for independence can be used to examine whether the difference in signup rates between the two variants is statistically significant.</p><p>Below is an extended explanation of how one might run the experiment end to end, the mathematical reasoning behind it, possible pitfalls, and how to interpret the outcome.</p><p>Planning and Implementation of the A/B Experiment</p><p>Begin by defining the metric: the proportion of users who sign up. Once your metric is set, define the null and alternative hypotheses. The null hypothesis is that the new feature has no impact, so the signup rate in treatment equals the signup rate in control. The alternative hypothesis is that there is a difference, or more specifically, you might want to show that the signup rate is greater in the treatment group.</p><p>Randomly split users into two groups of approximately equal size. Group A (control) sees the original interface or system without the new feature; Group B (treatment) sees the new feature. By ensuring that assignment is random, you help guarantee that any external factors, such as time of day, geography, user demographics, or device type, are evenly distributed across both variants.</p><p>Run the experiment for enough time to collect a representative sample from each variant. Statistical power is necessary to detect meaningful differences reliably. Power depends on minimum detectable effect size, significance level, and sample size. If your site has a high volume of visitors, you can reach a large sample size in a shorter period. For lower traffic sites, the experiment will necessarily take longer.</p><p>After collecting data, compute the signups in each group and the proportion of signups. Denote the control group&#8217;s conversion rate (proportion of signups) as ( p_C ) with sample size ( n_C ), and the treatment group&#8217;s conversion rate as ( p_T ) with sample size ( n_T ). The quantity of primary interest is ( p_T - p_C ), the difference in signup rates.</p><p>A standard test for difference in proportions uses a Z-statistic:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7T1I!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f3a7f9f-6523-462c-aafe-7bb8b27a7754_724x260.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7T1I!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f3a7f9f-6523-462c-aafe-7bb8b27a7754_724x260.png 424w, https://substackcdn.com/image/fetch/$s_!7T1I!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f3a7f9f-6523-462c-aafe-7bb8b27a7754_724x260.png 848w, https://substackcdn.com/image/fetch/$s_!7T1I!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f3a7f9f-6523-462c-aafe-7bb8b27a7754_724x260.png 1272w, https://substackcdn.com/image/fetch/$s_!7T1I!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f3a7f9f-6523-462c-aafe-7bb8b27a7754_724x260.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7T1I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f3a7f9f-6523-462c-aafe-7bb8b27a7754_724x260.png" width="724" height="260" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3f3a7f9f-6523-462c-aafe-7bb8b27a7754_724x260.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:260,&quot;width&quot;:724,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:21361,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165093205?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f3a7f9f-6523-462c-aafe-7bb8b27a7754_724x260.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!7T1I!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f3a7f9f-6523-462c-aafe-7bb8b27a7754_724x260.png 424w, https://substackcdn.com/image/fetch/$s_!7T1I!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f3a7f9f-6523-462c-aafe-7bb8b27a7754_724x260.png 848w, https://substackcdn.com/image/fetch/$s_!7T1I!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f3a7f9f-6523-462c-aafe-7bb8b27a7754_724x260.png 1272w, https://substackcdn.com/image/fetch/$s_!7T1I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f3a7f9f-6523-462c-aafe-7bb8b27a7754_724x260.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>where ( \hat{p} ) is the pooled proportion:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9nw5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7edf43a6-eea7-4d70-9a02-bad9a2767885_393x197.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9nw5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7edf43a6-eea7-4d70-9a02-bad9a2767885_393x197.png 424w, https://substackcdn.com/image/fetch/$s_!9nw5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7edf43a6-eea7-4d70-9a02-bad9a2767885_393x197.png 848w, https://substackcdn.com/image/fetch/$s_!9nw5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7edf43a6-eea7-4d70-9a02-bad9a2767885_393x197.png 1272w, https://substackcdn.com/image/fetch/$s_!9nw5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7edf43a6-eea7-4d70-9a02-bad9a2767885_393x197.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9nw5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7edf43a6-eea7-4d70-9a02-bad9a2767885_393x197.png" width="393" height="197" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7edf43a6-eea7-4d70-9a02-bad9a2767885_393x197.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:197,&quot;width&quot;:393,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:10123,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165093205?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7edf43a6-eea7-4d70-9a02-bad9a2767885_393x197.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9nw5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7edf43a6-eea7-4d70-9a02-bad9a2767885_393x197.png 424w, https://substackcdn.com/image/fetch/$s_!9nw5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7edf43a6-eea7-4d70-9a02-bad9a2767885_393x197.png 848w, https://substackcdn.com/image/fetch/$s_!9nw5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7edf43a6-eea7-4d70-9a02-bad9a2767885_393x197.png 1272w, https://substackcdn.com/image/fetch/$s_!9nw5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7edf43a6-eea7-4d70-9a02-bad9a2767885_393x197.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Here ( X_C ) is the number of signups in the control group, and ( X_T ) is the number of signups in the treatment group.</p><p>The rationale is that under the null hypothesis that both groups come from the same distribution (same true signup probability), you can approximate the variance of the difference in proportions by assuming a binomial distribution for each group. The Z-statistic then is used to assess how many standard deviations away from zero the observed difference in proportions is. If the Z-statistic is sufficiently large (in absolute value), you reject the null hypothesis.</p><p>A p-value can then be calculated from the Z-statistic, based on the standard normal distribution. If the p-value is below the chosen significance threshold (commonly 0.05), you can conclude that the new feature leads to a statistically significant difference in signup rate.</p><p>Significance alone does not always imply practical importance. It is best to consider the magnitude of the observed effect (( p_T - p_C )) and its confidence interval. If the improvement in signups is very small, it might still be significant with a sufficiently large sample size, yet the real-world benefit might be negligible. Alternatively, if the difference is large but not statistically significant due to insufficient sample size, it may suggest running the test longer or collecting more data.</p><p>Below is an example of how you might compute a two-proportion Z-test in Python:</p><pre><code><code>import numpy as np
from statsmodels.stats.proportion import proportions_ztest

# Example numbers for demonstration
# X_C: number of signups in the control group
# X_T: number of signups in the treatment group
# n_C: total number of users in the control group
# n_T: total number of users in the treatment group

X_C = 300
X_T = 350
n_C = 2000
n_T = 2000

count = np.array([X_C, X_T])
nobs = np.array([n_C, n_T])

stat, p_value = proportions_ztest(count, nobs, alternative='two-sided')
print("Z-statistic:", stat)
print("p-value:", p_value)
</code></code></pre><p>This test uses a two-sided alternative by default. If you only wanted to test whether the new feature increases signups (and are not concerned with detecting a decrease), you could specify <code>alternative='larger'</code>.</p><p>If you prefer to use a Chi-square test for difference in proportions, you can prepare a contingency table and use <code>scipy.stats.chi2_contingency()</code>. However, the difference-of-proportions Z-test is straightforward and is usually the most direct approach.</p><p>Addressing Potential Pitfalls</p><p>A key consideration is how you define the experiment boundaries and ensure correct random assignment. For instance, you might face sample ratio mismatches if there is a glitch in randomization. Be vigilant about factors like time-based effects (weekday vs. weekend), novelty effects (users react differently simply because the feature is new), and the possibility of user overlap across variants if the system does not consistently bucket users. Another subtlety is &#8220;peeking&#8221; at the data too often, which inflates false positives. If you continuously monitor p-values, you may need sequential testing methods such as group sequential analysis or a Bayesian approach.</p><p>It is also critical to verify that your site has enough overall traffic and sufficiently large differences in signups to detect an effect. If your baseline signup rate is extremely low or high, or if you expect very minor changes, you will need to gather larger sample sizes to achieve high statistical power.</p><p>Selecting the Right Statistical Test</p><p>If the signup outcome is yes/no, a test for difference in proportions is the most straightforward. If your outcome were a continuous metric (like revenue per user, time on site, or rating on a 1&#8211;5 scale), then a t-test could be used if the normality assumptions are reasonably satisfied or if the sample sizes are large enough. For non-normal or small-sample cases, non-parametric tests (e.g., Mann-Whitney U) can be employed. However, for signups specifically, the difference-in-proportions approach is standard practice.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.rohan-paul.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">I write everyday for my readers on actionable AI. Subscribe and instantly get a 1300+ page Python book.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2><strong>How do you decide on sample size and test duration?</strong></h2><p>It is important to consider how many participants (and how long) you need to run the experiment to detect a given effect size at a desired power level and significance level. For example, if the baseline signup rate is ( p ), you want to detect an absolute increase of ( d ), your desired significance level is ( \alpha ) (often 0.05), and you want power ( 1 - \beta ) (often 0.8 or 0.9). You use standard sample size formulas or power calculators for two-proportion tests.</p><p>In practice, you can use Python&#8217;s statsmodels library, R&#8217;s pwr package, or online tools. If the baseline rate is 0.1, you want to detect an increase to 0.12, and you want 80% power at 5% significance, you can solve for ( n_C ) and ( n_T ). This ensures you don&#8217;t cut off the experiment prematurely, thus underpowering the test.</p><h2><strong>How do you handle concerns about novelty effects?</strong></h2><p>One subtlety is that users might initially respond positively or negatively just because the feature is new. Over time, people may revert to typical usage patterns. You can mitigate the novelty effect by running the experiment for a sufficiently long time so that you capture user behavior once the newness has worn off. Another approach is to track user cohorts (users in the experiment for a while vs. newly entering users) and see if the difference in signups diminishes or remains stable over time.</p><h2><strong>What if we need to stop the test early or make it adaptive?</strong></h2><p>Sometimes there is a need for early stopping if you see dramatic negative results or if the positive results are overwhelmingly significant. Traditional hypothesis testing procedures assume a fixed sample size. If you peek at the data mid-experiment, you inflate the type I error rate. Methods for adaptive experimentation like group sequential designs or Bayesian approaches with credible intervals can handle interim analyses more rigorously. These frameworks control error rates under repeated looks at the data or provide updated posterior distributions that guide early termination. Traditional frequentist A/B testing, however, generally requires that you fix a sample size and only test the hypothesis after collecting the entire sample.</p><h2><strong>When would a non-parametric or Bayesian approach be preferred?</strong></h2><p>If the underlying distribution is unknown, sample sizes are moderate, or you want a different interpretive paradigm (e.g., posterior probability that the new feature is better instead of a p-value), then Bayesian approaches might be preferred. In practice, large technology companies often rely on frequentist approaches with large sample sizes for computational convenience and well-established tooling. However, Bayesian methods can provide more intuitive statements about the probability of the treatment being better, along with built-in ability to do continuous monitoring.</p><p>For instance, if you wanted to estimate posterior distributions of the signup rate for each group, you could apply a Beta-Bernoulli model. Observations of signups (success/failure) can be treated as Bernoulli trials with Beta distributions as the prior for the rate parameter. Posterior distributions can be directly computed, updated iteratively as new data arrives, and used to evaluate the probability that the treatment outperforms the control.</p><h2><strong>How would you interpret the results if the test was not significant?</strong></h2><p>Failure to reject the null hypothesis (i.e., a &#8220;not significant&#8221; result) does not necessarily mean there is no difference. It can also imply you do not have enough evidence to conclude a difference at the chosen significance level, possibly due to insufficient statistical power. The new feature might still have a meaningful effect, but your experiment was not adequately powered to detect that effect. Often, if the feature is small or the time window is short, you may need more data or additional analyses.</p><p>Alternatively, it might mean that the feature truly does not improve signups or has no effect that is practically large enough to matter. Reviewing confidence intervals around the difference can clarify the plausible range of effects. If the entire interval is near zero, you might conclude that the feature is not particularly beneficial in terms of signups.</p><h2><strong>What if we have multiple metrics to track?</strong></h2><p>In real-world settings, you might track signups, revenue, time on site, or user satisfaction surveys. If you run the same test across multiple metrics, you risk multiple hypothesis testing inflation of type I error. Techniques such as Bonferroni correction, Holm-Bonferroni, or controlling the false discovery rate can be used to adjust significance levels. Another approach is to have a strictly defined primary metric and consider the others exploratory or secondary.</p><p>You also want to ensure that your new feature does not negatively impact key metrics. For example, you might have a &#8220;guardrail metric&#8221; like site speed. You do not want signups to improve at the cost of severely slowing down the site. Hence, advanced setups might define success as &#8220;improved signups without hurting speed.&#8221;</p><h2><strong>How do you ensure randomization remains consistent over time?</strong></h2><p>In typical web-based setups, a user gets assigned to either control or treatment on their first visit. Subsequent visits are tracked by a cookie or a user ID that ensures they always see the same variant. This is crucial for internal validity. If random assignment is not sticky, you can get contamination or repeated exposures to different variants by the same user. Proper bucketing (coherent assignment) ensures that each user consistently sees only one version.</p><p>Server-based assignment can be done by hashing user IDs into stable buckets. For example, you could do:</p><pre><code><code>import hashlib

def assign_variant(user_id):
    # Convert user_id to a string if it's not already
    user_str = str(user_id).encode('utf-8')
    # Create a hash
    result = hashlib.md5(user_str).hexdigest()
    # Convert hash to an integer for bucket assignment
    bucket = int(result, 16) % 100
    # For 50-50 split
    if bucket &lt; 50:
        return "control"
    else:
        return "treatment"
</code></code></pre><p>This ensures the same user always falls in the same bucket, guaranteeing that the user&#8217;s experience is consistent throughout the experiment.</p><h2><strong>Could you use a paired test instead if the same user sees both versions?</strong></h2><p>Ideally, in an online experiment, you do not want a single user to be exposed to both versions of the site&#8217;s interface for that same task, because it introduces confounds like learning effects. In some controlled lab studies, you might do a within-subject design and show each user both versions in randomized order, but then you must carefully account for carryover effects. For signups in a typical real-world scenario, a between-subject design is standard, so a paired test is usually not appropriate.</p><h2><strong>How do you move forward after analyzing the results?</strong></h2><p>If the p-value is below the defined threshold and the confidence intervals indicate a positive uplift, you might roll out the new feature to all users. You would also watch real-world metrics afterward to confirm that the observed uplift holds and that unexpected issues do not surface. If the test is inconclusive, you could run it longer, re-check randomization, and recalculate power. If the results suggest a negative impact, you may consider not deploying the feature or reevaluating the user experience.</p><p>If you deploy the feature to all users, it is still valuable to track longer-term outcomes, to see if the positive effects remain. Continuous monitoring of important metrics in production is often a best practice.</p><h2><strong>What if your data is heavily skewed or exhibits outliers?</strong></h2><p>With signups (binary), outliers are not typically a concern since the metric is 0/1. But for metrics like revenue per user that can be heavily skewed, a log-transform or a non-parametric approach can sometimes be used. For signups specifically, the binomial distribution assumption in a proportions test usually suffices, especially with high sample sizes.</p><h2><strong>Could you use a t-test instead for signups?</strong></h2><p>Some teams do use a t-test on binary data, with 0/1 coding of success/fail. If the sample size is large, the Central Limit Theorem suggests the sample mean can be treated as normally distributed. A two-sample t-test can approximate the difference in means. However, a direct two-proportion Z-test is typically the more canonical approach and is mathematically straightforward for binomial outcomes. The numeric results should be very similar for large samples.</p><p>Overall, the main experiment design is an A/B test with a random split between control and treatment, where your chosen success metric is the proportion of users who sign up. You then apply a difference-in-proportions statistical test, typically a two-proportion Z-test, to determine if the observed difference is significant enough to reject the null hypothesis that the new feature has no effect on signups.</p><h2><strong>How would you address confounding variables?</strong></h2><p>If the experiment is properly randomized, confounders should be evenly distributed on average. However, sometimes you might want to segment the data after the fact (e.g., by geography or device type) to see if the feature&#8217;s effect differs across subpopulations. You must be careful not to inflate type I error by looking at too many segments. Preregistration of your analysis plan can help prevent data dredging. If you suspect a confounding variable that cannot be balanced simply by randomization, you might incorporate stratified random assignment or use a more advanced approach like a matched pairs design, though those are less common for large-scale online experiments.</p><h2><strong>How do you check if your results are robust to violations of assumptions?</strong></h2><p>The two-proportion Z-test typically relies on a large-sample approximation to the normal distribution. A commonly cited rule of thumb is that you want at least five to ten successes and failures in each group for the normal approximation to be reasonable. If the sample is extremely small or the signup rate is extremely low or extremely high, exact tests (like Fisher&#8217;s exact test) or Bayesian methods might be more accurate. In large-scale online experiments (especially at big tech companies), you usually have hundreds or thousands of signups, making these approximations valid.</p><p>If you suspect that your traffic or user behavior is not homogeneous across time, consider blocking by time or analyzing day-by-day differences. If the difference in signups is consistently positive each day, it supports your results. If it flips sign, you might suspect time-based confounding or cyclical usage patterns.</p><h2><strong>What if you are concerned about negative user experience while testing?</strong></h2><p>If you fear that the new feature could degrade user experience significantly, you can do a small ramp-up. You start with a small percentage of traffic (like 1%) in treatment to mitigate risk, then gradually increase it. This approach requires caution around repeated significance testing, but it is common to do a staged rollout if you anticipate potential harm. If a quick check shows extremely negative metrics, you can roll back the new feature promptly.</p><p>All these considerations ensure that your experiment is well-defined, that you are using the right test, and that you interpret the results responsibly. The core principle remains that randomization isolates the effect of the new feature, and a well-chosen statistical test (difference-in-proportions for signups) provides a rigorous way to confirm or refute the hypothesis that the feature changes user signup behavior.</p><div><hr></div><h2><strong>Below are additional follow-up questions</strong></h2><h2><strong>What if your site experiences user growth or changes in traffic patterns during the experiment?</strong></h2><p>When the user base is growing rapidly or traffic patterns shift significantly, the composition of the incoming traffic may change halfway through the test. This can introduce biases if these new users differ in important ways from the earlier users. For instance, new users might be more likely to sign up due to higher curiosity or reduced prior exposure to the legacy site experience.</p><p>One approach is to use a &#8220;time-blocked&#8221; analysis, dividing the experiment into daily or weekly segments. You can compare the difference in signup rates within each time block. If both variants are affected similarly by the changing traffic patterns, the net effect will still hold. If there is evidence that the composition of traffic changed drastically and impacted only one variant (e.g., a marketing campaign that ran exclusively on the treatment experience), you might exclude or separately analyze that period or re-run the test to isolate the confound.</p><p>Another strategy is to monitor user characteristics (like geographic distribution, user agent, referral source) across both variants to ensure that randomization remains balanced at scale. If you see major imbalances, investigate the cause. Proper monitoring of external campaigns or events is also important to see how they might have skewed one variant.</p><h2><strong>How do you deal with multiple concurrent experiments?</strong></h2><p>Large platforms often run many experiments simultaneously, which can lead to interaction effects. For example, if one experiment changes the site layout and another experiment changes the signup workflow, the two modifications might interact in unexpected ways. This can dilute or inflate the effect you observe.</p><p>One practice is to partition your user base into mutually exclusive slices, so each user is only exposed to one experiment at a time. This avoids direct interference between tests but requires more users overall to power each experiment. Alternatively, some organizations allow overlapping experiments but carefully track experiment intersections. They may do a post-hoc analysis of any sub-population that is in both experiments.</p><p>If your experiment intersects with many others, you could see an unexplainable difference in signups, or you might fail to detect a real difference because the second experiment dilutes the effect. To mitigate this, design a thorough plan for experiment assignment, ensuring that high-priority tests are isolated and that any overlap is intentional, well-measured, and large enough to detect interactions if they exist.</p><h2><strong>What if the signup process has multiple steps and you want to measure completion at each stage?</strong></h2><p>In reality, &#8220;signups&#8221; might not be a single binary event but a multi-step funnel. For example, users might fill out a form, confirm their email, and then create a profile. If your new feature only affects the initial step (like an eye-catching prompt), you could see more initial form starts but not necessarily an increase in confirmed signups if users drop out in the later stages.</p><p>A good practice is to measure the drop-off rate at each funnel step. That way, you can pinpoint whether the feature is improving the start of the signup funnel without proportionally improving completions. If you find that funnel completion remains low for the treatment, you can investigate friction points in subsequent steps. Sometimes, a combined product strategy is needed: the new feature that drives more initial conversions plus a redesigned verification step that ensures higher final completions.</p><p>Statistically, you can perform a difference-in-proportions test on each step or use an approach that models funnel stages as conditional probabilities. This helps you identify exactly where the user journey is improved or still has bottlenecks.</p><h2><strong>What if the new feature changes which demographic segments are more likely to sign up?</strong></h2><p>Sometimes a new feature resonates strongly with a particular demographic (e.g., mobile users, a certain geographic region, or a particular age group). If randomization was done per user, each demographic should be balanced in control and treatment overall, but the effect on signups might not be uniform across all segments. You could see a sizable improvement in one segment and a negligible (or even negative) effect in others.</p><p>You can do a segment analysis, splitting results by demographic attributes (when available). However, analyzing many segments inflates the risk of false positives due to multiple comparisons. Carefully define a small number of primary segments in advance if you believe the effect might vary. If you see that the feature helps only a niche segment, you might consider a targeted rollout for that group. Or if a segment is negatively impacted, you might refine the feature to better serve them.</p><p>Be aware that your main metric (overall signup rate) could still be significant even if the effect is concentrated in a small user group, provided that group is sufficiently large to drive the overall difference. Conversely, a strong positive effect in a small segment might be diluted in the overall result.</p><h2><strong>How do you weigh user privacy or data protection concerns in the experiment design?</strong></h2><p>In many jurisdictions, experimentation involving user data must comply with privacy regulations such as GDPR or CCPA. Collecting personal data or storing user behavior for analysis must respect user consent and data minimization principles. If your test design requires storing new or sensitive attributes, make sure you have a lawful basis. Anonymize data wherever possible by storing minimal identifiers or aggregated metrics rather than raw event logs.</p><p>When randomizing users, ensure that user IDs or any hashed identifiers are handled securely and not directly tied to personal information in your analytics environment. If you must analyze segments like location or age, see if that data can be aggregated or bucketed to reduce risk of identification. Furthermore, ensure that any data retention policies are followed: once the experiment is concluded, older granular logs might need to be deleted or further anonymized.</p><h2><strong>How can you measure user satisfaction or sentiment in addition to signups?</strong></h2><p>Although signups are a critical metric, a new feature might frustrate or annoy users even if it boosts immediate conversions. You might track user sentiment through satisfaction surveys, Net Promoter Score (NPS), helpdesk tickets, or social media mentions. If you detect that the new feature leads to a spike in negative feedback, that might outweigh the boost in signups.</p><p>In practice, you can incorporate a short survey on the site (though this can have selection bias) or look at user retention metrics after signups. If signups go up but retention plummets, it suggests that while you got people to sign up, they aren&#8217;t staying. You could also track user engagement after the signup, measuring metrics like active days over the following weeks. This ensures you have a holistic view of user experience, not just initial conversions.</p><h2><strong>How do you factor engineering maintenance cost or complexity into decisions?</strong></h2><p>Even if the new feature shows a statistically significant signup uplift, it might be complex to maintain or scale. For instance, it may require specialized infrastructure, third-party integrations, or constant content updates. The engineering team&#8217;s time could be better spent on simpler or more impactful features.</p><p>You might conduct a cost-benefit analysis that includes the projected additional signups or revenue from those signups versus the engineering and maintenance overhead. If the net benefit remains positive, that justifies rolling out the feature broadly. Otherwise, you might consider refining the design for simpler maintenance. Sometimes, a substantial positive effect can justify a complicated rollout, but be sure you have enough resources to maintain performance, security, and reliability.</p><h2><strong>How do you address day-of-week or seasonal variations in signups?</strong></h2><p>User behavior might vary significantly between weekdays and weekends, or during holiday seasons versus normal times. If your experiment starts on a Monday and ends on a Friday two weeks later, you might not capture weekend behavior. If the experiment accidentally includes a major holiday sale or marketing campaign that skews traffic, you might see artificial spikes.</p><p>To handle day-of-week or seasonal variation, run the experiment for at least one full cycle of user behavior. For daily cycles, you might need multiple days to ensure each weekday and weekend is represented. For monthly or seasonal cycles, you might extend it longer. You can also analyze conversions by day-of-week, checking whether the difference is consistent. If you see a difference on weekdays but not weekends, you might do a deeper investigation to see if the new feature only appeals to weekday traffic.</p><h2><strong>How do you detect and handle spam or bot signups?</strong></h2><p>Some websites see a portion of signups from bots or spam accounts. If these bots are not distributed uniformly across the control and treatment groups, it can skew results. For instance, a malicious actor might specifically target the new feature if it is more vulnerable to automation or scraping.</p><p>One strategy is to filter out suspicious signups using bot-detection heuristics or CAPTCHAs. Randomization helps, but if bots are triggered by the presence of the new feature, the groups are no longer comparable. You could exclude obviously fraudulent signups from the analysis, but be transparent about how you define &#8220;fraudulent.&#8221; Ensure that any filtering logic is consistent and does not inadvertently introduce bias. If you suspect your data has been heavily contaminated, it might be necessary to re-run the experiment after tightening security.</p><h2><strong>How do you handle partial exposure if some users block the new feature?</strong></h2><p>If the new feature relies on JavaScript or certain third-party scripts, users with strict privacy settings, content blockers, or ad blockers might never see it. This leads to partial exposure in the treatment group: a portion of the assigned treatment users effectively remain on something close to the control experience.</p><p>You can tag user sessions to detect whether the new feature was actually rendered. Then you can analyze your results on a per-protocol basis (only among those actually exposed) or via an &#8220;intent-to-treat&#8221; framework (everyone assigned to treatment, regardless of whether they saw it). The typical approach in A/B testing is an intent-to-treat analysis, which might dilute the measured effect size but preserves randomization. You can also look at &#8220;compliance&#8221; rates: the fraction of treatment users who actually see the feature. If it&#8217;s very low, you may need to investigate why, or re-evaluate if the feature can be robust to ad blockers.</p><h2><strong>How does changing the design or code mid-test affect validity?</strong></h2><p>If you pivot halfway through the experiment&#8212;perhaps redesigning the new feature or patching a bug&#8212;this can undermine the assumption of consistent treatment. The data from before and after the change might not be comparable. In many organizations, you would stop the experiment, fix the feature, and restart it to ensure a clean test.</p><p>If you must fix a critical bug, clearly document the time of the change and the nature of the fix, then either exclude the data before the fix or treat the experiment as two separate phases. Some advanced statistical methods can model an intervention point, but usually it is safer to run a stable experiment with minimal changes during the data collection window.</p><h2><strong>How do you handle a dynamic environment where other site elements regularly change?</strong></h2><p>If your site is highly dynamic, with new content or marketing campaigns rolling out daily, it becomes challenging to isolate the effect of your single feature. One approach is to keep the control and treatment experiences as similar as possible except for the tested feature, while all other changes apply to both groups equally. Ensure you version control your site or app so that every user in control vs. treatment sees the same baseline plus the respective feature difference.</p><p>When external changes are unavoidable, document them. You can check if major site changes coincided with unexpected fluctuations in conversions for one variant. If the randomization is done properly and these changes affect both variants equally, the net difference should still be valid. In a real-world environment, it&#8217;s about controlling as many confounding variables as feasible and monitoring the rest.</p><h2><strong>How do you approach testing across multiple products or domains?</strong></h2><p>In large organizations, the same new feature might be deployed across multiple products, each with different user segments or usage patterns. You could pool data if you assume that the effect of the feature is similar across domains, but that might mask product-specific differences. Alternatively, you can stratify by product line or domain and look at the effect in each place separately, then combine the results using a meta-analysis approach.</p><p>A meta-analysis calculates a weighted average of the effect sizes, weighting by sample size or other metrics. This lets you see if the new feature is consistently beneficial across all products or if some products see bigger gains than others. If you find large heterogeneity, you might decide to roll out the feature only to the product lines that benefit.</p><h2><strong>How do you interpret a confidence interval that just barely crosses zero?</strong></h2><p>When your confidence interval for the difference in signup rates is something like [-0.1%, +0.2%], it might straddle zero in a way that suggests the effect could be negative, negligible, or positive. If you are using a 95% confidence interval, crossing zero indicates that, statistically, you cannot rule out zero effect at the 5% significance level.</p><p>However, it might be very close to significance. You could consider running the experiment longer to gain more precise estimates. Alternatively, if your domain knowledge suggests even a small positive effect is valuable, you might deploy the feature. Or if you want absolute certainty, you might not proceed until you have stronger evidence. The decision depends on your risk tolerance, the cost of implementing the feature, and how critical an error would be if you incorrectly conclude that it helps.</p><h2><strong>What if the effect is significant only in a narrow user segment?</strong></h2><p>If your overall results are inconclusive, but a specific user segment (e.g., mobile Android users in a certain region) shows a clear improvement, you could consider a targeted rollout for that segment. This approach can extract maximum benefit where it is most relevant while avoiding potential negative or neutral impact on other segments.</p><p>Before you do so, be sure the segment-based effect is not a fluke. Multiple subgroup analyses can lead to random false positives. Confirm you had a hypothesis that this segment might respond differently, or run a follow-up experiment specifically in that segment. From a business perspective, targeted rollouts can reduce risk. But keep in mind the engineering overhead of maintaining multiple versions.</p><h2><strong>How do you ensure accuracy in your logging or analytics pipeline?</strong></h2><p>For large-scale systems, data ingestion often involves multiple services&#8212;front-end logs, back-end events, ETL pipelines&#8212;before analysis. A single bug in any step could cause missing or duplicated data. You might see mismatched counts between signups and assigned variants if logs fail to record events properly.</p><p>One best practice is to maintain robust monitoring and alerting. Track key metrics in real time (or near real time) to spot unusual patterns like a sudden drop in recorded signups or an unexpected spike in the proportion of users assigned to treatment. Perform periodic QA checks by comparing data from different sources (e.g., front-end vs. back-end) to confirm consistency. If you detect serious discrepancies, you may need to pause the experiment and fix the instrumentation.</p><h2><strong>How do you handle contamination if control users accidentally see the treatment feature?</strong></h2><p>Contamination occurs if a subset of control users is exposed to the new feature due to a deployment bug or if they share a device with a treatment user. This violates the assumption that the control group has no exposure to the treatment. The measured effect size might be reduced because the control group partially behaves like the treatment group.</p><p>You can try to detect contamination by logging which interface each user session actually saw. If contamination is minor, you can continue with an intent-to-treat analysis but note that the effect might be underestimated. In severe cases, you may need to discard contaminated sessions or re-run the experiment after fixing the bug. Another solution is to randomize at a higher level, such as device ID or household, if shared access is common.</p><h2><strong>What if multiple users share the same device or IP, violating the independence assumption?</strong></h2><p>When testing on websites accessible by shared computers&#8212;for instance, libraries, family households, or workplaces&#8212;multiple people might appear to be the same &#8220;user&#8221; from an IP or device standpoint. This correlation means your assumption that each user is an independent observation could be violated, leading to narrower confidence intervals than warranted.</p><p>If you have stable user login accounts, randomize based on unique logged-in IDs. If that is not possible, randomize by device fingerprint or IP, which is a weaker approximation but still lumps all visits from that device into the same variant. You could also consider more advanced approaches that model the correlation explicitly, though that is less common in standard A/B testing frameworks.</p><h2><strong>How do you incorporate domain knowledge or business context in deciding the final rollout?</strong></h2><p>Statistical significance alone does not dictate business strategy. Suppose your feature yields a tiny but significant increase in signups, yet the product roadmap prioritizes other features with potentially larger returns. Alternatively, you might have brand or design guidelines that override a purely data-driven approach if the new feature conflicts with the company&#8217;s long-term vision.</p><p>In practice, a product manager and a cross-functional team weigh the measured impact, user experience, technical costs, and alignment with strategic goals. Even if the test is not definitively significant, if domain experts believe the feature strongly fits user needs, the company might proceed with a partial or full rollout. Statistical tests are a tool to inform decisions, not the sole factor.</p><h2><strong>Could a multi-armed bandit be more suitable than a fixed A/B test?</strong></h2><p>A multi-armed bandit approach continuously shifts traffic toward the better-performing variant, rather than sticking to a fixed split for the entire test duration. If your traffic is large and you want to minimize the opportunity cost of continuing to send users to a suboptimal variant, bandit algorithms can automatically allocate more traffic to promising treatments.</p><p>However, bandits have trade-offs: they assume stationarity (the best arm does not change drastically over time) and can be slower to gather unbiased data about less-shown variants. If your only goal is to precisely measure the difference in signups, a standard A/B test with fixed allocations and a clear hypothesis might be simpler. If your priority is quickly maximizing conversions rather than specifically measuring the effect size, multi-armed bandits are appealing.</p><h2><strong>How do you handle delayed signups that occur in future sessions?</strong></h2><p>Some features might spark interest but not lead to an immediate signup. Users might come back days or weeks later to complete the process. If you only measure signups within the first session or first day, you could miss this delayed effect.</p><p>One approach is to track users for a defined window (e.g., 7 or 14 days) after first exposure. That means if a user in the treatment group is exposed to the new feature on day one, but actually signs up on day four, you still attribute that signup to the correct bucket. You need consistent user IDs across sessions. If a large fraction of signups happen long after first exposure, you might extend the observation window. This lengthens your experiment but gives a more comprehensive measure of the feature&#8217;s true impact.</p><h2><strong>What if most signups come from a small, highly engaged subset?</strong></h2><p>If a small minority of very engaged users (like power users or loyal fans) drive the majority of signups, they might overshadow the general user base. Even though you randomly assign all users, the small fraction of highly motivated signers might mask the effect of the feature on typical users.</p><p>You can look at segmenting by engagement level, based on the user&#8217;s prior activity. Check if the feature helps moderate or low-engagement users. Alternatively, if your target is to increase signups among new or casual visitors, you might specifically focus your analysis on that segment. However, interpret these segment-level analyses with caution, watching out for multiple comparison issues.</p><h2><strong>How do you avoid double counting if a user sees the feature multiple times before signing up?</strong></h2><p>If your analytics count a signup each time a user hits the signup button, you might overestimate. In many systems, a user might attempt signup on multiple visits but only succeed once. Ensure you track unique user signups and the first time they appear in your dataset. Typically, an event-based tracking system will log the user&#8217;s actual conversion event once, keyed by a unique user ID.</p><p>Also consider that if your user sees the new feature multiple times, you still only want to count a single successful signup. Some organizations store a boolean &#8220;has user signed up?&#8221; attribute in a user profile. Once it&#8217;s set to True, further signups from that ID are not incremented. This approach ensures each user&#8217;s conversion is counted once.</p><h2><strong>How do you measure longer-term engagement rather than just immediate signups?</strong></h2><p>Sometimes you want to look beyond whether the user signed up to see if they remain active or if churn increases. For instance, a user might sign up due to a flashy new feature but then never return. Or a slower, more thoughtful signup process might lead to more committed users.</p><p>One method is to define a retention metric, such as &#8220;user is active 7 days after signup.&#8221; You can then test if the new feature leads to better or worse 7-day retention. If your experiment reveals an immediate conversion lift but a subsequent retention drop, you might question the net benefit. You might also track the user&#8217;s lifetime value (LTV), which can be measured if you have a known monetization model. This gives a fuller picture of the feature&#8217;s real impact on your business.</p><h2><strong>How do you detect or correct for instrumentation or assignment bugs after the fact?</strong></h2><p>It&#8217;s not uncommon to discover mid-experiment that, for example, 10% of the treatment users were never shown the new feature or that the random assignment logic was flawed. You can attempt to do an &#8220;as-treated&#8221; analysis, restricting the data to users who definitely saw the feature. However, this can break randomization if the subset is systematically different. An alternative approach is an &#8220;intent-to-treat&#8221; analysis, acknowledging that some portion of assigned users did not receive the correct exposure. This might reduce the observed effect size.</p><p>If the bug is serious enough, you might discard the entire data set and restart the experiment properly. In some cases, you can do partial corrections by removing obviously impacted user sessions, but be very transparent about the potential biases introduced. In high-stakes decisions, repeated testing or multiple lines of evidence (e.g., multiple regions or subgroups) can bolster confidence.</p><h2><strong>How do you finalize the experiment without explicit introduction or conclusion?</strong></h2><p>Once all the data is collected, you compile your findings: the difference in signup rates, confidence intervals, p-values, potential segment insights, and any secondary metrics (e.g., retention, user satisfaction). You present them to stakeholders, typically in a results document or dashboard. Based on the significance and practical relevance of the changes in signups, plus any cost or product considerations, you make a go/no-go decision on rolling out the new feature. Then the experiment is considered complete.</p>]]></content:encoded></item><item><title><![CDATA[ML Interview Q Series: Bayesian Estimation of Low Disease Prevalence from Zero Observed Cases]]></title><description><![CDATA[Browse all the Probability Interview Questions here.]]></description><link>https://www.rohan-paul.com/p/ml-interview-q-series-bayesian-estimation-e8f</link><guid isPermaLink="false">https://www.rohan-paul.com/p/ml-interview-q-series-bayesian-estimation-e8f</guid><pubDate>Tue, 03 Jun 2025 12:50:21 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!zvbZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F524f6e2f-71cd-4720-b366-de776efbe362_1920x1080.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zvbZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F524f6e2f-71cd-4720-b366-de776efbe362_1920x1080.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zvbZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F524f6e2f-71cd-4720-b366-de776efbe362_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!zvbZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F524f6e2f-71cd-4720-b366-de776efbe362_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!zvbZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F524f6e2f-71cd-4720-b366-de776efbe362_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!zvbZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F524f6e2f-71cd-4720-b366-de776efbe362_1920x1080.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zvbZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F524f6e2f-71cd-4720-b366-de776efbe362_1920x1080.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/524f6e2f-71cd-4720-b366-de776efbe362_1920x1080.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1908898,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165088957?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F524f6e2f-71cd-4720-b366-de776efbe362_1920x1080.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zvbZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F524f6e2f-71cd-4720-b366-de776efbe362_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!zvbZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F524f6e2f-71cd-4720-b366-de776efbe362_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!zvbZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F524f6e2f-71cd-4720-b366-de776efbe362_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!zvbZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F524f6e2f-71cd-4720-b366-de776efbe362_1920x1080.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Browse all the <strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">Probability Interview Questions here</a></strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">.</a></p><h2><strong>8. Estimate the disease probability in one city, given that the probability is very low nationwide. You randomly asked 1000 people in this city, and all tested negative (no disease). What is the probability of the disease in this city?</strong></h2><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://x.com/rohanpaul_ai&quot;,&quot;text&quot;:&quot;Connect with me on X (Twitter)&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://x.com/rohanpaul_ai"><span>Connect with me on X (Twitter)</span></a></p><p>Understanding the question</p><p>The question is about estimating the probability of a certain disease in a city, given that:</p><ul><li><p>Nationwide, the disease probability is very low.</p></li><li><p>We randomly sampled 1000 people from this city.</p></li><li><p>All 1000 tested negative for the disease.</p></li></ul><p>We want to combine the prior knowledge (that the disease is rare) with the observed data (0 positives in 1000 tests) to arrive at an estimate of the disease probability for this city. The question implicitly invites either a frequentist-style confidence bound or a Bayesian update approach. Both can be used here. The key points are:</p><ul><li><p>If one uses a frequentist approach (like the Clopper-Pearson interval), the maximum likelihood estimate (MLE) is 0. But the confidence interval might give us an upper bound on what the true disease rate could be.</p></li><li><p>If one uses a Bayesian approach with a Beta prior (or another appropriate prior), the posterior distribution after observing 1000 negatives can guide us to a posterior credible interval or posterior mean.</p></li></ul><p>Below, we explore both perspectives.</p><p>Frequentist viewpoint</p><p>Under a classical binomial setting, assume the city has an unknown disease prevalence p. We sample 1000 independent individuals, each with probability p of having the disease. If X is the number of positive cases out of 1000 tested:</p><ul><li><p><em>X</em> follows a Binomial distribution with parameters (n=1000,p).</p></li></ul><p>The number of positives we observed is 0. The probability of observing exactly 0 positives is:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2Ex_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17a6d23c-2ff9-4bbc-b866-342d20c3fb4b_623x144.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2Ex_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17a6d23c-2ff9-4bbc-b866-342d20c3fb4b_623x144.png 424w, https://substackcdn.com/image/fetch/$s_!2Ex_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17a6d23c-2ff9-4bbc-b866-342d20c3fb4b_623x144.png 848w, https://substackcdn.com/image/fetch/$s_!2Ex_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17a6d23c-2ff9-4bbc-b866-342d20c3fb4b_623x144.png 1272w, https://substackcdn.com/image/fetch/$s_!2Ex_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17a6d23c-2ff9-4bbc-b866-342d20c3fb4b_623x144.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2Ex_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17a6d23c-2ff9-4bbc-b866-342d20c3fb4b_623x144.png" width="623" height="144" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/17a6d23c-2ff9-4bbc-b866-342d20c3fb4b_623x144.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:144,&quot;width&quot;:623,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:10816,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165088957?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17a6d23c-2ff9-4bbc-b866-342d20c3fb4b_623x144.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2Ex_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17a6d23c-2ff9-4bbc-b866-342d20c3fb4b_623x144.png 424w, https://substackcdn.com/image/fetch/$s_!2Ex_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17a6d23c-2ff9-4bbc-b866-342d20c3fb4b_623x144.png 848w, https://substackcdn.com/image/fetch/$s_!2Ex_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17a6d23c-2ff9-4bbc-b866-342d20c3fb4b_623x144.png 1272w, https://substackcdn.com/image/fetch/$s_!2Ex_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17a6d23c-2ff9-4bbc-b866-342d20c3fb4b_623x144.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!IORl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f06d877-ee45-4402-bd96-8e48af8e8712_935x723.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!IORl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f06d877-ee45-4402-bd96-8e48af8e8712_935x723.png 424w, https://substackcdn.com/image/fetch/$s_!IORl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f06d877-ee45-4402-bd96-8e48af8e8712_935x723.png 848w, https://substackcdn.com/image/fetch/$s_!IORl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f06d877-ee45-4402-bd96-8e48af8e8712_935x723.png 1272w, https://substackcdn.com/image/fetch/$s_!IORl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f06d877-ee45-4402-bd96-8e48af8e8712_935x723.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!IORl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f06d877-ee45-4402-bd96-8e48af8e8712_935x723.png" width="935" height="723" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4f06d877-ee45-4402-bd96-8e48af8e8712_935x723.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:723,&quot;width&quot;:935,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:129607,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165088957?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f06d877-ee45-4402-bd96-8e48af8e8712_935x723.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!IORl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f06d877-ee45-4402-bd96-8e48af8e8712_935x723.png 424w, https://substackcdn.com/image/fetch/$s_!IORl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f06d877-ee45-4402-bd96-8e48af8e8712_935x723.png 848w, https://substackcdn.com/image/fetch/$s_!IORl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f06d877-ee45-4402-bd96-8e48af8e8712_935x723.png 1272w, https://substackcdn.com/image/fetch/$s_!IORl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f06d877-ee45-4402-bd96-8e48af8e8712_935x723.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>to get the upper limit. The approximate outcome is indeed on the order of 3/n. This approximation is a quick rule of thumb that is well known in epidemiological applications.</p><p>Bayesian viewpoint</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4abX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3156557-3b5c-4e4c-bea8-2210a7b4e24b_927x641.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4abX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3156557-3b5c-4e4c-bea8-2210a7b4e24b_927x641.png 424w, https://substackcdn.com/image/fetch/$s_!4abX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3156557-3b5c-4e4c-bea8-2210a7b4e24b_927x641.png 848w, https://substackcdn.com/image/fetch/$s_!4abX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3156557-3b5c-4e4c-bea8-2210a7b4e24b_927x641.png 1272w, https://substackcdn.com/image/fetch/$s_!4abX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3156557-3b5c-4e4c-bea8-2210a7b4e24b_927x641.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4abX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3156557-3b5c-4e4c-bea8-2210a7b4e24b_927x641.png" width="927" height="641" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e3156557-3b5c-4e4c-bea8-2210a7b4e24b_927x641.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:641,&quot;width&quot;:927,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:123869,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165088957?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3156557-3b5c-4e4c-bea8-2210a7b4e24b_927x641.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!4abX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3156557-3b5c-4e4c-bea8-2210a7b4e24b_927x641.png 424w, https://substackcdn.com/image/fetch/$s_!4abX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3156557-3b5c-4e4c-bea8-2210a7b4e24b_927x641.png 848w, https://substackcdn.com/image/fetch/$s_!4abX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3156557-3b5c-4e4c-bea8-2210a7b4e24b_927x641.png 1272w, https://substackcdn.com/image/fetch/$s_!4abX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3156557-3b5c-4e4c-bea8-2210a7b4e24b_927x641.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3JUA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b5cf38a-0a1e-4e75-a99e-0b737a963fef_947x488.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3JUA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b5cf38a-0a1e-4e75-a99e-0b737a963fef_947x488.png 424w, https://substackcdn.com/image/fetch/$s_!3JUA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b5cf38a-0a1e-4e75-a99e-0b737a963fef_947x488.png 848w, https://substackcdn.com/image/fetch/$s_!3JUA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b5cf38a-0a1e-4e75-a99e-0b737a963fef_947x488.png 1272w, https://substackcdn.com/image/fetch/$s_!3JUA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b5cf38a-0a1e-4e75-a99e-0b737a963fef_947x488.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3JUA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b5cf38a-0a1e-4e75-a99e-0b737a963fef_947x488.png" width="947" height="488" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8b5cf38a-0a1e-4e75-a99e-0b737a963fef_947x488.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:488,&quot;width&quot;:947,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:46223,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165088957?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b5cf38a-0a1e-4e75-a99e-0b737a963fef_947x488.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!3JUA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b5cf38a-0a1e-4e75-a99e-0b737a963fef_947x488.png 424w, https://substackcdn.com/image/fetch/$s_!3JUA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b5cf38a-0a1e-4e75-a99e-0b737a963fef_947x488.png 848w, https://substackcdn.com/image/fetch/$s_!3JUA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b5cf38a-0a1e-4e75-a99e-0b737a963fef_947x488.png 1272w, https://substackcdn.com/image/fetch/$s_!3JUA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b5cf38a-0a1e-4e75-a99e-0b737a963fef_947x488.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xu5Z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1566eb6a-cdfa-43c9-826a-ff3f0887ad23_921x260.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xu5Z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1566eb6a-cdfa-43c9-826a-ff3f0887ad23_921x260.png 424w, https://substackcdn.com/image/fetch/$s_!xu5Z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1566eb6a-cdfa-43c9-826a-ff3f0887ad23_921x260.png 848w, https://substackcdn.com/image/fetch/$s_!xu5Z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1566eb6a-cdfa-43c9-826a-ff3f0887ad23_921x260.png 1272w, https://substackcdn.com/image/fetch/$s_!xu5Z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1566eb6a-cdfa-43c9-826a-ff3f0887ad23_921x260.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xu5Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1566eb6a-cdfa-43c9-826a-ff3f0887ad23_921x260.png" width="921" height="260" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1566eb6a-cdfa-43c9-826a-ff3f0887ad23_921x260.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:260,&quot;width&quot;:921,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:61725,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165088957?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1566eb6a-cdfa-43c9-826a-ff3f0887ad23_921x260.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!xu5Z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1566eb6a-cdfa-43c9-826a-ff3f0887ad23_921x260.png 424w, https://substackcdn.com/image/fetch/$s_!xu5Z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1566eb6a-cdfa-43c9-826a-ff3f0887ad23_921x260.png 848w, https://substackcdn.com/image/fetch/$s_!xu5Z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1566eb6a-cdfa-43c9-826a-ff3f0887ad23_921x260.png 1272w, https://substackcdn.com/image/fetch/$s_!xu5Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1566eb6a-cdfa-43c9-826a-ff3f0887ad23_921x260.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Practical interpretation</p><p>Either way, the probability of the disease in the city is going to be extremely low. If we want a simple frequentist upper bound, we can say something around 0.3% with 95% confidence. Or if we have a Bayesian prior that the disease was extremely rare, the posterior might center around something even lower, e.g. 0.1% or below.</p><p>In real-world applications, we often also consider:</p><ul><li><p>False negatives (test sensitivity). If the test is not perfect, the probability of detecting a diseased individual is less than 1, and that must be factored in carefully.</p></li><li><p>Demographic or sampling biases. If you tested 1000 people in a non-representative sample of the city, the estimate may not reflect the city as a whole.</p></li><li><p>Temporal aspects. Maybe the disease is cyclical or has seasonal variations, so the timing of testing could matter.</p></li></ul><p>Nevertheless, from a straightforward binomial perspective, seeing 0 positives in 1000 tests strongly suggests that the prevalence is at most a few tenths of a percent, and likely lower if we consider prior knowledge that it is &#8220;very low nationwide.&#8221;</p><p>How one might compute it in code</p><p>Below is a small Python snippet that sketches out a Bayesian update for a Beta prior, assuming a uniform prior Beta(1,1) for demonstration. In practice, you would set different hyperparameters to reflect that the disease is rare:</p><pre><code><code>import numpy as np
from scipy.stats import beta

# Observations
n = 1000  # total tested
x = 0     # total positives

# Prior parameters (for a uniform prior: alpha=1, beta=1)
alpha_prior = 1
beta_prior = 1

# Posterior parameters
alpha_post = alpha_prior + x
beta_post  = beta_prior  + n - x

# Posterior mean
posterior_mean = alpha_post / (alpha_post + beta_post)
print("Posterior mean =", posterior_mean)

# 95% credible interval using the Beta distribution's ppf (percent point function)
lower_bound = beta.ppf(0.025, alpha_post, beta_post)
upper_bound = beta.ppf(0.975, alpha_post, beta_post)

print("95% Credible Interval: [{}, {}]".format(lower_bound, upper_bound))
</code></code></pre><p>In this illustration, if we choose a uniform prior Beta(1,1), then after 0 positives in 1000 tests, we end up with Beta(1, 1001). The posterior mean is about 1/1002 &#8776; 0.000997, or roughly 0.1%. The 95% credible interval will be from 0 to around 0.003, paralleling the frequentist confidence interval result.</p><p>This kind of code snippet demonstrates how you might practically estimate the probability in a Bayesian framework. If you believe the disease to be much rarer, you adjust the prior (alpha, beta) accordingly.</p><p>Likely final numeric answer</p><p>From a standard quick approach:</p><ul><li><p>The frequentist rule of thumb says the disease probability in the city is most likely 0, but it is no bigger than about 0.003 (0.3%) with 95% confidence.</p></li><li><p>A Bayesian approach with a uniform prior would yield a posterior mean around 0.001 (0.1%), with a similar upper bound on the credible interval near 0.003. A more skeptical prior about disease prevalence (e.g., mean ~ 0.0001) might yield an even smaller posterior estimate.</p></li></ul><p>Hence, the straightforward conclusion is that the probability is probably on the order of a fraction of a percent, with an upper bound that can be a few tenths of a percent depending on the specifics of the method used.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.rohan-paul.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">I write everyday for my readers on actionable AI. Subscribe and instantly get a 1300+ page Python book.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2><strong>If the interviewer asks: &#8220;Why not just say the probability is zero since we saw zero cases?&#8221;</strong></h2><p>It&#8217;s true that the maximum likelihood estimate from the binomial model is 0. However, an estimate of exactly 0 is typically not realistic in practical epidemiological settings. There could be unobserved cases, sampling biases, or imperfect test sensitivities. Statistically, we also know we cannot prove the probability is exactly zero from finite data. Hence, we provide an interval or a posterior distribution that shows how small p can be while remaining consistent with zero observed positives in 1000 trials. The estimate is near zero, but not strictly zero.</p><h2><strong>If the interviewer asks: &#8220;How do you get that approximate bound of 3/n for zero positives?&#8221;</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JO7C!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd5d07cc-6a77-494b-991a-1e6e1820432f_929x337.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JO7C!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd5d07cc-6a77-494b-991a-1e6e1820432f_929x337.png 424w, https://substackcdn.com/image/fetch/$s_!JO7C!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd5d07cc-6a77-494b-991a-1e6e1820432f_929x337.png 848w, https://substackcdn.com/image/fetch/$s_!JO7C!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd5d07cc-6a77-494b-991a-1e6e1820432f_929x337.png 1272w, https://substackcdn.com/image/fetch/$s_!JO7C!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd5d07cc-6a77-494b-991a-1e6e1820432f_929x337.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JO7C!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd5d07cc-6a77-494b-991a-1e6e1820432f_929x337.png" width="929" height="337" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cd5d07cc-6a77-494b-991a-1e6e1820432f_929x337.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:337,&quot;width&quot;:929,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:79803,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165088957?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd5d07cc-6a77-494b-991a-1e6e1820432f_929x337.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!JO7C!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd5d07cc-6a77-494b-991a-1e6e1820432f_929x337.png 424w, https://substackcdn.com/image/fetch/$s_!JO7C!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd5d07cc-6a77-494b-991a-1e6e1820432f_929x337.png 848w, https://substackcdn.com/image/fetch/$s_!JO7C!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd5d07cc-6a77-494b-991a-1e6e1820432f_929x337.png 1272w, https://substackcdn.com/image/fetch/$s_!JO7C!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd5d07cc-6a77-494b-991a-1e6e1820432f_929x337.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>If the interviewer asks: &#8220;What if the test has a non-negligible false negative rate?&#8221;</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!UjIu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdfcab85-bd9a-43b9-a16b-8657f6731a4f_957x726.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!UjIu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdfcab85-bd9a-43b9-a16b-8657f6731a4f_957x726.png 424w, https://substackcdn.com/image/fetch/$s_!UjIu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdfcab85-bd9a-43b9-a16b-8657f6731a4f_957x726.png 848w, https://substackcdn.com/image/fetch/$s_!UjIu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdfcab85-bd9a-43b9-a16b-8657f6731a4f_957x726.png 1272w, https://substackcdn.com/image/fetch/$s_!UjIu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdfcab85-bd9a-43b9-a16b-8657f6731a4f_957x726.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!UjIu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdfcab85-bd9a-43b9-a16b-8657f6731a4f_957x726.png" width="957" height="726" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bdfcab85-bd9a-43b9-a16b-8657f6731a4f_957x726.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:726,&quot;width&quot;:957,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:150824,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165088957?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdfcab85-bd9a-43b9-a16b-8657f6731a4f_957x726.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!UjIu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdfcab85-bd9a-43b9-a16b-8657f6731a4f_957x726.png 424w, https://substackcdn.com/image/fetch/$s_!UjIu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdfcab85-bd9a-43b9-a16b-8657f6731a4f_957x726.png 848w, https://substackcdn.com/image/fetch/$s_!UjIu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdfcab85-bd9a-43b9-a16b-8657f6731a4f_957x726.png 1272w, https://substackcdn.com/image/fetch/$s_!UjIu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdfcab85-bd9a-43b9-a16b-8657f6731a4f_957x726.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!B6uI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff8c2f9e-413d-4822-a1d2-6f22dd5d9ed3_946x203.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!B6uI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff8c2f9e-413d-4822-a1d2-6f22dd5d9ed3_946x203.png 424w, https://substackcdn.com/image/fetch/$s_!B6uI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff8c2f9e-413d-4822-a1d2-6f22dd5d9ed3_946x203.png 848w, https://substackcdn.com/image/fetch/$s_!B6uI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff8c2f9e-413d-4822-a1d2-6f22dd5d9ed3_946x203.png 1272w, https://substackcdn.com/image/fetch/$s_!B6uI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff8c2f9e-413d-4822-a1d2-6f22dd5d9ed3_946x203.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!B6uI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff8c2f9e-413d-4822-a1d2-6f22dd5d9ed3_946x203.png" width="946" height="203" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ff8c2f9e-413d-4822-a1d2-6f22dd5d9ed3_946x203.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:203,&quot;width&quot;:946,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:26406,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165088957?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff8c2f9e-413d-4822-a1d2-6f22dd5d9ed3_946x203.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!B6uI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff8c2f9e-413d-4822-a1d2-6f22dd5d9ed3_946x203.png 424w, https://substackcdn.com/image/fetch/$s_!B6uI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff8c2f9e-413d-4822-a1d2-6f22dd5d9ed3_946x203.png 848w, https://substackcdn.com/image/fetch/$s_!B6uI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff8c2f9e-413d-4822-a1d2-6f22dd5d9ed3_946x203.png 1272w, https://substackcdn.com/image/fetch/$s_!B6uI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff8c2f9e-413d-4822-a1d2-6f22dd5d9ed3_946x203.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>From a frequentist perspective, one might solve for the p that makes this probability correspond to a certain confidence bound. In a Bayesian framework, we would re-compute the likelihood accordingly and update the prior on p.</p><p>The net effect is that any false negative rate means a higher possible prevalence for the same observation of zero positives. If your test misses 20% of actual cases, you cannot exclude the possibility that some fraction of those 1000 were in fact infected but tested negative.</p><h2><strong>If the interviewer asks: &#8220;Could the sample be biased or unrepresentative of the city?&#8221;</strong></h2><p>Yes. If the 1000 people tested are not representative&#8212;for instance, if they come from a demographic with different exposure or health outcomes than the general city population&#8212;then the result might not generalize. The assumption behind the binomial model is that each individual tested is an independent draw from the city population. In reality, you might have cluster effects or self-selection in testing. True random sampling is ideal but often not the practical reality in medical or epidemiological contexts. Hence, the overall city probability might differ if the tested group systematically under- or over-represents certain segments of the population.</p><h2><strong>If the interviewer asks: &#8220;Please detail how you&#8217;d communicate these results to non-technical stakeholders?&#8221;</strong></h2><p>In non-technical communication, it&#8217;s often enough to say:</p><ul><li><p>&#8220;We tested 1000 people. No one tested positive. While we can&#8217;t say the disease is truly 0% in the city, our statistical estimate is that it&#8217;s probably well below 1%. A common rule of thumb puts an upper bound around 0.3%.&#8221;</p></li><li><p>We&#8217;d emphasize: &#8220;This result is consistent with a very low prevalence. However, it does not rule out that some cases exist&#8212;especially if the test can miss some cases or if the sample was not fully representative.&#8221;</p></li></ul><p>We avoid stating &#8220;there is no disease at all,&#8221; because that can be misleading. Instead, we highlight that the data strongly suggests a small upper limit, subject to various assumptions.</p><h2><strong>If the interviewer asks: &#8220;How does the Bayesian posterior interval differ from a frequentist confidence interval?&#8221;</strong></h2><ul><li><p>A frequentist confidence interval is an interval that would contain the true parameter in repeated sampling 95% of the time. It is strictly a statement about a procedure&#8217;s long-run behavior on hypothetical repeated experiments.</p></li><li><p>A Bayesian credible interval is a direct probability statement about the parameter itself given the observed data. It answers: &#8220;Given our prior and the data, there is a 95% probability that p lies in this range.&#8221;</p></li></ul><p>In practice, for a large sample size or for relatively simple problems, the intervals can look numerically similar. But philosophically and interpretationally, they differ. For this scenario (0 successes in 1000 trials), both intervals will often cluster near zero with an upper bound around 0.002-0.003. The exact number depends on the chosen Bayesian prior or the frequentist confidence procedure.</p><h2><strong>If the interviewer asks: &#8220;Summarize the final numeric estimate and interpretation again?&#8221;</strong></h2><p>We usually quote:</p><ul><li><p>MLE: 0%.</p></li><li><p>95% confidence (or credible) upper bound: roughly 0.3%.</p></li><li><p>Bayesian posterior mean (assuming a uniform prior): about 0.1%.</p></li><li><p>Bayesian posterior interval: from near 00 up to about 0.3%.</p></li></ul><p>Hence, it is likely that the disease rate is very small, definitely under 1%, probably under 0.3%. The exact numeric estimate within that range depends on the assumptions (prior, test accuracy, sample representativeness).</p><h2><strong>If the interviewer asks: &#8220;What does this show about the difference between statistical significance and practical significance?&#8221;</strong></h2><p>It highlights how an event can be extremely unlikely (like seeing zero positives if the city had a 1% prevalence, you&#8217;d expect about 10 positives out of 1000). Observing zero is quite strong evidence that the prevalence is significantly less than 1%. From a practical standpoint, it means the disease is rare enough that targeted testing or certain interventions may be more cost-effective than broad-based city-wide measures. However, for diseases with serious outcomes, even a tiny prevalence can still be important. You would not want to say &#8220;ignore it altogether&#8221; if the disease is fatal or highly contagious.</p><h2><strong>If the interviewer asks: &#8220;How would you handle the case where the nationwide prior is extremely low, like 0.0001?&#8221;</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!I7Bm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc4cbdae-1c7e-49e3-875a-815c64c298d5_932x328.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!I7Bm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc4cbdae-1c7e-49e3-875a-815c64c298d5_932x328.png 424w, https://substackcdn.com/image/fetch/$s_!I7Bm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc4cbdae-1c7e-49e3-875a-815c64c298d5_932x328.png 848w, https://substackcdn.com/image/fetch/$s_!I7Bm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc4cbdae-1c7e-49e3-875a-815c64c298d5_932x328.png 1272w, https://substackcdn.com/image/fetch/$s_!I7Bm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc4cbdae-1c7e-49e3-875a-815c64c298d5_932x328.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!I7Bm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc4cbdae-1c7e-49e3-875a-815c64c298d5_932x328.png" width="932" height="328" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fc4cbdae-1c7e-49e3-875a-815c64c298d5_932x328.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:328,&quot;width&quot;:932,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:90812,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165088957?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc4cbdae-1c7e-49e3-875a-815c64c298d5_932x328.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!I7Bm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc4cbdae-1c7e-49e3-875a-815c64c298d5_932x328.png 424w, https://substackcdn.com/image/fetch/$s_!I7Bm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc4cbdae-1c7e-49e3-875a-815c64c298d5_932x328.png 848w, https://substackcdn.com/image/fetch/$s_!I7Bm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc4cbdae-1c7e-49e3-875a-815c64c298d5_932x328.png 1272w, https://substackcdn.com/image/fetch/$s_!I7Bm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffc4cbdae-1c7e-49e3-875a-815c64c298d5_932x328.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>If the interviewer asks: &#8220;Could you show me a minimal Python code snippet for constructing a confidence interval for the binomial proportion with 0 successes?&#8221;</strong></h2><p>Yes. One could use statsmodels or other libraries. A minimal example:</p><pre><code><code>import math

n = 1000
x = 0
alpha = 0.05  # For a 95% confidence interval
# Use a basic approximate formula for the upper bound:
# 1 - alpha -&gt; about 3/n if x=0 for large n
upper_bound_approx = 3 / n
print("Approximate 95% upper bound (rule of thumb):", upper_bound_approx)

# For an exact Clopper-Pearson interval, we could do:
from statsmodels.stats.proportion import proportion_confint
ci_low, ci_high = proportion_confint(x, n, alpha=alpha, method='beta')
print("Exact Clopper-Pearson CI:", (ci_low, ci_high))
</code></code></pre><p>If you run this, you&#8217;ll see <code>ci_low</code> is 0, and <code>ci_high</code> is around 0.00299 (0.299%), which aligns with the rule of thumb.</p><h2><strong>If the interviewer asks: &#8220;Give a final one-liner answer to the original question.&#8221;</strong></h2><p>If forced to give a single value, one might say: &#8220;It&#8217;s very likely below 0.3%.&#8221; Or one might say: &#8220;Based on the data, an upper 95% bound is around 0.3% for the prevalence in that city.&#8221; If using a Bayesian approach with a uniform prior, the posterior mean is around 0.1%. Either way, the estimate is extremely small.</p><div><hr></div><h2><strong>Below are additional follow-up questions</strong></h2><h2><strong>What if the test is assumed to be perfect, but the population is extremely heterogeneous?</strong></h2><p>When the test itself is near 100% sensitivity and specificity, the main source of uncertainty shifts from test accuracy to the underlying variability in disease prevalence across subgroups of the population. In such heterogeneous settings, the overall city-wide probability of the disease isn&#8217;t necessarily uniform. One subgroup might have a higher prevalence, while most of the city has an extremely low prevalence. If we happened to sample 1000 individuals mostly from the low-prevalence subgroup, the test results could misleadingly indicate near-zero prevalence.</p><p>In statistical terms, the simple binomial model assumes each person&#8217;s probability p of having the disease is the same. That assumption breaks down if there are clusters of different p values. The typical approach would be to stratify the population by known risk factors or subpopulation identifiers (e.g., age groups, neighborhoods, occupations) and sample proportionally or oversample from higher-risk strata. Then we estimate prevalence within each subgroup and combine them (weighted by their proportion in the population) for an overall estimate.</p><p>A potential pitfall is ignoring the heterogeneity and concluding that the disease is almost nonexistent city-wide, even though pockets of higher prevalence might exist. This can happen if the sample missed or underrepresented those high-prevalence areas.</p><p>A real-world example could be if the disease is heavily localized among certain neighborhoods or communities. A random sample that fails to capture those communities accurately might yield a misleadingly low estimate. Hence, even with a perfect test, heterogeneity in the population requires careful sampling design or a stratified model. If unmodeled, it can lead to biased estimates of overall prevalence.</p><h2><strong>How does the sample size impact the ability to detect very low prevalence?</strong></h2><p>The sample size directly influences the power to detect low prevalence. Power, in this context, is the probability that a test of hypothesis (e.g., p&gt;0) will reject a null hypothesis if a true nonzero prevalence exists. Suppose the true prevalence is extremely small, such as 0.1%. In a sample of 1000, the expected number of positives would be only 1. If we see zero positives, it might be statistically plausible that 0.1% is the actual prevalence (since on average 1 positive is expected, but 0 is not too unlikely). If we want a higher chance of observing at least one positive at that prevalence, we need a larger sample.</p><p>Increasing the sample size helps in two ways:</p><ol><li><p><strong>More expected positives</strong>. If p is small but nonzero, a larger n yields a higher expected count of positives, which helps confirm whether the disease is truly absent or merely rare.</p></li><li><p><strong>Narrower intervals</strong>. Confidence or credible intervals shrink with more data, giving more precise estimates. With a bigger n, the difference between &#8220;true prevalence is zero&#8221; and &#8220;true prevalence is a tiny fraction&#8221; becomes easier to detect.</p></li></ol><p>The main pitfall here is underestimating how large a sample is needed to detect extremely rare events. If the disease is on the order of 0.01%, even 1000 samples might not be enough to confidently observe a case. That might lead to an incorrect inference of near-zero prevalence, even though a small nonzero prevalence exists.</p><h2><strong>How would we incorporate strong prior evidence that this city differs significantly from national trends?</strong></h2><p>If the city is known for special conditions&#8212;such as a different climate, unusual demographics, or a very different health system&#8212;we may want to override or adjust the national prior. Instead of using a prior that the city&#8217;s prevalence matches the nationwide rate, we might set a prior that&#8217;s either heavier (if there are risk factors) or lighter (if there are protective factors).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!c-7_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40d1bb5a-b99e-4ab1-8521-af15e59380ab_929x318.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!c-7_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40d1bb5a-b99e-4ab1-8521-af15e59380ab_929x318.png 424w, https://substackcdn.com/image/fetch/$s_!c-7_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40d1bb5a-b99e-4ab1-8521-af15e59380ab_929x318.png 848w, https://substackcdn.com/image/fetch/$s_!c-7_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40d1bb5a-b99e-4ab1-8521-af15e59380ab_929x318.png 1272w, https://substackcdn.com/image/fetch/$s_!c-7_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40d1bb5a-b99e-4ab1-8521-af15e59380ab_929x318.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!c-7_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40d1bb5a-b99e-4ab1-8521-af15e59380ab_929x318.png" width="929" height="318" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/40d1bb5a-b99e-4ab1-8521-af15e59380ab_929x318.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:318,&quot;width&quot;:929,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:78342,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165088957?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40d1bb5a-b99e-4ab1-8521-af15e59380ab_929x318.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!c-7_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40d1bb5a-b99e-4ab1-8521-af15e59380ab_929x318.png 424w, https://substackcdn.com/image/fetch/$s_!c-7_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40d1bb5a-b99e-4ab1-8521-af15e59380ab_929x318.png 848w, https://substackcdn.com/image/fetch/$s_!c-7_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40d1bb5a-b99e-4ab1-8521-af15e59380ab_929x318.png 1272w, https://substackcdn.com/image/fetch/$s_!c-7_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40d1bb5a-b99e-4ab1-8521-af15e59380ab_929x318.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The challenge is determining how strong that prior evidence should be. If the prior is too strongly weighted (e.g., extremely high or low), it can overwhelm the data. If it&#8217;s too weak or uninformative, then we might ignore relevant city-specific knowledge. Balancing prior beliefs with observed data is the core of Bayesian inference, and it depends on domain expertise. The pitfall is ignoring real local factors or, conversely, using an unrealistic prior that can&#8217;t be justified by actual knowledge.</p><h2><strong>How would a real-time monitoring or longitudinal system for disease prevalence differ from a single cross-sectional sample?</strong></h2><p>A single cross-sectional sample captures a snapshot in time. If we want to track changes in disease prevalence across weeks or months, we might do repeated sampling or rely on continual test data from healthcare systems. A real-time or longitudinal monitoring approach might use:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!czdi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F010f18b2-b7c8-47a0-b546-34e41dc1bf17_875x245.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!czdi!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F010f18b2-b7c8-47a0-b546-34e41dc1bf17_875x245.png 424w, https://substackcdn.com/image/fetch/$s_!czdi!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F010f18b2-b7c8-47a0-b546-34e41dc1bf17_875x245.png 848w, https://substackcdn.com/image/fetch/$s_!czdi!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F010f18b2-b7c8-47a0-b546-34e41dc1bf17_875x245.png 1272w, https://substackcdn.com/image/fetch/$s_!czdi!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F010f18b2-b7c8-47a0-b546-34e41dc1bf17_875x245.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!czdi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F010f18b2-b7c8-47a0-b546-34e41dc1bf17_875x245.png" width="875" height="245" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/010f18b2-b7c8-47a0-b546-34e41dc1bf17_875x245.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:245,&quot;width&quot;:875,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:56285,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165088957?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F010f18b2-b7c8-47a0-b546-34e41dc1bf17_875x245.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!czdi!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F010f18b2-b7c8-47a0-b546-34e41dc1bf17_875x245.png 424w, https://substackcdn.com/image/fetch/$s_!czdi!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F010f18b2-b7c8-47a0-b546-34e41dc1bf17_875x245.png 848w, https://substackcdn.com/image/fetch/$s_!czdi!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F010f18b2-b7c8-47a0-b546-34e41dc1bf17_875x245.png 1272w, https://substackcdn.com/image/fetch/$s_!czdi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F010f18b2-b7c8-47a0-b546-34e41dc1bf17_875x245.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In each new time step, we incorporate new observations (like &#8220;1000 more tested, 1 positive found&#8221;) and revise our estimate. This is more informative than a one-time estimate because it captures trends. The main pitfall is that if the disease prevalence starts extremely low but then spikes quickly, a system that updates too slowly (or uses outdated data) might not catch the surge in time. Another subtlety is ensuring that each new sample is representative over time, which is not always trivial. Also, if we rely on self-reporting or hospital data alone, selection bias can accumulate over time.</p><h2><strong>What if we want to combine data sources, e.g., official health records plus our random sample?</strong></h2><p>In practice, the best estimates may come from blending multiple data sources. We might have:</p><ul><li><p><strong>Official health records</strong>: Hospitals or clinics might record confirmed cases, but those records can be biased toward symptomatic or severe cases.</p></li><li><p><strong>Randomly sampled survey</strong>: A smaller but systematically collected set of tests from the general population.</p></li></ul><p>A Bayesian hierarchical model could incorporate these sources. The hospital data might inform an estimate of symptomatic or severe-case prevalence, while the random sample might inform overall prevalence (including asymptomatic cases). We might create a latent variable for the &#8220;true&#8221; prevalence and then have different likelihood models for each data source, factoring in each source&#8217;s biases or detection rates.</p><p>One major pitfall is double-counting the same individuals (overlapping data) or incorrectly assuming independence across sources. Another subtlety is reconciling different timescales or definitions of &#8220;case.&#8221; Official data might count &#8220;test positives,&#8221; while a random sample might detect &#8220;current infection.&#8221; If the definitions or timescales don&#8217;t align, we risk combining apples and oranges. The advantage is that multiple data sources often reduce uncertainty and yield a more robust estimate if carefully modeled together.</p><h2><strong>How do we handle a scenario where there might be localized hotspots or super-spreader events but still zero observed positives in our random sample?</strong></h2><p>If there are potential hotspots&#8212;say, one specific cluster, like a nursing home or a large indoor gathering&#8212;a purely random sample from the entire city might miss that cluster if it&#8217;s small relative to the city population. That can give a false sense of security. The disease might still be present but contained in that hotspot.</p><p>To handle this, epidemiologists sometimes use:</p><ol><li><p><strong>Cluster sampling or oversampling</strong>: If they suspect certain hotspots, they specifically test those areas more thoroughly.</p></li><li><p><strong>Spatial or network-based models</strong>: Instead of a single city-wide prevalence, they model prevalence as a function of location or social networks.</p></li></ol><p>Seeing zero positives in a city-wide random sample does not guarantee zero hotspots; it could simply mean that the hotspot is small and was missed. The pitfall is concluding no risk city-wide. In reality, an outbreak could be brewing in a corner of the city. Hence, we might combine random sampling with targeted hotspot surveillance. If both show zero positives, that&#8217;s more convincing.</p><h2><strong>What if we only tested 100 or 200 people, not 1000?</strong></h2><p>The smaller the sample, the wider the confidence or credible interval. Observing zero positives in 200 tests is less informative than zero positives in 1000 tests. For instance:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ZcSA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e5d7c2-befc-46d5-ac9b-0fcdadb13c6a_951x509.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZcSA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e5d7c2-befc-46d5-ac9b-0fcdadb13c6a_951x509.png 424w, https://substackcdn.com/image/fetch/$s_!ZcSA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e5d7c2-befc-46d5-ac9b-0fcdadb13c6a_951x509.png 848w, https://substackcdn.com/image/fetch/$s_!ZcSA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e5d7c2-befc-46d5-ac9b-0fcdadb13c6a_951x509.png 1272w, https://substackcdn.com/image/fetch/$s_!ZcSA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e5d7c2-befc-46d5-ac9b-0fcdadb13c6a_951x509.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZcSA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e5d7c2-befc-46d5-ac9b-0fcdadb13c6a_951x509.png" width="951" height="509" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/75e5d7c2-befc-46d5-ac9b-0fcdadb13c6a_951x509.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:509,&quot;width&quot;:951,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:114975,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165088957?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e5d7c2-befc-46d5-ac9b-0fcdadb13c6a_951x509.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ZcSA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e5d7c2-befc-46d5-ac9b-0fcdadb13c6a_951x509.png 424w, https://substackcdn.com/image/fetch/$s_!ZcSA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e5d7c2-befc-46d5-ac9b-0fcdadb13c6a_951x509.png 848w, https://substackcdn.com/image/fetch/$s_!ZcSA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e5d7c2-befc-46d5-ac9b-0fcdadb13c6a_951x509.png 1272w, https://substackcdn.com/image/fetch/$s_!ZcSA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e5d7c2-befc-46d5-ac9b-0fcdadb13c6a_951x509.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>How do we handle diseases with significant latent periods where the test might not detect early infections?</strong></h2><p>Some diseases have an incubation or latent period during which tests (especially certain types of tests, like antibody tests) might not detect the infection. For example, if it takes two weeks from infection before a person tests positive, someone recently infected would appear negative even though they are infected.</p><p>We can incorporate a time dimension in the test sensitivity model. Instead of a single sensitivity value, we have a sensitivity function that depends on how long since exposure. If the tested individuals were in early stages of infection, the probability of detection is lower. Hence, the probability of seeing zero positives might be higher than you&#8217;d assume under a single-sensitivity assumption.</p><p>A real-world pitfall is ignoring these dynamics. If we tested 1000 people during a time window that coincides with the latency period, many infections could go undetected. We might incorrectly conclude near-zero prevalence. One approach is repeated testing or using a test that detects earlier stages (like PCR for viral RNA) rather than relying on an antibody test that only becomes positive after a longer period.</p><h2><strong>Could we apply a non-parametric or bootstrapping approach to estimating prevalence instead of a binomial model?</strong></h2><p>Yes, non-parametric or resampling techniques can be used, but they typically still rely on the assumption that each sample is an i.i.d. draw from the city population. For instance, one might do a bootstrap by repeatedly sampling from the observed test results, but if we have only zeros, the bootstrap distribution also yields zeros.</p><p>In effect, bootstrapping with zero positives in the data will often produce an estimated distribution heavily centered at zero, unless some smoothing or prior is introduced. In many epidemiological scenarios, the parametric binomial model is straightforward and well-accepted. A purely non-parametric approach might not provide much additional insight when you observe all negatives.</p><p>One pitfall is that a naive bootstrap could yield no new information if your empirical data has no positives. Another subtlety is that bootstrapping doesn&#8217;t incorporate an informative prior that the disease is just rare. So in practice, a parametric or Bayesian approach is often more interpretable. Still, if you had a set of positive results from a bigger region, you might do partial pooling or advanced resampling. But with zero positives, the parametric binomial or a Beta-Binomial approach typically suffices.</p><h2><strong>What if the disease presence in the city is correlated across families or neighborhoods (not independent Bernoulli trials)?</strong></h2><p>When infection status is correlated&#8212;say, within families or neighborhoods&#8212;the assumption of independent Bernoulli trials doesn&#8217;t hold. This can cause underestimation or overestimation of the variance in the number of cases. Typically, binomial confidence intervals assume independence. But if entire households tend to share exposure, either you see &#8220;clusters&#8221; of positive or negative results.</p><p>If your sample includes families or neighborhoods, the real effective sample size might be smaller than it appears, because each household&#8217;s results are correlated. This leads to narrower or incorrectly calculated intervals if you ignore that correlation. One approach is to move to a Beta-Binomial or hierarchical model that can capture within-group correlation. Another approach is carefully sampling one individual per household, ensuring independence.</p><p>The pitfall is ignoring the correlation and using standard binomial methods, which leads to overly optimistic confidence intervals. In other words, you might claim more certainty about your estimate than is actually warranted, because each test is not truly independent evidence.</p><h2><strong>What if the city health department or stakeholders want a guaranteed upper bound at higher confidence (e.g., 99.9% instead of 95%)?</strong></h2><p>Raising the confidence level from 95% to 99.9% widens the interval, meaning the upper bound on prevalence increases. For instance, using the rule of thumb or exact binomial intervals at 99.9% confidence might push the upper bound well above the 0.3% figure we get at 95% confidence.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fSYy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4529edbc-6454-44d5-ae83-1185526d3b41_923x380.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fSYy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4529edbc-6454-44d5-ae83-1185526d3b41_923x380.png 424w, https://substackcdn.com/image/fetch/$s_!fSYy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4529edbc-6454-44d5-ae83-1185526d3b41_923x380.png 848w, https://substackcdn.com/image/fetch/$s_!fSYy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4529edbc-6454-44d5-ae83-1185526d3b41_923x380.png 1272w, https://substackcdn.com/image/fetch/$s_!fSYy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4529edbc-6454-44d5-ae83-1185526d3b41_923x380.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fSYy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4529edbc-6454-44d5-ae83-1185526d3b41_923x380.png" width="923" height="380" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4529edbc-6454-44d5-ae83-1185526d3b41_923x380.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:380,&quot;width&quot;:923,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:93185,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165088957?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4529edbc-6454-44d5-ae83-1185526d3b41_923x380.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!fSYy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4529edbc-6454-44d5-ae83-1185526d3b41_923x380.png 424w, https://substackcdn.com/image/fetch/$s_!fSYy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4529edbc-6454-44d5-ae83-1185526d3b41_923x380.png 848w, https://substackcdn.com/image/fetch/$s_!fSYy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4529edbc-6454-44d5-ae83-1185526d3b41_923x380.png 1272w, https://substackcdn.com/image/fetch/$s_!fSYy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4529edbc-6454-44d5-ae83-1185526d3b41_923x380.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>What if there&#8217;s a risk of test contamination or a small but nonzero risk of false positives?</strong></h2><p>Even if no positives appeared, we might wonder if the test could produce false positives or if the lab might mix up a sample. Usually, that would result in a few positives, not zero. So ironically, false positives wouldn&#8217;t lower our estimate further, they&#8217;d raise it or at least create some noise. However, the presence of potential contamination can cast doubt on any result. If the lab might discard suspicious results or retest suspicious positives more than negatives, that could bias the results in favor of fewer positives reported.</p><p>Another subtle scenario is if a lab systematically discards borderline positive tests to &#8220;be sure&#8221; or if they assume the disease is rare and attribute borderline results to errors. This sort of confirmation bias can artificially drive positives to zero. The pitfall is that all the classical binomial or Bayesian formulas assume accurate classification of disease status. If we suspect systematic lab or test biases, the entire inference process must be revisited with a realistic measurement-error model.</p><h2><strong>How can we extend this analysis to account for mortality and recovery rates?</strong></h2><p>If we&#8217;re considering a disease that has a certain mortality rate or a known recovery period, then prevalence at a specific point in time is a function of new infections, recoveries, and deaths. Over a longer window, we may need a compartmental model (like SIR or SEIR in epidemiology):</p><ul><li><p><strong>S</strong> = Susceptible</p></li><li><p><strong>E</strong> = Exposed (latent)</p></li><li><p><strong>I</strong> = Infectious</p></li><li><p><strong>R</strong> = Recovered (or removed)</p></li></ul><p>Prevalence is essentially the proportion of the population in the &#8220;I&#8221; state (or possibly &#8220;E&#8221; + &#8220;I&#8221; if the test detects early infection). If we test 1000 people at a random time, 0 positives might mean the &#8220;I&#8221; compartment is very small or practically zero. But if transitions in and out of &#8220;I&#8221; happen quickly, we might be testing at a moment of low incidence. Another time, the city might experience a surge.</p><p>The pitfall is using a simple cross-sectional estimate from a single time point to project or forecast the disease course without considering dynamic factors. The more accurate approach is to incorporate the zero-case observation as an initial condition or constraint in a dynamic model. Then we can project forward or backward, factoring in infection rates, mortality, and recovery. This is complex but more realistic in certain epidemiological contexts.</p><h2><strong>How might we adapt the approach if the question was about &#8220;probability of a rare event&#8221; more generally, not just disease prevalence?</strong></h2><p>The logic extends to any scenario where we&#8217;re trying to estimate a low probability of occurrence&#8212;like product defect rates, financial default rates, or event occurrences in a system. Whenever we observe zero occurrences in a sample, the same binomial-based intervals or Bayesian updates apply. For a Poisson process with a low event rate, we can also use a Poisson assumption in place of binomial. If we sample 1000 days (or 1000 units) with zero events, we get an estimate or confidence interval for the underlying rate.</p><p>A potential pitfall is mismatch between real-world processes and the chosen model. For instance, if events cluster in time, a Poisson or binomial assumption might be wrong. The takeaway is that the math is similar, but we must ensure the underlying assumptions&#8212;independence, distribution type, sample representativeness&#8212;hold for the general scenario.</p><h2><strong>How do we reconcile multiple intervals or estimates that come from different methods (frequentist vs. Bayesian, or from different data subsets) that appear contradictory?</strong></h2><p>Contradictory intervals might arise if, for instance, a frequentist approach on one data subset yields an upper bound of 0.4%, while a Bayesian approach with a strong prior on another subset yields 0.1%. This can happen if the subsets differ, or if the prior in the Bayesian method strongly pulls the estimate down.</p><p>We reconcile them by asking:</p><ol><li><p><strong>Are the datasets truly comparable?</strong> Maybe one subset was tested at a different time or in a different population segment.</p></li><li><p><strong>How strong is the Bayesian prior, and does it properly reflect reality?</strong> If the prior is too optimistic or extremely tight, it might artificially reduce the posterior.</p></li><li><p><strong>What is the confidence level or credible interval used in each approach?</strong> A 99% frequentist interval vs. a 90% Bayesian credible interval might yield ranges that don&#8217;t overlap simply because of different confidence levels.</p></li></ol><p>A combined or hierarchical approach might help unify the sources. The main pitfall is assuming that each &#8220;interval&#8221; must match exactly. Different methods can yield different intervals, especially with small counts and strong priors. Investigating the assumptions behind each method is essential for a coherent final conclusion.</p><h2><strong>How would we modify the approach if we suspect under-reporting of negative test results, or incomplete data?</strong></h2><p>Sometimes data might only be recorded for positive tests, or negative results are less diligently recorded. That would effectively sample more from positives, skewing the sample. In a scenario where we have 1000 negative tests recorded, but an unknown number might not have been reported, our sample is incomplete. We can&#8217;t treat it as a random sample of the city.</p><p>One approach is to attempt to estimate the missing data fraction. If we know that only half of negative tests are typically reported, we can partially correct for that under-reporting. But that correction requires additional assumptions about how negatives are missed. In a Bayesian framework, we can place a prior on the fraction of missing data and incorporate that into the likelihood. The pitfall is that any error in that missing fraction assumption drastically changes the prevalence estimate. Without reliable data on the extent of under-reporting, the uncertainty grows considerably.</p><h2><strong>How do we handle follow-up studies if we eventually find a small number of positives?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VBTa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae726ccd-9bbf-4c0a-9750-814b0acb45b9_922x261.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VBTa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae726ccd-9bbf-4c0a-9750-814b0acb45b9_922x261.png 424w, https://substackcdn.com/image/fetch/$s_!VBTa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae726ccd-9bbf-4c0a-9750-814b0acb45b9_922x261.png 848w, https://substackcdn.com/image/fetch/$s_!VBTa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae726ccd-9bbf-4c0a-9750-814b0acb45b9_922x261.png 1272w, https://substackcdn.com/image/fetch/$s_!VBTa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae726ccd-9bbf-4c0a-9750-814b0acb45b9_922x261.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VBTa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae726ccd-9bbf-4c0a-9750-814b0acb45b9_922x261.png" width="922" height="261" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ae726ccd-9bbf-4c0a-9750-814b0acb45b9_922x261.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:261,&quot;width&quot;:922,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:64658,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165088957?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae726ccd-9bbf-4c0a-9750-814b0acb45b9_922x261.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!VBTa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae726ccd-9bbf-4c0a-9750-814b0acb45b9_922x261.png 424w, https://substackcdn.com/image/fetch/$s_!VBTa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae726ccd-9bbf-4c0a-9750-814b0acb45b9_922x261.png 848w, https://substackcdn.com/image/fetch/$s_!VBTa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae726ccd-9bbf-4c0a-9750-814b0acb45b9_922x261.png 1272w, https://substackcdn.com/image/fetch/$s_!VBTa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae726ccd-9bbf-4c0a-9750-814b0acb45b9_922x261.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In a frequentist approach, we can pool the data: total tests = 1500, total positives = 1. Then we do a binomial estimate with n=1500, x=1. Or we can do separate interval calculations for each wave of data and combine them via meta-analysis or a weighted approach. The pitfall is ignoring the time gap or changes in conditions between the two sampling periods. If the disease prevalence changed in the intervening period, pooling might not reflect a single consistent probability. One might need a time-varying model to properly handle that shift in prevalence.</p><h2><strong>How might budget and logistical constraints influence the approach or interpretation of results?</strong></h2><p>In the real world, testing 1000 people can be expensive. Decision-makers might only want to test 200 people. But as discussed, a smaller sample means wider uncertainty. Another scenario is that tests are costly, but we can do them in multiple small waves over time. This sometimes yields more information if the disease prevalence changes or if we want to quickly detect an outbreak.</p><p>Budgetary constraints can also influence the design of a testing program. We might do adaptive testing: start with a smaller sample, see if positives appear, and expand if evidence suggests non-negligible prevalence. The pitfall is concluding that zero positives from a small sample is enough to claim near-zero disease. For extremely rare diseases, a large enough sample or a repeated-sampling strategy is crucial to reduce the chance that we&#8217;re simply missing the few positive cases.</p><h2><strong>If herd immunity or vaccination coverage is very high in the city, how does that alter the interpretation of zero positives?</strong></h2><p>High vaccination coverage or partial immunity might lower the effective disease prevalence. Observing zero positives can be consistent with a high level of protection in the population. However, &#8220;prevalence&#8221; in that context might be different from the &#8220;probability of the disease in an unvaccinated individual.&#8221; If most people are immune, the overall prevalence is small, but the risk for the unvaccinated could still be higher than the city-wide average.</p><p>In practical epidemiology, we might measure the &#8220;breakthrough infection&#8221; rate among vaccinated individuals separately from the &#8220;infection rate&#8221; among unvaccinated. If we don&#8217;t distinguish, the zero positives might be mostly among vaccinated individuals. If the unvaccinated population is small, we might not have tested enough unvaccinated individuals to see a positive. The pitfall is concluding &#8220;nobody is infected,&#8221; but not realizing that among the handful of unvaccinated folks, prevalence might still be meaningful if the disease thrives there. This underscores the importance of understanding the composition of the tested group and the overall immunity landscape.</p><h2><strong>How do we refine our model if the disease is highly seasonal or has known fluctuation patterns?</strong></h2><p>Seasonal diseases (e.g., influenza-like illnesses) might have low prevalence in the off-season and higher prevalence in peak season. Observing zero positives in the off-season is not surprising. To estimate prevalence, we may need a seasonal model capturing p(t) as a function of time of year. If the sample was taken in the disease&#8217;s typical &#8220;low season,&#8221; it might not reflect the potential prevalence that could occur in the &#8220;high season.&#8221;</p><p>Statistically, we could use a sinusoidal or piecewise function for the prevalence over time, or a state-space model with seasonal components. The pitfall is ignoring the time of measurement. A naive approach concluding near-zero disease year-round from a test done at the low point can be very misleading. Epidemiologists often do repeated surveys across the year or over multiple years to handle seasonality. For a single snapshot, they usually interpret zero positives in context: &#8220;We tested in the off-season, so that&#8217;s consistent with near-zero at this moment, but not necessarily a forecast for the peak season.&#8221;</p><h2><strong>Could a hierarchical Bayesian approach be used to borrow strength from data on other diseases in the same city or from the same disease in neighboring cities?</strong></h2><p>Yes. Hierarchical modeling can allow partial pooling across multiple diseases or across multiple cities. For example, if City A, B, and C are geographically similar, we might treat the disease prevalence in each as drawn from a common hyper-distribution. Observing zero positives in City A but some positives in City B might shift A&#8217;s posterior a bit upward because it&#8217;s plausible they share risk factors. Or if we see no positives in all three, that jointly increases confidence that the region has very low prevalence.</p><p>A big pitfall, though, is incorrectly assuming cities or diseases are sufficiently similar. If one city has unique features (like high vaccination rates or strong travel restrictions), pooling data with other cities might artificially inflate or deflate estimates. Proper hierarchical modeling requires verifying that the grouping factor (cities, diseases) is indeed coherent. Otherwise, you get erroneous &#8220;borrowing&#8221; that misrepresents local realities.</p><h2><strong>If the local government uses zero-positives to cut back on testing, what are the risks?</strong></h2><p>This is a policy pitfall. After seeing zero positives in a sample of 1000, officials might reduce testing programs to save costs, believing the disease is virtually absent. That could be risky if:</p><ol><li><p><strong>The disease is still present but at a very low level</strong>. Reduced testing might miss the early signals of an outbreak.</p></li><li><p><strong>New variant or new wave</strong>. Conditions can change; external introductions of the pathogen might cause a sudden increase.</p></li><li><p><strong>Sampling was unrepresentative</strong>. If the initial sample was incomplete or biased, the city might incorrectly think there&#8217;s no problem.</p></li></ol><p>An ongoing surveillance approach is often recommended, even if scaled down, to promptly detect changes in prevalence. Another strategy is sentinel surveillance: testing selected clinics, high-risk groups, or random samples at regular intervals. The main pitfall is that zero positives is not an absolute guarantee of no disease; it&#8217;s just strong evidence that the prevalence is very low at that moment.</p><h2><strong>How does the ratio of infected to total population differ from incidence, and does that matter here?</strong></h2><p>Prevalence typically refers to the proportion of the population that is currently infected (or has a disease) at a given time. Incidence refers to the rate of new infections per unit time. The question we addressed focuses on prevalence: &#8220;What is the probability that someone has the disease now?&#8221;</p><p>However, if the disease is acute and short-lived, the prevalence might be very low, even though the incidence (new cases per day) might be more substantial for short intervals. For instance, a disease that lasts only a few days might never accumulate large prevalence. If the question was about incidence, we would need data on how many people newly become infected over time, which is different from &#8220;how many are infected at a single time.&#8221;</p><p>The pitfall is conflating the two measures. A city might have zero currently infected individuals at a certain moment (prevalence near zero), but that doesn&#8217;t mean they have a zero rate of new infections if, for example, the disease has short duration but recurs in waves. Clarifying whether the question is about point-prevalence or incidence is crucial for correct interpretation.</p><h2><strong>If results indicated zero infected individuals, how might community testing strategy shift toward sampling more at-risk subgroups?</strong></h2><p>When zero positives come from a broad random sample, the next step might be more targeted testing. We&#8217;d direct resources where the disease is most likely to appear, such as travelers arriving from high-prevalence regions or individuals with known risk factors.</p><p>The idea is two-tiered:</p><ol><li><p><strong>General screening</strong>: We do a broad random sample to gauge baseline prevalence.</p></li><li><p><strong>Targeted follow-up</strong>: If we see zero in the broad sample, but we still have concerns about specific high-risk subgroups, we do a separate or additional test in those subgroups.</p></li></ol><p>The pitfall is to assume that one broad sample that yields zero positives means we can ignore high-risk subgroups. Conversely, focusing too heavily on high-risk groups might skew city-wide prevalence estimates if we want to continue measuring the overall level. Balancing general population testing with risk-focused testing is often the best approach, especially when resources are limited.</p><h2><strong>Could we incorporate knowledge about disease transmission dynamics (like R0) into the prevalence estimate?</strong></h2><p>R0 (the basic reproduction number) or the effective reproduction number Re can inform how quickly a disease would spread if introduced. If a disease has a high R0 but we still see zero positives, it might mean we&#8217;re in a lucky scenario where no introduction events have occurred yet, or the population has immunity. This knowledge might shape a Bayesian prior, indicating that if the disease were present, it would likely have spread to produce some positives. Observing zero might be stronger evidence for extremely low prevalence than if it&#8217;s a disease with low R0.</p><p>However, direct integration of R0 into a simple binomial or Beta-Binomial analysis is not typical unless we build a dynamic transmission model. The pitfall is mixing up theoretical transmission potential with actual observed data. R0 alone can&#8217;t measure current prevalence&#8212;some highly transmissible diseases might still be absent in a particular location if they haven&#8217;t been introduced or if controls are in place. Combining these methods in a full epidemiological model can be powerful but is significantly more complex than the static binomial approach.</p><h2><strong>What if the disease has known subclinical or asymptomatic cases that even a perfect test cannot detect unless they&#8217;re in a specific phase?</strong></h2><p>Some diseases manifest in waves of detectable biomarkers. If the test only detects the pathogen during symptomatic or a particular phase, asymptomatic carriers might test negative. This is effectively a test sensitivity issue, but with the added complexity that the sensitivity depends on symptom phase.</p><p>We might extend the model to:</p><ol><li><p>Identify the fraction of cases that remain asymptomatic or subclinical.</p></li><li><p>Estimate the fraction of those asymptomatic cases that still test positive (some tests can detect the pathogen even when asymptomatic).</p></li><li><p>Combine these factors in the likelihood function for observing zero positives.</p></li></ol><p>If the fraction of subclinical carriers is high and the detection rate in that phase is low, it&#8217;s plausible to see zero positives even if the true prevalence is not zero. The pitfall is using a single sensitivity figure that only applies to symptomatic individuals and ignoring subclinical or asymptomatic states. This leads to underestimation of the true prevalence if we rely purely on test outcomes.</p><h2><strong>How do we handle logistical constraints such as batch testing (pool testing) where multiple samples are combined to reduce costs?</strong></h2><p>Pool testing involves mixing, say, 10 samples together and running one test on the pooled sample. If negative, we conclude all 10 are negative. If positive, we individually retest. It&#8217;s a common approach to reduce costs when prevalence is expected to be very low.</p><p>If all pooled tests come back negative, we effectively have zero positives across many individuals, but we must consider the possibility that a single infected sample in a pool might go undetected if the viral load is diluted below the test&#8217;s detection threshold. That modifies the probability model. The risk is higher false negatives in pooled samples, especially if the pool size is large, or if the test&#8217;s detection threshold is borderline.</p><p>Hence, to estimate the overall city prevalence, we must adjust the binomial or Beta-Binomial model to account for pooling efficiency and any test sensitivity changes due to dilution. The pitfall is applying the standard binomial formula to pooled results, ignoring the possibility that a small number of positives could be missed. If we don&#8217;t correct for that, we might be overly confident in concluding zero or near-zero prevalence.</p><h2><strong>What if local clinicians suspect mild cases are going unreported due to a cultural tendency to avoid medical testing?</strong></h2><p>Cultural or behavioral factors can lead to self-selection: people who feel ill may avoid testing to keep working or to avoid stigma. This introduces a hidden segment of untested but possibly infected individuals. The 1000 tested might be the more health-conscious population that believes they&#8217;re not infected or is comfortable reporting to clinics.</p><p>Statistically, this means the tested sample might not be random&#8212;it&#8217;s a self-selected subset with possibly lower prevalence. The real city-wide prevalence could be higher. A solution is to do an actively recruited random sample (like going door-to-door or offering incentives). If that&#8217;s not feasible, we might attempt a selection-bias correction model. The pitfall is ignoring these cultural factors, leading to an underestimate. If mild symptomatic individuals systematically avoid testing, we might incorrectly conclude zero prevalence from an unrepresentative sample.</p><h2><strong>How might contact tracing results or known contact networks inform the prevalence estimate?</strong></h2><p>Contact tracing data can reveal how many close contacts a confirmed positive had, how many tested negative or positive, etc. This can be integrated into a more elaborate network model of disease spread. If contact tracers find no evidence of spread within the city (no new positives among hundreds of close contacts), that suggests a very low prevalence or that the disease was never introduced to begin with.</p><p>A Bayesian network model might incorporate each contact event as an edge in a graph, with a probability of transmission if one node is infected. Zero positives among traced contacts is strong evidence of minimal or no presence in the city. The pitfall is that contact tracing is rarely 100% complete: some contacts may be missed, or some might refuse testing. Also, a zero-case scenario might discourage thorough contact tracing, so we have limited data. If there was an index case who left the city or was never tested, we might have missed an introduction event. Combining random testing with contact tracing can yield a more holistic picture, but it&#8217;s methodologically complex to unify those data sources in a single estimate.</p><h2><strong>What if, after seeing zero positives, we do a second test on exactly the same 1000 individuals? Does that improve our estimate?</strong></h2><p>Testing the same group twice can provide some additional information, particularly about test reliability or disease incidence over a short period. If, for example, the disease has an incubation period or if the second test is a different type with different sensitivity, combining the results might reduce the chance we missed someone who was infected. However, if we do a back-to-back test on the exact same individuals at roughly the same time, the second test might be almost redundant if the disease status wouldn&#8217;t have changed.</p><p>In a standard binomial framework, if the prevalence is stable and we get all negatives twice from the same group, it doesn&#8217;t drastically change the conclusion that the prevalence is very low for that group. The pitfall is to double-count the results as if they were two independent samples from the city. They&#8217;re not entirely independent if it&#8217;s the same people. On the other hand, if we space out the tests by a few weeks, it might provide more robust information about new infections. But if the question is just &#8220;What is the city prevalence at a single point in time?,&#8221; retesting the exact same individuals soon after yields diminishing returns.</p><h2><strong>What if we want a decision rule, like &#8220;we declare the city disease-free if the posterior probability that p&gt;0.001 is less than 5%?&#8221;</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3KNI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ed6f76d-bad5-49ea-adbe-75082c171a22_924x402.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3KNI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ed6f76d-bad5-49ea-adbe-75082c171a22_924x402.png 424w, https://substackcdn.com/image/fetch/$s_!3KNI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ed6f76d-bad5-49ea-adbe-75082c171a22_924x402.png 848w, https://substackcdn.com/image/fetch/$s_!3KNI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ed6f76d-bad5-49ea-adbe-75082c171a22_924x402.png 1272w, https://substackcdn.com/image/fetch/$s_!3KNI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ed6f76d-bad5-49ea-adbe-75082c171a22_924x402.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3KNI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ed6f76d-bad5-49ea-adbe-75082c171a22_924x402.png" width="924" height="402" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0ed6f76d-bad5-49ea-adbe-75082c171a22_924x402.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:402,&quot;width&quot;:924,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:76943,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165088957?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ed6f76d-bad5-49ea-adbe-75082c171a22_924x402.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!3KNI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ed6f76d-bad5-49ea-adbe-75082c171a22_924x402.png 424w, https://substackcdn.com/image/fetch/$s_!3KNI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ed6f76d-bad5-49ea-adbe-75082c171a22_924x402.png 848w, https://substackcdn.com/image/fetch/$s_!3KNI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ed6f76d-bad5-49ea-adbe-75082c171a22_924x402.png 1272w, https://substackcdn.com/image/fetch/$s_!3KNI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ed6f76d-bad5-49ea-adbe-75082c171a22_924x402.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This approach is more direct than constructing a credible interval. We have a decision boundary at 0.1%. The pitfall is that the chosen threshold might be arbitrary. Why 0.1%? Or 5% probability? The choice might be driven by policy or risk tolerance. Also, if the prior is overly optimistic or pessimistic, we might too quickly or too slowly meet that decision threshold. The advantage is clarity: the final statement is a direct measure of &#8220;We are X% certain that the prevalence is below Y%.&#8221;</p><h2><strong>How could we incorporate the notion that the disease might have an extinction probability if it falls below a certain prevalence?</strong></h2><p>Some epidemiological models posit that if an infectious disease falls below a critical fraction, it may die out entirely (basic branching process logic). Zero positives might signal that the disease failed to sustain transmission. If we adopt a branching process model, we might estimate the probability that the disease has &#8220;gone extinct&#8221; in the city. Observing 0 cases in a large sample can increase the posterior probability that the chain of transmission ended.</p><p>However, we must be cautious: local extinction is possible, but reinfection from outside sources is also possible, so &#8220;extinction&#8221; might be temporary. The pitfall is proclaiming the disease extinct city-wide when it might still exist in an untested cluster or be reintroduced from outside. Nonetheless, for diseases known to have a critical community size or threshold, the observation of zero positives in 1000 samples is strong evidence that the chain of transmission is currently not self-sustaining. This again requires a dynamic model that extends beyond a static binomial approach.</p><h2><strong>Could advanced machine learning techniques, such as Bayesian neural networks or Gaussian processes, help in this estimation?</strong></h2><p>In principle, yes. For example, if the city is large and we want a spatially varying prevalence model, a Gaussian process can be used to model the prevalence function across geographical coordinates. If we have zero positives from certain sampled locations, that suggests a near-zero mean function in those areas. Additional data from different neighborhoods might feed into the GP to refine the city-wide map. Or a Bayesian neural network might incorporate covariates (e.g., population density, mobility patterns) to estimate prevalence.</p><p>However, if the number of positives is zero or extremely small, these advanced models can suffer from data scarcity. They might overfit or fail to converge on meaningful parameters. The advantage is they can incorporate complex dependencies and side information. The pitfall is that for something as simple as &#8220;0 out of 1000 tested,&#8221; classical methods (binomial or Beta-Binomial) might be more straightforward and robust, especially if we lack extensive features to feed into ML models. In real-world scenarios, advanced ML might be helpful if we have rich data about each individual or region. But for a quick, straightforward prevalence estimate with zero positives, the classical approach is often sufficient and more interpretable.</p><h2><strong>What if public perception demands a definitive statement (&#8220;the disease is nonexistent&#8221;) but from a scientific standpoint we can only say &#8220;it&#8217;s below X%&#8221;?</strong></h2><p>This is a classic science communication challenge. Statistics can&#8217;t prove a negative absolutely; we only provide intervals or probabilities. A demand for a definitive zero is impossible to meet. The best we can say is: &#8220;Based on our sample, we&#8217;re highly confident the prevalence is below some small threshold.&#8221;</p><p>The pitfall is that authorities or the media might spin zero positives as total absence. Then, if a single case appears later, it could damage trust in the data or the health department. The recommended approach is to carefully phrase the conclusion, emphasizing that zero positives in 1000 tests strongly suggests a very low prevalence, but not a literal zero. Using intervals (e.g., &#8220;very likely below 0.3%&#8221;) or probabilities (e.g., &#8220;95% chance it&#8217;s below 0.3%&#8221;) manages expectations better. Scientific caution is key, even though it may not align perfectly with public desire for certainty.</p><h2><strong>What if the city&#8217;s population is quite large (e.g., millions) and 1000 tests is a relatively small fraction, but we still see zero positives?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!EZ-P!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d8b3500-6e25-4914-a3d5-e49d206c78ab_930x559.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!EZ-P!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d8b3500-6e25-4914-a3d5-e49d206c78ab_930x559.png 424w, https://substackcdn.com/image/fetch/$s_!EZ-P!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d8b3500-6e25-4914-a3d5-e49d206c78ab_930x559.png 848w, https://substackcdn.com/image/fetch/$s_!EZ-P!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d8b3500-6e25-4914-a3d5-e49d206c78ab_930x559.png 1272w, https://substackcdn.com/image/fetch/$s_!EZ-P!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d8b3500-6e25-4914-a3d5-e49d206c78ab_930x559.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!EZ-P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d8b3500-6e25-4914-a3d5-e49d206c78ab_930x559.png" width="930" height="559" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6d8b3500-6e25-4914-a3d5-e49d206c78ab_930x559.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:559,&quot;width&quot;:930,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:133706,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165088957?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d8b3500-6e25-4914-a3d5-e49d206c78ab_930x559.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!EZ-P!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d8b3500-6e25-4914-a3d5-e49d206c78ab_930x559.png 424w, https://substackcdn.com/image/fetch/$s_!EZ-P!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d8b3500-6e25-4914-a3d5-e49d206c78ab_930x559.png 848w, https://substackcdn.com/image/fetch/$s_!EZ-P!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d8b3500-6e25-4914-a3d5-e49d206c78ab_930x559.png 1272w, https://substackcdn.com/image/fetch/$s_!EZ-P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d8b3500-6e25-4914-a3d5-e49d206c78ab_930x559.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>What if the city suspects the disease is so rare that they only tested the highest-risk people (like symptomatic individuals), and still got zero positives?</strong></h2><p>Testing only high-risk or symptomatic individuals and finding zero positives is very strong evidence that the disease is absent in that specific group. If the disease typically manifests with clear symptoms, that lowers the chance that it exists silently among symptomatic people. But it says less about truly asymptomatic or mild cases in the broader population.</p><p>In a binomial framework, we are no longer sampling from the general population with a probability p. Instead, we&#8217;re sampling from a subpopulation with presumably higher disease probability. Observing zero there might push us to an even lower estimate of city-wide prevalence, or at least for the prevalence among symptomatic individuals. The pitfall is confusing the result among symptomatic or high-risk individuals with the overall city prevalence. The city might still have infected individuals who do not present strong symptoms or do not consider themselves &#8220;high-risk.&#8221;</p><h2><strong>How might privacy laws or data regulations (e.g., HIPAA) limit the precision or sample design we can use?</strong></h2><p>Privacy concerns might prevent us from collecting granular data on each test subject&#8217;s demographics, location, or risk factors. Consequently, we can&#8217;t stratify or properly model subpopulation prevalence. We might only have aggregate data like &#8220;0 positives out of 1000.&#8221; This hamper&#8217;s more sophisticated Bayesian or hierarchical approaches that rely on covariates.</p><p>Moreover, we might be unable to recontact individuals for follow-up tests or link test results to hospital records. That can reduce the reliability of our estimates. The pitfall is that if our sampling is forced to remain anonymous or aggregated, we lose the ability to check for repeated tests, analyze group-based differences, or correct for confounders. We have to rely on simpler, coarser statistical approaches, which might widen intervals or require stronger assumptions about representativeness.</p><h2><strong>Could we design an adaptive sampling strategy that adjusts how many additional people to test based on the observed negatives so far?</strong></h2><p>Yes, an adaptive or sequential sampling design is common in industrial quality control or medical surveillance. The idea:</p><ol><li><p>Start by testing a small group (e.g., 200 people).</p></li><li><p>If we see zero positives, check the posterior or confidence interval. If the upper bound is above a certain threshold, we test more individuals to narrow it.</p></li><li><p>Continue until the upper bound on prevalence is below a target threshold (e.g., 0.2%) with high confidence.</p></li></ol><p>This approach can save resources if disease truly is very rare, but it can also quickly scale up if early results suggest a non-trivial prevalence. The pitfall is not setting clear stopping criteria. If we keep testing indefinitely to push the upper bound lower and lower, we might run out of resources. Also, each additional round of testing must be random or representative to ensure valid inferences, which can be logistically complex.</p><h2><strong>If the city is planning an event (e.g., a large festival), how does zero positives in a sample inform risk assessment for that event?</strong></h2><p>Zero positives is reassuring, but risk assessment for an event depends on:</p><ol><li><p><strong>Time-lag</strong>: The tests reflect the situation at sampling time, not necessarily the future event date.</p></li><li><p><strong>Potential introduction from outside</strong>: People from elsewhere may come to the festival, so local zero prevalence doesn&#8217;t guarantee no one will bring in the disease.</p></li><li><p><strong>Population mixing at the event</strong>: Even if local prevalence is near zero, a single infected visitor could spark an outbreak if transmission at large gatherings is efficient.</p></li></ol><p>Hence, from a public health standpoint, we might combine these zero-positive results with:</p><ul><li><p>Travel data: Are people coming from regions with higher prevalence?</p></li><li><p>Vaccination or immunity checks: Are attendees required to show negative tests or proof of vaccination?</p></li><li><p>Mitigation measures: Mask requirements, social distancing, or capacity limits.</p></li></ul><p>A pitfall is overconfidence in the city&#8217;s data while ignoring external sources of infection. Another subtlety is that a large event might change contact patterns drastically, so a near-zero city prevalence might not remain near zero if a single infected attendee arrives. Thus, zero positives is good news, but event-level risk must consider multiple factors beyond the local snapshot.</p><h2><strong>How does the uncertainty around each test&#8217;s specificity matter if we found zero positives?</strong></h2><p>Specificity is the true negative rate. If a test is less than 100% specific, it means some negative results might actually be false negatives&#8212;but typically specificity relates to false positives (so, a test with less than 100% specificity might incorrectly label healthy people as positive). Because we got zero positives, specificity doesn&#8217;t come into play directly for a negative classification. However, one subtlety is:</p><ul><li><p>If the test had less than perfect specificity, it might produce some false positives in a large sample. Yet we got zero positives. That suggests either an extremely small prevalence or the specificity might be better than we thought.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3Rh-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F645b88e0-41ad-412a-966f-c30494cdbcef_929x411.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3Rh-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F645b88e0-41ad-412a-966f-c30494cdbcef_929x411.png 424w, https://substackcdn.com/image/fetch/$s_!3Rh-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F645b88e0-41ad-412a-966f-c30494cdbcef_929x411.png 848w, https://substackcdn.com/image/fetch/$s_!3Rh-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F645b88e0-41ad-412a-966f-c30494cdbcef_929x411.png 1272w, https://substackcdn.com/image/fetch/$s_!3Rh-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F645b88e0-41ad-412a-966f-c30494cdbcef_929x411.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3Rh-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F645b88e0-41ad-412a-966f-c30494cdbcef_929x411.png" width="929" height="411" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/645b88e0-41ad-412a-966f-c30494cdbcef_929x411.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:411,&quot;width&quot;:929,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:107485,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165088957?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F645b88e0-41ad-412a-966f-c30494cdbcef_929x411.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!3Rh-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F645b88e0-41ad-412a-966f-c30494cdbcef_929x411.png 424w, https://substackcdn.com/image/fetch/$s_!3Rh-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F645b88e0-41ad-412a-966f-c30494cdbcef_929x411.png 848w, https://substackcdn.com/image/fetch/$s_!3Rh-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F645b88e0-41ad-412a-966f-c30494cdbcef_929x411.png 1272w, https://substackcdn.com/image/fetch/$s_!3Rh-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F645b88e0-41ad-412a-966f-c30494cdbcef_929x411.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Could partial data on positivity from older tests or adjacent time frames be combined with the current zero-positives to refine the estimate?</strong></h2><p>Absolutely. If we have historical data&#8212;for instance, last month 2000 people were tested, and 2 positives were found, then this month 1000 were tested with 0 positives&#8212;that can be combined in either a frequentist or Bayesian approach. We can pool the data (3000 tested, 2 positives) to get a single prevalence estimate, or we can separate them by time period and do a time-series approach.</p><p>A Bayesian approach might treat each month&#8217;s data as a separate binomial trial with a prevalence that evolves slightly over time. The posterior from the first month becomes the prior for the second month, etc. The pitfall is ignoring the time dimension. If prevalence changes from month to month, simply pooling might be misleading. Also, if the sample is not comparable across months (different demographics or testing criteria), mixing them without adjustments is risky. But done carefully, older data can reduce overall uncertainty. The new zero positives strongly suggests a downward shift in prevalence compared to the older data with 2 positives, leading to an updated, smaller estimate for the current time frame.</p><h2><strong>If the city leaders want a margin of safety, how should they interpret these statistical intervals?</strong></h2><p>Leaders might adopt a conservative stance: even if the 95% upper bound is 0.3%, they might plan for the possibility that 0.3% is real. This is especially relevant if the disease is dangerous or has severe consequences. In practice, they might use the upper bound in worst-case scenario planning. For instance, if the city&#8217;s population is 1 million, 0.3% would mean up to 3,000 infected individuals. That&#8217;s not trivial if the disease is serious.</p><p>Thus, city leaders might implement proportionate measures even though the central estimate is near zero. The pitfall is ignoring the difference between the central best estimate and the upper bound. Overly conservative policy might be expensive or disruptive. At the same time, ignoring the upper bound might create complacency. A balanced approach is to weigh the worst-case scenario from the confidence interval against costs and other risk factors (like how quickly the disease might spread).</p><h2><strong>Could &#8220;zero positives in 1000&#8221; be used to approximate a p-value for testing the hypothesis p=0.01 or p=0.005?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9rbY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcb054ec-9730-4880-b86e-27070abad048_916x246.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9rbY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcb054ec-9730-4880-b86e-27070abad048_916x246.png 424w, https://substackcdn.com/image/fetch/$s_!9rbY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcb054ec-9730-4880-b86e-27070abad048_916x246.png 848w, https://substackcdn.com/image/fetch/$s_!9rbY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcb054ec-9730-4880-b86e-27070abad048_916x246.png 1272w, https://substackcdn.com/image/fetch/$s_!9rbY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcb054ec-9730-4880-b86e-27070abad048_916x246.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9rbY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcb054ec-9730-4880-b86e-27070abad048_916x246.png" width="916" height="246" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dcb054ec-9730-4880-b86e-27070abad048_916x246.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:246,&quot;width&quot;:916,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:69400,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165088957?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcb054ec-9730-4880-b86e-27070abad048_916x246.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9rbY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcb054ec-9730-4880-b86e-27070abad048_916x246.png 424w, https://substackcdn.com/image/fetch/$s_!9rbY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcb054ec-9730-4880-b86e-27070abad048_916x246.png 848w, https://substackcdn.com/image/fetch/$s_!9rbY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcb054ec-9730-4880-b86e-27070abad048_916x246.png 1272w, https://substackcdn.com/image/fetch/$s_!9rbY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcb054ec-9730-4880-b86e-27070abad048_916x246.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This approach is a classical hypothesis test. The pitfall is that p-values can be misinterpreted as the probability the city&#8217;s prevalence is at least 0.01, which is not correct. It&#8217;s just the probability of seeing zero positives if the true p=0.01. Also, we can test various hypothesized values. This is less commonly done in epidemiological practice compared to interval estimation or Bayesian updating, but it can be used for quick check of a specific threshold.</p><h2><strong>If we suspect strong confounding variables (e.g., the sample is only young adults) how do we adjust the estimate to the entire city&#8217;s age distribution?</strong></h2><p>If the tested sample is primarily young adults, but the entire city has a range of ages, we need a post-stratification adjustment. If disease prevalence strongly depends on age, a direct inference from a mostly young sample to the entire city might be biased. One solution is to:</p><ol><li><p>Estimate age-specific prevalence within the sample (though we have zero positives, so it&#8217;s challenging).</p></li><li><p>Weight those age-specific estimates according to the city&#8217;s known age distribution.</p></li></ol><p>Because we have zero positives in each age bracket of the sample, we might do a Bayesian approach with a small prior for each bracket. Then a partial pooling or hierarchical approach can share information across age groups. The pitfall is small sample sizes in some brackets. If older adults are underrepresented, we have little direct evidence about that group. A carefully stratified sampling design from the start would have avoided the confounding. But if we must adjust after the fact, we rely on assumptions about how the disease prevalence differs by age. If those assumptions are off, the final city-wide estimate could still be biased.</p><h2><strong>How does the type of test (antibody vs. antigen vs. PCR) affect the interpretation of zero positives?</strong></h2><ul><li><p><strong>Antibody test</strong>: Typically measures whether an individual had the infection in the past. If the disease was never present or only recently introduced, an antibody test might not detect it yet. Zero positives might reflect either no prior infection or that not enough time has passed for antibodies to develop.</p></li><li><p><strong>Antigen or PCR</strong>: Detects current infection. Zero positives means no current active infection among those tested at that moment. However, it says little about past infections if individuals have already cleared the virus.</p></li></ul><p>Hence, we must be clear which aspect of infection we&#8217;re measuring. Observing zero antibody positives could mean the disease was truly absent historically, or that the population is newly exposed and hasn&#8217;t developed antibodies. Observing zero antigen/PCR positives means no active cases at the test time, not necessarily zero overall exposure. A pitfall is mixing these test types without clarity, leading to confusion about whether we&#8217;re measuring current or past infection rates.</p><h2><strong>What if the disease is so severe that infected individuals immediately seek treatment, so you&#8217;d never find them randomly in a street sample?</strong></h2><p>Certain diseases (like Ebola or other severe infections) may drive symptomatic individuals rapidly into hospitals, making them unlikely to be found in random community testing. Then a random sample that yields zero positives might simply be missing the cases that are already hospitalized. To accurately estimate prevalence, we might need to include hospital data or do a thorough check of recently hospitalized individuals.</p><p>A potential pitfall is concluding the disease is absent in the entire city just because no one on the streets tested positive. In reality, the cases might be quarantined or in specialized units. This again highlights the importance of knowing the natural history of the disease and how that affects the chance of encountering infected individuals in any sampling method.</p><h2><strong>Could we leverage experts&#8217; opinions or existing epidemiological models to define a more informative prior rather than a generic Beta distribution?</strong></h2><p>Yes, one common approach is eliciting a prior from domain experts. For example, local epidemiologists might say, &#8220;We believe there&#8217;s an 80% chance the prevalence is between 0.05% and 0.2%, and almost no chance it&#8217;s above 1%.&#8221; We can translate that into parameters for a Beta distribution or even piecewise distributions. That prior can be combined with the binomial likelihood from the sample.</p><p>The advantage is more realism than a uniform or ad-hoc prior. The pitfall is subjectivity&#8212;experts could be wrong, or might have bias. If the data strongly contradicts the expert prior, we must rely on the posterior to reflect that tension. And if 0 positives appear, it might drastically reduce the plausibility of the expert&#8217;s higher estimates. This can cause friction if experts are hesitant to revise their beliefs. Proper use of Bayesian methods demands we let the data override prior beliefs when there&#8217;s a strong discrepancy.</p><h2><strong>If we repeated the test on 10,000 people and still got zero positives, does that definitively prove no disease is present?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cbhX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9be9253c-71ed-4440-a3e1-cb1c8f63c959_920x225.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cbhX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9be9253c-71ed-4440-a3e1-cb1c8f63c959_920x225.png 424w, https://substackcdn.com/image/fetch/$s_!cbhX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9be9253c-71ed-4440-a3e1-cb1c8f63c959_920x225.png 848w, https://substackcdn.com/image/fetch/$s_!cbhX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9be9253c-71ed-4440-a3e1-cb1c8f63c959_920x225.png 1272w, https://substackcdn.com/image/fetch/$s_!cbhX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9be9253c-71ed-4440-a3e1-cb1c8f63c959_920x225.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cbhX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9be9253c-71ed-4440-a3e1-cb1c8f63c959_920x225.png" width="920" height="225" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9be9253c-71ed-4440-a3e1-cb1c8f63c959_920x225.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:225,&quot;width&quot;:920,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:53213,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165088957?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9be9253c-71ed-4440-a3e1-cb1c8f63c959_920x225.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!cbhX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9be9253c-71ed-4440-a3e1-cb1c8f63c959_920x225.png 424w, https://substackcdn.com/image/fetch/$s_!cbhX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9be9253c-71ed-4440-a3e1-cb1c8f63c959_920x225.png 848w, https://substackcdn.com/image/fetch/$s_!cbhX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9be9253c-71ed-4440-a3e1-cb1c8f63c959_920x225.png 1272w, https://substackcdn.com/image/fetch/$s_!cbhX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9be9253c-71ed-4440-a3e1-cb1c8f63c959_920x225.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Practically, 10,000 tests might make us very confident that the disease is not widespread. But a small outbreak or single-digit cases in a city of millions could still be missed. The pitfall is complacency. A surprise outbreak might still occur if conditions suddenly change or if a case enters from outside. It&#8217;s safer to say &#8220;the disease is extremely rare or possibly absent,&#8221; not that it&#8217;s definitively nonexistent.</p><h2><strong>Does zero positives imply anything about the risk of future outbreaks?</strong></h2><p>Not necessarily. Zero positives only shows that at the time of sampling, there were no current detected cases. If the disease is highly transmissible and arrives with a single infected traveler, an outbreak can occur quickly. If the local population isn&#8217;t immune, the risk of future outbreaks depends on external factors (travel, neighboring regions, wildlife reservoirs, etc.). Zero positives might reduce the probability that an outbreak is already silently spreading, but it doesn&#8217;t remove the risk of future introductions.</p><p>The pitfall is ignoring external introduction. Diseases don&#8217;t respect city boundaries. A city with zero positives can become a hotspot if an infected person arrives and conditions favor rapid transmission. Public health policy often focuses on surveillance at points of entry or ongoing random tests, even if the current prevalence is near zero, to catch new introductions early.</p><h2><strong>What if &#8220;0 out of 1000&#8221; is a simplified summary, but in reality, a small fraction of tests were inconclusive?</strong></h2><p>Inconclusive or invalid tests are common in practice. If some portion&#8212;say 50 out of 1000&#8212;were invalid and had to be discarded or repeated, we effectively only have 950 valid negatives. Or if inconclusive results are a separate category, we need to figure out how to incorporate them. Some inconclusive tests might have been positive but unreadable, or might simply be test-lab errors.</p><p>One approach is to treat inconclusives as missing data. If we re-run them or eventually classify them, we can finalize the count. If we can&#8217;t retest them, we might incorporate a modeling assumption that inconclusives have the same probability of positivity as the overall sample or possibly a different probability if we suspect they were borderline. The pitfall is incorrectly counting inconclusive results as negatives or ignoring them altogether, which might bias the prevalence estimate. A robust method either excludes them properly or accounts for them with a missing-data approach, potentially introducing more uncertainty.</p><h2><strong>How might we respond if a local news headline runs &#8220;Disease totally eradicated in City X!&#8221; citing zero positives?</strong></h2><p>As a statistician or data scientist, the correct response is to clarify that zero positives in 1000 tests strongly suggests a very low prevalence but does not prove eradication. We can provide the statistical intervals or Bayesian posterior distribution to show that there remains a small but nonzero probability that the disease exists in a tiny fraction of the population.</p><p>The pitfall is in public misunderstanding or sensationalism. The phrase &#8220;eradicated&#8221; implies the disease is gone with 100% certainty. We&#8217;d caution that while the evidence is good that the disease is rare or absent, ongoing surveillance is prudent. A single moment of zero positives doesn&#8217;t guarantee zero future risk. This is a classic communication challenge: bridging the gap between statistical nuance and news-friendly language.</p>]]></content:encoded></item><item><title><![CDATA[ML Interview Q Series: Maximum Likelihood Estimation for Uniform Distribution Bounds]]></title><description><![CDATA[Browse all the Probability Interview Questions here.]]></description><link>https://www.rohan-paul.com/p/ml-interview-q-series-maximum-likelihood</link><guid isPermaLink="false">https://www.rohan-paul.com/p/ml-interview-q-series-maximum-likelihood</guid><pubDate>Tue, 03 Jun 2025 11:40:24 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!9uYK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F908b7172-a659-4725-ad32-8822ac1e149f_1024x572.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9uYK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F908b7172-a659-4725-ad32-8822ac1e149f_1024x572.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9uYK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F908b7172-a659-4725-ad32-8822ac1e149f_1024x572.png 424w, https://substackcdn.com/image/fetch/$s_!9uYK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F908b7172-a659-4725-ad32-8822ac1e149f_1024x572.png 848w, https://substackcdn.com/image/fetch/$s_!9uYK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F908b7172-a659-4725-ad32-8822ac1e149f_1024x572.png 1272w, https://substackcdn.com/image/fetch/$s_!9uYK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F908b7172-a659-4725-ad32-8822ac1e149f_1024x572.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9uYK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F908b7172-a659-4725-ad32-8822ac1e149f_1024x572.png" width="1024" height="572" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/908b7172-a659-4725-ad32-8822ac1e149f_1024x572.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:572,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:969898,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165087454?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F908b7172-a659-4725-ad32-8822ac1e149f_1024x572.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9uYK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F908b7172-a659-4725-ad32-8822ac1e149f_1024x572.png 424w, https://substackcdn.com/image/fetch/$s_!9uYK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F908b7172-a659-4725-ad32-8822ac1e149f_1024x572.png 848w, https://substackcdn.com/image/fetch/$s_!9uYK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F908b7172-a659-4725-ad32-8822ac1e149f_1024x572.png 1272w, https://substackcdn.com/image/fetch/$s_!9uYK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F908b7172-a659-4725-ad32-8822ac1e149f_1024x572.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Browse all the <strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">Probability Interview Questions here</a></strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">.</a></p><h2><strong>7. Say you draw n samples from a uniform distribution U(a, b). What is the MLE estimate of a and b?</strong></h2><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://x.com/rohanpaul_ai&quot;,&quot;text&quot;:&quot;Connect with me on X (Twitter)&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://x.com/rohanpaul_ai"><span>Connect with me on X (Twitter)</span></a></p><p>Understanding Maximum Likelihood Estimation (MLE) for the Uniform distribution can be very intuitive if we look at the geometry of the problem. However, let&#8217;s delve into the details, step by step, to give the strongest possible reasoning. We want to consider the distribution:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!erwA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fc15044-0a24-479b-992a-a30a3c605455_921x537.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!erwA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fc15044-0a24-479b-992a-a30a3c605455_921x537.png 424w, https://substackcdn.com/image/fetch/$s_!erwA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fc15044-0a24-479b-992a-a30a3c605455_921x537.png 848w, https://substackcdn.com/image/fetch/$s_!erwA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fc15044-0a24-479b-992a-a30a3c605455_921x537.png 1272w, https://substackcdn.com/image/fetch/$s_!erwA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fc15044-0a24-479b-992a-a30a3c605455_921x537.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!erwA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fc15044-0a24-479b-992a-a30a3c605455_921x537.png" width="921" height="537" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4fc15044-0a24-479b-992a-a30a3c605455_921x537.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:537,&quot;width&quot;:921,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:79427,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165087454?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fc15044-0a24-479b-992a-a30a3c605455_921x537.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!erwA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fc15044-0a24-479b-992a-a30a3c605455_921x537.png 424w, https://substackcdn.com/image/fetch/$s_!erwA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fc15044-0a24-479b-992a-a30a3c605455_921x537.png 848w, https://substackcdn.com/image/fetch/$s_!erwA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fc15044-0a24-479b-992a-a30a3c605455_921x537.png 1272w, https://substackcdn.com/image/fetch/$s_!erwA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4fc15044-0a24-479b-992a-a30a3c605455_921x537.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FSUK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f5ab549-6153-420d-9f86-7d3bf102174c_1038x645.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FSUK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f5ab549-6153-420d-9f86-7d3bf102174c_1038x645.png 424w, https://substackcdn.com/image/fetch/$s_!FSUK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f5ab549-6153-420d-9f86-7d3bf102174c_1038x645.png 848w, https://substackcdn.com/image/fetch/$s_!FSUK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f5ab549-6153-420d-9f86-7d3bf102174c_1038x645.png 1272w, https://substackcdn.com/image/fetch/$s_!FSUK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f5ab549-6153-420d-9f86-7d3bf102174c_1038x645.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FSUK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f5ab549-6153-420d-9f86-7d3bf102174c_1038x645.png" width="1038" height="645" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2f5ab549-6153-420d-9f86-7d3bf102174c_1038x645.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:645,&quot;width&quot;:1038,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:89621,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165087454?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f5ab549-6153-420d-9f86-7d3bf102174c_1038x645.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!FSUK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f5ab549-6153-420d-9f86-7d3bf102174c_1038x645.png 424w, https://substackcdn.com/image/fetch/$s_!FSUK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f5ab549-6153-420d-9f86-7d3bf102174c_1038x645.png 848w, https://substackcdn.com/image/fetch/$s_!FSUK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f5ab549-6153-420d-9f86-7d3bf102174c_1038x645.png 1272w, https://substackcdn.com/image/fetch/$s_!FSUK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f5ab549-6153-420d-9f86-7d3bf102174c_1038x645.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mMgg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde9523f8-a2bc-47a7-bdb6-c376cf6ae3a0_900x361.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mMgg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde9523f8-a2bc-47a7-bdb6-c376cf6ae3a0_900x361.png 424w, https://substackcdn.com/image/fetch/$s_!mMgg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde9523f8-a2bc-47a7-bdb6-c376cf6ae3a0_900x361.png 848w, https://substackcdn.com/image/fetch/$s_!mMgg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde9523f8-a2bc-47a7-bdb6-c376cf6ae3a0_900x361.png 1272w, https://substackcdn.com/image/fetch/$s_!mMgg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde9523f8-a2bc-47a7-bdb6-c376cf6ae3a0_900x361.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mMgg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde9523f8-a2bc-47a7-bdb6-c376cf6ae3a0_900x361.png" width="900" height="361" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/de9523f8-a2bc-47a7-bdb6-c376cf6ae3a0_900x361.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:361,&quot;width&quot;:900,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:66836,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165087454?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde9523f8-a2bc-47a7-bdb6-c376cf6ae3a0_900x361.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!mMgg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde9523f8-a2bc-47a7-bdb6-c376cf6ae3a0_900x361.png 424w, https://substackcdn.com/image/fetch/$s_!mMgg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde9523f8-a2bc-47a7-bdb6-c376cf6ae3a0_900x361.png 848w, https://substackcdn.com/image/fetch/$s_!mMgg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde9523f8-a2bc-47a7-bdb6-c376cf6ae3a0_900x361.png 1272w, https://substackcdn.com/image/fetch/$s_!mMgg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde9523f8-a2bc-47a7-bdb6-c376cf6ae3a0_900x361.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This result aligns perfectly with intuition: to fit a uniform distribution via MLE, you essentially want to pick the smallest observed value as the estimated lower bound and the largest observed value as the estimated upper bound.</p><p>A deeper explanation behind why these are indeed the MLE solutions is that any deviation from these extremes would either (1) exclude some sample points from the domain of the uniform or (2) unnecessarily expand the interval, reducing the height of the uniform density and hence lowering the likelihood. The MLE solution precisely &#8220;pins&#8221; the edges of the distribution to the outermost data points.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9MNU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd298c2ac-32d5-4cb2-8fb7-1931c5020f7d_926x197.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9MNU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd298c2ac-32d5-4cb2-8fb7-1931c5020f7d_926x197.png 424w, https://substackcdn.com/image/fetch/$s_!9MNU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd298c2ac-32d5-4cb2-8fb7-1931c5020f7d_926x197.png 848w, https://substackcdn.com/image/fetch/$s_!9MNU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd298c2ac-32d5-4cb2-8fb7-1931c5020f7d_926x197.png 1272w, https://substackcdn.com/image/fetch/$s_!9MNU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd298c2ac-32d5-4cb2-8fb7-1931c5020f7d_926x197.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9MNU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd298c2ac-32d5-4cb2-8fb7-1931c5020f7d_926x197.png" width="926" height="197" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d298c2ac-32d5-4cb2-8fb7-1931c5020f7d_926x197.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:197,&quot;width&quot;:926,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:43232,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165087454?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd298c2ac-32d5-4cb2-8fb7-1931c5020f7d_926x197.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9MNU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd298c2ac-32d5-4cb2-8fb7-1931c5020f7d_926x197.png 424w, https://substackcdn.com/image/fetch/$s_!9MNU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd298c2ac-32d5-4cb2-8fb7-1931c5020f7d_926x197.png 848w, https://substackcdn.com/image/fetch/$s_!9MNU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd298c2ac-32d5-4cb2-8fb7-1931c5020f7d_926x197.png 1272w, https://substackcdn.com/image/fetch/$s_!9MNU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd298c2ac-32d5-4cb2-8fb7-1931c5020f7d_926x197.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>You can also see how easily this can be coded in Python if we assume your samples are in a NumPy array called &#8220;samples&#8221;:</p><pre><code><code>import numpy as np

def uniform_mle_params(samples):
    a_hat = np.min(samples)
    b_hat = np.max(samples)
    return a_hat, b_hat

data = np.array([1.2, 2.5, 3.7, 2.9, 1.8])
a_est, b_est = uniform_mle_params(data)
print("MLE estimate for a:", a_est)
print("MLE estimate for b:", b_est)
</code></code></pre><p>This code snippet reflects the idea: estimate a by the minimum of the sample data, and estimate b by the maximum.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.rohan-paul.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">I write everyday for my readers on actionable AI. Subscribe and instantly get a 1300+ page Python book.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!BiII!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d73aaab-463c-498c-b89c-46e6cb21b671_934x461.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BiII!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d73aaab-463c-498c-b89c-46e6cb21b671_934x461.png 424w, https://substackcdn.com/image/fetch/$s_!BiII!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d73aaab-463c-498c-b89c-46e6cb21b671_934x461.png 848w, https://substackcdn.com/image/fetch/$s_!BiII!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d73aaab-463c-498c-b89c-46e6cb21b671_934x461.png 1272w, https://substackcdn.com/image/fetch/$s_!BiII!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d73aaab-463c-498c-b89c-46e6cb21b671_934x461.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BiII!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d73aaab-463c-498c-b89c-46e6cb21b671_934x461.png" width="934" height="461" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9d73aaab-463c-498c-b89c-46e6cb21b671_934x461.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:461,&quot;width&quot;:934,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:95930,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165087454?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d73aaab-463c-498c-b89c-46e6cb21b671_934x461.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!BiII!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d73aaab-463c-498c-b89c-46e6cb21b671_934x461.png 424w, https://substackcdn.com/image/fetch/$s_!BiII!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d73aaab-463c-498c-b89c-46e6cb21b671_934x461.png 848w, https://substackcdn.com/image/fetch/$s_!BiII!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d73aaab-463c-498c-b89c-46e6cb21b671_934x461.png 1272w, https://substackcdn.com/image/fetch/$s_!BiII!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d73aaab-463c-498c-b89c-46e6cb21b671_934x461.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>What if the data is not truly uniform in real-world scenarios?</strong></h2><p>In many real-world applications, data might approximate a uniform distribution but not match it perfectly. The MLE procedure remains the same: you find the smallest and largest data points as your best estimate for the bounds. However, in practice, you might want to consider outliers. A single outlier might greatly shift your a or b estimates, creating a very large interval and lowering the overall density. This can be problematic if the distribution is only &#8220;near-uniform&#8221; or truncated in reality. Practitioners might resort to robust methods or consult domain knowledge to decide if some extreme values should be removed or if a Bayesian prior should be considered.</p><h2><strong>How do outliers affect the MLE estimate for U(a, b)?</strong></h2><p>The uniform distribution by its mathematical definition requires that the entire range is captured. So a single outlier that is extremely large (or small) extends your uniform range drastically, resulting in a wide interval. This phenomenon can cause a wide uniform distribution with a small height (since 1/(b&#8722;a) becomes smaller if b&#8722;a is large). If you truly believe the data is uniform with no reason to discard that outlier, the MLE approach forcibly includes that outlier in the domain, producing the correct (though perhaps undesirable) estimate. In practice, if you suspect that outliers may come from measurement error or from a different data-generating process, you might adopt a more nuanced approach, possibly a robust variant or a truncated outlier removal approach.</p><h2><strong>Could we do a Bayesian approach for a and b?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PliI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12544cf9-a54d-4fa3-a2dc-db618af59f78_937x449.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PliI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12544cf9-a54d-4fa3-a2dc-db618af59f78_937x449.png 424w, https://substackcdn.com/image/fetch/$s_!PliI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12544cf9-a54d-4fa3-a2dc-db618af59f78_937x449.png 848w, https://substackcdn.com/image/fetch/$s_!PliI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12544cf9-a54d-4fa3-a2dc-db618af59f78_937x449.png 1272w, https://substackcdn.com/image/fetch/$s_!PliI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12544cf9-a54d-4fa3-a2dc-db618af59f78_937x449.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PliI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12544cf9-a54d-4fa3-a2dc-db618af59f78_937x449.png" width="937" height="449" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/12544cf9-a54d-4fa3-a2dc-db618af59f78_937x449.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:449,&quot;width&quot;:937,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:110310,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165087454?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12544cf9-a54d-4fa3-a2dc-db618af59f78_937x449.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!PliI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12544cf9-a54d-4fa3-a2dc-db618af59f78_937x449.png 424w, https://substackcdn.com/image/fetch/$s_!PliI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12544cf9-a54d-4fa3-a2dc-db618af59f78_937x449.png 848w, https://substackcdn.com/image/fetch/$s_!PliI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12544cf9-a54d-4fa3-a2dc-db618af59f78_937x449.png 1272w, https://substackcdn.com/image/fetch/$s_!PliI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12544cf9-a54d-4fa3-a2dc-db618af59f78_937x449.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>How can we verify the MLE solution is indeed optimal?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RHMq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c2d516f-31fe-49d2-bbce-4879fa2b64ea_933x456.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RHMq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c2d516f-31fe-49d2-bbce-4879fa2b64ea_933x456.png 424w, https://substackcdn.com/image/fetch/$s_!RHMq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c2d516f-31fe-49d2-bbce-4879fa2b64ea_933x456.png 848w, https://substackcdn.com/image/fetch/$s_!RHMq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c2d516f-31fe-49d2-bbce-4879fa2b64ea_933x456.png 1272w, https://substackcdn.com/image/fetch/$s_!RHMq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c2d516f-31fe-49d2-bbce-4879fa2b64ea_933x456.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RHMq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c2d516f-31fe-49d2-bbce-4879fa2b64ea_933x456.png" width="933" height="456" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3c2d516f-31fe-49d2-bbce-4879fa2b64ea_933x456.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:456,&quot;width&quot;:933,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:121444,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165087454?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c2d516f-31fe-49d2-bbce-4879fa2b64ea_933x456.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!RHMq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c2d516f-31fe-49d2-bbce-4879fa2b64ea_933x456.png 424w, https://substackcdn.com/image/fetch/$s_!RHMq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c2d516f-31fe-49d2-bbce-4879fa2b64ea_933x456.png 848w, https://substackcdn.com/image/fetch/$s_!RHMq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c2d516f-31fe-49d2-bbce-4879fa2b64ea_933x456.png 1272w, https://substackcdn.com/image/fetch/$s_!RHMq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c2d516f-31fe-49d2-bbce-4879fa2b64ea_933x456.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Could there be a bias or an alternative solution?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ggrw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2eaed3a1-428c-4066-a8bb-79002136f60e_931x440.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ggrw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2eaed3a1-428c-4066-a8bb-79002136f60e_931x440.png 424w, https://substackcdn.com/image/fetch/$s_!ggrw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2eaed3a1-428c-4066-a8bb-79002136f60e_931x440.png 848w, https://substackcdn.com/image/fetch/$s_!ggrw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2eaed3a1-428c-4066-a8bb-79002136f60e_931x440.png 1272w, https://substackcdn.com/image/fetch/$s_!ggrw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2eaed3a1-428c-4066-a8bb-79002136f60e_931x440.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ggrw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2eaed3a1-428c-4066-a8bb-79002136f60e_931x440.png" width="931" height="440" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2eaed3a1-428c-4066-a8bb-79002136f60e_931x440.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:440,&quot;width&quot;:931,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:114377,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165087454?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2eaed3a1-428c-4066-a8bb-79002136f60e_931x440.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ggrw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2eaed3a1-428c-4066-a8bb-79002136f60e_931x440.png 424w, https://substackcdn.com/image/fetch/$s_!ggrw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2eaed3a1-428c-4066-a8bb-79002136f60e_931x440.png 848w, https://substackcdn.com/image/fetch/$s_!ggrw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2eaed3a1-428c-4066-a8bb-79002136f60e_931x440.png 1272w, https://substackcdn.com/image/fetch/$s_!ggrw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2eaed3a1-428c-4066-a8bb-79002136f60e_931x440.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Potential pitfalls in implementing the uniform MLE approach in code</strong></h2><p>One pitfall is the presence of any data point that is unexpected or incorrectly measured. Because the uniform distribution is extremely sensitive to outliers (the largest or smallest point dominates the estimate of the entire range), even a single measurement error or outlier can cause the interval to become very large. In real-world data pipelines, it&#8217;s common to run outlier detection or sanity checks prior to committing to a uniform distribution assumption. Another pitfall is if the distribution is not truly uniform. Sometimes you might approximate something with a uniform distribution for convenience, but the data might be heavily skewed or follow a different shape. The MLE method described above will produce correct estimates for a pure uniform distribution, but it might perform poorly if your assumption is severely violated.</p><h2><strong>Conclusion of the MLE for a uniform distribution</strong></h2><p>Based on the likelihood analysis, the MLE solution to find the parameters of the uniform distribution U(a,b) is simply:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!B4nO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F182710dd-da91-48c3-9783-d99fba9fff95_660x137.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!B4nO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F182710dd-da91-48c3-9783-d99fba9fff95_660x137.png 424w, https://substackcdn.com/image/fetch/$s_!B4nO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F182710dd-da91-48c3-9783-d99fba9fff95_660x137.png 848w, https://substackcdn.com/image/fetch/$s_!B4nO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F182710dd-da91-48c3-9783-d99fba9fff95_660x137.png 1272w, https://substackcdn.com/image/fetch/$s_!B4nO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F182710dd-da91-48c3-9783-d99fba9fff95_660x137.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!B4nO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F182710dd-da91-48c3-9783-d99fba9fff95_660x137.png" width="660" height="137" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/182710dd-da91-48c3-9783-d99fba9fff95_660x137.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:137,&quot;width&quot;:660,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:11937,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165087454?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F182710dd-da91-48c3-9783-d99fba9fff95_660x137.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!B4nO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F182710dd-da91-48c3-9783-d99fba9fff95_660x137.png 424w, https://substackcdn.com/image/fetch/$s_!B4nO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F182710dd-da91-48c3-9783-d99fba9fff95_660x137.png 848w, https://substackcdn.com/image/fetch/$s_!B4nO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F182710dd-da91-48c3-9783-d99fba9fff95_660x137.png 1272w, https://substackcdn.com/image/fetch/$s_!B4nO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F182710dd-da91-48c3-9783-d99fba9fff95_660x137.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>This result follows from the fact that you must include all samples in the interval for a non-zero likelihood, and shrinking the interval to exactly the range of the data points maximizes the likelihood. All deeper considerations&#8212;outliers, bias, Bayesian approaches&#8212;do not change this fundamental MLE result, but they do come into play in practical scenarios where data may not be perfectly uniform or might contain anomalies.</p><div><hr></div><h2><strong>Below are additional follow-up questions</strong></h2><h2><strong>Suppose we had a situation where we only observe data points in a specific sub-range of the true uniform distribution. How does that affect the MLE estimates for a and b?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CCBV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cbdff0e-60a0-4708-ac49-628992fa1c88_1022x610.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CCBV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cbdff0e-60a0-4708-ac49-628992fa1c88_1022x610.png 424w, https://substackcdn.com/image/fetch/$s_!CCBV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cbdff0e-60a0-4708-ac49-628992fa1c88_1022x610.png 848w, https://substackcdn.com/image/fetch/$s_!CCBV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cbdff0e-60a0-4708-ac49-628992fa1c88_1022x610.png 1272w, https://substackcdn.com/image/fetch/$s_!CCBV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cbdff0e-60a0-4708-ac49-628992fa1c88_1022x610.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CCBV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cbdff0e-60a0-4708-ac49-628992fa1c88_1022x610.png" width="1022" height="610" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1cbdff0e-60a0-4708-ac49-628992fa1c88_1022x610.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:610,&quot;width&quot;:1022,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:112251,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165087454?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cbdff0e-60a0-4708-ac49-628992fa1c88_1022x610.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!CCBV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cbdff0e-60a0-4708-ac49-628992fa1c88_1022x610.png 424w, https://substackcdn.com/image/fetch/$s_!CCBV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cbdff0e-60a0-4708-ac49-628992fa1c88_1022x610.png 848w, https://substackcdn.com/image/fetch/$s_!CCBV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cbdff0e-60a0-4708-ac49-628992fa1c88_1022x610.png 1272w, https://substackcdn.com/image/fetch/$s_!CCBV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cbdff0e-60a0-4708-ac49-628992fa1c88_1022x610.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Cz8Z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F349dffab-603f-478e-9b44-420e65573a39_1071x566.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Cz8Z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F349dffab-603f-478e-9b44-420e65573a39_1071x566.png 424w, https://substackcdn.com/image/fetch/$s_!Cz8Z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F349dffab-603f-478e-9b44-420e65573a39_1071x566.png 848w, https://substackcdn.com/image/fetch/$s_!Cz8Z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F349dffab-603f-478e-9b44-420e65573a39_1071x566.png 1272w, https://substackcdn.com/image/fetch/$s_!Cz8Z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F349dffab-603f-478e-9b44-420e65573a39_1071x566.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Cz8Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F349dffab-603f-478e-9b44-420e65573a39_1071x566.png" width="1071" height="566" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/349dffab-603f-478e-9b44-420e65573a39_1071x566.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:566,&quot;width&quot;:1071,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:130499,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165087454?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F349dffab-603f-478e-9b44-420e65573a39_1071x566.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Cz8Z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F349dffab-603f-478e-9b44-420e65573a39_1071x566.png 424w, https://substackcdn.com/image/fetch/$s_!Cz8Z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F349dffab-603f-478e-9b44-420e65573a39_1071x566.png 848w, https://substackcdn.com/image/fetch/$s_!Cz8Z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F349dffab-603f-478e-9b44-420e65573a39_1071x566.png 1272w, https://substackcdn.com/image/fetch/$s_!Cz8Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F349dffab-603f-478e-9b44-420e65573a39_1071x566.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>How do floating-point precision issues in real implementations influence the MLE for a and b?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nUNN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43313593-6aa8-4397-9c8e-09867b73d123_943x721.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nUNN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43313593-6aa8-4397-9c8e-09867b73d123_943x721.png 424w, https://substackcdn.com/image/fetch/$s_!nUNN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43313593-6aa8-4397-9c8e-09867b73d123_943x721.png 848w, https://substackcdn.com/image/fetch/$s_!nUNN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43313593-6aa8-4397-9c8e-09867b73d123_943x721.png 1272w, https://substackcdn.com/image/fetch/$s_!nUNN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43313593-6aa8-4397-9c8e-09867b73d123_943x721.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nUNN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43313593-6aa8-4397-9c8e-09867b73d123_943x721.png" width="943" height="721" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/43313593-6aa8-4397-9c8e-09867b73d123_943x721.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:721,&quot;width&quot;:943,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:176058,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165087454?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43313593-6aa8-4397-9c8e-09867b73d123_943x721.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!nUNN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43313593-6aa8-4397-9c8e-09867b73d123_943x721.png 424w, https://substackcdn.com/image/fetch/$s_!nUNN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43313593-6aa8-4397-9c8e-09867b73d123_943x721.png 848w, https://substackcdn.com/image/fetch/$s_!nUNN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43313593-6aa8-4397-9c8e-09867b73d123_943x721.png 1272w, https://substackcdn.com/image/fetch/$s_!nUNN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43313593-6aa8-4397-9c8e-09867b73d123_943x721.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>What if the data comes from a uniform distribution on a circle or some other bounded manifold? Does the MLE for a, b still apply?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JCt0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ccdf807-daa8-4c90-a164-a7a7151d5615_1081x611.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JCt0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ccdf807-daa8-4c90-a164-a7a7151d5615_1081x611.png 424w, https://substackcdn.com/image/fetch/$s_!JCt0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ccdf807-daa8-4c90-a164-a7a7151d5615_1081x611.png 848w, https://substackcdn.com/image/fetch/$s_!JCt0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ccdf807-daa8-4c90-a164-a7a7151d5615_1081x611.png 1272w, https://substackcdn.com/image/fetch/$s_!JCt0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ccdf807-daa8-4c90-a164-a7a7151d5615_1081x611.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JCt0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ccdf807-daa8-4c90-a164-a7a7151d5615_1081x611.png" width="1081" height="611" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3ccdf807-daa8-4c90-a164-a7a7151d5615_1081x611.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:611,&quot;width&quot;:1081,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:183321,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165087454?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ccdf807-daa8-4c90-a164-a7a7151d5615_1081x611.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!JCt0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ccdf807-daa8-4c90-a164-a7a7151d5615_1081x611.png 424w, https://substackcdn.com/image/fetch/$s_!JCt0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ccdf807-daa8-4c90-a164-a7a7151d5615_1081x611.png 848w, https://substackcdn.com/image/fetch/$s_!JCt0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ccdf807-daa8-4c90-a164-a7a7151d5615_1081x611.png 1272w, https://substackcdn.com/image/fetch/$s_!JCt0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ccdf807-daa8-4c90-a164-a7a7151d5615_1081x611.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Can the MLE estimation fail if there is a known gap in the data?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wy0m!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56138a65-0a35-4566-8c96-7b429a4ce600_920x401.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wy0m!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56138a65-0a35-4566-8c96-7b429a4ce600_920x401.png 424w, https://substackcdn.com/image/fetch/$s_!wy0m!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56138a65-0a35-4566-8c96-7b429a4ce600_920x401.png 848w, https://substackcdn.com/image/fetch/$s_!wy0m!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56138a65-0a35-4566-8c96-7b429a4ce600_920x401.png 1272w, https://substackcdn.com/image/fetch/$s_!wy0m!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56138a65-0a35-4566-8c96-7b429a4ce600_920x401.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wy0m!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56138a65-0a35-4566-8c96-7b429a4ce600_920x401.png" width="920" height="401" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/56138a65-0a35-4566-8c96-7b429a4ce600_920x401.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:401,&quot;width&quot;:920,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:101338,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165087454?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56138a65-0a35-4566-8c96-7b429a4ce600_920x401.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!wy0m!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56138a65-0a35-4566-8c96-7b429a4ce600_920x401.png 424w, https://substackcdn.com/image/fetch/$s_!wy0m!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56138a65-0a35-4566-8c96-7b429a4ce600_920x401.png 848w, https://substackcdn.com/image/fetch/$s_!wy0m!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56138a65-0a35-4566-8c96-7b429a4ce600_920x401.png 1272w, https://substackcdn.com/image/fetch/$s_!wy0m!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56138a65-0a35-4566-8c96-7b429a4ce600_920x401.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In practice, encountering a big empty gap strongly suggests the data might not be drawn from a single U(a,b). A common remedy is to check for multi-modal behavior. If discovered, you might consider a mixture of uniform distributions or conclude that the uniform assumption is violated. The MLE formula for a single uniform distribution won&#8217;t fail mathematically, but it may fail as a model of reality.</p><h2><strong>What if the data&#8217;s true distribution is uniform but it has discrete rounding to certain intervals&#8212;like integers only? Does the continuous uniform MLE differ from a discrete uniform MLE?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_3X-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F458cdaf1-b225-47ef-bb16-7a70241295fe_932x407.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_3X-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F458cdaf1-b225-47ef-bb16-7a70241295fe_932x407.png 424w, https://substackcdn.com/image/fetch/$s_!_3X-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F458cdaf1-b225-47ef-bb16-7a70241295fe_932x407.png 848w, https://substackcdn.com/image/fetch/$s_!_3X-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F458cdaf1-b225-47ef-bb16-7a70241295fe_932x407.png 1272w, https://substackcdn.com/image/fetch/$s_!_3X-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F458cdaf1-b225-47ef-bb16-7a70241295fe_932x407.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_3X-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F458cdaf1-b225-47ef-bb16-7a70241295fe_932x407.png" width="932" height="407" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/458cdaf1-b225-47ef-bb16-7a70241295fe_932x407.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:407,&quot;width&quot;:932,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:108956,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165087454?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F458cdaf1-b225-47ef-bb16-7a70241295fe_932x407.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_3X-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F458cdaf1-b225-47ef-bb16-7a70241295fe_932x407.png 424w, https://substackcdn.com/image/fetch/$s_!_3X-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F458cdaf1-b225-47ef-bb16-7a70241295fe_932x407.png 848w, https://substackcdn.com/image/fetch/$s_!_3X-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F458cdaf1-b225-47ef-bb16-7a70241295fe_932x407.png 1272w, https://substackcdn.com/image/fetch/$s_!_3X-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F458cdaf1-b225-47ef-bb16-7a70241295fe_932x407.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In real tasks, if the data is only roughly discrete or the data frequency is extremely high, the difference between a continuous vs. discrete uniform might be negligible. But if you have small integer support (like {1,2,3,4,5}), the difference can matter. You can test goodness-of-fit or compare how well each approach captures the distribution.</p><h2><strong>What if we fit a uniform distribution in an online fashion&#8212;i.e., streaming data arrives one point at a time?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FkZp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935826e5-5728-48cb-aa6c-94114f2cc0f0_941x777.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FkZp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935826e5-5728-48cb-aa6c-94114f2cc0f0_941x777.png 424w, https://substackcdn.com/image/fetch/$s_!FkZp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935826e5-5728-48cb-aa6c-94114f2cc0f0_941x777.png 848w, https://substackcdn.com/image/fetch/$s_!FkZp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935826e5-5728-48cb-aa6c-94114f2cc0f0_941x777.png 1272w, https://substackcdn.com/image/fetch/$s_!FkZp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935826e5-5728-48cb-aa6c-94114f2cc0f0_941x777.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FkZp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935826e5-5728-48cb-aa6c-94114f2cc0f0_941x777.png" width="941" height="777" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/935826e5-5728-48cb-aa6c-94114f2cc0f0_941x777.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:777,&quot;width&quot;:941,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:154628,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165087454?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935826e5-5728-48cb-aa6c-94114f2cc0f0_941x777.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!FkZp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935826e5-5728-48cb-aa6c-94114f2cc0f0_941x777.png 424w, https://substackcdn.com/image/fetch/$s_!FkZp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935826e5-5728-48cb-aa6c-94114f2cc0f0_941x777.png 848w, https://substackcdn.com/image/fetch/$s_!FkZp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935826e5-5728-48cb-aa6c-94114f2cc0f0_941x777.png 1272w, https://substackcdn.com/image/fetch/$s_!FkZp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935826e5-5728-48cb-aa6c-94114f2cc0f0_941x777.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>How do we handle negative values for a and b if the data is centered around negative or zero ranges?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8uRj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3313dc9c-a6fc-4085-bd62-2c79f53dcc70_941x367.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8uRj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3313dc9c-a6fc-4085-bd62-2c79f53dcc70_941x367.png 424w, https://substackcdn.com/image/fetch/$s_!8uRj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3313dc9c-a6fc-4085-bd62-2c79f53dcc70_941x367.png 848w, https://substackcdn.com/image/fetch/$s_!8uRj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3313dc9c-a6fc-4085-bd62-2c79f53dcc70_941x367.png 1272w, https://substackcdn.com/image/fetch/$s_!8uRj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3313dc9c-a6fc-4085-bd62-2c79f53dcc70_941x367.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8uRj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3313dc9c-a6fc-4085-bd62-2c79f53dcc70_941x367.png" width="941" height="367" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3313dc9c-a6fc-4085-bd62-2c79f53dcc70_941x367.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:367,&quot;width&quot;:941,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:96697,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165087454?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3313dc9c-a6fc-4085-bd62-2c79f53dcc70_941x367.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8uRj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3313dc9c-a6fc-4085-bd62-2c79f53dcc70_941x367.png 424w, https://substackcdn.com/image/fetch/$s_!8uRj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3313dc9c-a6fc-4085-bd62-2c79f53dcc70_941x367.png 848w, https://substackcdn.com/image/fetch/$s_!8uRj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3313dc9c-a6fc-4085-bd62-2c79f53dcc70_941x367.png 1272w, https://substackcdn.com/image/fetch/$s_!8uRj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3313dc9c-a6fc-4085-bd62-2c79f53dcc70_941x367.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Is there a closed-form expression for the variance of the MLE estimators a-hat and b-hat?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rRM5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0eb44d55-ca79-41d8-b3e4-338a47e16c3a_939x522.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rRM5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0eb44d55-ca79-41d8-b3e4-338a47e16c3a_939x522.png 424w, https://substackcdn.com/image/fetch/$s_!rRM5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0eb44d55-ca79-41d8-b3e4-338a47e16c3a_939x522.png 848w, https://substackcdn.com/image/fetch/$s_!rRM5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0eb44d55-ca79-41d8-b3e4-338a47e16c3a_939x522.png 1272w, https://substackcdn.com/image/fetch/$s_!rRM5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0eb44d55-ca79-41d8-b3e4-338a47e16c3a_939x522.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rRM5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0eb44d55-ca79-41d8-b3e4-338a47e16c3a_939x522.png" width="939" height="522" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0eb44d55-ca79-41d8-b3e4-338a47e16c3a_939x522.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:522,&quot;width&quot;:939,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:109001,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165087454?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0eb44d55-ca79-41d8-b3e4-338a47e16c3a_939x522.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rRM5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0eb44d55-ca79-41d8-b3e4-338a47e16c3a_939x522.png 424w, https://substackcdn.com/image/fetch/$s_!rRM5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0eb44d55-ca79-41d8-b3e4-338a47e16c3a_939x522.png 848w, https://substackcdn.com/image/fetch/$s_!rRM5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0eb44d55-ca79-41d8-b3e4-338a47e16c3a_939x522.png 1272w, https://substackcdn.com/image/fetch/$s_!rRM5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0eb44d55-ca79-41d8-b3e4-338a47e16c3a_939x522.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Could we apply a transformation to the data before applying the MLE for a and b?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!T9h4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bff2867-2453-434d-953e-74109541a9c3_939x563.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!T9h4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bff2867-2453-434d-953e-74109541a9c3_939x563.png 424w, https://substackcdn.com/image/fetch/$s_!T9h4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bff2867-2453-434d-953e-74109541a9c3_939x563.png 848w, https://substackcdn.com/image/fetch/$s_!T9h4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bff2867-2453-434d-953e-74109541a9c3_939x563.png 1272w, https://substackcdn.com/image/fetch/$s_!T9h4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bff2867-2453-434d-953e-74109541a9c3_939x563.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!T9h4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bff2867-2453-434d-953e-74109541a9c3_939x563.png" width="939" height="563" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0bff2867-2453-434d-953e-74109541a9c3_939x563.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:563,&quot;width&quot;:939,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:120255,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165087454?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bff2867-2453-434d-953e-74109541a9c3_939x563.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!T9h4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bff2867-2453-434d-953e-74109541a9c3_939x563.png 424w, https://substackcdn.com/image/fetch/$s_!T9h4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bff2867-2453-434d-953e-74109541a9c3_939x563.png 848w, https://substackcdn.com/image/fetch/$s_!T9h4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bff2867-2453-434d-953e-74109541a9c3_939x563.png 1272w, https://substackcdn.com/image/fetch/$s_!T9h4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bff2867-2453-434d-953e-74109541a9c3_939x563.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>What if the sample size is extremely small&#8212;like n=2 or n=3? Is MLE still reliable?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PNJO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2e90fe4-9c5d-4e37-a9de-4d4af8ff292d_922x455.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PNJO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2e90fe4-9c5d-4e37-a9de-4d4af8ff292d_922x455.png 424w, https://substackcdn.com/image/fetch/$s_!PNJO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2e90fe4-9c5d-4e37-a9de-4d4af8ff292d_922x455.png 848w, https://substackcdn.com/image/fetch/$s_!PNJO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2e90fe4-9c5d-4e37-a9de-4d4af8ff292d_922x455.png 1272w, https://substackcdn.com/image/fetch/$s_!PNJO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2e90fe4-9c5d-4e37-a9de-4d4af8ff292d_922x455.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PNJO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2e90fe4-9c5d-4e37-a9de-4d4af8ff292d_922x455.png" width="922" height="455" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d2e90fe4-9c5d-4e37-a9de-4d4af8ff292d_922x455.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:455,&quot;width&quot;:922,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:114111,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165087454?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2e90fe4-9c5d-4e37-a9de-4d4af8ff292d_922x455.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!PNJO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2e90fe4-9c5d-4e37-a9de-4d4af8ff292d_922x455.png 424w, https://substackcdn.com/image/fetch/$s_!PNJO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2e90fe4-9c5d-4e37-a9de-4d4af8ff292d_922x455.png 848w, https://substackcdn.com/image/fetch/$s_!PNJO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2e90fe4-9c5d-4e37-a9de-4d4af8ff292d_922x455.png 1272w, https://substackcdn.com/image/fetch/$s_!PNJO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2e90fe4-9c5d-4e37-a9de-4d4af8ff292d_922x455.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>How would the MLE approach be adapted if we know that a must be non-negative, or if b cannot exceed a certain known value?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Kokk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac096a19-5e5d-404a-98d4-3ef6e4b9060c_930x635.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Kokk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac096a19-5e5d-404a-98d4-3ef6e4b9060c_930x635.png 424w, https://substackcdn.com/image/fetch/$s_!Kokk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac096a19-5e5d-404a-98d4-3ef6e4b9060c_930x635.png 848w, https://substackcdn.com/image/fetch/$s_!Kokk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac096a19-5e5d-404a-98d4-3ef6e4b9060c_930x635.png 1272w, https://substackcdn.com/image/fetch/$s_!Kokk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac096a19-5e5d-404a-98d4-3ef6e4b9060c_930x635.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Kokk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac096a19-5e5d-404a-98d4-3ef6e4b9060c_930x635.png" width="930" height="635" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ac096a19-5e5d-404a-98d4-3ef6e4b9060c_930x635.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:635,&quot;width&quot;:930,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:161030,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165087454?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac096a19-5e5d-404a-98d4-3ef6e4b9060c_930x635.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Kokk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac096a19-5e5d-404a-98d4-3ef6e4b9060c_930x635.png 424w, https://substackcdn.com/image/fetch/$s_!Kokk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac096a19-5e5d-404a-98d4-3ef6e4b9060c_930x635.png 848w, https://substackcdn.com/image/fetch/$s_!Kokk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac096a19-5e5d-404a-98d4-3ef6e4b9060c_930x635.png 1272w, https://substackcdn.com/image/fetch/$s_!Kokk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac096a19-5e5d-404a-98d4-3ef6e4b9060c_930x635.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>How do we incorporate repeated data points or weighted observations?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qcIX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca304642-9568-4bcc-bad4-6f9b77a4994f_959x569.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qcIX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca304642-9568-4bcc-bad4-6f9b77a4994f_959x569.png 424w, https://substackcdn.com/image/fetch/$s_!qcIX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca304642-9568-4bcc-bad4-6f9b77a4994f_959x569.png 848w, https://substackcdn.com/image/fetch/$s_!qcIX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca304642-9568-4bcc-bad4-6f9b77a4994f_959x569.png 1272w, https://substackcdn.com/image/fetch/$s_!qcIX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca304642-9568-4bcc-bad4-6f9b77a4994f_959x569.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qcIX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca304642-9568-4bcc-bad4-6f9b77a4994f_959x569.png" width="959" height="569" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ca304642-9568-4bcc-bad4-6f9b77a4994f_959x569.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:569,&quot;width&quot;:959,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:142678,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165087454?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca304642-9568-4bcc-bad4-6f9b77a4994f_959x569.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!qcIX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca304642-9568-4bcc-bad4-6f9b77a4994f_959x569.png 424w, https://substackcdn.com/image/fetch/$s_!qcIX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca304642-9568-4bcc-bad4-6f9b77a4994f_959x569.png 848w, https://substackcdn.com/image/fetch/$s_!qcIX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca304642-9568-4bcc-bad4-6f9b77a4994f_959x569.png 1272w, https://substackcdn.com/image/fetch/$s_!qcIX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca304642-9568-4bcc-bad4-6f9b77a4994f_959x569.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Can we use likelihood ratio tests or confidence intervals for the uniform distribution boundaries?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nABq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc68d81e-e899-4300-92e6-fdfb25e8e2b1_920x477.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nABq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc68d81e-e899-4300-92e6-fdfb25e8e2b1_920x477.png 424w, https://substackcdn.com/image/fetch/$s_!nABq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc68d81e-e899-4300-92e6-fdfb25e8e2b1_920x477.png 848w, https://substackcdn.com/image/fetch/$s_!nABq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc68d81e-e899-4300-92e6-fdfb25e8e2b1_920x477.png 1272w, https://substackcdn.com/image/fetch/$s_!nABq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc68d81e-e899-4300-92e6-fdfb25e8e2b1_920x477.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nABq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc68d81e-e899-4300-92e6-fdfb25e8e2b1_920x477.png" width="920" height="477" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cc68d81e-e899-4300-92e6-fdfb25e8e2b1_920x477.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:477,&quot;width&quot;:920,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:118934,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165087454?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc68d81e-e899-4300-92e6-fdfb25e8e2b1_920x477.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!nABq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc68d81e-e899-4300-92e6-fdfb25e8e2b1_920x477.png 424w, https://substackcdn.com/image/fetch/$s_!nABq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc68d81e-e899-4300-92e6-fdfb25e8e2b1_920x477.png 848w, https://substackcdn.com/image/fetch/$s_!nABq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc68d81e-e899-4300-92e6-fdfb25e8e2b1_920x477.png 1272w, https://substackcdn.com/image/fetch/$s_!nABq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc68d81e-e899-4300-92e6-fdfb25e8e2b1_920x477.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>If you are in a role where precise error bounds matter&#8212;like bounding reliability or worst-case performance&#8212;understanding how to build confidence intervals from the uniform MLE is crucial. For large samples, standard approximations can be used. For small samples, exact or near-exact methods via order statistics are typically employed.</p>]]></content:encoded></item><item><title><![CDATA[ML Interview Q Series: Finding Independence for Linear Combinations of Bivariate Normals via Zero Covariance.]]></title><description><![CDATA[Browse all the Probability Interview Questions here.]]></description><link>https://www.rohan-paul.com/p/ml-interview-q-series-finding-independence</link><guid isPermaLink="false">https://www.rohan-paul.com/p/ml-interview-q-series-finding-independence</guid><pubDate>Tue, 03 Jun 2025 11:11:53 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!0Y9v!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F928bf3c4-15b2-4d9b-936a-c4b5099243a4_1024x547.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0Y9v!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F928bf3c4-15b2-4d9b-936a-c4b5099243a4_1024x547.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0Y9v!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F928bf3c4-15b2-4d9b-936a-c4b5099243a4_1024x547.png 424w, https://substackcdn.com/image/fetch/$s_!0Y9v!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F928bf3c4-15b2-4d9b-936a-c4b5099243a4_1024x547.png 848w, https://substackcdn.com/image/fetch/$s_!0Y9v!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F928bf3c4-15b2-4d9b-936a-c4b5099243a4_1024x547.png 1272w, https://substackcdn.com/image/fetch/$s_!0Y9v!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F928bf3c4-15b2-4d9b-936a-c4b5099243a4_1024x547.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0Y9v!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F928bf3c4-15b2-4d9b-936a-c4b5099243a4_1024x547.png" width="1024" height="547" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/928bf3c4-15b2-4d9b-936a-c4b5099243a4_1024x547.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:547,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:609393,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F928bf3c4-15b2-4d9b-936a-c4b5099243a4_1024x547.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!0Y9v!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F928bf3c4-15b2-4d9b-936a-c4b5099243a4_1024x547.png 424w, https://substackcdn.com/image/fetch/$s_!0Y9v!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F928bf3c4-15b2-4d9b-936a-c4b5099243a4_1024x547.png 848w, https://substackcdn.com/image/fetch/$s_!0Y9v!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F928bf3c4-15b2-4d9b-936a-c4b5099243a4_1024x547.png 1272w, https://substackcdn.com/image/fetch/$s_!0Y9v!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F928bf3c4-15b2-4d9b-936a-c4b5099243a4_1024x547.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Browse all the <strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">Probability Interview Questions here</a></strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">.</a></p><h2><strong>6. Suppose we have two random variables, X and Y, which are bivariate normal. The correlation between them is -0.2. Let A = cX + Y and B = X + cY. For what values of c are A and B independent?</strong></h2><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://x.com/rohanpaul_ai&quot;,&quot;text&quot;:&quot;Connect with me on X (Twitter)&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://x.com/rohanpaul_ai"><span>Connect with me on X (Twitter)</span></a></p><p>Detailed Explanation of the Core Concept and Reasoning</p><p>When X and Y are jointly (bivariate) normal, any linear combinations of X and Y will also be normally distributed. For two normally distributed random variables to be independent, it is necessary and sufficient that their correlation be zero. Hence, to find for which values of c the random variables A = cX + Y and B = X + cY are independent, we look for c such that</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4Iz5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0da294d0-8b81-42e6-9eda-9797048bc6c6_409x101.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4Iz5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0da294d0-8b81-42e6-9eda-9797048bc6c6_409x101.png 424w, https://substackcdn.com/image/fetch/$s_!4Iz5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0da294d0-8b81-42e6-9eda-9797048bc6c6_409x101.png 848w, https://substackcdn.com/image/fetch/$s_!4Iz5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0da294d0-8b81-42e6-9eda-9797048bc6c6_409x101.png 1272w, https://substackcdn.com/image/fetch/$s_!4Iz5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0da294d0-8b81-42e6-9eda-9797048bc6c6_409x101.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4Iz5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0da294d0-8b81-42e6-9eda-9797048bc6c6_409x101.png" width="409" height="101" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0da294d0-8b81-42e6-9eda-9797048bc6c6_409x101.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:101,&quot;width&quot;:409,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:8749,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0da294d0-8b81-42e6-9eda-9797048bc6c6_409x101.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!4Iz5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0da294d0-8b81-42e6-9eda-9797048bc6c6_409x101.png 424w, https://substackcdn.com/image/fetch/$s_!4Iz5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0da294d0-8b81-42e6-9eda-9797048bc6c6_409x101.png 848w, https://substackcdn.com/image/fetch/$s_!4Iz5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0da294d0-8b81-42e6-9eda-9797048bc6c6_409x101.png 1272w, https://substackcdn.com/image/fetch/$s_!4Iz5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0da294d0-8b81-42e6-9eda-9797048bc6c6_409x101.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p>Below is the derivation of Cov(A, B) under the assumption that X and Y have mean zero (which simplifies the correlation and covariance expressions without any loss of generality). Once we find the condition Cov(A, B) = 0, we solve for c. Because we are told the correlation between X and Y is -0.2, we can either use the general variance and covariance symbols or make the simplifying assumption of unit variances. In many interview contexts, it is standard to assume X and Y each have variance 1 unless specified otherwise. The bivariate normal correlation of -0.2 implies</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Im2Y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff09a11bc-f32d-4d1d-bacb-abefd55c03ab_1122x97.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Im2Y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff09a11bc-f32d-4d1d-bacb-abefd55c03ab_1122x97.png 424w, https://substackcdn.com/image/fetch/$s_!Im2Y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff09a11bc-f32d-4d1d-bacb-abefd55c03ab_1122x97.png 848w, https://substackcdn.com/image/fetch/$s_!Im2Y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff09a11bc-f32d-4d1d-bacb-abefd55c03ab_1122x97.png 1272w, https://substackcdn.com/image/fetch/$s_!Im2Y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff09a11bc-f32d-4d1d-bacb-abefd55c03ab_1122x97.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Im2Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff09a11bc-f32d-4d1d-bacb-abefd55c03ab_1122x97.png" width="1122" height="97" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f09a11bc-f32d-4d1d-bacb-abefd55c03ab_1122x97.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:97,&quot;width&quot;:1122,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:16461,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff09a11bc-f32d-4d1d-bacb-abefd55c03ab_1122x97.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Im2Y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff09a11bc-f32d-4d1d-bacb-abefd55c03ab_1122x97.png 424w, https://substackcdn.com/image/fetch/$s_!Im2Y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff09a11bc-f32d-4d1d-bacb-abefd55c03ab_1122x97.png 848w, https://substackcdn.com/image/fetch/$s_!Im2Y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff09a11bc-f32d-4d1d-bacb-abefd55c03ab_1122x97.png 1272w, https://substackcdn.com/image/fetch/$s_!Im2Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff09a11bc-f32d-4d1d-bacb-abefd55c03ab_1122x97.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p>Under that standard normal assumption, we have:</p><p>A = cX + Y B = X + cY</p><p>We compute Cov(A, B) as follows:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!euBM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49cff9f7-faab-4bae-a182-fa2180b7a375_988x128.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!euBM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49cff9f7-faab-4bae-a182-fa2180b7a375_988x128.png 424w, https://substackcdn.com/image/fetch/$s_!euBM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49cff9f7-faab-4bae-a182-fa2180b7a375_988x128.png 848w, https://substackcdn.com/image/fetch/$s_!euBM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49cff9f7-faab-4bae-a182-fa2180b7a375_988x128.png 1272w, https://substackcdn.com/image/fetch/$s_!euBM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49cff9f7-faab-4bae-a182-fa2180b7a375_988x128.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!euBM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49cff9f7-faab-4bae-a182-fa2180b7a375_988x128.png" width="988" height="128" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/49cff9f7-faab-4bae-a182-fa2180b7a375_988x128.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:128,&quot;width&quot;:988,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:18603,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49cff9f7-faab-4bae-a182-fa2180b7a375_988x128.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!euBM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49cff9f7-faab-4bae-a182-fa2180b7a375_988x128.png 424w, https://substackcdn.com/image/fetch/$s_!euBM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49cff9f7-faab-4bae-a182-fa2180b7a375_988x128.png 848w, https://substackcdn.com/image/fetch/$s_!euBM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49cff9f7-faab-4bae-a182-fa2180b7a375_988x128.png 1272w, https://substackcdn.com/image/fetch/$s_!euBM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49cff9f7-faab-4bae-a182-fa2180b7a375_988x128.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Since covariance is bilinear,</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7zFO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe630504d-5054-46e2-bd86-ef0b16085001_1271x117.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7zFO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe630504d-5054-46e2-bd86-ef0b16085001_1271x117.png 424w, https://substackcdn.com/image/fetch/$s_!7zFO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe630504d-5054-46e2-bd86-ef0b16085001_1271x117.png 848w, https://substackcdn.com/image/fetch/$s_!7zFO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe630504d-5054-46e2-bd86-ef0b16085001_1271x117.png 1272w, https://substackcdn.com/image/fetch/$s_!7zFO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe630504d-5054-46e2-bd86-ef0b16085001_1271x117.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7zFO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe630504d-5054-46e2-bd86-ef0b16085001_1271x117.png" width="1271" height="117" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e630504d-5054-46e2-bd86-ef0b16085001_1271x117.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:117,&quot;width&quot;:1271,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:17178,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe630504d-5054-46e2-bd86-ef0b16085001_1271x117.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!7zFO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe630504d-5054-46e2-bd86-ef0b16085001_1271x117.png 424w, https://substackcdn.com/image/fetch/$s_!7zFO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe630504d-5054-46e2-bd86-ef0b16085001_1271x117.png 848w, https://substackcdn.com/image/fetch/$s_!7zFO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe630504d-5054-46e2-bd86-ef0b16085001_1271x117.png 1272w, https://substackcdn.com/image/fetch/$s_!7zFO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe630504d-5054-46e2-bd86-ef0b16085001_1271x117.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>When X and Y have variance 1 and correlation -0.2, we get:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!peQi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9685a43c-4b48-4ccc-9710-a5991eacf797_1265x86.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!peQi!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9685a43c-4b48-4ccc-9710-a5991eacf797_1265x86.png 424w, https://substackcdn.com/image/fetch/$s_!peQi!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9685a43c-4b48-4ccc-9710-a5991eacf797_1265x86.png 848w, https://substackcdn.com/image/fetch/$s_!peQi!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9685a43c-4b48-4ccc-9710-a5991eacf797_1265x86.png 1272w, https://substackcdn.com/image/fetch/$s_!peQi!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9685a43c-4b48-4ccc-9710-a5991eacf797_1265x86.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!peQi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9685a43c-4b48-4ccc-9710-a5991eacf797_1265x86.png" width="1265" height="86" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9685a43c-4b48-4ccc-9710-a5991eacf797_1265x86.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:86,&quot;width&quot;:1265,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:16647,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9685a43c-4b48-4ccc-9710-a5991eacf797_1265x86.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!peQi!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9685a43c-4b48-4ccc-9710-a5991eacf797_1265x86.png 424w, https://substackcdn.com/image/fetch/$s_!peQi!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9685a43c-4b48-4ccc-9710-a5991eacf797_1265x86.png 848w, https://substackcdn.com/image/fetch/$s_!peQi!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9685a43c-4b48-4ccc-9710-a5991eacf797_1265x86.png 1272w, https://substackcdn.com/image/fetch/$s_!peQi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9685a43c-4b48-4ccc-9710-a5991eacf797_1265x86.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Substituting these values in:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4SKJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde91dc7a-fa05-4e6c-9d8b-0193cf79dbde_1027x96.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4SKJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde91dc7a-fa05-4e6c-9d8b-0193cf79dbde_1027x96.png 424w, https://substackcdn.com/image/fetch/$s_!4SKJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde91dc7a-fa05-4e6c-9d8b-0193cf79dbde_1027x96.png 848w, https://substackcdn.com/image/fetch/$s_!4SKJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde91dc7a-fa05-4e6c-9d8b-0193cf79dbde_1027x96.png 1272w, https://substackcdn.com/image/fetch/$s_!4SKJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde91dc7a-fa05-4e6c-9d8b-0193cf79dbde_1027x96.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4SKJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde91dc7a-fa05-4e6c-9d8b-0193cf79dbde_1027x96.png" width="1027" height="96" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/de91dc7a-fa05-4e6c-9d8b-0193cf79dbde_1027x96.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:96,&quot;width&quot;:1027,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:15500,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde91dc7a-fa05-4e6c-9d8b-0193cf79dbde_1027x96.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!4SKJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde91dc7a-fa05-4e6c-9d8b-0193cf79dbde_1027x96.png 424w, https://substackcdn.com/image/fetch/$s_!4SKJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde91dc7a-fa05-4e6c-9d8b-0193cf79dbde_1027x96.png 848w, https://substackcdn.com/image/fetch/$s_!4SKJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde91dc7a-fa05-4e6c-9d8b-0193cf79dbde_1027x96.png 1272w, https://substackcdn.com/image/fetch/$s_!4SKJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde91dc7a-fa05-4e6c-9d8b-0193cf79dbde_1027x96.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Combine like terms:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!S68w!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F372a1291-6675-4b52-9f4c-b953b98d42ef_789x124.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!S68w!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F372a1291-6675-4b52-9f4c-b953b98d42ef_789x124.png 424w, https://substackcdn.com/image/fetch/$s_!S68w!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F372a1291-6675-4b52-9f4c-b953b98d42ef_789x124.png 848w, https://substackcdn.com/image/fetch/$s_!S68w!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F372a1291-6675-4b52-9f4c-b953b98d42ef_789x124.png 1272w, https://substackcdn.com/image/fetch/$s_!S68w!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F372a1291-6675-4b52-9f4c-b953b98d42ef_789x124.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!S68w!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F372a1291-6675-4b52-9f4c-b953b98d42ef_789x124.png" width="789" height="124" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/372a1291-6675-4b52-9f4c-b953b98d42ef_789x124.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:124,&quot;width&quot;:789,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:13482,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F372a1291-6675-4b52-9f4c-b953b98d42ef_789x124.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!S68w!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F372a1291-6675-4b52-9f4c-b953b98d42ef_789x124.png 424w, https://substackcdn.com/image/fetch/$s_!S68w!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F372a1291-6675-4b52-9f4c-b953b98d42ef_789x124.png 848w, https://substackcdn.com/image/fetch/$s_!S68w!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F372a1291-6675-4b52-9f4c-b953b98d42ef_789x124.png 1272w, https://substackcdn.com/image/fetch/$s_!S68w!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F372a1291-6675-4b52-9f4c-b953b98d42ef_789x124.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Rewrite it more neatly:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NnH3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c7ba7f7-a040-4be3-b9f1-e556ac755c04_848x143.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NnH3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c7ba7f7-a040-4be3-b9f1-e556ac755c04_848x143.png 424w, https://substackcdn.com/image/fetch/$s_!NnH3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c7ba7f7-a040-4be3-b9f1-e556ac755c04_848x143.png 848w, https://substackcdn.com/image/fetch/$s_!NnH3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c7ba7f7-a040-4be3-b9f1-e556ac755c04_848x143.png 1272w, https://substackcdn.com/image/fetch/$s_!NnH3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c7ba7f7-a040-4be3-b9f1-e556ac755c04_848x143.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NnH3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c7ba7f7-a040-4be3-b9f1-e556ac755c04_848x143.png" width="848" height="143" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3c7ba7f7-a040-4be3-b9f1-e556ac755c04_848x143.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:143,&quot;width&quot;:848,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:14535,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c7ba7f7-a040-4be3-b9f1-e556ac755c04_848x143.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!NnH3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c7ba7f7-a040-4be3-b9f1-e556ac755c04_848x143.png 424w, https://substackcdn.com/image/fetch/$s_!NnH3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c7ba7f7-a040-4be3-b9f1-e556ac755c04_848x143.png 848w, https://substackcdn.com/image/fetch/$s_!NnH3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c7ba7f7-a040-4be3-b9f1-e556ac755c04_848x143.png 1272w, https://substackcdn.com/image/fetch/$s_!NnH3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c7ba7f7-a040-4be3-b9f1-e556ac755c04_848x143.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>We want this to be zero:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mTVz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F991a536d-e4f2-47ba-b2fe-ed30b352eaf4_591x118.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mTVz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F991a536d-e4f2-47ba-b2fe-ed30b352eaf4_591x118.png 424w, https://substackcdn.com/image/fetch/$s_!mTVz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F991a536d-e4f2-47ba-b2fe-ed30b352eaf4_591x118.png 848w, https://substackcdn.com/image/fetch/$s_!mTVz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F991a536d-e4f2-47ba-b2fe-ed30b352eaf4_591x118.png 1272w, https://substackcdn.com/image/fetch/$s_!mTVz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F991a536d-e4f2-47ba-b2fe-ed30b352eaf4_591x118.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mTVz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F991a536d-e4f2-47ba-b2fe-ed30b352eaf4_591x118.png" width="591" height="118" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/991a536d-e4f2-47ba-b2fe-ed30b352eaf4_591x118.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:118,&quot;width&quot;:591,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:8082,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F991a536d-e4f2-47ba-b2fe-ed30b352eaf4_591x118.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!mTVz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F991a536d-e4f2-47ba-b2fe-ed30b352eaf4_591x118.png 424w, https://substackcdn.com/image/fetch/$s_!mTVz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F991a536d-e4f2-47ba-b2fe-ed30b352eaf4_591x118.png 848w, https://substackcdn.com/image/fetch/$s_!mTVz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F991a536d-e4f2-47ba-b2fe-ed30b352eaf4_591x118.png 1272w, https://substackcdn.com/image/fetch/$s_!mTVz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F991a536d-e4f2-47ba-b2fe-ed30b352eaf4_591x118.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Multiplying both sides by -5 for clarity:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lHnq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44f1c4ba-bd7f-4a1d-805c-678d90a90c39_486x115.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lHnq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44f1c4ba-bd7f-4a1d-805c-678d90a90c39_486x115.png 424w, https://substackcdn.com/image/fetch/$s_!lHnq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44f1c4ba-bd7f-4a1d-805c-678d90a90c39_486x115.png 848w, https://substackcdn.com/image/fetch/$s_!lHnq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44f1c4ba-bd7f-4a1d-805c-678d90a90c39_486x115.png 1272w, https://substackcdn.com/image/fetch/$s_!lHnq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44f1c4ba-bd7f-4a1d-805c-678d90a90c39_486x115.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lHnq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44f1c4ba-bd7f-4a1d-805c-678d90a90c39_486x115.png" width="486" height="115" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/44f1c4ba-bd7f-4a1d-805c-678d90a90c39_486x115.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:115,&quot;width&quot;:486,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:6283,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44f1c4ba-bd7f-4a1d-805c-678d90a90c39_486x115.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!lHnq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44f1c4ba-bd7f-4a1d-805c-678d90a90c39_486x115.png 424w, https://substackcdn.com/image/fetch/$s_!lHnq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44f1c4ba-bd7f-4a1d-805c-678d90a90c39_486x115.png 848w, https://substackcdn.com/image/fetch/$s_!lHnq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44f1c4ba-bd7f-4a1d-805c-678d90a90c39_486x115.png 1272w, https://substackcdn.com/image/fetch/$s_!lHnq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44f1c4ba-bd7f-4a1d-805c-678d90a90c39_486x115.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>This is a standard quadratic equation in c. The solutions are given by the quadratic formula:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jw_I!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffca9606b-7773-4a94-b67e-b9e575de24ea_993x143.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jw_I!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffca9606b-7773-4a94-b67e-b9e575de24ea_993x143.png 424w, https://substackcdn.com/image/fetch/$s_!jw_I!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffca9606b-7773-4a94-b67e-b9e575de24ea_993x143.png 848w, https://substackcdn.com/image/fetch/$s_!jw_I!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffca9606b-7773-4a94-b67e-b9e575de24ea_993x143.png 1272w, https://substackcdn.com/image/fetch/$s_!jw_I!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffca9606b-7773-4a94-b67e-b9e575de24ea_993x143.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jw_I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffca9606b-7773-4a94-b67e-b9e575de24ea_993x143.png" width="993" height="143" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fca9606b-7773-4a94-b67e-b9e575de24ea_993x143.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:143,&quot;width&quot;:993,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:15205,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffca9606b-7773-4a94-b67e-b9e575de24ea_993x143.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!jw_I!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffca9606b-7773-4a94-b67e-b9e575de24ea_993x143.png 424w, https://substackcdn.com/image/fetch/$s_!jw_I!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffca9606b-7773-4a94-b67e-b9e575de24ea_993x143.png 848w, https://substackcdn.com/image/fetch/$s_!jw_I!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffca9606b-7773-4a94-b67e-b9e575de24ea_993x143.png 1272w, https://substackcdn.com/image/fetch/$s_!jw_I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffca9606b-7773-4a94-b67e-b9e575de24ea_993x143.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Thus, for X and Y bivariate normal with correlation -0.2 and unit variances, the two values of c that make A and B independent are</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!o1jR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25f01874-64e7-4bab-94c1-c4566fac260d_756x101.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!o1jR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25f01874-64e7-4bab-94c1-c4566fac260d_756x101.png 424w, https://substackcdn.com/image/fetch/$s_!o1jR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25f01874-64e7-4bab-94c1-c4566fac260d_756x101.png 848w, https://substackcdn.com/image/fetch/$s_!o1jR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25f01874-64e7-4bab-94c1-c4566fac260d_756x101.png 1272w, https://substackcdn.com/image/fetch/$s_!o1jR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25f01874-64e7-4bab-94c1-c4566fac260d_756x101.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!o1jR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25f01874-64e7-4bab-94c1-c4566fac260d_756x101.png" width="756" height="101" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/25f01874-64e7-4bab-94c1-c4566fac260d_756x101.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:101,&quot;width&quot;:756,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:11235,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25f01874-64e7-4bab-94c1-c4566fac260d_756x101.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!o1jR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25f01874-64e7-4bab-94c1-c4566fac260d_756x101.png 424w, https://substackcdn.com/image/fetch/$s_!o1jR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25f01874-64e7-4bab-94c1-c4566fac260d_756x101.png 848w, https://substackcdn.com/image/fetch/$s_!o1jR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25f01874-64e7-4bab-94c1-c4566fac260d_756x101.png 1272w, https://substackcdn.com/image/fetch/$s_!o1jR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25f01874-64e7-4bab-94c1-c4566fac260d_756x101.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wuiB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a414bd0-952c-4e0e-a892-9e1abab5b66f_904x452.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wuiB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a414bd0-952c-4e0e-a892-9e1abab5b66f_904x452.png 424w, https://substackcdn.com/image/fetch/$s_!wuiB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a414bd0-952c-4e0e-a892-9e1abab5b66f_904x452.png 848w, https://substackcdn.com/image/fetch/$s_!wuiB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a414bd0-952c-4e0e-a892-9e1abab5b66f_904x452.png 1272w, https://substackcdn.com/image/fetch/$s_!wuiB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a414bd0-952c-4e0e-a892-9e1abab5b66f_904x452.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wuiB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a414bd0-952c-4e0e-a892-9e1abab5b66f_904x452.png" width="904" height="452" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5a414bd0-952c-4e0e-a892-9e1abab5b66f_904x452.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:452,&quot;width&quot;:904,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:32622,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a414bd0-952c-4e0e-a892-9e1abab5b66f_904x452.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!wuiB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a414bd0-952c-4e0e-a892-9e1abab5b66f_904x452.png 424w, https://substackcdn.com/image/fetch/$s_!wuiB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a414bd0-952c-4e0e-a892-9e1abab5b66f_904x452.png 848w, https://substackcdn.com/image/fetch/$s_!wuiB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a414bd0-952c-4e0e-a892-9e1abab5b66f_904x452.png 1272w, https://substackcdn.com/image/fetch/$s_!wuiB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a414bd0-952c-4e0e-a892-9e1abab5b66f_904x452.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hmJK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b0c74e8-efab-4cb3-9c33-5df7dbf0440e_1302x97.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hmJK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b0c74e8-efab-4cb3-9c33-5df7dbf0440e_1302x97.png 424w, https://substackcdn.com/image/fetch/$s_!hmJK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b0c74e8-efab-4cb3-9c33-5df7dbf0440e_1302x97.png 848w, https://substackcdn.com/image/fetch/$s_!hmJK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b0c74e8-efab-4cb3-9c33-5df7dbf0440e_1302x97.png 1272w, https://substackcdn.com/image/fetch/$s_!hmJK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b0c74e8-efab-4cb3-9c33-5df7dbf0440e_1302x97.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hmJK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b0c74e8-efab-4cb3-9c33-5df7dbf0440e_1302x97.png" width="1302" height="97" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9b0c74e8-efab-4cb3-9c33-5df7dbf0440e_1302x97.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:97,&quot;width&quot;:1302,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19211,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b0c74e8-efab-4cb3-9c33-5df7dbf0440e_1302x97.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!hmJK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b0c74e8-efab-4cb3-9c33-5df7dbf0440e_1302x97.png 424w, https://substackcdn.com/image/fetch/$s_!hmJK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b0c74e8-efab-4cb3-9c33-5df7dbf0440e_1302x97.png 848w, https://substackcdn.com/image/fetch/$s_!hmJK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b0c74e8-efab-4cb3-9c33-5df7dbf0440e_1302x97.png 1272w, https://substackcdn.com/image/fetch/$s_!hmJK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b0c74e8-efab-4cb3-9c33-5df7dbf0440e_1302x97.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Setting that expression to zero yields a quadratic equation in c. Solving that equation will yield a similar form. However, in many interview questions (and especially with the numeric correlation -0.2 provided), it is common to assume X and Y have unit variance unless otherwise specified, hence the simpler numeric final result above.</p><p>The fundamental idea is: for any two random variables that are linear combinations of jointly Gaussian variables, zero covariance implies independence. This crucial fact holds only because X and Y are jointly normal. If X and Y were not jointly normal, zero covariance (or zero correlation) would not guarantee independence.</p><h2><strong>How We Know Setting Cov(A, B) = 0 Ensures Independence Here</strong></h2><p>In a bivariate normal setting, (A, B) also form a jointly normal pair. For jointly normal pairs, the condition Corr(A, B) = 0 is equivalent to independence. This does not generally hold in non-normal distributions.</p><h2><strong>Possible Subtle Points</strong></h2><p>It is worth noting a few real-world considerations or subtleties that might come up in deeper discussions:</p><p>If the correlation between X and Y was different (e.g., 0.5 or -0.8), or if their variances were not both equal to 1, the resulting values of c would differ. The main takeaway is that the independence condition is always determined by forcing the covariance between A and B to zero when (A, B) are jointly normal.</p><p>If X and Y had non-zero means, we could shift them to zero mean by subtracting their means (i.e., define</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!XfiM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F346c3f40-fa11-4866-941a-6fe478916b7a_554x193.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!XfiM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F346c3f40-fa11-4866-941a-6fe478916b7a_554x193.png 424w, https://substackcdn.com/image/fetch/$s_!XfiM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F346c3f40-fa11-4866-941a-6fe478916b7a_554x193.png 848w, https://substackcdn.com/image/fetch/$s_!XfiM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F346c3f40-fa11-4866-941a-6fe478916b7a_554x193.png 1272w, https://substackcdn.com/image/fetch/$s_!XfiM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F346c3f40-fa11-4866-941a-6fe478916b7a_554x193.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!XfiM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F346c3f40-fa11-4866-941a-6fe478916b7a_554x193.png" width="554" height="193" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/346c3f40-fa11-4866-941a-6fe478916b7a_554x193.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:193,&quot;width&quot;:554,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:7167,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F346c3f40-fa11-4866-941a-6fe478916b7a_554x193.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!XfiM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F346c3f40-fa11-4866-941a-6fe478916b7a_554x193.png 424w, https://substackcdn.com/image/fetch/$s_!XfiM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F346c3f40-fa11-4866-941a-6fe478916b7a_554x193.png 848w, https://substackcdn.com/image/fetch/$s_!XfiM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F346c3f40-fa11-4866-941a-6fe478916b7a_554x193.png 1272w, https://substackcdn.com/image/fetch/$s_!XfiM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F346c3f40-fa11-4866-941a-6fe478916b7a_554x193.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>). Since linear shifts do not affect covariance or correlation, the condition for independence (in terms of c) would remain the same.</p><p>A potential interview pitfall is to assume that zero correlation always implies independence in general. This is only guaranteed for the special case where the pair is jointly Gaussian (or in certain other specialized distributions). Otherwise, uncorrelated variables might still be dependent. The difference between uncorrelatedness and independence is a standard conceptual check in interviews.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.rohan-paul.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">I write everyday for my readers on actionable AI. Subscribe and instantly get a 1300+ page Python book.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2><strong>Follow-up Question 1</strong></h2><p>If we did not assume that X and Y have unit variances, how would the result change?</p><p>In that more general case, assume</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ZogV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3db9e87c-79d1-4912-b687-b2ddc88777e2_1183x130.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZogV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3db9e87c-79d1-4912-b687-b2ddc88777e2_1183x130.png 424w, https://substackcdn.com/image/fetch/$s_!ZogV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3db9e87c-79d1-4912-b687-b2ddc88777e2_1183x130.png 848w, https://substackcdn.com/image/fetch/$s_!ZogV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3db9e87c-79d1-4912-b687-b2ddc88777e2_1183x130.png 1272w, https://substackcdn.com/image/fetch/$s_!ZogV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3db9e87c-79d1-4912-b687-b2ddc88777e2_1183x130.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZogV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3db9e87c-79d1-4912-b687-b2ddc88777e2_1183x130.png" width="1183" height="130" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3db9e87c-79d1-4912-b687-b2ddc88777e2_1183x130.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:130,&quot;width&quot;:1183,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:18220,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3db9e87c-79d1-4912-b687-b2ddc88777e2_1183x130.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ZogV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3db9e87c-79d1-4912-b687-b2ddc88777e2_1183x130.png 424w, https://substackcdn.com/image/fetch/$s_!ZogV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3db9e87c-79d1-4912-b687-b2ddc88777e2_1183x130.png 848w, https://substackcdn.com/image/fetch/$s_!ZogV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3db9e87c-79d1-4912-b687-b2ddc88777e2_1183x130.png 1272w, https://substackcdn.com/image/fetch/$s_!ZogV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3db9e87c-79d1-4912-b687-b2ddc88777e2_1183x130.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Define again:</p><p>A = cX + Y B = X + cY</p><p>Then the covariance is:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RpIo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F666f6285-436d-4888-bdd2-75c82ec5d621_1286x93.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RpIo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F666f6285-436d-4888-bdd2-75c82ec5d621_1286x93.png 424w, https://substackcdn.com/image/fetch/$s_!RpIo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F666f6285-436d-4888-bdd2-75c82ec5d621_1286x93.png 848w, https://substackcdn.com/image/fetch/$s_!RpIo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F666f6285-436d-4888-bdd2-75c82ec5d621_1286x93.png 1272w, https://substackcdn.com/image/fetch/$s_!RpIo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F666f6285-436d-4888-bdd2-75c82ec5d621_1286x93.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RpIo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F666f6285-436d-4888-bdd2-75c82ec5d621_1286x93.png" width="1286" height="93" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/666f6285-436d-4888-bdd2-75c82ec5d621_1286x93.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:93,&quot;width&quot;:1286,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19880,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F666f6285-436d-4888-bdd2-75c82ec5d621_1286x93.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!RpIo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F666f6285-436d-4888-bdd2-75c82ec5d621_1286x93.png 424w, https://substackcdn.com/image/fetch/$s_!RpIo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F666f6285-436d-4888-bdd2-75c82ec5d621_1286x93.png 848w, https://substackcdn.com/image/fetch/$s_!RpIo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F666f6285-436d-4888-bdd2-75c82ec5d621_1286x93.png 1272w, https://substackcdn.com/image/fetch/$s_!RpIo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F666f6285-436d-4888-bdd2-75c82ec5d621_1286x93.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Set it to zero to find c:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VTDS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F799005c8-82cc-4652-b317-671f5c00ec52_947x131.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VTDS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F799005c8-82cc-4652-b317-671f5c00ec52_947x131.png 424w, https://substackcdn.com/image/fetch/$s_!VTDS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F799005c8-82cc-4652-b317-671f5c00ec52_947x131.png 848w, https://substackcdn.com/image/fetch/$s_!VTDS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F799005c8-82cc-4652-b317-671f5c00ec52_947x131.png 1272w, https://substackcdn.com/image/fetch/$s_!VTDS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F799005c8-82cc-4652-b317-671f5c00ec52_947x131.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VTDS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F799005c8-82cc-4652-b317-671f5c00ec52_947x131.png" width="947" height="131" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/799005c8-82cc-4652-b317-671f5c00ec52_947x131.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:131,&quot;width&quot;:947,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:16293,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F799005c8-82cc-4652-b317-671f5c00ec52_947x131.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!VTDS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F799005c8-82cc-4652-b317-671f5c00ec52_947x131.png 424w, https://substackcdn.com/image/fetch/$s_!VTDS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F799005c8-82cc-4652-b317-671f5c00ec52_947x131.png 848w, https://substackcdn.com/image/fetch/$s_!VTDS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F799005c8-82cc-4652-b317-671f5c00ec52_947x131.png 1272w, https://substackcdn.com/image/fetch/$s_!VTDS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F799005c8-82cc-4652-b317-671f5c00ec52_947x131.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>This is a quadratic in c:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!e7Fm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a3d8d48-6ad9-4162-ba97-f554fc522658_989x123.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!e7Fm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a3d8d48-6ad9-4162-ba97-f554fc522658_989x123.png 424w, https://substackcdn.com/image/fetch/$s_!e7Fm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a3d8d48-6ad9-4162-ba97-f554fc522658_989x123.png 848w, https://substackcdn.com/image/fetch/$s_!e7Fm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a3d8d48-6ad9-4162-ba97-f554fc522658_989x123.png 1272w, https://substackcdn.com/image/fetch/$s_!e7Fm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a3d8d48-6ad9-4162-ba97-f554fc522658_989x123.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!e7Fm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a3d8d48-6ad9-4162-ba97-f554fc522658_989x123.png" width="989" height="123" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0a3d8d48-6ad9-4162-ba97-f554fc522658_989x123.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:123,&quot;width&quot;:989,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:16359,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a3d8d48-6ad9-4162-ba97-f554fc522658_989x123.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!e7Fm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a3d8d48-6ad9-4162-ba97-f554fc522658_989x123.png 424w, https://substackcdn.com/image/fetch/$s_!e7Fm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a3d8d48-6ad9-4162-ba97-f554fc522658_989x123.png 848w, https://substackcdn.com/image/fetch/$s_!e7Fm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a3d8d48-6ad9-4162-ba97-f554fc522658_989x123.png 1272w, https://substackcdn.com/image/fetch/$s_!e7Fm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a3d8d48-6ad9-4162-ba97-f554fc522658_989x123.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Solving via the quadratic formula:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!INxx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fb3db11-18ba-45b6-8e72-724137073746_1028x163.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!INxx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fb3db11-18ba-45b6-8e72-724137073746_1028x163.png 424w, https://substackcdn.com/image/fetch/$s_!INxx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fb3db11-18ba-45b6-8e72-724137073746_1028x163.png 848w, https://substackcdn.com/image/fetch/$s_!INxx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fb3db11-18ba-45b6-8e72-724137073746_1028x163.png 1272w, https://substackcdn.com/image/fetch/$s_!INxx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fb3db11-18ba-45b6-8e72-724137073746_1028x163.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!INxx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fb3db11-18ba-45b6-8e72-724137073746_1028x163.png" width="1028" height="163" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9fb3db11-18ba-45b6-8e72-724137073746_1028x163.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:163,&quot;width&quot;:1028,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19229,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fb3db11-18ba-45b6-8e72-724137073746_1028x163.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!INxx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fb3db11-18ba-45b6-8e72-724137073746_1028x163.png 424w, https://substackcdn.com/image/fetch/$s_!INxx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fb3db11-18ba-45b6-8e72-724137073746_1028x163.png 848w, https://substackcdn.com/image/fetch/$s_!INxx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fb3db11-18ba-45b6-8e72-724137073746_1028x163.png 1272w, https://substackcdn.com/image/fetch/$s_!INxx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fb3db11-18ba-45b6-8e72-724137073746_1028x163.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Hence, for the general variances</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_PRw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9343502f-20c5-4ff2-bffe-aff876da4d44_134x78.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_PRw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9343502f-20c5-4ff2-bffe-aff876da4d44_134x78.png 424w, https://substackcdn.com/image/fetch/$s_!_PRw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9343502f-20c5-4ff2-bffe-aff876da4d44_134x78.png 848w, https://substackcdn.com/image/fetch/$s_!_PRw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9343502f-20c5-4ff2-bffe-aff876da4d44_134x78.png 1272w, https://substackcdn.com/image/fetch/$s_!_PRw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9343502f-20c5-4ff2-bffe-aff876da4d44_134x78.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_PRw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9343502f-20c5-4ff2-bffe-aff876da4d44_134x78.png" width="134" height="78" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9343502f-20c5-4ff2-bffe-aff876da4d44_134x78.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:78,&quot;width&quot;:134,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:3082,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9343502f-20c5-4ff2-bffe-aff876da4d44_134x78.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_PRw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9343502f-20c5-4ff2-bffe-aff876da4d44_134x78.png 424w, https://substackcdn.com/image/fetch/$s_!_PRw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9343502f-20c5-4ff2-bffe-aff876da4d44_134x78.png 848w, https://substackcdn.com/image/fetch/$s_!_PRw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9343502f-20c5-4ff2-bffe-aff876da4d44_134x78.png 1272w, https://substackcdn.com/image/fetch/$s_!_PRw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9343502f-20c5-4ff2-bffe-aff876da4d44_134x78.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>, you would get two possible real values of c (assuming the expression under the square root is nonnegative). In an interview, you might simply provide either the final formula or note that in the special case</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JMUV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca651aea-9b9f-46b3-b52a-9e3b2f2455f7_475x372.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JMUV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca651aea-9b9f-46b3-b52a-9e3b2f2455f7_475x372.png 424w, https://substackcdn.com/image/fetch/$s_!JMUV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca651aea-9b9f-46b3-b52a-9e3b2f2455f7_475x372.png 848w, https://substackcdn.com/image/fetch/$s_!JMUV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca651aea-9b9f-46b3-b52a-9e3b2f2455f7_475x372.png 1272w, https://substackcdn.com/image/fetch/$s_!JMUV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca651aea-9b9f-46b3-b52a-9e3b2f2455f7_475x372.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JMUV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca651aea-9b9f-46b3-b52a-9e3b2f2455f7_475x372.png" width="475" height="372" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ca651aea-9b9f-46b3-b52a-9e3b2f2455f7_475x372.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:372,&quot;width&quot;:475,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:18199,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca651aea-9b9f-46b3-b52a-9e3b2f2455f7_475x372.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!JMUV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca651aea-9b9f-46b3-b52a-9e3b2f2455f7_475x372.png 424w, https://substackcdn.com/image/fetch/$s_!JMUV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca651aea-9b9f-46b3-b52a-9e3b2f2455f7_475x372.png 848w, https://substackcdn.com/image/fetch/$s_!JMUV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca651aea-9b9f-46b3-b52a-9e3b2f2455f7_475x372.png 1272w, https://substackcdn.com/image/fetch/$s_!JMUV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca651aea-9b9f-46b3-b52a-9e3b2f2455f7_475x372.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Follow-up Question 2</strong></h2><p>Why can we rely on Cov(A, B) = 0 to guarantee independence for this particular problem?</p><p>For a pair of random variables to be independent given that they are jointly normal, it suffices (and is necessary) that their correlation be zero. Any linear combination of two jointly normal variables results in another jointly normal pair. Hence, if (X, Y) are bivariate normal, then (A, B) defined by linear transformations of X and Y are also jointly normal. In a jointly normal setting, zero correlation always implies independence.</p><p>However, if X and Y were not jointly normal, zero correlation between A and B would not necessarily imply that A and B are independent.</p><h2><strong>Follow-up Question 3</strong></h2><p>Could there be any numerical or edge-case pitfalls?</p><p>One potential edge case arises if</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-ozT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc96b509f-ed23-4314-b4d2-eca89c888a60_166x60.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-ozT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc96b509f-ed23-4314-b4d2-eca89c888a60_166x60.png 424w, https://substackcdn.com/image/fetch/$s_!-ozT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc96b509f-ed23-4314-b4d2-eca89c888a60_166x60.png 848w, https://substackcdn.com/image/fetch/$s_!-ozT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc96b509f-ed23-4314-b4d2-eca89c888a60_166x60.png 1272w, https://substackcdn.com/image/fetch/$s_!-ozT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc96b509f-ed23-4314-b4d2-eca89c888a60_166x60.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-ozT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc96b509f-ed23-4314-b4d2-eca89c888a60_166x60.png" width="166" height="60" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c96b509f-ed23-4314-b4d2-eca89c888a60_166x60.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:60,&quot;width&quot;:166,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2781,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc96b509f-ed23-4314-b4d2-eca89c888a60_166x60.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!-ozT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc96b509f-ed23-4314-b4d2-eca89c888a60_166x60.png 424w, https://substackcdn.com/image/fetch/$s_!-ozT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc96b509f-ed23-4314-b4d2-eca89c888a60_166x60.png 848w, https://substackcdn.com/image/fetch/$s_!-ozT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc96b509f-ed23-4314-b4d2-eca89c888a60_166x60.png 1272w, https://substackcdn.com/image/fetch/$s_!-ozT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc96b509f-ed23-4314-b4d2-eca89c888a60_166x60.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>(i.e., X and Y are uncorrelated to begin with, or one has zero variance). Then the quadratic formula might degenerate or yield strange values (e.g., dividing by zero). Another pitfall is if the expression under the square root becomes negative, indicating no real values of c exist that make Cov(A, B) = 0. This would occur if</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9xJk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba01a4d8-9aa9-4f86-a8ad-53067ff7370b_652x127.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9xJk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba01a4d8-9aa9-4f86-a8ad-53067ff7370b_652x127.png 424w, https://substackcdn.com/image/fetch/$s_!9xJk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba01a4d8-9aa9-4f86-a8ad-53067ff7370b_652x127.png 848w, https://substackcdn.com/image/fetch/$s_!9xJk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba01a4d8-9aa9-4f86-a8ad-53067ff7370b_652x127.png 1272w, https://substackcdn.com/image/fetch/$s_!9xJk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba01a4d8-9aa9-4f86-a8ad-53067ff7370b_652x127.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9xJk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba01a4d8-9aa9-4f86-a8ad-53067ff7370b_652x127.png" width="652" height="127" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ba01a4d8-9aa9-4f86-a8ad-53067ff7370b_652x127.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:127,&quot;width&quot;:652,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:11712,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba01a4d8-9aa9-4f86-a8ad-53067ff7370b_652x127.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9xJk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba01a4d8-9aa9-4f86-a8ad-53067ff7370b_652x127.png 424w, https://substackcdn.com/image/fetch/$s_!9xJk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba01a4d8-9aa9-4f86-a8ad-53067ff7370b_652x127.png 848w, https://substackcdn.com/image/fetch/$s_!9xJk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba01a4d8-9aa9-4f86-a8ad-53067ff7370b_652x127.png 1272w, https://substackcdn.com/image/fetch/$s_!9xJk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba01a4d8-9aa9-4f86-a8ad-53067ff7370b_652x127.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>which means you cannot find a real c in that scenario. For typical correlation magnitudes less than 1 and positive variances, though, you will usually find two real solutions.</p><p>A further subtlety can occur if in practice you do not have perfect knowledge of the correlation (for instance, it might be estimated from data). Then the real-world solution for c might be approximate, reflecting the uncertainty in your estimate of</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!IKUo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7db1e869-7a2d-4d22-89dc-bfda9daf64a4_145x69.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!IKUo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7db1e869-7a2d-4d22-89dc-bfda9daf64a4_145x69.png 424w, https://substackcdn.com/image/fetch/$s_!IKUo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7db1e869-7a2d-4d22-89dc-bfda9daf64a4_145x69.png 848w, https://substackcdn.com/image/fetch/$s_!IKUo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7db1e869-7a2d-4d22-89dc-bfda9daf64a4_145x69.png 1272w, https://substackcdn.com/image/fetch/$s_!IKUo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7db1e869-7a2d-4d22-89dc-bfda9daf64a4_145x69.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!IKUo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7db1e869-7a2d-4d22-89dc-bfda9daf64a4_145x69.png" width="145" height="69" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7db1e869-7a2d-4d22-89dc-bfda9daf64a4_145x69.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:69,&quot;width&quot;:145,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:3056,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7db1e869-7a2d-4d22-89dc-bfda9daf64a4_145x69.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!IKUo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7db1e869-7a2d-4d22-89dc-bfda9daf64a4_145x69.png 424w, https://substackcdn.com/image/fetch/$s_!IKUo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7db1e869-7a2d-4d22-89dc-bfda9daf64a4_145x69.png 848w, https://substackcdn.com/image/fetch/$s_!IKUo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7db1e869-7a2d-4d22-89dc-bfda9daf64a4_145x69.png 1272w, https://substackcdn.com/image/fetch/$s_!IKUo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7db1e869-7a2d-4d22-89dc-bfda9daf64a4_145x69.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h2><strong>Follow-up Question 4</strong></h2><p>What happens if we accidentally rely on zero correlation for non-normal variables?</p><p>Zero correlation alone does not imply independence for arbitrary distributions. For example, in certain cases (like a symmetric distribution of X and Y around zero but with a nonlinear dependence), X and Y can have zero correlation yet remain dependent. The key reason it works here is the assumption of joint normality. Interviewers often want to see if the candidate can make that distinction: correlation being zero is not generally enough for independence, unless we have the normality assumption or some other special structure.</p><h2><strong>Follow-up Question 5</strong></h2><p>Could you provide a short Python example illustrating how one might check independence numerically?</p><p>Below is a simple snippet in Python. We generate X and Y with correlation -0.2 and assume each has variance 1. We then form A and B for the two computed values of c. Finally, we check if the empirical correlation of A and B is close to zero:</p><pre><code><code>import numpy as np

np.random.seed(42)

# Number of samples
n = 10_000_000

# Correlation
rho = -0.2

# Generate X, Y as standard normal with correlation rho
# We can use Cholesky of covariance matrix or direct methods
mean = [0, 0]
cov = [[1, rho],
       [rho, 1]]

X, Y = np.random.multivariate_normal(mean, cov, size=n).T

# Compute the two possible c values:
# From the derived quadratic c^2 - 10c + 1 = 0 =&gt; c = 5 &#177; 2 sqrt(6)
c1 = 5 + 2*np.sqrt(6)
c2 = 5 - 2*np.sqrt(6)

# For each c, define A = cX + Y, B = X + cY
for c in [c1, c2]:
    A = c*X + Y
    B = X + c*Y
    corr_AB = np.corrcoef(A, B)[0, 1]
    print(f"c = {c}, Empirical corr(A, B) = {corr_AB:.6f}")
</code></code></pre><p>This example (with a large n) would yield empirical correlations near zero for the two values of c that we derived, confirming that they are effectively uncorrelated in practice for a large sample, and thus close to being independent when the data truly follows a bivariate normal distribution with correlation -0.2.</p><p>In a real-world scenario, you might not know</p><p>&#961;</p><p>or the variances exactly, but the principle remains: for bivariate normal data, the values of c that force Cov(A, B) = 0 are precisely those that make A and B independent.</p><div><hr></div><h2><strong>Below are additional follow-up questions</strong></h2><h2><strong>How does this analysis extend if we consider a trivariate or higher-dimensional normal scenario with more correlated variables?</strong></h2><p>When we move beyond two variables and consider a higher-dimensional normal distribution, the fundamental principle that zero covariance implies independence still holds, but only if the entire vector of random variables is jointly Gaussian. In a trivariate or higher-dimensional normal setting, linear combinations remain jointly Gaussian. However, one subtlety is that independence between two specific linear combinations in a higher-dimensional setting may depend on the correlations (and covariances) those linear combinations have with all other variables in the set, not just the pair under immediate consideration.</p><p>It can sometimes happen that the constraints required to make two combinations uncorrelated in a higher-dimensional space become more intricate. For instance, in a trivariate normal distribution with variables X, Y, and Z, if you define two linear combinations involving all three variables, you would need to solve a system of equations to ensure their mutual covariance is zero. A key pitfall arises if you assume that forcing certain pairwise covariances to zero is sufficient for independence without verifying that no other dependencies remain in the broader joint structure. Because independence in a jointly normal system can be considered by looking at the covariance matrix as a whole, one must systematically ensure that the off-diagonal blocks of the covariance matrix vanish between the relevant combinations.</p><p>In real-world scenarios, data might not perfectly follow a multivariate normal distribution, which complicates the independence argument. Zero covariance in higher dimensions does not necessarily imply independence unless you have established or can approximate joint normality. Additionally, practical constraints, such as not having enough samples to reliably estimate the full covariance matrix, can affect how accurately you identify those linear combinations that might be uncorrelated or independent in a high-dimensional setting.</p><h2><strong>What happens if we only have sample estimates of the correlation and covariance, and we attempt to solve for c based on those estimates?</strong></h2><p>In practical machine learning or statistical analysis, we rarely know the exact values of correlations and variances. Instead, we have sample estimates from data. If we attempt to solve for c by replacing the true parameters (like the true correlation</p><p>&#961;</p><p>or the true variances</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HLos!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe79948f1-386e-4f18-bfea-193997795f2b_107x61.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HLos!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe79948f1-386e-4f18-bfea-193997795f2b_107x61.png 424w, https://substackcdn.com/image/fetch/$s_!HLos!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe79948f1-386e-4f18-bfea-193997795f2b_107x61.png 848w, https://substackcdn.com/image/fetch/$s_!HLos!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe79948f1-386e-4f18-bfea-193997795f2b_107x61.png 1272w, https://substackcdn.com/image/fetch/$s_!HLos!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe79948f1-386e-4f18-bfea-193997795f2b_107x61.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HLos!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe79948f1-386e-4f18-bfea-193997795f2b_107x61.png" width="107" height="61" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e79948f1-386e-4f18-bfea-193997795f2b_107x61.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:61,&quot;width&quot;:107,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2361,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe79948f1-386e-4f18-bfea-193997795f2b_107x61.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!HLos!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe79948f1-386e-4f18-bfea-193997795f2b_107x61.png 424w, https://substackcdn.com/image/fetch/$s_!HLos!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe79948f1-386e-4f18-bfea-193997795f2b_107x61.png 848w, https://substackcdn.com/image/fetch/$s_!HLos!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe79948f1-386e-4f18-bfea-193997795f2b_107x61.png 1272w, https://substackcdn.com/image/fetch/$s_!HLos!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe79948f1-386e-4f18-bfea-193997795f2b_107x61.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>) with sample estimates, we get an estimate of c rather than an exact value.</p><p>This estimation introduces uncertainty because sample correlations and variances are themselves random variables subject to sampling error, especially if the dataset is not sufficiently large. The estimated c might vary significantly depending on the sample used, leading to possible overfitting if we rely on these parameters too strongly in a model-building context.</p><p>In real-world applications, one might construct confidence intervals for c. For example, you can bootstrap your sample multiple times to get a distribution of the estimated correlation and variance values, then solve for c in each bootstrap replicate. This would give you an empirical distribution of possible c values. A key pitfall here is that if your sample size is small or if the true correlation is close to zero, the estimation variance for</p><p>&#961;</p><p>might be large, which can produce a wide range of c estimates. Moreover, in real datasets that deviate from normality, the sampling distributions of correlation estimators can be skewed, further complicating the inference process.</p><h2><strong>How would we interpret the scenario if correlation is exactly -1 or +1, given the formulas we derived?</strong></h2><p>If X and Y are perfectly correlated (correlation of +1 or -1), they are linearly dependent, meaning one can be expressed exactly as a scalar multiple of the other. For instance, if</p><p>&#961;=+1</p><p>, we essentially have Y = aX for some a with probability 1 (assuming non-zero variances). If</p><p>&#961;=&#8722;1</p><p>, Y = -bX for some b. In either case, you lose the degrees of freedom to form interesting combinations that are independent because, effectively, there is just a single unique underlying random variable driving both X and Y.</p><p>In the formula for Cov(A, B) to be zero, you could end up with degenerate conditions or potential divisions by zero when you incorporate perfect correlations. If</p><p>&#961;=+1</p><p>or</p><p>&#961;=&#8722;1</p><p>, the determinant of the covariance matrix for (X, Y) is zero, which signals perfect collinearity. Substituting those values into the quadratic expressions we had can cause the discriminant to vanish or become undefined, meaning no real solution for c that yields independence other than contrived cases where A or B collapse to a constant zero random variable. In other words, if X and Y are perfectly correlated or anti-correlated, A and B cannot be independent unless one of them is identically zero or they are the same up to a sign factor.</p><p>In practical terms, perfect correlation is rarely observed in real data, but near-perfect correlation can still cause numerical instability in computations (e.g., near-singular covariance matrices). This can be a pitfall in machine learning pipelines, especially if you rely on matrix inversions or gradient-based methods where near-singularities can lead to exploding parameters or indefinite Hessians.</p><h2><strong>Could there be situations in which nonlinearity or transformations of X and Y affect the independence of A and B?</strong></h2><p>When X and Y are bivariate normal, any linear combination stays in the same linear domain, and independence of these linear combinations hinges on zero covariance. However, if we apply nonlinear transformations&#8212;for example, A =</p><p>cX+Y</p><p>but B =</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xuda!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F497f92f6-5295-40c1-9109-2b85d706d252_161x71.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xuda!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F497f92f6-5295-40c1-9109-2b85d706d252_161x71.png 424w, https://substackcdn.com/image/fetch/$s_!xuda!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F497f92f6-5295-40c1-9109-2b85d706d252_161x71.png 848w, https://substackcdn.com/image/fetch/$s_!xuda!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F497f92f6-5295-40c1-9109-2b85d706d252_161x71.png 1272w, https://substackcdn.com/image/fetch/$s_!xuda!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F497f92f6-5295-40c1-9109-2b85d706d252_161x71.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xuda!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F497f92f6-5295-40c1-9109-2b85d706d252_161x71.png" width="161" height="71" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/497f92f6-5295-40c1-9109-2b85d706d252_161x71.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:71,&quot;width&quot;:161,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:3061,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165085805?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F497f92f6-5295-40c1-9109-2b85d706d252_161x71.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!xuda!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F497f92f6-5295-40c1-9109-2b85d706d252_161x71.png 424w, https://substackcdn.com/image/fetch/$s_!xuda!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F497f92f6-5295-40c1-9109-2b85d706d252_161x71.png 848w, https://substackcdn.com/image/fetch/$s_!xuda!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F497f92f6-5295-40c1-9109-2b85d706d252_161x71.png 1272w, https://substackcdn.com/image/fetch/$s_!xuda!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F497f92f6-5295-40c1-9109-2b85d706d252_161x71.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>, or B = log</p><p>(X+cY)</p><p>&#8212;then even in the bivariate normal setting, we no longer have a straightforward guarantee that zero covariance of transformed variables leads to independence.</p><p>The reason is that bivariate normal distribution properties are preserved under linear transformations, not under arbitrary nonlinear transformations. A subtlety emerges if you transform X or Y to X' = g(X) and Y' = h(Y) for some nonlinear g, h. Then, even if X and Y were originally normal, (X', Y') may not have a joint distribution that remains &#8220;nice,&#8221; and the independence arguments using only linear covariance can fail.</p><p>In a real-world scenario, transformations are often used to stabilize variance or to induce approximate normality (like Box-Cox transformations). One must carefully check whether these transformations preserve or destroy the linear correlation structure. A pitfall is to assume that independence is implied by zero correlation after transformations. This assumption typically requires verifying that the transformed pair is still jointly normal or at least verifying independence through more direct means (e.g., performing tests for mutual information).</p><h2><strong>Are there practical applications where one might deliberately construct such linear combinations to achieve independence?</strong></h2><p>One practical application is in constructing portfolios in finance. If X and Y represent returns on two different assets and you want to combine them into a new pair of portfolios that are as uncorrelated (or independent) as possible, you might adjust the weights (analogous to c) to achieve minimal covariance between them. Although independence is a strong condition (and real market returns rarely obey strict normality), the principle of seeking uncorrelated portfolios is quite common.</p><p>Another example appears in signal processing, where you might want to separate signals (e.g., for blind source separation) using techniques like Independent Component Analysis (ICA). While ICA often relies on higher-order statistics beyond covariance, certain simpler algorithms might start by enforcing zero correlation in linear mixtures as a first step. A subtlety is that zero correlation is just one constraint, and achieving full independence might require additional constraints or transformations (since many real-world signals do not follow normal distributions).</p><p>A pitfall arises when applying these methods blindly: you might only reduce correlation at the second-order (i.e., covariance) level without truly achieving independence in higher-order moments. This is especially relevant if you rely on the assumption of normality, which can be incorrect for non-Gaussian signals or data series.</p><h2><strong>What if the random variables X and Y have unequal sample sizes or come from slightly different distributions?</strong></h2><p>Sometimes in practice, you might have data for X from one source or time period and data for Y from another source or partially overlapping time intervals. If you try to combine them in the manner A = cX + Y and B = X + cY, you have to handle missing data or mismatched sample sizes. One approach is to only analyze the time (or index) range where both X and Y are simultaneously observed, effectively discarding extra data from either side. This can reduce your effective sample size, thus increasing variance in the covariance estimates.</p><p>Additionally, if the distributions of X and Y are not precisely normal&#8212;say Y has a heavier tail or a different shape&#8212;then the theoretical property that zero covariance implies independence no longer holds strictly. You might use transformations or robust estimation techniques (like rank-based correlation measures) to get a better sense of the dependence structure. A potential pitfall is to proceed with the normal-theory formulas and interpret the results as if they guaranteed independence, when, in fact, you are only capturing linear relationships with respect to the overlapping segments of data.</p><h2><strong>How do outliers or heavy tails impact the numerical stability of solving Cov(A, B) = 0?</strong></h2><p>In real data, especially from domains such as finance, e-commerce, or user activity logs, heavy-tailed distributions are common. Outliers can greatly affect sample covariance estimates. Because covariance is sensitive to extreme values, a few large outliers in X or Y can skew the estimated correlation or variances, leading to an inaccurately computed c if you rely on those sample estimates.</p><p>Heavy tails can also make confidence intervals around correlation or variance estimates much wider, so the numeric solution for c might not be reliable. Practically, if the data exhibit outliers, you might consider robust methods for covariance estimation (e.g., M-estimators or minimum covariance determinant estimators). A pitfall is ignoring the presence of outliers, which can produce a spurious solution for c that does not generalize. This is particularly critical in any domain where extremes can occur with non-trivial probability, such as risk assessment or anomaly detection.</p><h2><strong>What modifications are necessary if we want to force A and B to be orthogonal in a least-squares sense (rather than merely uncorrelated)?</strong></h2><p>If you interpret A and B as vectors in a high-dimensional feature space (e.g., each sample of A and B seen as coordinates in a long vector), being orthogonal in the Euclidean sense can differ from being uncorrelated as random variables. Orthogonality in a least-squares or geometry sense might require you to consider dot products of sample vectors after some transformation or standardization.</p><p>Although in probability theory, &#8220;uncorrelatedness&#8221; is often called orthogonality in L2 space, in a machine learning context with sample-based data, one might define orthogonality differently. For instance, you may want the empirical average of A times B to be zero, which is akin to sample-based uncorrelatedness. A subtlety is that if you only impose orthogonality on the sample vectors for a particular batch or data segment, you might not guarantee true independence. The pitfall is failing to distinguish between these different notions of orthogonality and inadvertently concluding independence from a purely geometric constraint. In essence, random variable independence is a stronger condition than being uncorrelated over a finite sample or being orthogonal in a Euclidean sense for one batch of data.</p><h2><strong>How might knowledge of independence between A and B help in a machine learning feature engineering context?</strong></h2><p>In feature engineering, one common practice is to transform or combine existing features to reduce redundancy. If A and B are truly independent, each might capture distinct information about the target variable in a regression or classification task. This can reduce multicollinearity, leading to more stable parameter estimates in linear models and potentially improving generalization for certain algorithms.</p><p>However, a major subtlety is that independence among features does not necessarily guarantee better predictive performance unless that independence also aligns with the target variable&#8217;s predictive structure. Another pitfall is ignoring interactions with the label: two features can be marginally independent yet jointly correlated with the label in a complex nonlinear manner. For example, each feature might be uninformative alone, but together they provide strong predictive signals. So, while seeking uncorrelated or independent features is conceptually appealing for simpler models (like linear regression), advanced models (random forests, gradient boosting, deep networks) can automatically discover intricate dependencies between features.</p><h2><strong>Can we extend this concept to partial independence, where we condition on a third variable?</strong></h2><p>Partial independence refers to the notion that two random variables A and B might be independent given a third variable Z. In classical statistics, this is captured by conditional independence statements, often checked via partial correlations in a multivariate normal setting. If X and Y are bivariate normal, and we define A and B as linear combinations of X and Y plus potentially some third variable Z, we may want to check if Cov(A, B | Z) = 0 as a condition for conditional independence.</p><p>In a practical situation with conditioning, you need to look at the conditional covariance matrix. For instance, in a three-variable normal system X, Y, Z, the partial correlation between X and Y given Z is computed from the inverse of the covariance matrix (the precision matrix). If you try to ensure independence of A and B conditional on Z, you might solve a more complex system involving partial correlations, not just the raw pairwise correlations. A pitfall here is ignoring the partial correlation concept and incorrectly concluding independence when you have not accounted for a third or additional variables that might create spurious correlations or block paths of dependence.</p>]]></content:encoded></item><item><title><![CDATA[ML Interview Q Series: Likelihood Ratio Test: Comparing Exponential User Lifetime Rate Parameters]]></title><description><![CDATA[Browse all the Probability Interview Questions here.]]></description><link>https://www.rohan-paul.com/p/ml-interview-q-series-likelihood</link><guid isPermaLink="false">https://www.rohan-paul.com/p/ml-interview-q-series-likelihood</guid><pubDate>Tue, 03 Jun 2025 10:37:35 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!zHk7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F119d01e1-e517-4d06-a526-1d093140c757_1920x1080.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zHk7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F119d01e1-e517-4d06-a526-1d093140c757_1920x1080.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zHk7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F119d01e1-e517-4d06-a526-1d093140c757_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!zHk7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F119d01e1-e517-4d06-a526-1d093140c757_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!zHk7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F119d01e1-e517-4d06-a526-1d093140c757_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!zHk7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F119d01e1-e517-4d06-a526-1d093140c757_1920x1080.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zHk7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F119d01e1-e517-4d06-a526-1d093140c757_1920x1080.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/119d01e1-e517-4d06-a526-1d093140c757_1920x1080.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1906804,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F119d01e1-e517-4d06-a526-1d093140c757_1920x1080.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zHk7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F119d01e1-e517-4d06-a526-1d093140c757_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!zHk7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F119d01e1-e517-4d06-a526-1d093140c757_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!zHk7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F119d01e1-e517-4d06-a526-1d093140c757_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!zHk7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F119d01e1-e517-4d06-a526-1d093140c757_1920x1080.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Browse all the <strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">Probability Interview Questions here</a></strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">.</a></p><h2><strong>5. Say you have a large amount of user data that measures the lifetime of each user. Assume you model each lifetime as an exponentially distributed random variable. What is the likelihood ratio for assessing two potential &#955; values, one from the null hypothesis and the other from the alternative hypothesis?</strong></h2><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://x.com/rohanpaul_ai&quot;,&quot;text&quot;:&quot;Connect with me on X (Twitter)&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://x.com/rohanpaul_ai"><span>Connect with me on X (Twitter)</span></a></p><p>An exponential distribution with parameter &#955; is often used to model lifetimes or waiting times. If we have a sample of lifetimes from n users, call them x&#8321;, x&#8322;, ..., x&#8345;, and we assume each x&#7522; is i.i.d. according to an exponential distribution with rate parameter &#955;, then the probability density function for each observation x&#7522; is</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!A1Kh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13fbdd77-42ab-457a-8fef-98f3dc91cb97_756x131.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!A1Kh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13fbdd77-42ab-457a-8fef-98f3dc91cb97_756x131.png 424w, https://substackcdn.com/image/fetch/$s_!A1Kh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13fbdd77-42ab-457a-8fef-98f3dc91cb97_756x131.png 848w, https://substackcdn.com/image/fetch/$s_!A1Kh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13fbdd77-42ab-457a-8fef-98f3dc91cb97_756x131.png 1272w, https://substackcdn.com/image/fetch/$s_!A1Kh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13fbdd77-42ab-457a-8fef-98f3dc91cb97_756x131.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!A1Kh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13fbdd77-42ab-457a-8fef-98f3dc91cb97_756x131.png" width="756" height="131" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/13fbdd77-42ab-457a-8fef-98f3dc91cb97_756x131.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:131,&quot;width&quot;:756,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:12931,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13fbdd77-42ab-457a-8fef-98f3dc91cb97_756x131.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!A1Kh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13fbdd77-42ab-457a-8fef-98f3dc91cb97_756x131.png 424w, https://substackcdn.com/image/fetch/$s_!A1Kh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13fbdd77-42ab-457a-8fef-98f3dc91cb97_756x131.png 848w, https://substackcdn.com/image/fetch/$s_!A1Kh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13fbdd77-42ab-457a-8fef-98f3dc91cb97_756x131.png 1272w, https://substackcdn.com/image/fetch/$s_!A1Kh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13fbdd77-42ab-457a-8fef-98f3dc91cb97_756x131.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p>When we have two competing hypotheses about the rate parameter &#955; (for instance, a null hypothesis &#955;&#8320; and an alternative hypothesis &#955;&#8321;), we often want to assess the ratio of likelihoods under these two parameters. The likelihood function for the entire dataset {x&#8321;, x&#8322;, ..., x&#8345;} under a particular &#955; is</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AwzE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75cf7c43-4a9f-4e87-bb81-34758ae4d3a5_1124x201.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AwzE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75cf7c43-4a9f-4e87-bb81-34758ae4d3a5_1124x201.png 424w, https://substackcdn.com/image/fetch/$s_!AwzE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75cf7c43-4a9f-4e87-bb81-34758ae4d3a5_1124x201.png 848w, https://substackcdn.com/image/fetch/$s_!AwzE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75cf7c43-4a9f-4e87-bb81-34758ae4d3a5_1124x201.png 1272w, https://substackcdn.com/image/fetch/$s_!AwzE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75cf7c43-4a9f-4e87-bb81-34758ae4d3a5_1124x201.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AwzE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75cf7c43-4a9f-4e87-bb81-34758ae4d3a5_1124x201.png" width="1124" height="201" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/75cf7c43-4a9f-4e87-bb81-34758ae4d3a5_1124x201.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:201,&quot;width&quot;:1124,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:24518,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75cf7c43-4a9f-4e87-bb81-34758ae4d3a5_1124x201.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!AwzE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75cf7c43-4a9f-4e87-bb81-34758ae4d3a5_1124x201.png 424w, https://substackcdn.com/image/fetch/$s_!AwzE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75cf7c43-4a9f-4e87-bb81-34758ae4d3a5_1124x201.png 848w, https://substackcdn.com/image/fetch/$s_!AwzE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75cf7c43-4a9f-4e87-bb81-34758ae4d3a5_1124x201.png 1272w, https://substackcdn.com/image/fetch/$s_!AwzE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75cf7c43-4a9f-4e87-bb81-34758ae4d3a5_1124x201.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p>The likelihood ratio for comparing &#955;&#8320; (null) against &#955;&#8321; (alternative) is defined as</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Rauz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aa87d28-fdc8-469f-86cb-16b1ab03599c_1036x185.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Rauz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aa87d28-fdc8-469f-86cb-16b1ab03599c_1036x185.png 424w, https://substackcdn.com/image/fetch/$s_!Rauz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aa87d28-fdc8-469f-86cb-16b1ab03599c_1036x185.png 848w, https://substackcdn.com/image/fetch/$s_!Rauz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aa87d28-fdc8-469f-86cb-16b1ab03599c_1036x185.png 1272w, https://substackcdn.com/image/fetch/$s_!Rauz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aa87d28-fdc8-469f-86cb-16b1ab03599c_1036x185.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Rauz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aa87d28-fdc8-469f-86cb-16b1ab03599c_1036x185.png" width="1036" height="185" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1aa87d28-fdc8-469f-86cb-16b1ab03599c_1036x185.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:185,&quot;width&quot;:1036,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:36295,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aa87d28-fdc8-469f-86cb-16b1ab03599c_1036x185.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Rauz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aa87d28-fdc8-469f-86cb-16b1ab03599c_1036x185.png 424w, https://substackcdn.com/image/fetch/$s_!Rauz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aa87d28-fdc8-469f-86cb-16b1ab03599c_1036x185.png 848w, https://substackcdn.com/image/fetch/$s_!Rauz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aa87d28-fdc8-469f-86cb-16b1ab03599c_1036x185.png 1272w, https://substackcdn.com/image/fetch/$s_!Rauz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aa87d28-fdc8-469f-86cb-16b1ab03599c_1036x185.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Simplifying, this becomes</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yEeb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76b4ce87-718f-4db0-8961-da260e03f6df_838x170.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yEeb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76b4ce87-718f-4db0-8961-da260e03f6df_838x170.png 424w, https://substackcdn.com/image/fetch/$s_!yEeb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76b4ce87-718f-4db0-8961-da260e03f6df_838x170.png 848w, https://substackcdn.com/image/fetch/$s_!yEeb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76b4ce87-718f-4db0-8961-da260e03f6df_838x170.png 1272w, https://substackcdn.com/image/fetch/$s_!yEeb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76b4ce87-718f-4db0-8961-da260e03f6df_838x170.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yEeb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76b4ce87-718f-4db0-8961-da260e03f6df_838x170.png" width="838" height="170" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/76b4ce87-718f-4db0-8961-da260e03f6df_838x170.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:170,&quot;width&quot;:838,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:22055,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76b4ce87-718f-4db0-8961-da260e03f6df_838x170.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!yEeb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76b4ce87-718f-4db0-8961-da260e03f6df_838x170.png 424w, https://substackcdn.com/image/fetch/$s_!yEeb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76b4ce87-718f-4db0-8961-da260e03f6df_838x170.png 848w, https://substackcdn.com/image/fetch/$s_!yEeb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76b4ce87-718f-4db0-8961-da260e03f6df_838x170.png 1272w, https://substackcdn.com/image/fetch/$s_!yEeb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76b4ce87-718f-4db0-8961-da260e03f6df_838x170.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>This ratio forms the core of the likelihood ratio test: we compare this ratio (or its logarithm) to a threshold in order to decide whether to favor the null hypothesis (&#955;&#8320;) or the alternative hypothesis (&#955;&#8321;).</p><p>In extremely detailed form, here is how we arrive at it step by step:</p><p>&#8226; Each observation x&#7522; has exponential PDF &#955; e^(-&#955; x&#7522;). &#8226; Because the data points are assumed i.i.d., we multiply the PDF for each observation to get the joint likelihood. &#8226; For hypothesis H&#8320;: &#955; = &#955;&#8320;, the likelihood is &#955;&#8320;^n e^(-&#955;&#8320; &#931;x&#7522;). &#8226; For hypothesis H&#8321;: &#955; = &#955;&#8321;, the likelihood is &#955;&#8321;^n e^(-&#955;&#8321; &#931;x&#7522;). &#8226; The likelihood ratio is the fraction of these two likelihoods.</p><p>Hence, the direct answer to the question &#8220;What is the likelihood ratio for assessing two potential &#955; values?&#8221; is exactly</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Xn4J!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b5e77c8-655d-424b-8f8a-9fc0a4ac93ef_599x187.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Xn4J!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b5e77c8-655d-424b-8f8a-9fc0a4ac93ef_599x187.png 424w, https://substackcdn.com/image/fetch/$s_!Xn4J!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b5e77c8-655d-424b-8f8a-9fc0a4ac93ef_599x187.png 848w, https://substackcdn.com/image/fetch/$s_!Xn4J!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b5e77c8-655d-424b-8f8a-9fc0a4ac93ef_599x187.png 1272w, https://substackcdn.com/image/fetch/$s_!Xn4J!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b5e77c8-655d-424b-8f8a-9fc0a4ac93ef_599x187.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Xn4J!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b5e77c8-655d-424b-8f8a-9fc0a4ac93ef_599x187.png" width="599" height="187" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9b5e77c8-655d-424b-8f8a-9fc0a4ac93ef_599x187.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:187,&quot;width&quot;:599,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:20982,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b5e77c8-655d-424b-8f8a-9fc0a4ac93ef_599x187.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Xn4J!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b5e77c8-655d-424b-8f8a-9fc0a4ac93ef_599x187.png 424w, https://substackcdn.com/image/fetch/$s_!Xn4J!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b5e77c8-655d-424b-8f8a-9fc0a4ac93ef_599x187.png 848w, https://substackcdn.com/image/fetch/$s_!Xn4J!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b5e77c8-655d-424b-8f8a-9fc0a4ac93ef_599x187.png 1272w, https://substackcdn.com/image/fetch/$s_!Xn4J!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b5e77c8-655d-424b-8f8a-9fc0a4ac93ef_599x187.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Likelihood Ratio Test In Practice The likelihood ratio test (LRT) typically uses a decision rule of the form: reject H&#8320; if &#923; &lt; c (where c is chosen based on a significance level &#945;). Often, we look at the log-likelihood ratio</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fLqK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b10fd6b-fb44-402a-80f8-b71b20e8cc44_788x176.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fLqK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b10fd6b-fb44-402a-80f8-b71b20e8cc44_788x176.png 424w, https://substackcdn.com/image/fetch/$s_!fLqK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b10fd6b-fb44-402a-80f8-b71b20e8cc44_788x176.png 848w, https://substackcdn.com/image/fetch/$s_!fLqK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b10fd6b-fb44-402a-80f8-b71b20e8cc44_788x176.png 1272w, https://substackcdn.com/image/fetch/$s_!fLqK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b10fd6b-fb44-402a-80f8-b71b20e8cc44_788x176.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fLqK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b10fd6b-fb44-402a-80f8-b71b20e8cc44_788x176.png" width="788" height="176" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5b10fd6b-fb44-402a-80f8-b71b20e8cc44_788x176.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:176,&quot;width&quot;:788,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:17140,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b10fd6b-fb44-402a-80f8-b71b20e8cc44_788x176.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!fLqK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b10fd6b-fb44-402a-80f8-b71b20e8cc44_788x176.png 424w, https://substackcdn.com/image/fetch/$s_!fLqK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b10fd6b-fb44-402a-80f8-b71b20e8cc44_788x176.png 848w, https://substackcdn.com/image/fetch/$s_!fLqK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b10fd6b-fb44-402a-80f8-b71b20e8cc44_788x176.png 1272w, https://substackcdn.com/image/fetch/$s_!fLqK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b10fd6b-fb44-402a-80f8-b71b20e8cc44_788x176.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>and compare it to a threshold that is derived from statistical theory (for instance, using the asymptotic &#967;&#178; distribution for the log-likelihood ratio under certain regularity conditions).</p><p>To illustrate how we might compute this in code given a collection of user lifetimes, we can do something like:</p><pre><code><code>import numpy as np

def likelihood_ratio(data, lambda0, lambda1):
    # data is an array of user lifetimes
    n = len(data)
    sum_of_data = np.sum(data)

    # Compute numerator: L(lambda0)
    L0 = (lambda0**n) * np.exp(-lambda0 * sum_of_data)

    # Compute denominator: L(lambda1)
    L1 = (lambda1**n) * np.exp(-lambda1 * sum_of_data)

    return L0 / L1

# Example usage:
data_samples = np.array([2.3, 1.1, 0.7, 3.5, 4.2])  # Example lifetimes
lambda0 = 0.5
lambda1 = 0.8
lr_value = likelihood_ratio(data_samples, lambda0, lambda1)
print("Likelihood Ratio:", lr_value)
</code></code></pre><p>This code gives the ratio directly. From there, one would typically compare log(lr_value) to some threshold that is derived for the test, or equivalently compare lr_value itself to some threshold.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.rohan-paul.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">I write everyday for my readers on actionable AI. Subscribe and instantly get a 1300+ page Python book.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2><strong>What If the Data Is Not Truly Exponential?</strong></h2><p>One immediate follow-up question is what happens if the data is not actually exponentially distributed in reality. In real-world scenarios, user lifetimes can have more complicated distributions (for example, Weibull, Gamma, or even a mixture of distributions). The exponential distribution assumes a constant hazard rate, but real user retention can have different hazard rates over time. If this assumption is violated, the model can be misspecified, and the likelihood ratio test for distinguishing &#955;&#8320; from &#955;&#8321; can lose power or can be invalid.</p><p>In practice, analysts might use goodness-of-fit tests, or cross-validate with alternative distributions to confirm that the exponential assumption is not severely violated. Another approach could be to apply a parametric survival analysis method with a more flexible distribution. Alternatively, one might take a non-parametric approach if there is enough data.</p><h2><strong>How Do We Derive a Confidence Interval for &#955;?</strong></h2><p>Another likely follow-up is about obtaining confidence intervals for the rate parameter. In the exponential distribution, the Maximum Likelihood Estimate (MLE) for &#955; is</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tmC7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde0b4fdb-a017-4e31-930d-d5d5932a29ef_311x135.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tmC7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde0b4fdb-a017-4e31-930d-d5d5932a29ef_311x135.png 424w, https://substackcdn.com/image/fetch/$s_!tmC7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde0b4fdb-a017-4e31-930d-d5d5932a29ef_311x135.png 848w, https://substackcdn.com/image/fetch/$s_!tmC7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde0b4fdb-a017-4e31-930d-d5d5932a29ef_311x135.png 1272w, https://substackcdn.com/image/fetch/$s_!tmC7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde0b4fdb-a017-4e31-930d-d5d5932a29ef_311x135.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tmC7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde0b4fdb-a017-4e31-930d-d5d5932a29ef_311x135.png" width="311" height="135" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/de0b4fdb-a017-4e31-930d-d5d5932a29ef_311x135.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:135,&quot;width&quot;:311,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:7129,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde0b4fdb-a017-4e31-930d-d5d5932a29ef_311x135.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!tmC7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde0b4fdb-a017-4e31-930d-d5d5932a29ef_311x135.png 424w, https://substackcdn.com/image/fetch/$s_!tmC7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde0b4fdb-a017-4e31-930d-d5d5932a29ef_311x135.png 848w, https://substackcdn.com/image/fetch/$s_!tmC7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde0b4fdb-a017-4e31-930d-d5d5932a29ef_311x135.png 1272w, https://substackcdn.com/image/fetch/$s_!tmC7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde0b4fdb-a017-4e31-930d-d5d5932a29ef_311x135.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>One can use asymptotic properties: since the MLE is asymptotically normal with variance that can be approximated by the inverse of the Fisher information, we can derive approximate confidence intervals. Specifically, the Fisher information for &#955; in the exponential distribution, based on n i.i.d. samples, is</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8I-D!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a37eca-7bab-4042-b97b-fb8af144c8ea_255x122.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8I-D!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a37eca-7bab-4042-b97b-fb8af144c8ea_255x122.png 424w, https://substackcdn.com/image/fetch/$s_!8I-D!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a37eca-7bab-4042-b97b-fb8af144c8ea_255x122.png 848w, https://substackcdn.com/image/fetch/$s_!8I-D!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a37eca-7bab-4042-b97b-fb8af144c8ea_255x122.png 1272w, https://substackcdn.com/image/fetch/$s_!8I-D!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a37eca-7bab-4042-b97b-fb8af144c8ea_255x122.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8I-D!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a37eca-7bab-4042-b97b-fb8af144c8ea_255x122.png" width="255" height="122" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/59a37eca-7bab-4042-b97b-fb8af144c8ea_255x122.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:122,&quot;width&quot;:255,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:5753,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a37eca-7bab-4042-b97b-fb8af144c8ea_255x122.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8I-D!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a37eca-7bab-4042-b97b-fb8af144c8ea_255x122.png 424w, https://substackcdn.com/image/fetch/$s_!8I-D!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a37eca-7bab-4042-b97b-fb8af144c8ea_255x122.png 848w, https://substackcdn.com/image/fetch/$s_!8I-D!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a37eca-7bab-4042-b97b-fb8af144c8ea_255x122.png 1272w, https://substackcdn.com/image/fetch/$s_!8I-D!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a37eca-7bab-4042-b97b-fb8af144c8ea_255x122.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Thus, the asymptotic variance of the MLE is &#955;&#178; / n, and an approximate confidence interval is</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!p-_V!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4fecdc3-b46c-4753-b0de-6d9c789d74e0_367x182.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!p-_V!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4fecdc3-b46c-4753-b0de-6d9c789d74e0_367x182.png 424w, https://substackcdn.com/image/fetch/$s_!p-_V!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4fecdc3-b46c-4753-b0de-6d9c789d74e0_367x182.png 848w, https://substackcdn.com/image/fetch/$s_!p-_V!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4fecdc3-b46c-4753-b0de-6d9c789d74e0_367x182.png 1272w, https://substackcdn.com/image/fetch/$s_!p-_V!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4fecdc3-b46c-4753-b0de-6d9c789d74e0_367x182.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!p-_V!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4fecdc3-b46c-4753-b0de-6d9c789d74e0_367x182.png" width="367" height="182" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a4fecdc3-b46c-4753-b0de-6d9c789d74e0_367x182.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:182,&quot;width&quot;:367,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:9549,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4fecdc3-b46c-4753-b0de-6d9c789d74e0_367x182.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!p-_V!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4fecdc3-b46c-4753-b0de-6d9c789d74e0_367x182.png 424w, https://substackcdn.com/image/fetch/$s_!p-_V!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4fecdc3-b46c-4753-b0de-6d9c789d74e0_367x182.png 848w, https://substackcdn.com/image/fetch/$s_!p-_V!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4fecdc3-b46c-4753-b0de-6d9c789d74e0_367x182.png 1272w, https://substackcdn.com/image/fetch/$s_!p-_V!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4fecdc3-b46c-4753-b0de-6d9c789d74e0_367x182.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>where z&#7493;/&#8322; is the (1&#8722;&#945;/2) quantile of the standard normal distribution. More exact methods also exist (inversion of the likelihood ratio test itself, for instance).</p><h2><strong>How Does This Compare to a Bayesian Approach?</strong></h2><p>Another tricky follow-up is how the likelihood ratio test compares to Bayesian methods. In a Bayesian framework, you would incorporate prior distributions on &#955; and compute posterior distributions given the data. Instead of forming a ratio of likelihoods alone, you would typically compare the posterior probabilities of H&#8320; vs. H&#8321; (or compute the Bayes factor, which is the ratio of marginal likelihoods). The results can be similar if non-informative priors are used, but the Bayesian approach can incorporate more prior knowledge about &#955; and produce different thresholds.</p><h2><strong>What Happens If the Data Is Censored?</strong></h2><p>In some user lifetime studies, not all users have &#8220;exited&#8221; the system by the time of analysis. This leads to right-censored data (for example, a user who joined 10 days ago and is still active has only a partial lifetime observation). In an exponential model, the likelihood contribution for a user who is still active after time t is the survival function e^(-&#955; t). The likelihood ratio test still works, but you must adapt the likelihood appropriately to include these survival function terms for censored observations:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6VY-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90c1d030-1f7a-4e7a-b3ca-62dd42c98020_898x174.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6VY-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90c1d030-1f7a-4e7a-b3ca-62dd42c98020_898x174.png 424w, https://substackcdn.com/image/fetch/$s_!6VY-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90c1d030-1f7a-4e7a-b3ca-62dd42c98020_898x174.png 848w, https://substackcdn.com/image/fetch/$s_!6VY-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90c1d030-1f7a-4e7a-b3ca-62dd42c98020_898x174.png 1272w, https://substackcdn.com/image/fetch/$s_!6VY-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90c1d030-1f7a-4e7a-b3ca-62dd42c98020_898x174.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6VY-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90c1d030-1f7a-4e7a-b3ca-62dd42c98020_898x174.png" width="898" height="174" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/90c1d030-1f7a-4e7a-b3ca-62dd42c98020_898x174.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:174,&quot;width&quot;:898,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:17439,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90c1d030-1f7a-4e7a-b3ca-62dd42c98020_898x174.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!6VY-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90c1d030-1f7a-4e7a-b3ca-62dd42c98020_898x174.png 424w, https://substackcdn.com/image/fetch/$s_!6VY-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90c1d030-1f7a-4e7a-b3ca-62dd42c98020_898x174.png 848w, https://substackcdn.com/image/fetch/$s_!6VY-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90c1d030-1f7a-4e7a-b3ca-62dd42c98020_898x174.png 1272w, https://substackcdn.com/image/fetch/$s_!6VY-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90c1d030-1f7a-4e7a-b3ca-62dd42c98020_898x174.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>where y&#11388; are the censoring times (i.e., the time up to which you have observed the user without an exit event). The ratio is then formed in the same manner, plugging in &#955;&#8320; and &#955;&#8321; for the complete and censored observations. Real-world user lifetimes are often censored, so it&#8217;s crucial to account for it properly when forming a hypothesis test for &#955;.</p><h2><strong>Finding the MLE for &#955; and Performing the LRT</strong></h2><p>Sometimes, another follow-up question is about how the test statistic is formed for the final decision. After forming the likelihood ratio, we typically compute the test statistic</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Sbxy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36519e24-ab99-4364-ad2e-4b49101cfc1a_242x109.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Sbxy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36519e24-ab99-4364-ad2e-4b49101cfc1a_242x109.png 424w, https://substackcdn.com/image/fetch/$s_!Sbxy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36519e24-ab99-4364-ad2e-4b49101cfc1a_242x109.png 848w, https://substackcdn.com/image/fetch/$s_!Sbxy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36519e24-ab99-4364-ad2e-4b49101cfc1a_242x109.png 1272w, https://substackcdn.com/image/fetch/$s_!Sbxy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36519e24-ab99-4364-ad2e-4b49101cfc1a_242x109.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Sbxy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36519e24-ab99-4364-ad2e-4b49101cfc1a_242x109.png" width="242" height="109" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/36519e24-ab99-4364-ad2e-4b49101cfc1a_242x109.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:109,&quot;width&quot;:242,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:4756,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36519e24-ab99-4364-ad2e-4b49101cfc1a_242x109.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Sbxy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36519e24-ab99-4364-ad2e-4b49101cfc1a_242x109.png 424w, https://substackcdn.com/image/fetch/$s_!Sbxy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36519e24-ab99-4364-ad2e-4b49101cfc1a_242x109.png 848w, https://substackcdn.com/image/fetch/$s_!Sbxy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36519e24-ab99-4364-ad2e-4b49101cfc1a_242x109.png 1272w, https://substackcdn.com/image/fetch/$s_!Sbxy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36519e24-ab99-4364-ad2e-4b49101cfc1a_242x109.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>where &#923; is the ratio of the maximum likelihood under H&#8320; to the maximum likelihood under H&#8321; (or vice versa, depending on your testing convention). Under usual regularity conditions and large n, this statistic approximately follows a &#967;&#178; distribution with degrees of freedom equal to the difference in the number of parameters between H&#8320; and H&#8321; (in this case, typically 1 if the only difference is &#955;). We then compare it to critical values from the &#967;&#178; distribution or compute a p-value.</p><p>If &#8722;2 ln(&#923;) is large enough, this indicates the alternative hypothesis H&#8321; is favored. This approach is fundamental to many parametric hypothesis tests in statistics.</p><h2><strong>Python Code Example for Fitting and Testing</strong></h2><p>Another angle might be a practical step-by-step code snippet that:</p><ol><li><p>Reads in the data.</p></li><li><p>Fits the MLE for &#955; (although in the question we assume &#955;&#8320; and &#955;&#8321; are already specified, for a test scenario).</p></li><li><p>Computes the likelihood ratio.</p></li><li><p>Returns the test statistic and a p-value.</p></li></ol><p>Here is a more extended approach:</p><pre><code><code>import numpy as np
from scipy.stats import chi2

def exponential_log_likelihood(data, lam):
    n = len(data)
    return n * np.log(lam) - lam * np.sum(data)

def lrt_exponential(data, lambda_null, alpha=0.05):
    # log-likelihood under null (fixed lambda_null)
    ll_null = exponential_log_likelihood(data, lambda_null)

    # MLE for lambda under alternative
    n = len(data)
    sum_of_data = np.sum(data)
    lambda_mle = n / sum_of_data

    # log-likelihood under alternative
    ll_alternative = exponential_log_likelihood(data, lambda_mle)

    # Likelihood ratio statistic
    test_stat = -2 * (ll_null - ll_alternative)

    # Under large n, test_stat ~ chi-square with df=1 (since only 1 extra parameter in alternative)
    p_value = 1 - chi2.cdf(test_stat, df=1)

    reject = (p_value &lt; alpha)
    return test_stat, p_value, reject

# Example usage:
data_samples = np.array([2.3, 1.1, 0.7, 3.5, 4.2])  # example lifetimes
lambda0 = 0.5

ts, pval, decision = lrt_exponential(data_samples, lambda0, alpha=0.05)
print("Test Statistic:", ts)
print("p-value:", pval)
print("Reject H0?", decision)
</code></code></pre><p>While the question specifically asked for the ratio of the likelihoods at &#955;&#8320; vs. &#955;&#8321;, in real usage you might want to compare &#955;&#8320; (or an entire family of potential null values) to the MLE-based alternative or do a full parametric test. This is a typical pattern in parametric hypothesis testing for the exponential distribution.</p><h2><strong>Practical Concerns and Edge Cases</strong></h2><p>In large-scale user data, edge cases to watch out for include:</p><p>&#8226; Extremely large or small user lifetimes that might push the rate estimates (and thus the exponent terms) to numerically underflow or overflow. Log-transforming the likelihood (log-likelihood) is a standard way to handle this. &#8226; Many zero or near-zero lifetimes if the system logs user churn extremely quickly. Some robust approaches or slight data cleaning might be necessary. &#8226; Missing or partially observed data: as discussed, for right-censored data or other forms of incomplete observation, the likelihood ratio must incorporate the survival component for unobserved lifetimes beyond the last known time point.</p><h2><strong>Recap</strong></h2><p>The concise mathematical ratio for comparing two specific &#955; values, &#955;&#8320; vs. &#955;&#8321;, using a dataset of n i.i.d. exponential samples x&#8321;, x&#8322;, &#8230;, x&#8345; is:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!A20b!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1220756f-ad05-430a-a1c5-ae75ef962c52_548x243.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!A20b!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1220756f-ad05-430a-a1c5-ae75ef962c52_548x243.png 424w, https://substackcdn.com/image/fetch/$s_!A20b!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1220756f-ad05-430a-a1c5-ae75ef962c52_548x243.png 848w, https://substackcdn.com/image/fetch/$s_!A20b!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1220756f-ad05-430a-a1c5-ae75ef962c52_548x243.png 1272w, https://substackcdn.com/image/fetch/$s_!A20b!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1220756f-ad05-430a-a1c5-ae75ef962c52_548x243.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!A20b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1220756f-ad05-430a-a1c5-ae75ef962c52_548x243.png" width="548" height="243" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1220756f-ad05-430a-a1c5-ae75ef962c52_548x243.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:243,&quot;width&quot;:548,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:21995,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1220756f-ad05-430a-a1c5-ae75ef962c52_548x243.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!A20b!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1220756f-ad05-430a-a1c5-ae75ef962c52_548x243.png 424w, https://substackcdn.com/image/fetch/$s_!A20b!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1220756f-ad05-430a-a1c5-ae75ef962c52_548x243.png 848w, https://substackcdn.com/image/fetch/$s_!A20b!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1220756f-ad05-430a-a1c5-ae75ef962c52_548x243.png 1272w, https://substackcdn.com/image/fetch/$s_!A20b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1220756f-ad05-430a-a1c5-ae75ef962c52_548x243.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>However, the deeper understanding involves how to use this ratio in hypothesis testing, how to interpret the result, and how to adapt to real-world complications such as non-exponential data or censoring.</p><p>This forms the foundation for parametric hypothesis testing with the exponential distribution, and the same approach extends to many other distributions where the ratio of likelihoods can be computed in a closed-form expression.</p><div><hr></div><h2><strong>Below are additional follow-up questions</strong></h2><h2><strong>How does the memoryless property of the exponential distribution affect our interpretation of user lifetimes, and what pitfalls might arise if lifetimes are not truly memoryless?</strong></h2><p>The exponential distribution is unique among continuous distributions for having the memoryless property. This means that no matter how long a user has already stayed, the probability they leave in the next interval remains the same. In notation, for an exponential random variable X with rate &#955;,</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!XsgS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5de6d98f-8256-4ebf-a0d0-fd4c8e1efaaf_754x104.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!XsgS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5de6d98f-8256-4ebf-a0d0-fd4c8e1efaaf_754x104.png 424w, https://substackcdn.com/image/fetch/$s_!XsgS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5de6d98f-8256-4ebf-a0d0-fd4c8e1efaaf_754x104.png 848w, https://substackcdn.com/image/fetch/$s_!XsgS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5de6d98f-8256-4ebf-a0d0-fd4c8e1efaaf_754x104.png 1272w, https://substackcdn.com/image/fetch/$s_!XsgS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5de6d98f-8256-4ebf-a0d0-fd4c8e1efaaf_754x104.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!XsgS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5de6d98f-8256-4ebf-a0d0-fd4c8e1efaaf_754x104.png" width="754" height="104" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5de6d98f-8256-4ebf-a0d0-fd4c8e1efaaf_754x104.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:104,&quot;width&quot;:754,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:10465,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5de6d98f-8256-4ebf-a0d0-fd4c8e1efaaf_754x104.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!XsgS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5de6d98f-8256-4ebf-a0d0-fd4c8e1efaaf_754x104.png 424w, https://substackcdn.com/image/fetch/$s_!XsgS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5de6d98f-8256-4ebf-a0d0-fd4c8e1efaaf_754x104.png 848w, https://substackcdn.com/image/fetch/$s_!XsgS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5de6d98f-8256-4ebf-a0d0-fd4c8e1efaaf_754x104.png 1272w, https://substackcdn.com/image/fetch/$s_!XsgS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5de6d98f-8256-4ebf-a0d0-fd4c8e1efaaf_754x104.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>In the context of user lifetimes, this implies that a user who has remained in the system for a certain duration does not have any lower or higher probability to churn in the next instant compared to a new user.</p><h3><strong>Potential pitfalls</strong></h3><ol><li><p><strong>Non-constant hazard</strong>: Real-world churn often depends on user tenure: a user might be more likely to churn early on, then less likely after they pass some milestone. This violates the memoryless property. If we rely on the exponential assumption, we can underestimate or overestimate the churn rate for different user subpopulations.</p></li><li><p><strong>Ignoring user behavior changes</strong>: If the hazard rate changes over time (e.g., after onboarding, the user is more &#8220;sticky&#8221;), then an exponential model (with constant &#955;) might fit poorly. The likelihood ratio test comparing two exponential rates might still be mathematically valid but might not capture the real shape of user retention.</p></li><li><p><strong>Misleading test outcomes</strong>: Even if the test indicates a better fit for one &#955;<em> </em>vs. another, it does not prove the data truly follows an exponential distribution. A better approach could be to test the exponential assumption directly (e.g., with goodness-of-fit tests or survival curve checks) before performing the likelihood ratio test for specific rate parameters.</p><h2><strong>If we only have aggregated or discretized time intervals for churn data, how does that change the testing procedure?</strong></h2><p>In many real-world applications, user lifetimes are not observed with exact continuous timestamps. Instead, data might be summarized in daily or weekly aggregates (for instance, &#8220;user churned in the 2nd week,&#8221; or &#8220;user was active through week 5, then churned in week 6&#8221;). This effectively discretizes what was originally a continuous process.</p><h3><strong>Testing considerations</strong></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2-yS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4061fabc-ef19-42cf-a26e-b78259947d7b_957x436.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2-yS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4061fabc-ef19-42cf-a26e-b78259947d7b_957x436.png 424w, https://substackcdn.com/image/fetch/$s_!2-yS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4061fabc-ef19-42cf-a26e-b78259947d7b_957x436.png 848w, https://substackcdn.com/image/fetch/$s_!2-yS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4061fabc-ef19-42cf-a26e-b78259947d7b_957x436.png 1272w, https://substackcdn.com/image/fetch/$s_!2-yS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4061fabc-ef19-42cf-a26e-b78259947d7b_957x436.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2-yS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4061fabc-ef19-42cf-a26e-b78259947d7b_957x436.png" width="957" height="436" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4061fabc-ef19-42cf-a26e-b78259947d7b_957x436.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:436,&quot;width&quot;:957,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:128740,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4061fabc-ef19-42cf-a26e-b78259947d7b_957x436.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2-yS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4061fabc-ef19-42cf-a26e-b78259947d7b_957x436.png 424w, https://substackcdn.com/image/fetch/$s_!2-yS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4061fabc-ef19-42cf-a26e-b78259947d7b_957x436.png 848w, https://substackcdn.com/image/fetch/$s_!2-yS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4061fabc-ef19-42cf-a26e-b78259947d7b_957x436.png 1272w, https://substackcdn.com/image/fetch/$s_!2-yS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4061fabc-ef19-42cf-a26e-b78259947d7b_957x436.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>What if the user population is heterogeneous, consisting of subgroups that have different churn rates?</strong></h2><p>A single exponential parameter &#955; implies a homogeneous population with the same churn rate. In practice, some users may churn quickly while others rarely churn, suggesting multiple underlying distributions or a mixture model.</p><h3><strong>Implications</strong></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_5MS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3289dd2d-3cbc-4704-8470-78d21b82d5e2_954x366.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_5MS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3289dd2d-3cbc-4704-8470-78d21b82d5e2_954x366.png 424w, https://substackcdn.com/image/fetch/$s_!_5MS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3289dd2d-3cbc-4704-8470-78d21b82d5e2_954x366.png 848w, https://substackcdn.com/image/fetch/$s_!_5MS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3289dd2d-3cbc-4704-8470-78d21b82d5e2_954x366.png 1272w, https://substackcdn.com/image/fetch/$s_!_5MS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3289dd2d-3cbc-4704-8470-78d21b82d5e2_954x366.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_5MS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3289dd2d-3cbc-4704-8470-78d21b82d5e2_954x366.png" width="954" height="366" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3289dd2d-3cbc-4704-8470-78d21b82d5e2_954x366.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:366,&quot;width&quot;:954,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:102808,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3289dd2d-3cbc-4704-8470-78d21b82d5e2_954x366.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_5MS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3289dd2d-3cbc-4704-8470-78d21b82d5e2_954x366.png 424w, https://substackcdn.com/image/fetch/$s_!_5MS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3289dd2d-3cbc-4704-8470-78d21b82d5e2_954x366.png 848w, https://substackcdn.com/image/fetch/$s_!_5MS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3289dd2d-3cbc-4704-8470-78d21b82d5e2_954x366.png 1272w, https://substackcdn.com/image/fetch/$s_!_5MS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3289dd2d-3cbc-4704-8470-78d21b82d5e2_954x366.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Can the likelihood ratio test be used in an online or sequential testing scenario, where data arrives continuously over time?</strong></h2><p>Yes. In online or sequential testing, you collect user data in real time and want to update your hypothesis test as new lifetimes are observed.</p><h3><strong>Key considerations</strong></h3><ul><li><p><strong>Sequential test design</strong>: Classical hypothesis tests assume a fixed sample size. When data arrives continuously, using the standard LRT at arbitrary stopping points can inflate Type I error rates. Specially designed sequential tests (e.g., Sequential Probability Ratio Test or &#8220;SPRT&#8221;) maintain error rate control.</p></li><li><p><strong>SPRT approach</strong>: The SPRT accumulates log-likelihood ratios as data arrives. As soon as the ratio crosses an upper or lower threshold, you make a decision (accept or reject the null). If it remains in an inconclusive region, you keep collecting more data.</p></li><li><p><strong>Pitfalls</strong>:</p><ul><li><p>If you do repeated peeking at the data without adjusting thresholds, you can erroneously reject or fail to reject H&#8320; more often than expected under the nominal &#945; level.</p></li><li><p>Once you incorporate the user lifetimes in an online fashion, partial observations (censored data) are more common. The test must account for the fact that some users who started more recently have not yet churned.</p></li></ul></li></ul></li></ol><h2><strong>How can we incorporate user-level covariates (e.g., demographics, usage patterns) into the exponential model and the likelihood ratio test?</strong></h2><p>When user churn depends on additional features, a simple exponential distribution with a single rate &#955; may be too restrictive. Instead, we can employ parametric survival models that allow &#955; to vary based on covariates. One popular approach is to log-transform the rate:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!YBut!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fec2ed2-2fa6-4976-ba70-a38aef06a285_891x264.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YBut!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fec2ed2-2fa6-4976-ba70-a38aef06a285_891x264.png 424w, https://substackcdn.com/image/fetch/$s_!YBut!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fec2ed2-2fa6-4976-ba70-a38aef06a285_891x264.png 848w, https://substackcdn.com/image/fetch/$s_!YBut!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fec2ed2-2fa6-4976-ba70-a38aef06a285_891x264.png 1272w, https://substackcdn.com/image/fetch/$s_!YBut!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fec2ed2-2fa6-4976-ba70-a38aef06a285_891x264.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YBut!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fec2ed2-2fa6-4976-ba70-a38aef06a285_891x264.png" width="891" height="264" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6fec2ed2-2fa6-4976-ba70-a38aef06a285_891x264.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:264,&quot;width&quot;:891,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:29592,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fec2ed2-2fa6-4976-ba70-a38aef06a285_891x264.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!YBut!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fec2ed2-2fa6-4976-ba70-a38aef06a285_891x264.png 424w, https://substackcdn.com/image/fetch/$s_!YBut!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fec2ed2-2fa6-4976-ba70-a38aef06a285_891x264.png 848w, https://substackcdn.com/image/fetch/$s_!YBut!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fec2ed2-2fa6-4976-ba70-a38aef06a285_891x264.png 1272w, https://substackcdn.com/image/fetch/$s_!YBut!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fec2ed2-2fa6-4976-ba70-a38aef06a285_891x264.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3><strong>Likelihood ratio testing</strong></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!N4HN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdeeeb77-5ecc-4f8f-b82b-c38de5645fda_875x167.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!N4HN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdeeeb77-5ecc-4f8f-b82b-c38de5645fda_875x167.png 424w, https://substackcdn.com/image/fetch/$s_!N4HN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdeeeb77-5ecc-4f8f-b82b-c38de5645fda_875x167.png 848w, https://substackcdn.com/image/fetch/$s_!N4HN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdeeeb77-5ecc-4f8f-b82b-c38de5645fda_875x167.png 1272w, https://substackcdn.com/image/fetch/$s_!N4HN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdeeeb77-5ecc-4f8f-b82b-c38de5645fda_875x167.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!N4HN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdeeeb77-5ecc-4f8f-b82b-c38de5645fda_875x167.png" width="875" height="167" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bdeeeb77-5ecc-4f8f-b82b-c38de5645fda_875x167.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:167,&quot;width&quot;:875,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:33762,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdeeeb77-5ecc-4f8f-b82b-c38de5645fda_875x167.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!N4HN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdeeeb77-5ecc-4f8f-b82b-c38de5645fda_875x167.png 424w, https://substackcdn.com/image/fetch/$s_!N4HN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdeeeb77-5ecc-4f8f-b82b-c38de5645fda_875x167.png 848w, https://substackcdn.com/image/fetch/$s_!N4HN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdeeeb77-5ecc-4f8f-b82b-c38de5645fda_875x167.png 1272w, https://substackcdn.com/image/fetch/$s_!N4HN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdeeeb77-5ecc-4f8f-b82b-c38de5645fda_875x167.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><ul><li><p><strong>Interpretation</strong>: A statistically significant result could mean that adding certain covariates significantly improves the fit, indicating those features are relevant for explaining churn variation.</p></li><li><p><strong>Pitfalls</strong>:</p><ul><li><p>Overfitting if you include too many covariates with limited data.</p></li><li><p>Multicollinearity if the covariates are highly correlated. This can make coefficient estimates unstable and complicates the interpretation.</p></li><li><p>Violations of model assumptions if the relationship between log(&#955;) and covariates is not linear.</p></li></ul></li></ul><h2><strong>How do we handle extremely large datasets and ensure computational efficiency when calculating the likelihood ratio?</strong></h2><p>In large-scale ML or data engineering environments, user lifetime datasets can have millions or billions of records. The naive approach of directly multiplying large exponentials or raising &#955;<em> </em>to a huge power can lead to numerical underflow or overflow.</p><h3><strong>Strategies</strong></h3><p><strong>Log-likelihoods</strong>: Compute sums of log probabilities instead of directly computing products. This is standard practice:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!edoT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e86b113-5911-4cf0-9709-c16bf4782cf9_790x134.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!edoT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e86b113-5911-4cf0-9709-c16bf4782cf9_790x134.png 424w, https://substackcdn.com/image/fetch/$s_!edoT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e86b113-5911-4cf0-9709-c16bf4782cf9_790x134.png 848w, https://substackcdn.com/image/fetch/$s_!edoT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e86b113-5911-4cf0-9709-c16bf4782cf9_790x134.png 1272w, https://substackcdn.com/image/fetch/$s_!edoT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e86b113-5911-4cf0-9709-c16bf4782cf9_790x134.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!edoT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e86b113-5911-4cf0-9709-c16bf4782cf9_790x134.png" width="790" height="134" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9e86b113-5911-4cf0-9709-c16bf4782cf9_790x134.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:134,&quot;width&quot;:790,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:25226,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e86b113-5911-4cf0-9709-c16bf4782cf9_790x134.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!edoT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e86b113-5911-4cf0-9709-c16bf4782cf9_790x134.png 424w, https://substackcdn.com/image/fetch/$s_!edoT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e86b113-5911-4cf0-9709-c16bf4782cf9_790x134.png 848w, https://substackcdn.com/image/fetch/$s_!edoT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e86b113-5911-4cf0-9709-c16bf4782cf9_790x134.png 1272w, https://substackcdn.com/image/fetch/$s_!edoT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e86b113-5911-4cf0-9709-c16bf4782cf9_790x134.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><ul><li><p><strong>Vectorized operations</strong>: Libraries like NumPy or PyTorch handle large arrays efficiently on CPUs or GPUs, but you should keep memory constraints in mind. Summations need to be carefully done to avoid numeric instability (e.g., using double precision or appropriate summation algorithms).</p></li><li><p><strong>Distributed systems</strong>: For extremely large data, you might distribute the log-likelihood computation across multiple machines, summing partial results. The final ratio is then straightforward to compute once each node sends back its partial sum of lifetimes and count of records.</p></li><li><p><strong>Pitfalls</strong>:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oUNF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd85feb14-2b00-46c4-8e6a-584aa0a54d62_783x73.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oUNF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd85feb14-2b00-46c4-8e6a-584aa0a54d62_783x73.png 424w, https://substackcdn.com/image/fetch/$s_!oUNF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd85feb14-2b00-46c4-8e6a-584aa0a54d62_783x73.png 848w, https://substackcdn.com/image/fetch/$s_!oUNF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd85feb14-2b00-46c4-8e6a-584aa0a54d62_783x73.png 1272w, https://substackcdn.com/image/fetch/$s_!oUNF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd85feb14-2b00-46c4-8e6a-584aa0a54d62_783x73.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oUNF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd85feb14-2b00-46c4-8e6a-584aa0a54d62_783x73.png" width="783" height="73" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d85feb14-2b00-46c4-8e6a-584aa0a54d62_783x73.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:73,&quot;width&quot;:783,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:18425,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd85feb14-2b00-46c4-8e6a-584aa0a54d62_783x73.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!oUNF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd85feb14-2b00-46c4-8e6a-584aa0a54d62_783x73.png 424w, https://substackcdn.com/image/fetch/$s_!oUNF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd85feb14-2b00-46c4-8e6a-584aa0a54d62_783x73.png 848w, https://substackcdn.com/image/fetch/$s_!oUNF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd85feb14-2b00-46c4-8e6a-584aa0a54d62_783x73.png 1272w, https://substackcdn.com/image/fetch/$s_!oUNF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd85feb14-2b00-46c4-8e6a-584aa0a54d62_783x73.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Communication overhead in distributed settings if you frequently update partial sums. A well-batched approach reduces overhead.</p><h2><strong>If &#955; is extremely large or extremely small, what numerical issues or misinterpretations can arise?</strong></h2><p>When &#955; is very large, this implies users typically churn very quickly (short lifetimes). Conversely, a very small &#955;<em> </em>suggests extremely long retention. Both extremes can cause complications:</p><h3><strong>Large &#955;</strong></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!XQkX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ddf6eb7-f6a7-4466-a783-2fa598ecf0d1_830x122.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!XQkX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ddf6eb7-f6a7-4466-a783-2fa598ecf0d1_830x122.png 424w, https://substackcdn.com/image/fetch/$s_!XQkX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ddf6eb7-f6a7-4466-a783-2fa598ecf0d1_830x122.png 848w, https://substackcdn.com/image/fetch/$s_!XQkX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ddf6eb7-f6a7-4466-a783-2fa598ecf0d1_830x122.png 1272w, https://substackcdn.com/image/fetch/$s_!XQkX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ddf6eb7-f6a7-4466-a783-2fa598ecf0d1_830x122.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!XQkX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ddf6eb7-f6a7-4466-a783-2fa598ecf0d1_830x122.png" width="830" height="122" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3ddf6eb7-f6a7-4466-a783-2fa598ecf0d1_830x122.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:122,&quot;width&quot;:830,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:30598,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ddf6eb7-f6a7-4466-a783-2fa598ecf0d1_830x122.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!XQkX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ddf6eb7-f6a7-4466-a783-2fa598ecf0d1_830x122.png 424w, https://substackcdn.com/image/fetch/$s_!XQkX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ddf6eb7-f6a7-4466-a783-2fa598ecf0d1_830x122.png 848w, https://substackcdn.com/image/fetch/$s_!XQkX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ddf6eb7-f6a7-4466-a783-2fa598ecf0d1_830x122.png 1272w, https://substackcdn.com/image/fetch/$s_!XQkX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ddf6eb7-f6a7-4466-a783-2fa598ecf0d1_830x122.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><strong>Model misfit</strong>: If &#955; is large, small variations in data can drastically change the likelihood. This can cause the LRT to be sensitive if the data truly does not support such a high rate.</p></li></ul><h3><strong>Small &#955;</strong></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hUpE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9fac4c5-6e23-4d14-afc1-814a3d36f4db_887x129.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hUpE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9fac4c5-6e23-4d14-afc1-814a3d36f4db_887x129.png 424w, https://substackcdn.com/image/fetch/$s_!hUpE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9fac4c5-6e23-4d14-afc1-814a3d36f4db_887x129.png 848w, https://substackcdn.com/image/fetch/$s_!hUpE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9fac4c5-6e23-4d14-afc1-814a3d36f4db_887x129.png 1272w, https://substackcdn.com/image/fetch/$s_!hUpE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9fac4c5-6e23-4d14-afc1-814a3d36f4db_887x129.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hUpE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9fac4c5-6e23-4d14-afc1-814a3d36f4db_887x129.png" width="887" height="129" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e9fac4c5-6e23-4d14-afc1-814a3d36f4db_887x129.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:129,&quot;width&quot;:887,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:32998,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9fac4c5-6e23-4d14-afc1-814a3d36f4db_887x129.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!hUpE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9fac4c5-6e23-4d14-afc1-814a3d36f4db_887x129.png 424w, https://substackcdn.com/image/fetch/$s_!hUpE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9fac4c5-6e23-4d14-afc1-814a3d36f4db_887x129.png 848w, https://substackcdn.com/image/fetch/$s_!hUpE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9fac4c5-6e23-4d14-afc1-814a3d36f4db_887x129.png 1272w, https://substackcdn.com/image/fetch/$s_!hUpE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9fac4c5-6e23-4d14-afc1-814a3d36f4db_887x129.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><ul><li><p><strong>Misinterpretation</strong>: A tiny &#955; may indicate a near-zero churn rate. You must confirm that data genuinely suggests near-permanent user retention, or if instead your model is incorrectly capturing just a subset of the population.</p></li></ul><h2><strong>How do we address partial lifetimes or &#8220;delayed entry&#8221; scenarios where some users started before the observation period or only part of their usage history is available?</strong></h2><p>Besides right-censoring (users who have not yet churned), there are other complexities in real user data:</p><ol><li><p><strong>Left-truncation or delayed entry</strong>: Some users might have joined the system before your observation window started. You only begin tracking them mid-lifetime. Standard exponential modeling would incorrectly treat their &#8220;start&#8221; as time 0, ignoring the fact that they already &#8220;survived&#8221; up to that point.</p></li><li><p><strong>Intermittent observation</strong>: Some lifetimes might have gaps in observation. For instance, a user might go inactive for a while, then come back. Determining the moment of &#8220;churn&#8221; is ambiguous.</p></li></ol><h3><strong>Adapting the likelihood</strong></h3><ul><li><p>For left-truncation, the correct term for a user who enters the study at time a<em> </em>and churns at time b&gt;a is proportional to:</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_c2h!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd28f13e8-7836-48c2-a239-16f6d9abc933_503x165.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_c2h!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd28f13e8-7836-48c2-a239-16f6d9abc933_503x165.png 424w, https://substackcdn.com/image/fetch/$s_!_c2h!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd28f13e8-7836-48c2-a239-16f6d9abc933_503x165.png 848w, https://substackcdn.com/image/fetch/$s_!_c2h!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd28f13e8-7836-48c2-a239-16f6d9abc933_503x165.png 1272w, https://substackcdn.com/image/fetch/$s_!_c2h!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd28f13e8-7836-48c2-a239-16f6d9abc933_503x165.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_c2h!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd28f13e8-7836-48c2-a239-16f6d9abc933_503x165.png" width="503" height="165" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d28f13e8-7836-48c2-a239-16f6d9abc933_503x165.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:165,&quot;width&quot;:503,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:12335,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd28f13e8-7836-48c2-a239-16f6d9abc933_503x165.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_c2h!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd28f13e8-7836-48c2-a239-16f6d9abc933_503x165.png 424w, https://substackcdn.com/image/fetch/$s_!_c2h!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd28f13e8-7836-48c2-a239-16f6d9abc933_503x165.png 848w, https://substackcdn.com/image/fetch/$s_!_c2h!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd28f13e8-7836-48c2-a239-16f6d9abc933_503x165.png 1272w, https://substackcdn.com/image/fetch/$s_!_c2h!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd28f13e8-7836-48c2-a239-16f6d9abc933_503x165.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ZDxG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff405da5-b187-4d24-aa5b-7f164997dbe1_940x106.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZDxG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff405da5-b187-4d24-aa5b-7f164997dbe1_940x106.png 424w, https://substackcdn.com/image/fetch/$s_!ZDxG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff405da5-b187-4d24-aa5b-7f164997dbe1_940x106.png 848w, https://substackcdn.com/image/fetch/$s_!ZDxG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff405da5-b187-4d24-aa5b-7f164997dbe1_940x106.png 1272w, https://substackcdn.com/image/fetch/$s_!ZDxG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff405da5-b187-4d24-aa5b-7f164997dbe1_940x106.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZDxG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff405da5-b187-4d24-aa5b-7f164997dbe1_940x106.png" width="940" height="106" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ff405da5-b187-4d24-aa5b-7f164997dbe1_940x106.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:106,&quot;width&quot;:940,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:14379,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff405da5-b187-4d24-aa5b-7f164997dbe1_940x106.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ZDxG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff405da5-b187-4d24-aa5b-7f164997dbe1_940x106.png 424w, https://substackcdn.com/image/fetch/$s_!ZDxG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff405da5-b187-4d24-aa5b-7f164997dbe1_940x106.png 848w, https://substackcdn.com/image/fetch/$s_!ZDxG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff405da5-b187-4d24-aa5b-7f164997dbe1_940x106.png 1272w, https://substackcdn.com/image/fetch/$s_!ZDxG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff405da5-b187-4d24-aa5b-7f164997dbe1_940x106.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><ul><li><p>For intermittent observation, you need a carefully defined event time or a well-defined censoring rule.</p></li><li><p><strong>Pitfalls</strong>:</p><ul><li><p>Mixing partial lifetimes with full lifetimes without adjusting the likelihood can bias the rate estimate, often leading to underestimation or overestimation of churn depending on the distribution of entry times.</p></li><li><p>Dropping partially observed users is a common but naive approach that loses data and can bias results toward more engaged or long-lived users.</p></li></ul></li></ul><h2><strong>If we suspect the system changes over time (non-stationarity), does a single &#955;</strong><em><strong> </strong></em><strong>still make sense, and how can we test that?</strong></h2><p>Systems can evolve: for example, the product might have improved features that affect churn rates in later cohorts, or external events might change user behavior. A single &#955; across the entire data history may no longer be appropriate.</p><h3><strong>Approaches to handle time-varying behavior</strong></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!W2fY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8dde9c4-a6e7-4835-b005-880cc396babf_853x167.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!W2fY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8dde9c4-a6e7-4835-b005-880cc396babf_853x167.png 424w, https://substackcdn.com/image/fetch/$s_!W2fY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8dde9c4-a6e7-4835-b005-880cc396babf_853x167.png 848w, https://substackcdn.com/image/fetch/$s_!W2fY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8dde9c4-a6e7-4835-b005-880cc396babf_853x167.png 1272w, https://substackcdn.com/image/fetch/$s_!W2fY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8dde9c4-a6e7-4835-b005-880cc396babf_853x167.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!W2fY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8dde9c4-a6e7-4835-b005-880cc396babf_853x167.png" width="853" height="167" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a8dde9c4-a6e7-4835-b005-880cc396babf_853x167.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:167,&quot;width&quot;:853,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:36059,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8dde9c4-a6e7-4835-b005-880cc396babf_853x167.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!W2fY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8dde9c4-a6e7-4835-b005-880cc396babf_853x167.png 424w, https://substackcdn.com/image/fetch/$s_!W2fY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8dde9c4-a6e7-4835-b005-880cc396babf_853x167.png 848w, https://substackcdn.com/image/fetch/$s_!W2fY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8dde9c4-a6e7-4835-b005-880cc396babf_853x167.png 1272w, https://substackcdn.com/image/fetch/$s_!W2fY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8dde9c4-a6e7-4835-b005-880cc396babf_853x167.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><ol start="2"><li><p><strong>Time-dependent covariates</strong>: In parametric survival models, you can incorporate &#8220;calendar time&#8221; or &#8220;cohort effects&#8221; as a covariate in &#955;. This allows the rate to systematically shift over time.</p></li><li><p><strong>Moving window analysis</strong>: Instead of using all historical data at once, you apply the exponential fit to rolling windows or cohorts, then see if the best-fit &#955;<em> </em>changes. If it does, that&#8217;s evidence of non-stationarity.</p></li></ol><h3><strong>Pitfalls</strong></h3><ul><li><p>If the system truly changes frequently, forcing a single &#955; can mask significant shifts in user retention patterns. A test that lumps together old data with new data can be misleading about current churn rates.</p></li><li><p>Over-segmentation can reduce data within each segment, causing high variance in rate estimates.</p></li></ul><h2><strong>How do we interpret Type I and Type II errors in the context of a likelihood ratio test for user churn rates?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cWzP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98d538e2-d3c1-4058-a6d3-6518e097f4e1_933x816.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cWzP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98d538e2-d3c1-4058-a6d3-6518e097f4e1_933x816.png 424w, https://substackcdn.com/image/fetch/$s_!cWzP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98d538e2-d3c1-4058-a6d3-6518e097f4e1_933x816.png 848w, https://substackcdn.com/image/fetch/$s_!cWzP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98d538e2-d3c1-4058-a6d3-6518e097f4e1_933x816.png 1272w, https://substackcdn.com/image/fetch/$s_!cWzP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98d538e2-d3c1-4058-a6d3-6518e097f4e1_933x816.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cWzP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98d538e2-d3c1-4058-a6d3-6518e097f4e1_933x816.png" width="933" height="816" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/98d538e2-d3c1-4058-a6d3-6518e097f4e1_933x816.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:816,&quot;width&quot;:933,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:167032,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/165083372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98d538e2-d3c1-4058-a6d3-6518e097f4e1_933x816.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!cWzP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98d538e2-d3c1-4058-a6d3-6518e097f4e1_933x816.png 424w, https://substackcdn.com/image/fetch/$s_!cWzP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98d538e2-d3c1-4058-a6d3-6518e097f4e1_933x816.png 848w, https://substackcdn.com/image/fetch/$s_!cWzP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98d538e2-d3c1-4058-a6d3-6518e097f4e1_933x816.png 1272w, https://substackcdn.com/image/fetch/$s_!cWzP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98d538e2-d3c1-4058-a6d3-6518e097f4e1_933x816.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p>]]></content:encoded></item><item><title><![CDATA[ML Interview Q Series: Bias vs. Consistency: Understanding Critical Properties of Statistical Estimators]]></title><description><![CDATA[Browse all the Probability Interview Questions here.]]></description><link>https://www.rohan-paul.com/p/ml-interview-q-series-bias-vs-consistency</link><guid isPermaLink="false">https://www.rohan-paul.com/p/ml-interview-q-series-bias-vs-consistency</guid><pubDate>Sun, 01 Jun 2025 15:21:45 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!TV49!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d0bdf29-0d7d-42a5-bb97-a470b3834e46_1024x574.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!TV49!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d0bdf29-0d7d-42a5-bb97-a470b3834e46_1024x574.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!TV49!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d0bdf29-0d7d-42a5-bb97-a470b3834e46_1024x574.png 424w, https://substackcdn.com/image/fetch/$s_!TV49!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d0bdf29-0d7d-42a5-bb97-a470b3834e46_1024x574.png 848w, https://substackcdn.com/image/fetch/$s_!TV49!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d0bdf29-0d7d-42a5-bb97-a470b3834e46_1024x574.png 1272w, https://substackcdn.com/image/fetch/$s_!TV49!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d0bdf29-0d7d-42a5-bb97-a470b3834e46_1024x574.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!TV49!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d0bdf29-0d7d-42a5-bb97-a470b3834e46_1024x574.png" width="1024" height="574" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4d0bdf29-0d7d-42a5-bb97-a470b3834e46_1024x574.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:574,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:650849,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164939505?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d0bdf29-0d7d-42a5-bb97-a470b3834e46_1024x574.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!TV49!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d0bdf29-0d7d-42a5-bb97-a470b3834e46_1024x574.png 424w, https://substackcdn.com/image/fetch/$s_!TV49!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d0bdf29-0d7d-42a5-bb97-a470b3834e46_1024x574.png 848w, https://substackcdn.com/image/fetch/$s_!TV49!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d0bdf29-0d7d-42a5-bb97-a470b3834e46_1024x574.png 1272w, https://substackcdn.com/image/fetch/$s_!TV49!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d0bdf29-0d7d-42a5-bb97-a470b3834e46_1024x574.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Browse all the <strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">Probability Interview Questions here</a></strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">.</a></p><h2><strong>4. What does it mean for an estimator to be unbiased? What about consistent? Give examples of an unbiased but not consistent estimator, as well as a biased but consistent estimator.</strong></h2><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://x.com/rohanpaul_ai&quot;,&quot;text&quot;:&quot;Connect with me on X (Twitter)&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://x.com/rohanpaul_ai"><span>Connect with me on X (Twitter)</span></a></p><p><strong>Understanding the Concepts</strong></p><p>An estimator is a statistical method (often a function of sample data) that attempts to infer or approximate some parameter of the underlying distribution. Common parameters include the mean, variance, or more complex quantities depending on the problem.</p><ul><li><p><strong>Bias</strong> of an estimator is about how, on average, the estimator differs from the true parameter value across repeated samples.</p></li><li><p><strong>Consistency</strong> of an estimator is about how, as the sample size grows large, the estimator converges (in some well-defined sense) to the true parameter value.</p></li></ul><p>Below is a deeper discussion of each term, followed by detailed examples that illustrate how an estimator can be unbiased but not consistent, and vice versa.</p><h3><strong>Unbiasedness</strong></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!40gR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97ad575e-b538-4296-8791-687ac540b9d4_897x427.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!40gR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97ad575e-b538-4296-8791-687ac540b9d4_897x427.png 424w, https://substackcdn.com/image/fetch/$s_!40gR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97ad575e-b538-4296-8791-687ac540b9d4_897x427.png 848w, https://substackcdn.com/image/fetch/$s_!40gR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97ad575e-b538-4296-8791-687ac540b9d4_897x427.png 1272w, https://substackcdn.com/image/fetch/$s_!40gR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97ad575e-b538-4296-8791-687ac540b9d4_897x427.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!40gR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97ad575e-b538-4296-8791-687ac540b9d4_897x427.png" width="897" height="427" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/97ad575e-b538-4296-8791-687ac540b9d4_897x427.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:427,&quot;width&quot;:897,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:52228,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164939505?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97ad575e-b538-4296-8791-687ac540b9d4_897x427.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!40gR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97ad575e-b538-4296-8791-687ac540b9d4_897x427.png 424w, https://substackcdn.com/image/fetch/$s_!40gR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97ad575e-b538-4296-8791-687ac540b9d4_897x427.png 848w, https://substackcdn.com/image/fetch/$s_!40gR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97ad575e-b538-4296-8791-687ac540b9d4_897x427.png 1272w, https://substackcdn.com/image/fetch/$s_!40gR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97ad575e-b538-4296-8791-687ac540b9d4_897x427.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>An unbiased estimator does not necessarily become more accurate as the sample size increases&#8212;it just means that on average it is correct. However, it might still have large variance in finite samples.</p><h3><strong>Consistency</strong></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tRn0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8075c9ae-e922-4a4a-a1cb-6cb53fa4131c_896x469.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tRn0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8075c9ae-e922-4a4a-a1cb-6cb53fa4131c_896x469.png 424w, https://substackcdn.com/image/fetch/$s_!tRn0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8075c9ae-e922-4a4a-a1cb-6cb53fa4131c_896x469.png 848w, https://substackcdn.com/image/fetch/$s_!tRn0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8075c9ae-e922-4a4a-a1cb-6cb53fa4131c_896x469.png 1272w, https://substackcdn.com/image/fetch/$s_!tRn0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8075c9ae-e922-4a4a-a1cb-6cb53fa4131c_896x469.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tRn0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8075c9ae-e922-4a4a-a1cb-6cb53fa4131c_896x469.png" width="896" height="469" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8075c9ae-e922-4a4a-a1cb-6cb53fa4131c_896x469.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:469,&quot;width&quot;:896,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:61930,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164939505?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8075c9ae-e922-4a4a-a1cb-6cb53fa4131c_896x469.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!tRn0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8075c9ae-e922-4a4a-a1cb-6cb53fa4131c_896x469.png 424w, https://substackcdn.com/image/fetch/$s_!tRn0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8075c9ae-e922-4a4a-a1cb-6cb53fa4131c_896x469.png 848w, https://substackcdn.com/image/fetch/$s_!tRn0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8075c9ae-e922-4a4a-a1cb-6cb53fa4131c_896x469.png 1272w, https://substackcdn.com/image/fetch/$s_!tRn0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8075c9ae-e922-4a4a-a1cb-6cb53fa4131c_896x469.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Consistency does not necessarily imply unbiasedness in finite samples. An estimator can be slightly biased for small or moderate n, yet still converge to the true parameter as n grows large.</p><h3><strong>Example of Unbiased But Not Consistent Estimator</strong></h3><p><strong>Key idea</strong>: You want an estimator that has the correct expectation but does not converge to the parameter as n grows. The reason it might fail to converge is often because its variance does not shrink as n increases.</p><p>A classic (though somewhat contrived) example is:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NhUx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2f1a806-0ed0-4cce-9485-44a8489c69ca_920x334.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NhUx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2f1a806-0ed0-4cce-9485-44a8489c69ca_920x334.png 424w, https://substackcdn.com/image/fetch/$s_!NhUx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2f1a806-0ed0-4cce-9485-44a8489c69ca_920x334.png 848w, https://substackcdn.com/image/fetch/$s_!NhUx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2f1a806-0ed0-4cce-9485-44a8489c69ca_920x334.png 1272w, https://substackcdn.com/image/fetch/$s_!NhUx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2f1a806-0ed0-4cce-9485-44a8489c69ca_920x334.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NhUx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2f1a806-0ed0-4cce-9485-44a8489c69ca_920x334.png" width="920" height="334" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a2f1a806-0ed0-4cce-9485-44a8489c69ca_920x334.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:334,&quot;width&quot;:920,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:77410,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164939505?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2f1a806-0ed0-4cce-9485-44a8489c69ca_920x334.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!NhUx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2f1a806-0ed0-4cce-9485-44a8489c69ca_920x334.png 424w, https://substackcdn.com/image/fetch/$s_!NhUx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2f1a806-0ed0-4cce-9485-44a8489c69ca_920x334.png 848w, https://substackcdn.com/image/fetch/$s_!NhUx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2f1a806-0ed0-4cce-9485-44a8489c69ca_920x334.png 1272w, https://substackcdn.com/image/fetch/$s_!NhUx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2f1a806-0ed0-4cce-9485-44a8489c69ca_920x334.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3><strong>Example of Biased But Consistent Estimator</strong></h3><p><strong>Key idea</strong>: You want an estimator that, for finite samples, has an expectation that differs from the true parameter value, but as n grows large, it converges to the true value.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AYNz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b72359d-24b5-4c70-a80c-d8bb68b3ba3a_900x387.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AYNz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b72359d-24b5-4c70-a80c-d8bb68b3ba3a_900x387.png 424w, https://substackcdn.com/image/fetch/$s_!AYNz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b72359d-24b5-4c70-a80c-d8bb68b3ba3a_900x387.png 848w, https://substackcdn.com/image/fetch/$s_!AYNz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b72359d-24b5-4c70-a80c-d8bb68b3ba3a_900x387.png 1272w, https://substackcdn.com/image/fetch/$s_!AYNz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b72359d-24b5-4c70-a80c-d8bb68b3ba3a_900x387.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AYNz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b72359d-24b5-4c70-a80c-d8bb68b3ba3a_900x387.png" width="900" height="387" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3b72359d-24b5-4c70-a80c-d8bb68b3ba3a_900x387.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:387,&quot;width&quot;:900,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:60774,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164939505?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b72359d-24b5-4c70-a80c-d8bb68b3ba3a_900x387.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!AYNz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b72359d-24b5-4c70-a80c-d8bb68b3ba3a_900x387.png 424w, https://substackcdn.com/image/fetch/$s_!AYNz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b72359d-24b5-4c70-a80c-d8bb68b3ba3a_900x387.png 848w, https://substackcdn.com/image/fetch/$s_!AYNz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b72359d-24b5-4c70-a80c-d8bb68b3ba3a_900x387.png 1272w, https://substackcdn.com/image/fetch/$s_!AYNz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b72359d-24b5-4c70-a80c-d8bb68b3ba3a_900x387.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!d4TN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F845dc78c-08e4-42c0-9ff5-fb20b404132c_936x672.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!d4TN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F845dc78c-08e4-42c0-9ff5-fb20b404132c_936x672.png 424w, https://substackcdn.com/image/fetch/$s_!d4TN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F845dc78c-08e4-42c0-9ff5-fb20b404132c_936x672.png 848w, https://substackcdn.com/image/fetch/$s_!d4TN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F845dc78c-08e4-42c0-9ff5-fb20b404132c_936x672.png 1272w, https://substackcdn.com/image/fetch/$s_!d4TN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F845dc78c-08e4-42c0-9ff5-fb20b404132c_936x672.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!d4TN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F845dc78c-08e4-42c0-9ff5-fb20b404132c_936x672.png" width="936" height="672" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/845dc78c-08e4-42c0-9ff5-fb20b404132c_936x672.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:672,&quot;width&quot;:936,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:64477,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164939505?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F845dc78c-08e4-42c0-9ff5-fb20b404132c_936x672.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!d4TN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F845dc78c-08e4-42c0-9ff5-fb20b404132c_936x672.png 424w, https://substackcdn.com/image/fetch/$s_!d4TN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F845dc78c-08e4-42c0-9ff5-fb20b404132c_936x672.png 848w, https://substackcdn.com/image/fetch/$s_!d4TN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F845dc78c-08e4-42c0-9ff5-fb20b404132c_936x672.png 1272w, https://substackcdn.com/image/fetch/$s_!d4TN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F845dc78c-08e4-42c0-9ff5-fb20b404132c_936x672.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.rohan-paul.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">I write everyday for my readers on actionable AI. Subscribe and instantly get a 1300+ page Python book.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2><strong>Potential Follow-up Questions</strong></h2><h3><strong>What is the formal definition of consistency using convergence in probability?</strong></h3><p>Convergence in probability means that for every &#1013;&gt;0:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PjtF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d9d4e19-0c4e-4d38-b1cf-c9943102f45a_910x340.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PjtF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d9d4e19-0c4e-4d38-b1cf-c9943102f45a_910x340.png 424w, https://substackcdn.com/image/fetch/$s_!PjtF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d9d4e19-0c4e-4d38-b1cf-c9943102f45a_910x340.png 848w, https://substackcdn.com/image/fetch/$s_!PjtF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d9d4e19-0c4e-4d38-b1cf-c9943102f45a_910x340.png 1272w, https://substackcdn.com/image/fetch/$s_!PjtF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d9d4e19-0c4e-4d38-b1cf-c9943102f45a_910x340.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PjtF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d9d4e19-0c4e-4d38-b1cf-c9943102f45a_910x340.png" width="910" height="340" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7d9d4e19-0c4e-4d38-b1cf-c9943102f45a_910x340.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:340,&quot;width&quot;:910,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:48535,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164939505?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d9d4e19-0c4e-4d38-b1cf-c9943102f45a_910x340.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!PjtF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d9d4e19-0c4e-4d38-b1cf-c9943102f45a_910x340.png 424w, https://substackcdn.com/image/fetch/$s_!PjtF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d9d4e19-0c4e-4d38-b1cf-c9943102f45a_910x340.png 848w, https://substackcdn.com/image/fetch/$s_!PjtF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d9d4e19-0c4e-4d38-b1cf-c9943102f45a_910x340.png 1272w, https://substackcdn.com/image/fetch/$s_!PjtF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d9d4e19-0c4e-4d38-b1cf-c9943102f45a_910x340.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Follow-up considerations:</p><ul><li><p>Sometimes people also talk about <strong>almost sure convergence</strong> or <strong>mean-square convergence</strong>. For consistency in the simplest sense, we usually focus on convergence in probability.</p></li><li><p>In an interview, you might be asked about whether &#8220;unbiased + large n&#8221; automatically implies consistency. The answer is no, because you could remain unbiased but still have a high variance that does not vanish with large n (as in the earlier example).</p></li></ul><h3><strong>Why is the sample variance formula often written with 1/(n&#8722;1) instead of 1/n?</strong></h3><p>The sample variance with 1/(n&#8722;1) is called the <strong>unbiased estimator</strong> of the variance for an i.i.d. normal sample. It can be shown that:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qEsd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd54e1cd3-39e2-4d40-b6fc-14d5045e3275_808x242.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qEsd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd54e1cd3-39e2-4d40-b6fc-14d5045e3275_808x242.png 424w, https://substackcdn.com/image/fetch/$s_!qEsd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd54e1cd3-39e2-4d40-b6fc-14d5045e3275_808x242.png 848w, https://substackcdn.com/image/fetch/$s_!qEsd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd54e1cd3-39e2-4d40-b6fc-14d5045e3275_808x242.png 1272w, https://substackcdn.com/image/fetch/$s_!qEsd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd54e1cd3-39e2-4d40-b6fc-14d5045e3275_808x242.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qEsd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd54e1cd3-39e2-4d40-b6fc-14d5045e3275_808x242.png" width="808" height="242" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d54e1cd3-39e2-4d40-b6fc-14d5045e3275_808x242.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:242,&quot;width&quot;:808,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:16642,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164939505?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd54e1cd3-39e2-4d40-b6fc-14d5045e3275_808x242.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!qEsd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd54e1cd3-39e2-4d40-b6fc-14d5045e3275_808x242.png 424w, https://substackcdn.com/image/fetch/$s_!qEsd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd54e1cd3-39e2-4d40-b6fc-14d5045e3275_808x242.png 848w, https://substackcdn.com/image/fetch/$s_!qEsd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd54e1cd3-39e2-4d40-b6fc-14d5045e3275_808x242.png 1272w, https://substackcdn.com/image/fetch/$s_!qEsd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd54e1cd3-39e2-4d40-b6fc-14d5045e3275_808x242.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>When you use 1/n instead, you get the maximum likelihood estimator, which slightly underestimates the true variance on average, but that bias shrinks with n. Thus:</p><ul><li><p>1/(n&#8722;1) version is unbiased and consistent.</p></li><li><p>1/n version is biased but consistent (the difference is negligible for large n).</p></li></ul><h3><strong>Can an estimator be both biased and inconsistent?</strong></h3><p>Yes, there is no guarantee that a biased estimator must eventually converge to the true value. A biased estimator can fail to converge. For instance, you could define some pathological estimator whose bias increases or does not diminish with n. Or the estimator&#8217;s variance might grow, or some combination of bias and variance doesn&#8217;t allow it to approach the true value in probability.</p><h3><strong>How can an estimator be both unbiased and consistent?</strong></h3><p>Many standard estimators in classical statistics are both unbiased and consistent. For example:</p><ul><li><p>The <strong>sample mean</strong> of i.i.d. data from a distribution with finite mean is both unbiased and consistent for the population mean.</p></li><li><p>The <strong>sample proportion</strong> (in a Bernoulli setting) is both unbiased for the true probability p and also consistent as the number of trials grows.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dG6k!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ac48ea7-8ffc-45f1-8a74-c86a1d336bd0_885x100.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dG6k!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ac48ea7-8ffc-45f1-8a74-c86a1d336bd0_885x100.png 424w, https://substackcdn.com/image/fetch/$s_!dG6k!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ac48ea7-8ffc-45f1-8a74-c86a1d336bd0_885x100.png 848w, https://substackcdn.com/image/fetch/$s_!dG6k!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ac48ea7-8ffc-45f1-8a74-c86a1d336bd0_885x100.png 1272w, https://substackcdn.com/image/fetch/$s_!dG6k!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ac48ea7-8ffc-45f1-8a74-c86a1d336bd0_885x100.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dG6k!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ac48ea7-8ffc-45f1-8a74-c86a1d336bd0_885x100.png" width="885" height="100" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1ac48ea7-8ffc-45f1-8a74-c86a1d336bd0_885x100.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:100,&quot;width&quot;:885,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:21329,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164939505?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ac48ea7-8ffc-45f1-8a74-c86a1d336bd0_885x100.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dG6k!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ac48ea7-8ffc-45f1-8a74-c86a1d336bd0_885x100.png 424w, https://substackcdn.com/image/fetch/$s_!dG6k!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ac48ea7-8ffc-45f1-8a74-c86a1d336bd0_885x100.png 848w, https://substackcdn.com/image/fetch/$s_!dG6k!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ac48ea7-8ffc-45f1-8a74-c86a1d336bd0_885x100.png 1272w, https://substackcdn.com/image/fetch/$s_!dG6k!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ac48ea7-8ffc-45f1-8a74-c86a1d336bd0_885x100.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3><strong>Are there scenarios where we prefer a biased but consistent estimator over an unbiased one?</strong></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yPMQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01a44809-893a-4a4b-977a-eb9ff5f3efe0_1065x194.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yPMQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01a44809-893a-4a4b-977a-eb9ff5f3efe0_1065x194.png 424w, https://substackcdn.com/image/fetch/$s_!yPMQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01a44809-893a-4a4b-977a-eb9ff5f3efe0_1065x194.png 848w, https://substackcdn.com/image/fetch/$s_!yPMQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01a44809-893a-4a4b-977a-eb9ff5f3efe0_1065x194.png 1272w, https://substackcdn.com/image/fetch/$s_!yPMQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01a44809-893a-4a4b-977a-eb9ff5f3efe0_1065x194.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yPMQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01a44809-893a-4a4b-977a-eb9ff5f3efe0_1065x194.png" width="1065" height="194" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/01a44809-893a-4a4b-977a-eb9ff5f3efe0_1065x194.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:194,&quot;width&quot;:1065,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:34724,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164939505?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01a44809-893a-4a4b-977a-eb9ff5f3efe0_1065x194.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!yPMQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01a44809-893a-4a4b-977a-eb9ff5f3efe0_1065x194.png 424w, https://substackcdn.com/image/fetch/$s_!yPMQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01a44809-893a-4a4b-977a-eb9ff5f3efe0_1065x194.png 848w, https://substackcdn.com/image/fetch/$s_!yPMQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01a44809-893a-4a4b-977a-eb9ff5f3efe0_1065x194.png 1272w, https://substackcdn.com/image/fetch/$s_!yPMQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01a44809-893a-4a4b-977a-eb9ff5f3efe0_1065x194.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Sometimes, an estimator might have a small bias but a significantly lower variance. As n<em> </em>grows, even that small bias disappears or becomes negligible, and the overall MSE might be smaller. Practitioners often choose consistent estimators with minimal MSE, even if there is a slight bias in finite samples.</p><p>Real-world example:</p><ul><li><p>In regularized regression methods (like Ridge Regression or Lasso), the coefficients are typically biased toward zero, but the shrinkage often lowers variance and results in better generalization performance. These methods can still be consistent under certain conditions, though they are not unbiased.</p></li></ul><h3><strong>Could you show a short Python example illustrating how we might empirically check bias or consistency?</strong></h3><p>Below is a simple Python code snippet that simulates a normal distribution and checks two estimators of the variance:</p><ol><li><p>The 1/(n&#8722;1) version (unbiased and consistent).</p></li><li><p>The 1/n version (biased but consistent).</p></li></ol><pre><code><code>import numpy as np

def simulate_variance_estimators(num_simulations=100000, n=30, true_sigma=2.0, seed=42):
    np.random.seed(seed)
    # Generate samples from Normal(0, sigma^2)
    samples = np.random.normal(loc=0.0, scale=true_sigma, size=(num_simulations, n))

    # Unbiased estimator (1/(n-1)):
    sample_means = np.mean(samples, axis=1)
    unbiased_var_estimates = np.sum((samples - sample_means[:, None])**2, axis=1) / (n - 1)

    # Biased MLE estimator (1/n):
    mle_var_estimates = np.sum((samples - sample_means[:, None])**2, axis=1) / n

    return np.mean(unbiased_var_estimates), np.mean(mle_var_estimates)

if __name__ == "__main__":
    est_unbiased, est_mle = simulate_variance_estimators()
    print("Estimated mean of unbiased variance estimator:", est_unbiased)
    print("Estimated mean of biased MLE variance estimator:", est_mle)
</code></code></pre><p>Explanation:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DL26!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F309d5db9-6a0d-4b53-bc25-55d13c995cac_908x403.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DL26!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F309d5db9-6a0d-4b53-bc25-55d13c995cac_908x403.png 424w, https://substackcdn.com/image/fetch/$s_!DL26!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F309d5db9-6a0d-4b53-bc25-55d13c995cac_908x403.png 848w, https://substackcdn.com/image/fetch/$s_!DL26!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F309d5db9-6a0d-4b53-bc25-55d13c995cac_908x403.png 1272w, https://substackcdn.com/image/fetch/$s_!DL26!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F309d5db9-6a0d-4b53-bc25-55d13c995cac_908x403.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DL26!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F309d5db9-6a0d-4b53-bc25-55d13c995cac_908x403.png" width="908" height="403" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/309d5db9-6a0d-4b53-bc25-55d13c995cac_908x403.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:403,&quot;width&quot;:908,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:78914,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164939505?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F309d5db9-6a0d-4b53-bc25-55d13c995cac_908x403.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!DL26!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F309d5db9-6a0d-4b53-bc25-55d13c995cac_908x403.png 424w, https://substackcdn.com/image/fetch/$s_!DL26!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F309d5db9-6a0d-4b53-bc25-55d13c995cac_908x403.png 848w, https://substackcdn.com/image/fetch/$s_!DL26!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F309d5db9-6a0d-4b53-bc25-55d13c995cac_908x403.png 1272w, https://substackcdn.com/image/fetch/$s_!DL26!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F309d5db9-6a0d-4b53-bc25-55d13c995cac_908x403.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Additional Follow-up Question: How do we formally relate bias and consistency to the Law of Large Numbers and the Central Limit Theorem?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Q95W!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c65721e-b37b-494b-bdd8-064d66785b28_901x361.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Q95W!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c65721e-b37b-494b-bdd8-064d66785b28_901x361.png 424w, https://substackcdn.com/image/fetch/$s_!Q95W!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c65721e-b37b-494b-bdd8-064d66785b28_901x361.png 848w, https://substackcdn.com/image/fetch/$s_!Q95W!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c65721e-b37b-494b-bdd8-064d66785b28_901x361.png 1272w, https://substackcdn.com/image/fetch/$s_!Q95W!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c65721e-b37b-494b-bdd8-064d66785b28_901x361.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Q95W!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c65721e-b37b-494b-bdd8-064d66785b28_901x361.png" width="901" height="361" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7c65721e-b37b-494b-bdd8-064d66785b28_901x361.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:361,&quot;width&quot;:901,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:79979,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164939505?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c65721e-b37b-494b-bdd8-064d66785b28_901x361.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Q95W!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c65721e-b37b-494b-bdd8-064d66785b28_901x361.png 424w, https://substackcdn.com/image/fetch/$s_!Q95W!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c65721e-b37b-494b-bdd8-064d66785b28_901x361.png 848w, https://substackcdn.com/image/fetch/$s_!Q95W!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c65721e-b37b-494b-bdd8-064d66785b28_901x361.png 1272w, https://substackcdn.com/image/fetch/$s_!Q95W!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c65721e-b37b-494b-bdd8-064d66785b28_901x361.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>These theorems illustrate the difference between an unbiased estimator (which might be correct on average but not necessarily tight) and a consistent estimator (which might be biased for small n but will converge in probability to the true parameter).</p><h2><strong>Additional Follow-up Question: Can an estimator be asymptotically unbiased but still consistent?</strong></h2><p>An estimator is <strong>asymptotically unbiased</strong> if:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!q4zJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F972105b4-52c6-444a-8745-11fec189bf3f_922x422.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!q4zJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F972105b4-52c6-444a-8745-11fec189bf3f_922x422.png 424w, https://substackcdn.com/image/fetch/$s_!q4zJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F972105b4-52c6-444a-8745-11fec189bf3f_922x422.png 848w, https://substackcdn.com/image/fetch/$s_!q4zJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F972105b4-52c6-444a-8745-11fec189bf3f_922x422.png 1272w, https://substackcdn.com/image/fetch/$s_!q4zJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F972105b4-52c6-444a-8745-11fec189bf3f_922x422.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!q4zJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F972105b4-52c6-444a-8745-11fec189bf3f_922x422.png" width="922" height="422" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/972105b4-52c6-444a-8745-11fec189bf3f_922x422.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:422,&quot;width&quot;:922,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:61606,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164939505?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F972105b4-52c6-444a-8745-11fec189bf3f_922x422.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!q4zJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F972105b4-52c6-444a-8745-11fec189bf3f_922x422.png 424w, https://substackcdn.com/image/fetch/$s_!q4zJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F972105b4-52c6-444a-8745-11fec189bf3f_922x422.png 848w, https://substackcdn.com/image/fetch/$s_!q4zJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F972105b4-52c6-444a-8745-11fec189bf3f_922x422.png 1272w, https://substackcdn.com/image/fetch/$s_!q4zJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F972105b4-52c6-444a-8745-11fec189bf3f_922x422.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Additional Follow-up Question: Are there practical reasons to choose a biased but consistent estimator?</strong></h2><p>Sometimes, yes. Reasons include:</p><ul><li><p><strong>Regularization</strong>: Introducing a small bias can drastically reduce variance, leading to better overall performance (lower MSE).</p></li><li><p><strong>Computational simplicity</strong>: Certain biased estimators are easier to compute, especially in high-dimensional or complex settings, and the bias vanishes asymptotically.</p></li><li><p><strong>Domain knowledge</strong>: In Bayesian statistics, introducing priors can cause small biases but often yields better performance if the prior information is well chosen.</p></li></ul><p>Hence, the trade-off between bias and variance is at the heart of many practical machine learning and statistical modeling decisions.</p><p><strong>Summary of Key Points</strong></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tzsy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb8d958f-15dd-407f-a8d6-e897acb2250d_835x198.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tzsy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb8d958f-15dd-407f-a8d6-e897acb2250d_835x198.png 424w, https://substackcdn.com/image/fetch/$s_!tzsy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb8d958f-15dd-407f-a8d6-e897acb2250d_835x198.png 848w, https://substackcdn.com/image/fetch/$s_!tzsy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb8d958f-15dd-407f-a8d6-e897acb2250d_835x198.png 1272w, https://substackcdn.com/image/fetch/$s_!tzsy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb8d958f-15dd-407f-a8d6-e897acb2250d_835x198.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tzsy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb8d958f-15dd-407f-a8d6-e897acb2250d_835x198.png" width="835" height="198" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/db8d958f-15dd-407f-a8d6-e897acb2250d_835x198.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:198,&quot;width&quot;:835,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:38716,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164939505?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb8d958f-15dd-407f-a8d6-e897acb2250d_835x198.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!tzsy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb8d958f-15dd-407f-a8d6-e897acb2250d_835x198.png 424w, https://substackcdn.com/image/fetch/$s_!tzsy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb8d958f-15dd-407f-a8d6-e897acb2250d_835x198.png 848w, https://substackcdn.com/image/fetch/$s_!tzsy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb8d958f-15dd-407f-a8d6-e897acb2250d_835x198.png 1272w, https://substackcdn.com/image/fetch/$s_!tzsy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb8d958f-15dd-407f-a8d6-e897acb2250d_835x198.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><ul><li><p>Biased but consistent example: MLE for variance with 1/n factor. Finite-sample expectation is off, but it converges to the true variance as sample size grows.</p></li></ul><p>By focusing on mean squared error and asymptotic properties, one can see why, in practice, a biased but consistent estimator often suffices or may even be preferable in large-sample scenarios.</p><h2><strong>Below are additional follow-up questions</strong></h2><h2><strong>How do unbiasedness and consistency relate to the concept of minimum variance?</strong></h2><p>In classical estimation theory, we often hear about the &#8220;best unbiased estimator&#8221; or the &#8220;minimum variance unbiased estimator (MVUE).&#8221; This concept stems from the idea that among all unbiased estimators, we might prefer the one that has the smallest variance for each finite sample size. In other words, if an estimator is unbiased but has a large variance, it might be less desirable because its estimates could deviate significantly from the true parameter on a given sample, even though its average value over many samples coincides with the truth.</p><p>The <strong>Lehmann-Scheff&#233; Theorem</strong> tells us that under certain regularity conditions, a complete sufficient statistic can be used to construct the UMVUE (Uniformly Minimum Variance Unbiased Estimator). This theorem highlights that not all unbiased estimators are equally good; some have lower variance than others. However, unbiasedness does not directly tell us about consistency. A minimum variance unbiased estimator is guaranteed (by definition) to have the lowest variance among all unbiased estimators for each sample size, but it could still, in theory, fail to be consistent if its variance does not shrink with n or some other subtlety arises.</p><p>In practice, especially in large-sample problems, we might prefer a slightly biased estimator that has lower variance and is consistent. For instance, maximum likelihood estimators in many scenarios are not unbiased for finite n but do have good large-sample properties such as consistency and asymptotic normality.</p><p>Edge cases to consider:</p><ul><li><p>A scenario where a UMVUE might be extremely sensitive to outliers or high skewness, potentially making it undesirable in practice despite its unbiasedness and minimal variance among unbiased estimators.</p></li><li><p>Non-regular statistical models (e.g., distributions with infinite variance, heavy tails) where constructing a UMVUE is either impossible or leads to degenerate cases.</p></li></ul><p>In summary, minimum variance among unbiased estimators does not automatically imply consistency. An estimator might be UMVUE yet have idiosyncrasies for particular sample sizes, especially if the underlying assumptions that guarantee certain properties are not met in real-world data. This is why advanced methods often trade off a bit of bias for higher stability.</p><h2><strong>Could there be real-world data situations where unbiasedness is irrelevant if the Mean Squared Error (MSE) is large?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DN2s!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F800efeb8-25ce-4818-9524-1c1bae16731e_940x507.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DN2s!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F800efeb8-25ce-4818-9524-1c1bae16731e_940x507.png 424w, https://substackcdn.com/image/fetch/$s_!DN2s!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F800efeb8-25ce-4818-9524-1c1bae16731e_940x507.png 848w, https://substackcdn.com/image/fetch/$s_!DN2s!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F800efeb8-25ce-4818-9524-1c1bae16731e_940x507.png 1272w, https://substackcdn.com/image/fetch/$s_!DN2s!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F800efeb8-25ce-4818-9524-1c1bae16731e_940x507.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DN2s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F800efeb8-25ce-4818-9524-1c1bae16731e_940x507.png" width="940" height="507" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/800efeb8-25ce-4818-9524-1c1bae16731e_940x507.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:507,&quot;width&quot;:940,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:105603,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164939505?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F800efeb8-25ce-4818-9524-1c1bae16731e_940x507.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!DN2s!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F800efeb8-25ce-4818-9524-1c1bae16731e_940x507.png 424w, https://substackcdn.com/image/fetch/$s_!DN2s!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F800efeb8-25ce-4818-9524-1c1bae16731e_940x507.png 848w, https://substackcdn.com/image/fetch/$s_!DN2s!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F800efeb8-25ce-4818-9524-1c1bae16731e_940x507.png 1272w, https://substackcdn.com/image/fetch/$s_!DN2s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F800efeb8-25ce-4818-9524-1c1bae16731e_940x507.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Edge case scenarios:</p><ul><li><p><strong>High-dimensional settings</strong>: In high-dimensional regression or classification tasks, purely unbiased estimators can explode in variance. Regularization (which introduces bias) can drastically reduce variance and lead to better predictive performance.</p></li><li><p><strong>Non-Gaussian heavy-tailed data</strong>: Outliers can heavily impact the sample mean (which is unbiased), causing extreme variance. A robust estimator (like the median) might be biased relative to the mean but has lower MSE because it is less sensitive to outliers.</p></li></ul><p>In practice, MSE is usually the more relevant metric in real-world decision-making. If unbiasedness is a central concern (e.g., certain legal or financial applications where systematic misestimation is unacceptable), then bias is crucial. Otherwise, the MSE perspective typically drives practitioners to prefer methods that might be mildly biased but exhibit significantly less variance.</p><h2><strong>What if the estimator is consistent for a &#8220;trimmed&#8221; version of the parameter? Does that still count as consistent?</strong></h2><p>Sometimes, especially with heavy-tailed distributions, one might define a &#8220;trimmed mean&#8221; or a &#8220;robust estimate&#8221; that converges to a slightly modified version of the parameter. Strictly speaking, that estimator is consistent for the trimmed parameter, but it may not be consistent for the original theoretical parameter (like the raw population mean if the distribution has undefined moments or if the tails are so heavy that the classical mean is not meaningful).</p><p>In many practical applications, the &#8220;trimmed parameter&#8221; (like a 5% trimmed mean) is actually more reflective of what a practitioner wants to measure. That means:</p><ul><li><p>The estimator is consistent for that robust target parameter.</p></li><li><p>It might be &#8220;biased&#8221; for the untrimmed mean parameter, but that untrimmed parameter could be ill-defined or not robustly estimable in the presence of outliers.</p></li></ul><p>Edge cases:</p><ul><li><p>Distributions where the mean does not exist, such as the Cauchy distribution. If one tries to estimate the mean of such a distribution with a classical estimator, it is ill-defined. A robust or trimmed approach could be more meaningful, even though it technically estimates a different quantity.</p></li><li><p>Data subject to heavy skew, where a 5% or 10% trimming might remove extreme outliers and yield more stable results.</p></li></ul><p>Hence, calling an estimator &#8220;biased&#8221; or &#8220;unbiased&#8221; may lose some meaning if the underlying target parameter is changed. Always clarify what the parameter of interest is and whether it is well-defined or robustly estimable in the real-world scenario.</p><h2><strong>Why might the median be considered consistent for the population median but not unbiased for the population mean?</strong></h2><p>The sample median is a well-known robust estimator that estimates the population median. For i.i.d. data from a distribution with a well-defined median, the sample median will converge (in probability) to the true median. This makes the sample median a <strong>consistent</strong> estimator for the median of the distribution. However, if your parameter of interest is the mean, the median might be biased in most distributions (except symmetric ones like the normal distribution, where mean = median).</p><p>This raises the point that unbiasedness is always with respect to a specific parameter. If your parameter is the median, then the sample median is often unbiased (in certain distributions) or at least asymptotically unbiased and definitely consistent. But if your parameter is the mean, you can&#8217;t rely on the median being an unbiased estimator unless the distribution is symmetrical.</p><p>Edge cases:</p><ul><li><p><strong>Uniform distribution</strong> on [0, 1]: mean = 0.5, median = 0.5, so the sample median and sample mean converge to the same value, making the sample median effectively unbiased and consistent for that distribution&#8217;s mean.</p></li><li><p><strong>Exponential distribution</strong>: mean = 1/&#955;, median = (ln(2))/&#955;. The sample median is consistent for the distribution&#8217;s median but is biased for the mean, and that bias does not vanish for small sample sizes. As n grows, the median estimate converges to the population median, not to the population mean.</p></li></ul><h2><strong>Is maximum likelihood estimation always unbiased, and if not, does that affect its consistency?</strong></h2><p>Maximum likelihood estimators (MLEs) are not always unbiased. In fact, many popular MLEs (e.g., variance estimation of a normal distribution using 1/n) are biased in finite samples. However, the MLE often has strong asymptotic properties: under fairly general conditions, it is <strong>consistent</strong> and <strong>asymptotically efficient</strong>, and it converges in distribution to a normal random variable with variance given by the inverse of the Fisher information.</p><p>The fact that many MLEs are biased in finite samples rarely detracts from their usefulness. The primary reason is that the bias typically vanishes as n grows, or becomes negligible for large n. Moreover, the MLE can often be the simplest estimator to compute and reason about theoretically. In many real-world scenarios, the advantage of a conceptually straightforward and widely applicable method outweighs a slight finite-sample bias. If unbiasedness in small samples is critical, practitioners might apply a bias-correction, such as using 1/(n&#8722;1) in the sample variance estimate for the normal distribution or using more advanced bias-reduction techniques available for generalized linear models.</p><p>Edge cases:</p><ul><li><p>Very small sample sizes: MLE might have significant bias. This can be critical in medical studies or scenarios with extremely limited data. In such cases, analysts might switch to unbiased or robust methods, or apply a Bayesian approach with strong priors.</p></li><li><p>Non-regular situations (e.g., distributions with undefined Fisher information, or boundary points in the parameter space): MLE can fail to be consistent or might be subject to different forms of bias that do not vanish as n<em>n</em> grows.</p></li></ul><h2><strong>Is consistency guaranteed under the Central Limit Theorem (CLT), and what role does the CLT play in unbiasedness?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!J10i!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6594136b-b98e-46b9-8d27-80bf09573707_920x457.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!J10i!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6594136b-b98e-46b9-8d27-80bf09573707_920x457.png 424w, https://substackcdn.com/image/fetch/$s_!J10i!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6594136b-b98e-46b9-8d27-80bf09573707_920x457.png 848w, https://substackcdn.com/image/fetch/$s_!J10i!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6594136b-b98e-46b9-8d27-80bf09573707_920x457.png 1272w, https://substackcdn.com/image/fetch/$s_!J10i!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6594136b-b98e-46b9-8d27-80bf09573707_920x457.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!J10i!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6594136b-b98e-46b9-8d27-80bf09573707_920x457.png" width="920" height="457" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6594136b-b98e-46b9-8d27-80bf09573707_920x457.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:457,&quot;width&quot;:920,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:74477,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164939505?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6594136b-b98e-46b9-8d27-80bf09573707_920x457.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!J10i!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6594136b-b98e-46b9-8d27-80bf09573707_920x457.png 424w, https://substackcdn.com/image/fetch/$s_!J10i!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6594136b-b98e-46b9-8d27-80bf09573707_920x457.png 848w, https://substackcdn.com/image/fetch/$s_!J10i!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6594136b-b98e-46b9-8d27-80bf09573707_920x457.png 1272w, https://substackcdn.com/image/fetch/$s_!J10i!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6594136b-b98e-46b9-8d27-80bf09573707_920x457.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Regarding unbiasedness, the CLT doesn&#8217;t directly inform us whether an estimator is unbiased or not. What it does do is, if we start with an estimator that is consistent (like the sample mean) and also unbiased in finite samples, then the CLT can help us build confidence intervals and hypothesis tests around that estimator by telling us how it behaves for large n.</p><p>Edge cases:</p><ul><li><p>If the data is not i.i.d. or if the variance is infinite, the standard CLT may not apply. In heavy-tailed distributions (like certain stable distributions), alternative limit theorems apply (e.g., L&#233;vy stable laws), and standard consistency arguments for the mean might break down or require stronger assumptions (e.g., truncated data).</p></li><li><p>For time-series data with autocorrelation, the CLT might need to be replaced by a functional version or specialized results that account for dependence.</p></li></ul><h2><strong>How can one handle bias that arises from model misspecification, and does that affect consistency?</strong></h2><p>Model misspecification occurs when the assumed form of the distribution or the functional relationship is incorrect. This can introduce systematic bias into estimators because they are effectively estimating a &#8220;best fit&#8221; within an incorrect model class, rather than the true parameter. For example, if you assume a linear regression model, but the true relationship is quadratic, the estimated linear slope might be biased for the real effect.</p><p>Such bias often does <strong>not</strong> vanish even as n goes to infinity, because no matter how large the sample, you are fitting the wrong functional form. This means the estimator could fail to be consistent for the true parameter. However, it might be consistent for the best linear approximation if we define a new parameter that is effectively the &#8220;slope in the best linear sense.&#8221;</p><p>Pitfalls:</p><ul><li><p>Large sample sizes do not rescue you from a fundamentally incorrect model specification. This is a major real-world concern when modeling is done incorrectly or oversimplified.</p></li><li><p>Consistency is guaranteed under certain assumptions that the model form is correct (e.g., the standard linear regression model assumptions). Violate these assumptions significantly, and your estimator could converge to the wrong value.</p></li></ul><p>To handle model misspecification, one might:</p><ul><li><p>Use nonparametric or semiparametric approaches that place fewer structural assumptions on the data.</p></li><li><p>Conduct model diagnostics and residual checks to see if systematic patterns remain.</p></li><li><p>Use cross-validation or hold-out sets to test predictive performance, which can sometimes detect when a model systematically misses certain patterns.</p></li></ul><h2><strong>In a Bayesian framework, how do we think about bias and consistency?</strong></h2><p>In Bayesian statistics, the concept of bias is less central because we combine a prior distribution with the likelihood to obtain a posterior distribution for the parameter. A point estimate, such as the posterior mean, might be biased from a frequentist perspective if we compare it to the true parameter across repeated samples from the &#8220;true&#8221; data-generating process. However, from a Bayesian viewpoint, that estimator is simply the expected value of the posterior.</p><p>Bayesian estimators can still be consistent under regular conditions. Typically, if the true parameter is within the support of the prior and certain regularity conditions hold, the posterior distribution will concentrate around the true parameter as n&#8594;&#8734;. This means the posterior mean (or median, or mode) becomes consistent in a frequentist sense.</p><p>Pitfalls:</p><ul><li><p>An overly informative or incorrect prior can induce significant bias that might not vanish quickly if the sample size is not large relative to the strength of the prior belief.</p></li><li><p>If the prior excludes the true parameter (has zero prior probability on that parameter), then no amount of data can correct that, and the estimator fails to be consistent.</p></li></ul><p>Hence, from a Bayesian angle, &#8220;bias&#8221; is tied to prior assumptions. &#8220;Consistency&#8221; typically means the posterior distribution becomes sharply concentrated around the correct parameter as data accumulates, and this usually requires that the prior be reasonably well-behaved and not rule out the actual truth entirely.</p><h2><strong>Can measurement error or label noise turn an otherwise unbiased estimator into a biased or inconsistent one?</strong></h2><p>Yes, in practice, many measurement processes introduce extra noise or systematic errors that violate the assumptions that the data truly comes from the distribution we modeled. If the measurement error is random but has zero mean, you might still maintain unbiasedness in certain estimates, although the variance could grow. However, if the measurement error is systematically off (e.g., a sensor that always reads 5 units too high), that introduces <strong>additional bias</strong> in the observed data.</p><p>For consistency, if the measurement error is random and does not scale drastically with sample size, then under certain conditions the estimator can still be consistent for the underlying parameter because the law of large numbers may smooth out that additional noise. But if the measurement error is systematically correlated with the true values or grows with n in some complicated way, the estimator might no longer converge to the intended parameter.</p><p>Pitfalls:</p><ul><li><p>In regression, &#8220;errors in variables&#8221; can lead to attenuation bias, where estimated coefficients shrink toward zero, and the problem does not vanish with large n because the bias stems from the correlation between regressor measurement error and the outcome.</p></li><li><p>In classification tasks, label noise that is systematically biased (some classes mislabeled more often than others) can skew training processes in a way that might not diminish with n. This can make certain estimates of accuracy or class probabilities inconsistent or heavily biased.</p></li></ul><p>Hence, measurement error considerations are crucial in the design of data collection protocols and in the subsequent analysis. If the model incorrectly assumes there is no measurement error, the resulting inferences might be systematically off.</p><h2><strong>In model validation, how do we detect that an estimator is biased or inconsistent from practical diagnostics or data splitting?</strong></h2><p>In real-world projects, we often rely on techniques like cross-validation or out-of-sample tests to assess the performance of an estimator. While these methods do not directly prove unbiasedness or consistency, they can shed light on systematic deviations and how the estimator behaves with increasing amounts of data.</p><p>For instance, if you see that as you increase the training set size, the estimator&#8217;s predictions or parameter estimates remain systematically off even though variance shrinks, you might suspect a consistent bias. Conversely, if you notice the performance metrics keep improving and the estimate appears to get closer to the truth in repeated sampling or cross-validation folds, this suggests the estimator might be consistent (though not formally proven by these diagnostic checks alone).</p><p>Edge considerations:</p><ul><li><p>Cross-validation distributions might still be noisy, especially if the data is not truly i.i.d. or if certain segments of data are not representative of the entire population.</p></li><li><p>Overfitting can mask whether an estimator is consistent. An over-parameterized model could appear to fit well on training data yet fail to generalize, implying no real convergence to the true parameter, especially if the model&#8217;s complexity grows with n.</p></li></ul><p>Hence, in practice, we monitor both the bias (systematic offset in predictions or estimates) and the variance (fluctuations in estimates across different folds or subsets) to glean insights into whether the estimator might converge to the true parameter as data grows.</p><p></p>]]></content:encoded></item><item><title><![CDATA[ML Interview Q Series: Assessing Coin Bias: Hypothesis Testing for 550 Heads in 1000 Flips.]]></title><description><![CDATA[Browse all the Probability Interview Questions here.]]></description><link>https://www.rohan-paul.com/p/ml-interview-q-series-assessing-coin</link><guid isPermaLink="false">https://www.rohan-paul.com/p/ml-interview-q-series-assessing-coin</guid><pubDate>Sun, 01 Jun 2025 14:55:52 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Ra-3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c1ba3aa-b236-4407-a4f2-af034b7540d4_1024x573.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ra-3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c1ba3aa-b236-4407-a4f2-af034b7540d4_1024x573.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ra-3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c1ba3aa-b236-4407-a4f2-af034b7540d4_1024x573.png 424w, https://substackcdn.com/image/fetch/$s_!Ra-3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c1ba3aa-b236-4407-a4f2-af034b7540d4_1024x573.png 848w, https://substackcdn.com/image/fetch/$s_!Ra-3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c1ba3aa-b236-4407-a4f2-af034b7540d4_1024x573.png 1272w, https://substackcdn.com/image/fetch/$s_!Ra-3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c1ba3aa-b236-4407-a4f2-af034b7540d4_1024x573.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ra-3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c1ba3aa-b236-4407-a4f2-af034b7540d4_1024x573.png" width="1024" height="573" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8c1ba3aa-b236-4407-a4f2-af034b7540d4_1024x573.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:573,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1150343,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164937228?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c1ba3aa-b236-4407-a4f2-af034b7540d4_1024x573.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Ra-3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c1ba3aa-b236-4407-a4f2-af034b7540d4_1024x573.png 424w, https://substackcdn.com/image/fetch/$s_!Ra-3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c1ba3aa-b236-4407-a4f2-af034b7540d4_1024x573.png 848w, https://substackcdn.com/image/fetch/$s_!Ra-3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c1ba3aa-b236-4407-a4f2-af034b7540d4_1024x573.png 1272w, https://substackcdn.com/image/fetch/$s_!Ra-3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c1ba3aa-b236-4407-a4f2-af034b7540d4_1024x573.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Browse all the <strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">Probability Interview Questions here</a></strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">.</a></p><h2><strong>3. A coin was flipped 1000 times, and 550 times it showed up heads. Do you think the coin is biased? Why or why not?</strong></h2><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://x.com/rohanpaul_ai&quot;,&quot;text&quot;:&quot;Connect with me on X (Twitter)&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://x.com/rohanpaul_ai"><span>Connect with me on X (Twitter)</span></a></p><p>Explanation and Reasoning in Detail</p><p>Why might we suspect a coin could be biased? Intuitively, if we assume a fair coin, we expect the probability of heads p<em>p</em> to be 0.5. Across 1000 flips, the most likely count of heads would be around 500. Observing 550 heads is somewhat higher than 500, raising the question: is this deviation just random fluctuation, or is the coin genuinely biased?</p><p>One way to examine whether this result is due to random chance or indicates a real bias is to perform a hypothesis test or to construct confidence intervals. Below is a thorough exploration of these techniques, real-world considerations, potential pitfalls, and related insights.</p><p>Hypothesis Testing Perspective</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!09vY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7630a2e3-f505-47f0-851b-8776adaaf5fe_980x745.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!09vY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7630a2e3-f505-47f0-851b-8776adaaf5fe_980x745.png 424w, https://substackcdn.com/image/fetch/$s_!09vY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7630a2e3-f505-47f0-851b-8776adaaf5fe_980x745.png 848w, https://substackcdn.com/image/fetch/$s_!09vY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7630a2e3-f505-47f0-851b-8776adaaf5fe_980x745.png 1272w, https://substackcdn.com/image/fetch/$s_!09vY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7630a2e3-f505-47f0-851b-8776adaaf5fe_980x745.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!09vY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7630a2e3-f505-47f0-851b-8776adaaf5fe_980x745.png" width="980" height="745" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7630a2e3-f505-47f0-851b-8776adaaf5fe_980x745.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:745,&quot;width&quot;:980,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:129680,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164937228?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7630a2e3-f505-47f0-851b-8776adaaf5fe_980x745.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!09vY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7630a2e3-f505-47f0-851b-8776adaaf5fe_980x745.png 424w, https://substackcdn.com/image/fetch/$s_!09vY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7630a2e3-f505-47f0-851b-8776adaaf5fe_980x745.png 848w, https://substackcdn.com/image/fetch/$s_!09vY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7630a2e3-f505-47f0-851b-8776adaaf5fe_980x745.png 1272w, https://substackcdn.com/image/fetch/$s_!09vY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7630a2e3-f505-47f0-851b-8776adaaf5fe_980x745.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Mn38!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27a8e5c0-e01c-4123-8116-f2674813f9e0_920x624.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Mn38!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27a8e5c0-e01c-4123-8116-f2674813f9e0_920x624.png 424w, https://substackcdn.com/image/fetch/$s_!Mn38!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27a8e5c0-e01c-4123-8116-f2674813f9e0_920x624.png 848w, https://substackcdn.com/image/fetch/$s_!Mn38!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27a8e5c0-e01c-4123-8116-f2674813f9e0_920x624.png 1272w, https://substackcdn.com/image/fetch/$s_!Mn38!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27a8e5c0-e01c-4123-8116-f2674813f9e0_920x624.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Mn38!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27a8e5c0-e01c-4123-8116-f2674813f9e0_920x624.png" width="920" height="624" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/27a8e5c0-e01c-4123-8116-f2674813f9e0_920x624.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:624,&quot;width&quot;:920,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:118856,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164937228?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27a8e5c0-e01c-4123-8116-f2674813f9e0_920x624.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Mn38!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27a8e5c0-e01c-4123-8116-f2674813f9e0_920x624.png 424w, https://substackcdn.com/image/fetch/$s_!Mn38!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27a8e5c0-e01c-4123-8116-f2674813f9e0_920x624.png 848w, https://substackcdn.com/image/fetch/$s_!Mn38!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27a8e5c0-e01c-4123-8116-f2674813f9e0_920x624.png 1272w, https://substackcdn.com/image/fetch/$s_!Mn38!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27a8e5c0-e01c-4123-8116-f2674813f9e0_920x624.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Therefore, by this frequentist hypothesis test criterion, it is likely that 550 heads in 1000 flips is statistically significant evidence to reject the null hypothesis of a fair coin.</p><p>Confidence Interval Perspective</p><p>Another way to approach the question is via a confidence interval for p. Suppose we estimate p by the sample proportion:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rZgW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2cbe35a3-9c93-49be-839a-355ed2de3aae_458x195.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rZgW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2cbe35a3-9c93-49be-839a-355ed2de3aae_458x195.png 424w, https://substackcdn.com/image/fetch/$s_!rZgW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2cbe35a3-9c93-49be-839a-355ed2de3aae_458x195.png 848w, https://substackcdn.com/image/fetch/$s_!rZgW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2cbe35a3-9c93-49be-839a-355ed2de3aae_458x195.png 1272w, https://substackcdn.com/image/fetch/$s_!rZgW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2cbe35a3-9c93-49be-839a-355ed2de3aae_458x195.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rZgW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2cbe35a3-9c93-49be-839a-355ed2de3aae_458x195.png" width="458" height="195" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2cbe35a3-9c93-49be-839a-355ed2de3aae_458x195.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:195,&quot;width&quot;:458,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:11932,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164937228?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2cbe35a3-9c93-49be-839a-355ed2de3aae_458x195.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rZgW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2cbe35a3-9c93-49be-839a-355ed2de3aae_458x195.png 424w, https://substackcdn.com/image/fetch/$s_!rZgW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2cbe35a3-9c93-49be-839a-355ed2de3aae_458x195.png 848w, https://substackcdn.com/image/fetch/$s_!rZgW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2cbe35a3-9c93-49be-839a-355ed2de3aae_458x195.png 1272w, https://substackcdn.com/image/fetch/$s_!rZgW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2cbe35a3-9c93-49be-839a-355ed2de3aae_458x195.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>A 95% confidence interval for the true probability of heads can be constructed using the approximate formula:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rjwC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67afd932-2d76-482f-abce-9ac046223979_910x537.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rjwC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67afd932-2d76-482f-abce-9ac046223979_910x537.png 424w, https://substackcdn.com/image/fetch/$s_!rjwC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67afd932-2d76-482f-abce-9ac046223979_910x537.png 848w, https://substackcdn.com/image/fetch/$s_!rjwC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67afd932-2d76-482f-abce-9ac046223979_910x537.png 1272w, https://substackcdn.com/image/fetch/$s_!rjwC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67afd932-2d76-482f-abce-9ac046223979_910x537.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rjwC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67afd932-2d76-482f-abce-9ac046223979_910x537.png" width="910" height="537" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/67afd932-2d76-482f-abce-9ac046223979_910x537.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:537,&quot;width&quot;:910,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:51873,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164937228?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67afd932-2d76-482f-abce-9ac046223979_910x537.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rjwC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67afd932-2d76-482f-abce-9ac046223979_910x537.png 424w, https://substackcdn.com/image/fetch/$s_!rjwC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67afd932-2d76-482f-abce-9ac046223979_910x537.png 848w, https://substackcdn.com/image/fetch/$s_!rjwC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67afd932-2d76-482f-abce-9ac046223979_910x537.png 1272w, https://substackcdn.com/image/fetch/$s_!rjwC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67afd932-2d76-482f-abce-9ac046223979_910x537.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PpgB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecb23814-843b-42c3-adcb-1cc90384bc69_737x366.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PpgB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecb23814-843b-42c3-adcb-1cc90384bc69_737x366.png 424w, https://substackcdn.com/image/fetch/$s_!PpgB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecb23814-843b-42c3-adcb-1cc90384bc69_737x366.png 848w, https://substackcdn.com/image/fetch/$s_!PpgB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecb23814-843b-42c3-adcb-1cc90384bc69_737x366.png 1272w, https://substackcdn.com/image/fetch/$s_!PpgB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecb23814-843b-42c3-adcb-1cc90384bc69_737x366.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PpgB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecb23814-843b-42c3-adcb-1cc90384bc69_737x366.png" width="737" height="366" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ecb23814-843b-42c3-adcb-1cc90384bc69_737x366.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:366,&quot;width&quot;:737,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:28762,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164937228?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecb23814-843b-42c3-adcb-1cc90384bc69_737x366.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!PpgB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecb23814-843b-42c3-adcb-1cc90384bc69_737x366.png 424w, https://substackcdn.com/image/fetch/$s_!PpgB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecb23814-843b-42c3-adcb-1cc90384bc69_737x366.png 848w, https://substackcdn.com/image/fetch/$s_!PpgB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecb23814-843b-42c3-adcb-1cc90384bc69_737x366.png 1272w, https://substackcdn.com/image/fetch/$s_!PpgB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecb23814-843b-42c3-adcb-1cc90384bc69_737x366.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>So the interval is approximately [0.5192, 0.5808]. Notice that 0.5 (the value for a fair coin) is slightly below 0.5192, which suggests 0.5 is not inside the 95% confidence interval. This again indicates that the data provide evidence that the coin may be biased (with heads probability exceeding 0.5).</p><p>Bayesian Perspective</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!z0Be!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabbb545e-9e5c-4f61-8f66-03de010159ba_906x250.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!z0Be!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabbb545e-9e5c-4f61-8f66-03de010159ba_906x250.png 424w, https://substackcdn.com/image/fetch/$s_!z0Be!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabbb545e-9e5c-4f61-8f66-03de010159ba_906x250.png 848w, https://substackcdn.com/image/fetch/$s_!z0Be!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabbb545e-9e5c-4f61-8f66-03de010159ba_906x250.png 1272w, https://substackcdn.com/image/fetch/$s_!z0Be!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabbb545e-9e5c-4f61-8f66-03de010159ba_906x250.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!z0Be!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabbb545e-9e5c-4f61-8f66-03de010159ba_906x250.png" width="906" height="250" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/abbb545e-9e5c-4f61-8f66-03de010159ba_906x250.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:250,&quot;width&quot;:906,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:60137,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164937228?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabbb545e-9e5c-4f61-8f66-03de010159ba_906x250.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!z0Be!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabbb545e-9e5c-4f61-8f66-03de010159ba_906x250.png 424w, https://substackcdn.com/image/fetch/$s_!z0Be!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabbb545e-9e5c-4f61-8f66-03de010159ba_906x250.png 848w, https://substackcdn.com/image/fetch/$s_!z0Be!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabbb545e-9e5c-4f61-8f66-03de010159ba_906x250.png 1272w, https://substackcdn.com/image/fetch/$s_!z0Be!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabbb545e-9e5c-4f61-8f66-03de010159ba_906x250.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Regardless of the approach, all these methods converge to the notion that 550 heads out of 1000 is significantly higher than what one might expect from pure chance under a fair coin assumption.</p><p>Potential Real-World Pitfalls</p><p>Sampling Bias: If the coin flips were not truly independent or if the flipping process was controlled in some manner (e.g., the way a person flips the coin), the results might not reflect the underlying fairness of the physical coin itself.</p><p>Multiple Testing or Data Snooping: If we tested many coins and only reported the results of one coin that deviated the most from 50%, that would skew our interpretation.</p><p>Practical vs. Statistical Significance: From a purely statistical perspective, 50 out of 1000 extra heads is significant. However, from a practical standpoint, one might ask if that 5% difference has real-world implications. For certain applications, it definitely could (e.g., betting scenarios).</p><p>Implementation Example in Python</p><p>Below is a quick Python code snippet that uses a standard binomial test in the SciPy library to see whether 550 heads out of 1000 flips is significantly different from 0.5.</p><pre><code><code>import math
from statsmodels.stats.proportion import proportions_ztest

count = 550  # number of heads
nobs = 1000  # number of flips
value = 0.5  # hypothesized proportion

stat, p_value = proportions_ztest(count, nobs, value=value, alternative='two-sided')
print("Z-statistic:", stat)
print("p-value:", p_value)
</code></code></pre><p>This will yield a Z-statistic close to 3.16 and a very small p-value, confirming that 550 heads is unlikely to be due to pure chance if p=0.5.</p><p>Conclusion of the Main Question</p><p>Given the observed number of heads is 550 out of 1000, standard statistical methods (both hypothesis testing and confidence intervals) strongly suggest that the coin is likely biased rather than fair.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.rohan-paul.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">I write everyday for my readers on actionable AI. Subscribe and instantly get a 1300+ page Python book.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2><strong>How might you use a Bayesian approach to decide if the coin is biased?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ok1u!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d7714da-f602-43af-bd3a-c03e770114d9_947x769.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ok1u!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d7714da-f602-43af-bd3a-c03e770114d9_947x769.png 424w, https://substackcdn.com/image/fetch/$s_!Ok1u!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d7714da-f602-43af-bd3a-c03e770114d9_947x769.png 848w, https://substackcdn.com/image/fetch/$s_!Ok1u!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d7714da-f602-43af-bd3a-c03e770114d9_947x769.png 1272w, https://substackcdn.com/image/fetch/$s_!Ok1u!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d7714da-f602-43af-bd3a-c03e770114d9_947x769.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ok1u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d7714da-f602-43af-bd3a-c03e770114d9_947x769.png" width="947" height="769" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3d7714da-f602-43af-bd3a-c03e770114d9_947x769.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:769,&quot;width&quot;:947,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:154313,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164937228?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d7714da-f602-43af-bd3a-c03e770114d9_947x769.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Ok1u!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d7714da-f602-43af-bd3a-c03e770114d9_947x769.png 424w, https://substackcdn.com/image/fetch/$s_!Ok1u!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d7714da-f602-43af-bd3a-c03e770114d9_947x769.png 848w, https://substackcdn.com/image/fetch/$s_!Ok1u!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d7714da-f602-43af-bd3a-c03e770114d9_947x769.png 1272w, https://substackcdn.com/image/fetch/$s_!Ok1u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d7714da-f602-43af-bd3a-c03e770114d9_947x769.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Could this result be explained by random chance alone?</strong></h2><p>Strictly speaking, any one experiment (1000 flips) can still produce 550 heads by chance alone. However, the probability of seeing such a large deviation from the expected value of 500 if p=0.5 is quite small. The exact binomial test or the normal approximation both give very low p-values.</p><p>The threshold for deciding &#8220;it&#8217;s not just chance&#8221; typically depends on the chosen significance level. With a standard level of 0.05, we would reject the null hypothesis. With a much stricter threshold (say 0.001), we might still reject the null hypothesis. So while chance alone could produce this result, it is statistically unlikely.</p><h2><strong>Are there any real-world considerations beyond the raw statistics?</strong></h2><p>Yes. One important consideration is whether the flips are truly random and independent. If some external factor systematically influences the flips, that might create the appearance of bias in the coin. Also, in practical settings, if this coin is used for critical decisions, even a small deviation from 0.5 could be crucial. In casual settings, one might tolerate or ignore a 55% heads rate because it might be &#8220;close enough&#8221; to fairness for the purpose at hand.</p><p>Another consideration is how stable the estimated probability is if you flip the coin thousands more times. Perhaps 550 out of 1000 was just a lucky streak. Replicating the experiment reduces the chance that an outlier result is guiding our conclusion.</p><h2><strong>How do we address concerns about multiple comparisons in real data analysis?</strong></h2><p>If you test many coins or repeat experiments and only highlight the most extreme results, you inflate the Type I error rate. This is known as the multiple comparisons problem. A good practice is to use proper corrections (e.g., Bonferroni, FDR) or pre-register a single experiment so that the interpretation of p-values is statistically sound.</p><p>If this single 1000-flip experiment was planned in advance to test one specific coin, then the analysis remains straightforward. But if it was one among many unreported attempts, the significance might be overstated.</p><h2><strong>Can you show how to do an exact binomial test instead of the normal approximation?</strong></h2><p>The exact binomial test can be performed in Python with SciPy&#8217;s stats.binom_test (in older versions) or newer functions like stats.binomtest. For instance:</p><pre><code><code>from scipy.stats import binomtest

result = binomtest(k=550, n=1000, p=0.5, alternative='two-sided')
print("p-value (exact binomial test):", result.pvalue)
</code></code></pre><p>This p-value will generally be quite close to the one from the normal approximation for large n, but it&#8217;s considered more accurate since it uses the binomial distribution directly rather than a normal approximation.</p><h2><strong>Summary of the Statistical Conclusion</strong></h2><p>With 550 heads out of 1000 flips, the departure from 500 heads is statistically significant. All major statistical approaches (frequentist confidence intervals, hypothesis tests, or Bayesian credible intervals) would point to concluding that p&gt;0.5 at conventional significance levels. Therefore, it is reasonable to state that the coin is likely biased.</p><h2><strong>Below are additional follow-up questions</strong></h2><h2><strong>Could the coin&#8217;s behavior have changed partway through the experiment, and how would you detect that?</strong></h2><p>A shift in the coin&#8217;s &#8220;effective bias&#8221; during the 1000 flips is a realistic scenario if the physical conditions of flipping changed or if the coin itself got damaged or altered. For instance, maybe for the first 500 flips the coin was fair, and for the last 500 flips it consistently landed heads more often because the flipper&#8217;s technique changed (or because the coin got bent slightly).</p><p>One way to detect such a change is to perform a <strong>change-point analysis</strong>. You break the 1000 flips into segments and see if the data in one part of the sequence looks statistically significantly different from the rest. For example, you can:</p><ul><li><p>Split the data at different potential dividing points (say, after 100 flips, 200 flips, and so on). For each split, compute the likelihood of heads vs. tails in both segments and see whether one segment is significantly different from 0.5 or from the other segment.</p></li><li><p>Use a Bayesian change-point detection algorithm that places a prior on how likely a change could occur and tries to infer both the position and magnitude of the shift in bias. This approach typically uses dynamic programming or Monte Carlo methods (e.g., Markov Chain Monte Carlo).</p></li></ul><p>If a significant shift is detected around a certain flip number, you can hypothesize that the coin&#8217;s behavior changed partway through. You might then want to gather more data specifically in the environment or conditions around the suspected shift to verify if the coin itself or the flipping method changed.</p><p>A real-world subtlety is that you should confirm that no external factor (like the flipper physically getting tired, flipping from a different angle, or a breeze in the room) caused the shift in outcomes. Distinguishing whether the coin is physically biased from a systematic flipping bias (human behavior) is often challenging.</p><h2><strong>What if your sample size was much smaller, say 20 flips, but you still observed a higher proportion of heads?</strong></h2><p>If you only flip the coin 20 times and get 11 heads (55%), you observe the same empirical proportion of heads (0.55) as in the 1000-flip scenario. However, with 20 flips, the total amount of data is far smaller, leading to much higher uncertainty around the true bias. In that case:</p><ul><li><p>A frequentist might do a binomial test and find a p-value that is not small enough to reject the hypothesis of a fair coin. The difference between 11 and 10 heads is typically too small to conclude bias at conventional significance levels because the variance is larger with fewer trials.</p></li><li><p>A confidence interval for p with just 20 flips would be much wider than for 1000 flips, likely encompassing 0.5 comfortably.</p></li><li><p>A Bayesian approach (e.g., Beta(1,1) prior updated by 11 heads and 9 tails) yields a posterior Beta(12,10). The credible interval for this distribution is wide, so there would be substantial posterior mass around p=0.5.</p></li></ul><p>Hence, for smaller sample sizes, the random fluctuation is larger relative to the difference between expected vs. observed heads, so you usually cannot confidently conclude the coin is biased. The main pitfall is that with too few flips, the confidence interval or credible interval is wide enough to include a fair coin as a highly plausible scenario.</p><h2><strong>What if the coin landing on its edge is also a possibility?</strong></h2><p>Real coins have a tiny (but non-zero) probability of landing on their edge. This possibility slightly complicates the modeling assumptions because standard binomial tests assume all flips result in heads or tails with probabilities that sum to 1. If some fraction of flips land on the edge, the distribution changes:</p><ul><li><p>You might have a three-outcome scenario: heads with probability p<em>p</em>, tails with probability q, and edge with probability 1&#8722;p&#8722;q. A &#8220;fair coin&#8221; in a three-outcome sense might still not have p=0.5 and q=0.5 if the edge case is not negligible.</p></li><li><p>Typically, the proportion of edge outcomes is extremely small (often quoted on the order of 1 in 6000 for certain coin designs and typical flipping methods), so it might be safe to ignore in practical scenarios. But if the coin is thick or the flipping surface is unusual, it might happen more often.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!LGe3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a281afe-768e-4357-9797-9ee5750212ed_919x212.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!LGe3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a281afe-768e-4357-9797-9ee5750212ed_919x212.png 424w, https://substackcdn.com/image/fetch/$s_!LGe3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a281afe-768e-4357-9797-9ee5750212ed_919x212.png 848w, https://substackcdn.com/image/fetch/$s_!LGe3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a281afe-768e-4357-9797-9ee5750212ed_919x212.png 1272w, https://substackcdn.com/image/fetch/$s_!LGe3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a281afe-768e-4357-9797-9ee5750212ed_919x212.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!LGe3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a281afe-768e-4357-9797-9ee5750212ed_919x212.png" width="919" height="212" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8a281afe-768e-4357-9797-9ee5750212ed_919x212.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:212,&quot;width&quot;:919,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:51729,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164937228?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a281afe-768e-4357-9797-9ee5750212ed_919x212.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!LGe3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a281afe-768e-4357-9797-9ee5750212ed_919x212.png 424w, https://substackcdn.com/image/fetch/$s_!LGe3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a281afe-768e-4357-9797-9ee5750212ed_919x212.png 848w, https://substackcdn.com/image/fetch/$s_!LGe3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a281afe-768e-4357-9797-9ee5750212ed_919x212.png 1272w, https://substackcdn.com/image/fetch/$s_!LGe3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a281afe-768e-4357-9797-9ee5750212ed_919x212.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h2><strong>How would you handle suspected correlations between flips?</strong></h2><p>In a perfect coin-flipping scenario, each flip is an independent Bernoulli trial. However, in reality, there can be correlations&#8212;maybe the flipper&#8217;s wrist action systematically alternates between strong and weak flips, which might lead to a pattern in the coin&#8217;s outcome.</p><p>This correlation breaks the standard binomial model, which assumes independent trials. With correlated flips, the variance of the total heads count can be different from the binomial assumption. Some ways to investigate or mitigate correlation effects:</p><ul><li><p><strong>Runs Test</strong>: You can check if the sequence of heads (H) and tails (T) shows more (or fewer) runs than expected under independence. A &#8220;run&#8221; is a consecutive sequence of identical outcomes (like HHH or TT). If the sequence is excessively &#8220;clumpy,&#8221; it might indicate correlation or changing bias over time.</p></li><li><p><strong>Block Bootstrapping or Permutation Tests</strong>: Instead of assuming each flip is i.i.d., you might do a block bootstrap of the time series to maintain potential short-term correlations, then estimate the distribution of total heads from that resampling.</p></li><li><p><strong>Model-based Approach</strong>: Use something like a hidden Markov model if you suspect the coin&#8217;s probability of heads changes in a Markovian fashion from flip to flip. This is more complex, but it might reveal patterns such as a &#8220;high-heads&#8221; state vs. a &#8220;low-heads&#8221; state.</p></li></ul><p>The subtlety is that even if the coin is physically fair, the flipping process or environment may introduce correlation or cyclical patterns. Without checking or controlling for correlation, standard binomial-based methods can give misleading p-values and confidence intervals.</p><h2><strong>Could human biases in reporting the data produce the same effect?</strong></h2><p>Yes. If a human is recording data manually, there could be systematic errors or biases:</p><ul><li><p>Someone might be more prone to record heads if they look away mid-flip or if they accidentally miss some tails.</p></li><li><p>In some contexts, the person might subconsciously want the coin to come up heads more frequently, so they might misread borderline cases or quickly glance and assume it&#8217;s heads.</p></li></ul><p>To reduce or eliminate such reporting biases, an automated mechanism (like a slow-motion camera or a sensor) can capture the coin&#8217;s actual outcome. If manual recording is unavoidable, a double-check or second observer can help ensure data integrity. Auditing the raw data to see if there are suspicious patterns (like no consecutive tails ever recorded, or consistent tallies every 10 flips) can detect anomalies.</p><h2><strong>How does prior knowledge about coin manufacturing affect your assessment?</strong></h2><p>If you have prior knowledge that the coin is minted from a reputable source with high manufacturing consistency, you might assign a strong prior belief that p is extremely close to 0.5. In a Bayesian framework, this translates to using a Beta prior heavily concentrated near 0.5.</p><p>After observing 550 heads out of 1000 flips, your posterior would still likely shift away from 0.5, but less so than if you had a uniform prior. Whether you decide the coin is &#8220;biased&#8221; depends on how strong your prior belief was and how persuasive you find 550 heads to be.</p><p>Conversely, if the coin is suspect&#8212;maybe it&#8217;s a novelty coin or you have reason to suspect an unusual weight distribution&#8212;you might place a less informative prior or even one that slightly favors p&#8800;0.5. Observing 550 heads would then push your posterior to remain even further from 0.5.</p><p>The real-world nuance is that you can combine objective data about coin mass, symmetry, and official minting processes with the flipping data to arrive at a more comprehensive conclusion about bias.</p><h2><strong>How would you design a more robust experiment to test coin fairness?</strong></h2><p>Some guidelines for a more robust experiment:</p><ul><li><p><strong>Blinding/Automation</strong>: Use a mechanical coin-flipping machine or a high-speed automated flipper that ensures each flip has minimal human involvement. This reduces the possibility that the flipper&#8217;s technique biases outcomes.</p></li><li><p><strong>Randomization of Conditions</strong>: If multiple people or settings are involved, randomize which person flips or in which environment flips are done. This keeps external factors from being confounded with the coin&#8217;s potential bias.</p></li><li><p><strong>Large Sample Sizes Over Time</strong>: If feasible, gather data from multiple sessions to ensure day-to-day variations in environment don&#8217;t systematically favor heads or tails.</p></li><li><p><strong>Record-Keeping</strong>: Use a reliable method for counting heads and tails, such as real-time logging with sensors or multiple observers.</p></li><li><p><strong>Replications</strong>: If you have multiple identical coins from the same mint, you could replicate the experiment across coins and compare results, helping confirm if one coin is an outlier or if all share a bias.</p></li></ul><p>A subtlety here is balancing thoroughness with practicality. Extremely controlled experiments can be expensive or time-consuming, but if the cost of a biased coin is high (e.g., in gambling or critical decision-making), these measures can be worthwhile.</p><h2><strong>Why might a small p-value still not guarantee the coin is truly biased?</strong></h2><p>Statistical significance (p-value &lt; 0.05, for instance) does not guarantee that the coin is truly biased. Reasons include:</p><ul><li><p><strong>Type I Error</strong>: By definition, even when a coin is fair, there is still a (for example) 5% chance of rejecting the null hypothesis if the significance level is 0.05.</p></li><li><p><strong>Unrepresentative Sample or Hidden Factors</strong>: If the flipping process was not random (e.g., the flips were all done in a way that inadvertently produced more heads), the p-value calculation that assumes independent flips from a fair coin is invalid.</p></li><li><p><strong>Practical vs. Statistical Significance</strong>: Even if the difference is statistically meaningful, in practical terms a coin with p=0.51 or 0.55 might or might not matter depending on context. Statistical significance alone doesn&#8217;t measure the real-world impact.</p></li><li><p><strong>Multiple Testing</strong>: If you tested many coins or performed many sequential tests without correction, you might find a &#8220;significant&#8221; coin by chance.</p></li></ul><p>Understanding that a small p-value points to &#8220;strong evidence against the null hypothesis&#8221; in that specific test scenario is key. It is not ironclad proof. Additional experiments or confirmations can bolster the conclusion.</p><h2><strong>What if 550 heads out of 1000 flips was actually part of a marketing claim?</strong></h2><p>Imagine a scenario where a coin manufacturer claims their commemorative coin is &#8220;lucky&#8221; because it lands on heads more often. If they present you with an experiment of exactly 1000 flips and show 550 heads, you should question:</p><ul><li><p><strong>Was there any cherry-picking of the data?</strong> They might have flipped the coin 20,000 times in total but only reported a subset of 1000 flips that best demonstrated their claim. This artificially inflates the chances of seeing a biased result.</p></li><li><p><strong>Did they allow independent observers?</strong> If the flipping was not monitored by a neutral party, results can be fabricated or selectively recorded.</p></li><li><p><strong>Was the flipping method truly random?</strong> A suspicious technique like &#8220;tossing&#8221; the coin in a controlled manner can lead to an excess of one face.</p></li></ul><p>If any cherry-picking or non-random flipping is at play, the entire premise of using a binomial test or computing a standard confidence interval breaks down. The potential pitfall is trusting the presented data at face value without verifying the methodology.</p><h2><strong>How do you handle the scenario where the coin is obviously heavier on one side but the experiments still show near 50% heads?</strong></h2><p>Sometimes a physically asymmetric coin might still produce close to 50% heads in practice if the flipping process compensates for that asymmetry. For example, if the heavier side might typically face down at landing, but the flipping motion is such that heads or tails remains nearly equally likely.</p><p>In such a scenario:</p><ul><li><p>You would still run statistical tests on real-world flipping data to measure actual outcomes. Even if the coin is physically heavier on one side, what matters in practice is whether the flipping process yields 50% heads or not.</p></li><li><p>If the data from many flips show no significant departure from 50% heads, you can&#8217;t reject the hypothesis of fairness based purely on physical asymmetry. The real measure is the flipping outcome, not the coin&#8217;s geometry alone.</p></li><li><p>You might do additional experiments changing the flipping method to see if the coin&#8217;s heavier side advantage (or disadvantage) appears under different conditions. If certain flips systematically produce more heads, that suggests the &#8220;fairness&#8221; depends heavily on how it&#8217;s flipped.</p></li></ul><p>This underscores how &#8220;biased coin&#8221; is context-dependent. A physically off-balance coin might behave as &#8220;fair&#8221; under some flipping mechanics, while in other flipping styles it might produce a clear bias.</p><h2><strong>If the coin is indeed biased, how can we estimate the magnitude of the bias?</strong></h2><p>Once you have concluded the coin is biased, the next question is: &#8220;What is the probability of heads, p?&#8221; Estimating p typically involves:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!A5vi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa958eb0f-7875-4875-ac36-e239d0563222_936x405.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!A5vi!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa958eb0f-7875-4875-ac36-e239d0563222_936x405.png 424w, https://substackcdn.com/image/fetch/$s_!A5vi!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa958eb0f-7875-4875-ac36-e239d0563222_936x405.png 848w, https://substackcdn.com/image/fetch/$s_!A5vi!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa958eb0f-7875-4875-ac36-e239d0563222_936x405.png 1272w, https://substackcdn.com/image/fetch/$s_!A5vi!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa958eb0f-7875-4875-ac36-e239d0563222_936x405.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!A5vi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa958eb0f-7875-4875-ac36-e239d0563222_936x405.png" width="936" height="405" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a958eb0f-7875-4875-ac36-e239d0563222_936x405.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:405,&quot;width&quot;:936,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:91829,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164937228?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa958eb0f-7875-4875-ac36-e239d0563222_936x405.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!A5vi!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa958eb0f-7875-4875-ac36-e239d0563222_936x405.png 424w, https://substackcdn.com/image/fetch/$s_!A5vi!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa958eb0f-7875-4875-ac36-e239d0563222_936x405.png 848w, https://substackcdn.com/image/fetch/$s_!A5vi!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa958eb0f-7875-4875-ac36-e239d0563222_936x405.png 1272w, https://substackcdn.com/image/fetch/$s_!A5vi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa958eb0f-7875-4875-ac36-e239d0563222_936x405.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div></li></ul><ul><li><p>If flips are not independent or if there&#8217;s a time-varying bias, a single estimate might not capture the whole picture. You&#8217;d need a model that allows p<em> </em>to change over time, or you&#8217;d sample the coin flipping under known stable conditions.</p></li></ul><p>In practice, if you want to know &#8220;how biased&#8221; the coin is, you check how far your confidence or credible interval is from 0.5 and whether that difference is practically significant in your use case (e.g., gambling, random selection, etc.).</p><h2><strong>How would you communicate these results to a non-technical stakeholder who wants a straightforward answer?</strong></h2><p>When communicating to a non-technical audience:</p><ol><li><p><strong>Summarize the Key Finding</strong>: &#8220;We flipped the coin 1000 times. We observed 550 heads, which is about 55% heads.&#8221;</p></li><li><p><strong>Explain the Meaning</strong>: &#8220;Typically, if a coin were perfectly fair, we&#8217;d expect 50% heads&#8212;about 500 out of 1000. We got 550, which is noticeably higher.&#8221;</p></li><li><p><strong>Convey the Likelihood</strong>: &#8220;Statistically, the chance that a fair coin would produce at least 550 heads in 1000 flips is quite low&#8212;less than 1%.&#8221;</p></li><li><p><strong>Conclusion</strong>: &#8220;Because the probability is so low, we have good evidence the coin is biased toward heads.&#8221;</p></li><li><p><strong>Caveats</strong>: &#8220;But there is still a small possibility that this happened by chance alone, or that something in our flipping method influenced the results.&#8221;</p></li></ol><p>The subtlety is that &#8220;bias&#8221; doesn&#8217;t necessarily mean extremely far from 0.5. A coin can be slightly biased (e.g., 52% heads) but in large numbers of flips this bias can produce a clear deviation from 0.5 that&#8217;s statistically significant.</p><h2><strong>Could you apply a sequential hypothesis testing framework instead of a single test at the end?</strong></h2><p>Yes. Instead of flipping the coin 1000 times and then deciding whether it is biased, you could perform <strong>sequential hypothesis testing</strong>:</p><ul><li><p><strong>Wald&#8217;s Sequential Probability Ratio Test (SPRT)</strong> is one example. You begin flipping the coin and update your test statistic after each flip. You compare the running statistic to two boundaries: one boundary that favors &#8220;the coin is fair&#8221; and one boundary that favors &#8220;the coin is biased.&#8221;</p></li><li><p>When the running statistic hits one boundary, you make a decision and stop flipping. If neither boundary is met, you keep flipping.</p></li><li><p>This can be more efficient because if a coin is strongly biased, you might conclude it early with fewer flips, and if it&#8217;s very close to fair, you continue collecting data until the evidence is strong enough either way.</p></li></ul><p>A common subtlety is to design your stopping boundaries carefully so you maintain an overall desired Type I and Type II error rate. Another pitfall is that frequent early stopping to declare bias can lead to a higher false-positive rate if the boundaries are not properly calibrated.</p><h2><strong>Would it matter if the question is about it being biased toward heads vs. a general deviation from 0.5?</strong></h2><p>Yes. If the only question is &#8220;Is the coin biased in favor of heads (i.e., p&gt;0.5)?&#8221; that is a <strong>one-tailed</strong> test. If you are asking &#8220;Is the coin not fair (either more heads or more tails)?&#8221; that is a <strong>two-tailed</strong> test:</p><ul><li><p>In a one-tailed test (for p&gt;0.5), the p-value focuses on how extreme the data is in the direction of more heads. You would ignore the possibility of fewer heads as part of the same test. This can yield a smaller p-value if indeed there are many heads.</p></li><li><p>In a two-tailed test, you include both directions of extremity (much larger than 500 heads or much smaller than 500 heads). This generally doubles the one-tailed p-value if all other assumptions are the same.</p></li></ul><p>A subtlety is that if you had a strong prior reason to suspect bias toward heads only, you might justify a one-tailed test. But many standard procedures default to two-tailed tests unless there&#8217;s a compelling rationale for ignoring the other direction. Choosing incorrectly can inflate or deflate the significance of your result.</p><h2><strong>How does the Law of Large Numbers factor into interpreting 550 heads out of 1000?</strong></h2><p>The Law of Large Numbers (LLN) states that as the number of independent flips grows large, the sample average (heads proportion) converges to the true probability p. By the time you have 1000 flips, you are in a moderately large sample regime.</p><ul><li><p>If p<em> </em>was truly 0.5, by LLN we&#8217;d expect the proportion of heads to be close to 0.5&#8212;though &#8220;close&#8221; is still subject to the usual random fluctuation.</p></li><li><p>Observing 0.55 suggests the true p may be 0.55 or near that, given the LLN says the average is unlikely to deviate much from the true probability with so many flips.</p></li></ul><p>A subtlety is that &#8220;large enough&#8221; is relative to how small the difference from 0.5 is and how much variance you can tolerate. Even 1000 flips can exhibit random fluctuations. So the LLN is not a guarantee that you will see exactly 50% or 55%, only that as flips go to infinity, the sample proportion converges to the true p. Observing 550 out of 1000 is consistent with a true p near 0.55, and (as we analyzed) is far enough from 0.5 to raise suspicion about fairness.</p><h2><strong>How would you approach designing a predictive model that takes coin flips as input features?</strong></h2><p>If you wanted to build a <strong>machine learning model</strong> to predict the next flip outcome:</p><ul><li><p>You&#8217;d probably start by assuming each flip is i.i.d. with some probability p. The best you could do is predict &#8220;heads&#8221; with probability p<em> </em>each time. But this is not very interesting&#8212;there&#8217;s no complex feature set, just repeated flips.</p><p></p></li><li><p>If you suspect <strong>non-independence</strong>, you might incorporate features like the last few outcomes (Markov property). A model might find patterns that the next flip is more likely to be heads if the last two flips were tails, for example&#8212;though physically that&#8217;s often just gambler&#8217;s fallacy unless the flipping process truly changes.</p></li><li><p>You could track <strong>time-varying patterns</strong>. For instance, maybe flips near the end of the day produce more heads for some reason. You&#8217;d feed in the flip index or time-of-flip as a feature, and the model might learn a drifting bias.</p></li></ul><p>A subtlety is that you risk overfitting. If you only have 1000 flips, you need to be careful not to chase random noise. Often, a simple approach (estimating a single p or at most a low-order Markov chain) is more robust than a complex neural network for just coin outcomes.</p><h2><strong>How would you handle the situation where 550 heads are observed, but you believe it might be due to a &#8220;hot hand&#8221; phenomenon by the flipper?</strong></h2><p>A &#8220;hot hand&#8221; phenomenon refers to the idea that success breeds more success&#8212;like in basketball, someone who just made a few shots is more likely to make the next shot. Translated to flipping coins, it could mean that if the flipper is on a &#8220;hot streak,&#8221; they might flip in a way that produces more heads.</p><p>While physically questionable in typical coin toss scenarios, if you do suspect a &#8220;hot hand&#8221; effect:</p><ul><li><p>You&#8217;d test for <strong>autocorrelation</strong> in the sequence. If heads is more likely after a sequence of heads, that suggests a time-varying or state-dependent process.</p></li><li><p>You might fit a <strong>hidden Markov model</strong> or some dynamic model that lumps flips into states (e.g., &#8220;hot hand state&#8221; that yields a higher p for heads and a &#8220;cold hand state&#8221; with p closer to 0.5).</p></li><li><p>Even if you do detect a correlation, you&#8217;d want to confirm if it&#8217;s truly a physical or psychological effect as opposed to random clustering. Clustering can appear by chance.</p></li></ul><p>A subtlety is that a real &#8220;hot hand&#8221; phenomenon can be extremely difficult to confirm unless you gather a very large dataset showing consistent transitions from cold to hot states. With only 1000 flips, random runs can easily masquerade as hot streaks.</p><h2><strong>If an online casino used this coin for a 50-50 bet, how should they decide if it&#8217;s acceptable?</strong></h2><p>For an online casino that wants truly fair 50-50 bets, the risk of a 55% heads coin is significant because:</p><ul><li><p>Over a large number of bets, a consistent 5% tilt toward heads can be exploited by savvy players, costing the casino money (if heads is a winning outcome) or angering players (if tails is systematically favored).</p></li><li><p>The casino might demand that the coin&#8217;s bias be estimated precisely (within a tight confidence or credible interval around 0.5). If the interval doesn&#8217;t comfortably include 0.5, they might replace or recalibrate the coin (or use a random number generator).</p></li><li><p>Even small biases matter in gambling contexts. For instance, if large sums are wagered, a 1% or 2% deviation can accumulate large gains or losses.</p></li></ul><p>A subtlety is that casinos typically do not rely on physical coins for large-scale online betting. They often rely on cryptographic random number generators. But if a physical coin is used in a promotional context, the marketing, fairness auditing, and security teams would all want to ensure the coin is effectively 50-50.</p><h2><strong>What if the &#8220;bias&#8221; is beneficial in some contexts&#8212;would you still care?</strong></h2><p>Sometimes, a coin with a known slight bias might be beneficial:</p><ul><li><p><strong>Game Mechanics</strong>: If you&#8217;re designing a board game or a promotional event where you want the coin to have a 55% chance of heads to ensure some outcome occurs slightly more often, you might intentionally design or choose a biased coin.</p></li><li><p><strong>Research Setting</strong>: A slightly biased coin might help measure how people perceive randomness. If you let them guess the outcome of each flip, you can see if they notice the bias.</p></li><li><p><strong>Performance Tricks</strong>: Stage magicians or performers might prefer a coin that reliably turns up heads for a trick.</p></li></ul><p>Even in these scenarios, you need consistent, well-understood performance. The subtlety is that you must keep a record of how the coin was tested and validated so you can rely on the fact it consistently yields the desired 55% heads. If that &#8220;55%&#8221; starts drifting, your game or performance might not behave as intended.</p><h2><strong>Could the anomalous result be a simple error like incorrectly counting 50 extra heads?</strong></h2><p>Data quality mistakes can happen. If someone transcribed or tallied the coin flips incorrectly, that might lead to concluding &#8220;550 heads&#8221; when the true count was 500. Subtle mistakes that slip into data collection often yield big differences in the final analysis:</p><ul><li><p><strong>Check the raw data</strong> (the individual sequence of outcomes) against the summarized count to ensure no transcription errors.</p></li><li><p><strong>Have multiple counters</strong> or a programmatic script double-check the final tally.</p></li><li><p><strong>Look for suspicious patterns</strong> (e.g., if the data show improbable runs or if the ratio of heads to tails changes drastically across short intervals in a manner that conflicts with the reported final total).</p></li></ul><p>A real-world subtlety is that big mistakes can masquerade as important findings. Especially in an interview or an exam scenario, it&#8217;s wise to mention verifying data accuracy before delving into sophisticated statistical inferences.</p><h2><strong>How might you apply a power analysis before flipping the coin?</strong></h2><p>A <strong>power analysis</strong> helps determine how many flips you need to detect a given difference from 0.5 with high probability. For instance, if you want an 80% chance (power = 0.8) of detecting a coin that is truly p=0.55 at a significance level of 0.05 in a two-tailed test:</p><ul><li><p>The difference from 0.5 is 0.05. You can use standard formulas or statistical software to estimate how large n must be to reliably detect that difference with a given power.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hUTO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99e35423-8c38-4753-baad-cdb58fe31729_873x198.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hUTO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99e35423-8c38-4753-baad-cdb58fe31729_873x198.png 424w, https://substackcdn.com/image/fetch/$s_!hUTO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99e35423-8c38-4753-baad-cdb58fe31729_873x198.png 848w, https://substackcdn.com/image/fetch/$s_!hUTO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99e35423-8c38-4753-baad-cdb58fe31729_873x198.png 1272w, https://substackcdn.com/image/fetch/$s_!hUTO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99e35423-8c38-4753-baad-cdb58fe31729_873x198.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hUTO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99e35423-8c38-4753-baad-cdb58fe31729_873x198.png" width="873" height="198" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/99e35423-8c38-4753-baad-cdb58fe31729_873x198.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:198,&quot;width&quot;:873,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:44934,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164937228?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99e35423-8c38-4753-baad-cdb58fe31729_873x198.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!hUTO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99e35423-8c38-4753-baad-cdb58fe31729_873x198.png 424w, https://substackcdn.com/image/fetch/$s_!hUTO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99e35423-8c38-4753-baad-cdb58fe31729_873x198.png 848w, https://substackcdn.com/image/fetch/$s_!hUTO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99e35423-8c38-4753-baad-cdb58fe31729_873x198.png 1272w, https://substackcdn.com/image/fetch/$s_!hUTO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99e35423-8c38-4753-baad-cdb58fe31729_873x198.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>A subtlety is that if you suspect the coin might be only slightly biased, say 51% heads, you would need a larger n to detect that difference with high confidence. Power analysis ensures you do not waste resources on a too-small sample that fails to detect meaningful biases.</p><h2><strong>Does the method of flipping (e.g., spinning on a table vs. tossing in the air) affect bias?</strong></h2><p>Absolutely. The physical method can have a large impact:</p><ul><li><p><strong>Tossing</strong>: A standard toss in the air can be fairly random, though technique can matter. Studies have suggested coins can be biased toward the side that starts facing up if the rotation axis is not symmetrical.</p></li><li><p><strong>Spinning</strong>: Coins spun on a table have been shown in some experiments to favor one side due to the dynamics of how the coin interacts with the table surface.</p></li><li><p><strong>Flicking</strong>: Some stage performers can flick a coin in a manner that strongly biases the outcome.</p></li></ul><p>In short, the &#8220;true probability&#8221; p is not just a property of the coin but of the coin-plus-flip-system. You could find that a physically fair coin has p=0.55 for heads with a certain flipping method and p=0.5 with another. If you truly want to measure the coin&#8217;s inherent bias, you need a standardized flipping mechanism that doesn&#8217;t systematically favor one face.</p><p>A subtlety arises when the interviewer asks &#8220;Is the coin biased?&#8221; but the real question might be &#8220;Is the coin plus flipping method biased?&#8221; Distinguishing these is essential if you plan to use the coin in different contexts.</p><h2><strong>If you discovered a slight bias, how do you correct for it to make decisions fair?</strong></h2><p>If you want to generate a fair outcome from a slightly biased coin, you can use <strong>von Neumann&#8217;s procedure</strong>:</p><ol><li><p>Flip the coin twice:</p><ul><li><p>If the result is HT, call the outcome &#8220;Heads&#8221; (in the fair sense).</p></li><li><p>If the result is TH, call the outcome &#8220;Tails.&#8221;</p></li><li><p>If the result is HH or TT, discard and flip twice again.</p></li></ul></li></ol><p>This procedure, in theory, yields a fair result regardless of the underlying p&#8800;0.5, as long as flips are independent. However, it may waste many flips if p is far from 0.5, because you&#8217;ll see HH or TT frequently.</p></li></ul><p>A subtlety is that real-world constraints (time, cost, practicality) might make repeated flipping undesirable. If you need many fair outcomes, discarding half the flips might be too expensive. But from a purely theoretical standpoint, this is a foolproof method to correct for a known (or unknown) coin bias in a random process.</p><h2><strong>Could &#8220;burn-in&#8221; flips help remove initial anomalies?</strong></h2><p>Some experimenters do &#8220;burn-in&#8221; flips&#8212;ignore the first few flips&#8212;assuming that once the flipper gets into a consistent flipping rhythm, the bias might stabilize. For example, someone might decide to discard the first 50 flips and only record the subsequent 1000 flips.</p><p>The rationale is that early flips might be performed with a different technique (the flipper is warming up or adjusting their motion). If the flipping motion changes systematically, ignoring the early part might yield a more stable measure of p<em>p</em>.</p><p>However, there are pitfalls:</p><ul><li><p>You might be discarding genuine data. If the coin is truly biased from the start, ignoring early flips can skew your sample.</p></li><li><p>If the flipping motion continues to drift over time, ignoring early flips doesn&#8217;t solve the deeper problem that the process is not stationary.</p></li></ul><p>A real-world subtlety is that burn-in can help reduce the impact of transients if the flipping method is indeed stabilizing. But it&#8217;s no guarantee of fairness if an ongoing trend or correlation is present throughout the flipping sequence.</p><h2><strong>Is it possible that the extra 50 heads is due to an unusual run in the last few flips?</strong></h2><p>Yes, it&#8217;s possible that the first 900 flips were near 50-50, and the last 100 flips had a streak of heads, pushing the total to 550. This doesn&#8217;t automatically mean the coin is biased; it might just be chance. But you&#8217;d analyze the distribution of heads across the sequence:</p><ul><li><p>Examine how many heads occurred in the first 500 flips, the second 500 flips, or every 100-flip block.</p></li><li><p>If the last 100 flips had an abnormally high proportion of heads, you could see if that pattern is improbable compared to typical fluctuations.</p></li><li><p>Even if the coin is fair, &#8220;lucky streaks&#8221; can occur. The probability is not zero.</p></li></ul><p>A subtlety is that if you specifically search for streaks only after seeing the results, you&#8217;re engaging in post-hoc analysis, which can inflate the chance of concluding there is something unusual. You&#8217;d need a proper multiple-hypothesis correction or pre-registered plan specifying &#8220;We will examine whether the final 100 flips show a deviation from 0.5.&#8221;</p><h2><strong>How might you incorporate domain expertise about coin flips into the interpretation?</strong></h2><p>Domain expertise might include:</p><ul><li><p>Knowledge from physics that a coin that starts heads up in your hand is slightly more likely to land heads if you don&#8217;t flip it many times in the air.</p></li><li><p>Empirical research showing typical biases for standard U.S. coins or other currencies. Some studies have found that certain coins systematically come up the same face they started with slightly over 50% of the time.</p></li></ul><p>When analyzing 550 heads out of 1000 flips, domain expertise can refine your prior distribution if you&#8217;re using Bayesian methods, or it can shape your experimental design to avoid known pitfalls (e.g., always flipping from the same side up). A subtlety is that the actual observed data might differ from the physics-based expectation if real-world flipping is inconsistent. Observers might not precisely replicate the flipping technique used in controlled experiments.</p><h2><strong>What if the difference was 550 vs. 500, but the total flips were 10,000?</strong></h2><p>In that scenario, you have:</p><ul><li><p>10,000 total flips.</p></li><li><p>550 more heads than expected for a fair coin, meaning you observed 5,550 heads vs. an expectation of 5,000 for a fair coin (p=0.5).</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uv0G!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7af55153-613c-410a-82f4-6903e9bc766e_917x210.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uv0G!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7af55153-613c-410a-82f4-6903e9bc766e_917x210.png 424w, https://substackcdn.com/image/fetch/$s_!uv0G!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7af55153-613c-410a-82f4-6903e9bc766e_917x210.png 848w, https://substackcdn.com/image/fetch/$s_!uv0G!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7af55153-613c-410a-82f4-6903e9bc766e_917x210.png 1272w, https://substackcdn.com/image/fetch/$s_!uv0G!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7af55153-613c-410a-82f4-6903e9bc766e_917x210.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uv0G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7af55153-613c-410a-82f4-6903e9bc766e_917x210.png" width="917" height="210" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7af55153-613c-410a-82f4-6903e9bc766e_917x210.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:210,&quot;width&quot;:917,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:48668,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164937228?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7af55153-613c-410a-82f4-6903e9bc766e_917x210.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!uv0G!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7af55153-613c-410a-82f4-6903e9bc766e_917x210.png 424w, https://substackcdn.com/image/fetch/$s_!uv0G!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7af55153-613c-410a-82f4-6903e9bc766e_917x210.png 848w, https://substackcdn.com/image/fetch/$s_!uv0G!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7af55153-613c-410a-82f4-6903e9bc766e_917x210.png 1272w, https://substackcdn.com/image/fetch/$s_!uv0G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7af55153-613c-410a-82f4-6903e9bc766e_917x210.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div></li></ul><p>Thus, with more flips, even the same proportion of heads (55%) provides stronger evidence against fairness because your measurement is more precise. A subtlety is that systematic bias or correlation over 10,000 flips might also be more likely if the flipping process has any consistent tilt. But purely from a standard binomial perspective, a 55% outcome in 10,000 flips is a very strong indication the coin is not fair.</p><h2><strong>In practical machine learning or data science contexts, why do we rarely do coin-toss style tests?</strong></h2><p>In real data science workflows, we often deal with more complex data (images, text, user behavior logs) and more complex models (neural networks, ensemble methods). We don&#8217;t typically rely on &#8220;coin flips&#8221; unless we&#8217;re specifically analyzing a simpler random process. But the fundamental logic behind hypothesis testing for a coin toss is still instructive:</p><ul><li><p>Understanding p-values, confidence intervals, significance levels, and type I/II errors is crucial for interpreting model evaluation metrics.</p></li><li><p>Many real-world tasks can be reframed in terms of Bernoulli trials (e.g., a user clicking an ad or not). Then we do AB testing or proportion tests analogous to coin flips.</p></li><li><p>We rely on statistical significance tests to compare conversion rates, engagement metrics, or classification success rates across experiments.</p></li></ul><p>A subtlety is that real-world data seldom obey the i.i.d. assumption perfectly, so we must adapt the tests or modeling approach accordingly. The coin-flip scenario is a simple microcosm that helps illustrate key statistical principles relevant to broader data science tasks.</p><h2><strong>Could quantum coins or exotic physics lead to unusual distributions?</strong></h2><p>This might sound far-fetched, but occasionally interviewers pose hypothetical &#8220;what if&#8230;&#8221; questions. A &#8220;quantum coin&#8221; or a &#8220;non-classical coin&#8221; could mean some system that does not follow classical probability assumptions:</p><ul><li><p>If each flip outcome depends on a quantum state that can be entangled with some environment variable, you might see distributions that violate the classical model.</p></li><li><p>In practice, standard minted coins do not exhibit noticeable quantum phenomena at macroscopic scales. So this is more of a theoretical curiosity than a real practical concern.</p></li></ul><p>A subtlety is that in advanced cryptographic or quantum-based random number generation, we rely on sub-atomic processes. But the final aggregated measurement typically still yields outputs that can be analyzed with classical probability. So while the underlying mechanism is quantum, at the macroscale it typically still looks like an i.i.d. Bernoulli process if properly implemented.</p><h2><strong>How might you handle a coin that is double-headed (or double-tailed) from the start?</strong></h2><p>A coin with two heads (or two tails) is obviously biased at p=1 (or p=0). If the coin is disguised, you might not realize it at first. In an experiment:</p><ul><li><p>With 1000 flips, you might get 1000 heads. That is conclusive evidence for extreme bias.</p></li><li><p>But what if the coin occasionally shows tails due to a misinterpretation or a chipping that resembles tails? Or if it&#8217;s possible that in certain flipping positions it displays the &#8220;underside&#8221; of the same face? The outcome might be near 100% but not exactly.</p></li><li><p>Typically, if we suspect a trick coin, we visually inspect the coin. Relying on flipping data alone is strong but verifying physically can be definitive.</p></li></ul><p>A subtlety is that you might have a coin with a single &#8220;two-headed side&#8221; but slightly different designs that are not obvious at a glance. Observers might not detect the difference until they carefully look at the coin. Good experimental practice is to physically inspect the coin if extremely unusual results (like 1000 heads in a row) appear.</p><h2><strong>Could large deviations from 50% be explained by a loaded coin but still be consistent with a normal approximation?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zDN_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed920596-d110-4c71-bae5-887d089971b0_910x296.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zDN_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed920596-d110-4c71-bae5-887d089971b0_910x296.png 424w, https://substackcdn.com/image/fetch/$s_!zDN_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed920596-d110-4c71-bae5-887d089971b0_910x296.png 848w, https://substackcdn.com/image/fetch/$s_!zDN_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed920596-d110-4c71-bae5-887d089971b0_910x296.png 1272w, https://substackcdn.com/image/fetch/$s_!zDN_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed920596-d110-4c71-bae5-887d089971b0_910x296.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zDN_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed920596-d110-4c71-bae5-887d089971b0_910x296.png" width="910" height="296" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ed920596-d110-4c71-bae5-887d089971b0_910x296.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:296,&quot;width&quot;:910,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:74485,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164937228?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed920596-d110-4c71-bae5-887d089971b0_910x296.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zDN_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed920596-d110-4c71-bae5-887d089971b0_910x296.png 424w, https://substackcdn.com/image/fetch/$s_!zDN_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed920596-d110-4c71-bae5-887d089971b0_910x296.png 848w, https://substackcdn.com/image/fetch/$s_!zDN_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed920596-d110-4c71-bae5-887d089971b0_910x296.png 1272w, https://substackcdn.com/image/fetch/$s_!zDN_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed920596-d110-4c71-bae5-887d089971b0_910x296.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A subtlety is that for p near 0 or 1, the normal approximation gets less accurate because the distribution is skewed. But for moderate biases (like 0.7) and a large n, the normal approximation is still workable, though an exact binomial test or a Beta posterior might be more precise. It clearly indicates a deviation from 0.5 if p=0.7.</p><h2><strong>If you only recorded the outcome as &#8220;is it heads at least 55% of the time or not?&#8221; how does that lose information?</strong></h2><p>Dichotomizing the result&#8212;labeling the coin as &#8220;more than 55% heads&#8221; or &#8220;not&#8221; instead of keeping the exact count&#8212;reduces the resolution of your data. Instead of analyzing exactly how many heads out of 1000, you transform it into a yes/no about whether the proportion exceeded 0.55. This &#8220;coarse&#8221; approach:</p><ul><li><p>Loses detail about how far above (or below) 0.55 the coin&#8217;s heads rate is. Maybe you observed exactly 550 heads or 600 heads or 700 heads; if all those scenarios get labeled &#8220;Yes, above 55%,&#8221; you cannot differentiate their statistical significance or effect size.</p></li><li><p>Increases the possibility of borderline misclassification (like 550 heads is just at 55%, so are you labeling that as &#8220;yes&#8221; or &#8220;no&#8221;?). A tiny difference in counting could swing that label.</p></li></ul><p>A subtlety is that in some real-world decisions, you only care if the coin&#8217;s proportion is above a certain threshold. But from a statistical perspective, you typically lose power by collapsing continuous or near-continuous data into categorical labels.</p><h2><strong>Why might test quality matter if we want to detect smaller biases?</strong></h2><p>If the coin is biased at p=0.51 (51% heads), that is a small effect. Detecting such a small deviation from 0.5 at a high confidence level requires:</p><ul><li><p>A large number of flips (sample size). Even 1000 flips might not yield a definitive conclusion for such a marginal difference because the standard deviation around 500 heads is about 15.8. Observing 510 heads might not be a big enough deviation to reject fairness with high confidence.</p></li><li><p>Careful control of external factors that might introduce additional variance. Even small correlations or mistakes in counting can overshadow a 1% bias.</p></li><li><p>Possibly a specialized test with higher power or a repeated experiment. A single run of 1000 flips might not suffice; you might do multiple sets of 1000 flips, or go for 10,000 flips in one run.</p></li></ul><p>A subtlety is that real-world constraints might limit how many flips you can do or how carefully you can control conditions. In practice, many biases remain undetected if they are small and overshadowed by random noise or measurement errors.</p><h2><strong>How would you incorporate a cost-benefit analysis into deciding if 550 out of 1000 flips is &#8220;close enough&#8221; to fair?</strong></h2><p>In a cost-benefit analysis, you weigh the cost of continuing with a potentially biased coin against the risk or cost that the bias imposes. For example:</p><ul><li><p>If you&#8217;re using the coin for a small-stakes office game, the difference between 50% and 55% heads might not matter. The cost to get a new coin or run more tests might outweigh the slight unfairness.</p></li><li><p>If the coin is used in a high-stakes gambling context, even a 2% bias might cost or gain tens of thousands of dollars. In that scenario, the cost of doing more flips or procuring a perfectly fair coin is justified.</p></li></ul><p>A subtlety is that organizations often set thresholds for what is &#8220;acceptable bias.&#8221; For instance, a gaming commission might say &#8220;any coin used in official gambling must have a 95% confidence interval that falls entirely within [0.49, 0.51].&#8221; If your test indicates an estimated bias of 0.55, that fails the standard, and you would not be allowed to use that coin.</p><h2><strong>How would repeated flipping over multiple days validate or refute the conclusion?</strong></h2><p>If you suspect that your first set of 1000 flips was either a fluke or influenced by day-specific conditions (lighting, temperature, flipper fatigue), you might replicate:</p><ol><li><p>Flip the same coin another 1000 times on a different day, possibly with a different flipper or different location.</p></li><li><p>Compare results. If again you get around 550 heads, that further supports a consistent bias.</p></li><li><p>If you observe about 500 heads the second time, that might suggest either the first experiment was a statistical outlier or conditions changed.</p></li></ol><p>A subtlety is that day-to-day variations can mask the coin&#8217;s true bias or reveal that the coin&#8217;s effective bias depends on conditions. If you consistently replicate the 55% figure across multiple well-controlled days, your confidence in the bias conclusion grows significantly.</p><h2><strong>Could random seeds in simulation approaches mislead the analysis?</strong></h2><p>If you&#8217;re simulating flips or using Monte Carlo methods to approximate p-values or confidence intervals, the choice of random seed can affect the exact numeric results of the simulation. But for large enough simulation runs, the effect of different seeds should be negligible, since the law of large numbers ensures the distribution estimate converges:</p><ul><li><p>Always run enough simulation iterations (e.g., tens or hundreds of thousands) so that the estimated p-value stabilizes and does not vary wildly with different seeds.</p></li><li><p>If you suspect a bug in the simulation code, try multiple seeds or cross-check the simulation results with exact binomial calculations or an alternative method.</p></li></ul><p>A subtlety is that if the simulation code is flawed (e.g., it incorrectly generates biased random numbers) or if you pick too few iterations, you can get misleading results that either over- or understate significance. Proper code validation is essential.</p><h2><strong>How might outlier detection techniques reveal something unexpected in the distribution of flips?</strong></h2><p>Outlier detection typically focuses on identifying data points that deviate significantly from the bulk of the data. In the context of coin flips, the main data is binary&#8212;heads or tails. Outliers might not be meaningful in the typical sense. However, if you tracked additional metadata (like how high the coin was flipped, the flipper&#8217;s technique rating, or the time between flips), you might notice certain flips were performed abnormally and systematically produced heads or tails:</p><ul><li><p>For example, if you see that the flipper performed &#8220;lazy&#8221; flips that spun the coin fewer times, you could label these as potential outliers in the distribution of flipping style. Then you check whether those outliers correlated with the coin landing heads more often.</p></li><li><p>Similarly, if the environment changed drastically (like flipping outdoors in a gusty wind for 100 flips), those flips might be outliers in the sense of environmental conditions.</p></li></ul><p>The subtlety is that &#8220;outlier detection&#8221; in a standard numeric feature space doesn&#8217;t directly apply to heads/tails, but it can be relevant if you track additional continuous variables describing each flip or the environment.</p><h2><strong>If you wanted an online real-time estimate of the coin&#8217;s bias as flips come in, how would you implement that?</strong></h2><p>An <strong>online algorithm</strong> updates the estimate of p<em> </em>after each flip without storing all the past data:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hxeY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F063fea6a-bdaf-4214-9d36-c8d873b1f772_885x329.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hxeY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F063fea6a-bdaf-4214-9d36-c8d873b1f772_885x329.png 424w, https://substackcdn.com/image/fetch/$s_!hxeY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F063fea6a-bdaf-4214-9d36-c8d873b1f772_885x329.png 848w, https://substackcdn.com/image/fetch/$s_!hxeY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F063fea6a-bdaf-4214-9d36-c8d873b1f772_885x329.png 1272w, https://substackcdn.com/image/fetch/$s_!hxeY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F063fea6a-bdaf-4214-9d36-c8d873b1f772_885x329.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hxeY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F063fea6a-bdaf-4214-9d36-c8d873b1f772_885x329.png" width="885" height="329" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/063fea6a-bdaf-4214-9d36-c8d873b1f772_885x329.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:329,&quot;width&quot;:885,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:83063,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164937228?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F063fea6a-bdaf-4214-9d36-c8d873b1f772_885x329.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!hxeY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F063fea6a-bdaf-4214-9d36-c8d873b1f772_885x329.png 424w, https://substackcdn.com/image/fetch/$s_!hxeY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F063fea6a-bdaf-4214-9d36-c8d873b1f772_885x329.png 848w, https://substackcdn.com/image/fetch/$s_!hxeY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F063fea6a-bdaf-4214-9d36-c8d873b1f772_885x329.png 1272w, https://substackcdn.com/image/fetch/$s_!hxeY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F063fea6a-bdaf-4214-9d36-c8d873b1f772_885x329.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A subtlety is that real-time estimates can fluctuate with streaks. If the coin is truly p=0.5, but you see a short run of heads, the estimate or posterior might temporarily shift upward. Only after many flips converge will you see a stable estimate near the true p. If p changes over time (the coin physically warps), your algorithm might lag behind until enough new flips reflect the new bias.</p><h2><strong>Could the &#8220;bias&#8221; be beneficial if you needed more heads for a data augmentation technique?</strong></h2><p>In certain machine learning or data-driven applications, you might want to generate more frequent &#8220;heads-like&#8221; outcomes if you&#8217;re labeling heads as a &#8220;positive&#8221; class. For example, if you had a simulator that needed more positive examples, a biased coin might ironically help you sample that scenario more often.</p><p>However, if your goal is unbiased real-world sampling, you wouldn&#8217;t want the coin to produce artificially inflated positives. The subtlety is that in some simulation or augmentation contexts, you might deliberately want a coin (or random generator) that oversamples positives to speed up model training (akin to a biased sampling approach). That is not truly &#8220;fair,&#8221; but it might be beneficial for the application if you adjust your analysis or weighting accordingly.</p><h2><strong>Is a 5% difference in heads always &#8220;statistically significant&#8221; for large sample sizes?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!F6sp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcbc44db-ac03-4d6a-be4b-8afadc424460_932x260.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!F6sp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcbc44db-ac03-4d6a-be4b-8afadc424460_932x260.png 424w, https://substackcdn.com/image/fetch/$s_!F6sp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcbc44db-ac03-4d6a-be4b-8afadc424460_932x260.png 848w, https://substackcdn.com/image/fetch/$s_!F6sp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcbc44db-ac03-4d6a-be4b-8afadc424460_932x260.png 1272w, https://substackcdn.com/image/fetch/$s_!F6sp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcbc44db-ac03-4d6a-be4b-8afadc424460_932x260.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!F6sp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcbc44db-ac03-4d6a-be4b-8afadc424460_932x260.png" width="932" height="260" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bcbc44db-ac03-4d6a-be4b-8afadc424460_932x260.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:260,&quot;width&quot;:932,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:62177,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164937228?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcbc44db-ac03-4d6a-be4b-8afadc424460_932x260.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!F6sp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcbc44db-ac03-4d6a-be4b-8afadc424460_932x260.png 424w, https://substackcdn.com/image/fetch/$s_!F6sp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcbc44db-ac03-4d6a-be4b-8afadc424460_932x260.png 848w, https://substackcdn.com/image/fetch/$s_!F6sp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcbc44db-ac03-4d6a-be4b-8afadc424460_932x260.png 1272w, https://substackcdn.com/image/fetch/$s_!F6sp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcbc44db-ac03-4d6a-be4b-8afadc424460_932x260.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>However, the real question is whether that difference is <strong>practically significant</strong>. If a 0.5% difference has no real impact, you might ignore it. A subtlety is that if you see a tiny difference but with extremely large n, you might reject the null hypothesis in a purely statistical sense yet conclude that the effect size is negligible in practical terms.</p><h2><strong>Why is it crucial to specify the significance level before seeing the coin flip results?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!kg5n!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe80e1aaa-102a-4159-afca-13b3a157b24a_941x275.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kg5n!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe80e1aaa-102a-4159-afca-13b3a157b24a_941x275.png 424w, https://substackcdn.com/image/fetch/$s_!kg5n!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe80e1aaa-102a-4159-afca-13b3a157b24a_941x275.png 848w, https://substackcdn.com/image/fetch/$s_!kg5n!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe80e1aaa-102a-4159-afca-13b3a157b24a_941x275.png 1272w, https://substackcdn.com/image/fetch/$s_!kg5n!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe80e1aaa-102a-4159-afca-13b3a157b24a_941x275.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kg5n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe80e1aaa-102a-4159-afca-13b3a157b24a_941x275.png" width="941" height="275" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e80e1aaa-102a-4159-afca-13b3a157b24a_941x275.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:275,&quot;width&quot;:941,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:62239,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164937228?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe80e1aaa-102a-4159-afca-13b3a157b24a_941x275.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!kg5n!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe80e1aaa-102a-4159-afca-13b3a157b24a_941x275.png 424w, https://substackcdn.com/image/fetch/$s_!kg5n!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe80e1aaa-102a-4159-afca-13b3a157b24a_941x275.png 848w, https://substackcdn.com/image/fetch/$s_!kg5n!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe80e1aaa-102a-4159-afca-13b3a157b24a_941x275.png 1272w, https://substackcdn.com/image/fetch/$s_!kg5n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe80e1aaa-102a-4159-afca-13b3a157b24a_941x275.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A subtlety is that in practical machine learning or data science contexts, repeated experimentation can lead to unintentional p-hacking. People keep adjusting parameters or collecting more flips until they get a &#8220;significant&#8221; result. Proper experimental design demands a pre-specified number of flips (or a sequential testing plan) and a pre-specified significance criterion to maintain integrity.</p><h2><strong>Could you use confidence intervals alone rather than a hypothesis test?</strong></h2><p>Yes, many statisticians prefer the clarity of confidence intervals (or Bayesian credible intervals) over simple &#8220;reject/not reject&#8221; tests. A 95% confidence interval for p that does not include 0.5 implies a p-value below 0.05 for a two-sided test of p=0.5.</p><p>Confidence intervals also directly show the plausible range of p. For the coin observed as 550 heads in 1000 flips, you might get an interval like [0.52, 0.58]. You can see that 0.5 is below the lower bound, indicating that a fair coin is not consistent with the data at the 5% significance level.</p><p>A subtlety is that intervals can be more intuitive. They communicate both the magnitude of the observed effect (0.55 vs. 0.5) and the uncertainty around that estimate. A single p-value only tells you how surprising the data is under the null hypothesis, not how big or small the effect is.</p><h2><strong>How do you handle partial flips that are inconclusive?</strong></h2><p>Occasionally, a flip might land on the floor or get caught in someone&#8217;s hand such that the result is uncertain. Some experimenters might choose to re-flip in that scenario, effectively discarding that partial result. Others might mark it as missing data. In any structured experiment:</p><ul><li><p>Decide in advance how to handle ambiguous outcomes (redo or exclude).</p></li><li><p>If you have too many ambiguous outcomes, you might worry about systematic bias. For example, maybe ambiguous flips were more likely to occur when the coin would have landed tails. That would cause a hidden selection bias.</p></li></ul><p>A subtlety is that ignoring ambiguous flips can bias the sample if ambiguous flips are not random. The safest approach is to define a consistent rule from the start (e.g., &#8220;if uncertain, flip again until a definite heads or tails is obtained&#8221;) to maintain a consistent total count of 1000 fully observed flips.</p><h2><strong>If the coin&#8217;s true bias was unknown, how might you form a predictive distribution of the next 10 flips?</strong></h2><p>Using a Bayesian approach with a Beta prior:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yqKs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F671d0a89-b70f-4214-be91-8007caf55737_879x323.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yqKs!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F671d0a89-b70f-4214-be91-8007caf55737_879x323.png 424w, https://substackcdn.com/image/fetch/$s_!yqKs!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F671d0a89-b70f-4214-be91-8007caf55737_879x323.png 848w, https://substackcdn.com/image/fetch/$s_!yqKs!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F671d0a89-b70f-4214-be91-8007caf55737_879x323.png 1272w, https://substackcdn.com/image/fetch/$s_!yqKs!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F671d0a89-b70f-4214-be91-8007caf55737_879x323.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yqKs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F671d0a89-b70f-4214-be91-8007caf55737_879x323.png" width="879" height="323" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/671d0a89-b70f-4214-be91-8007caf55737_879x323.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:323,&quot;width&quot;:879,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:65270,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164937228?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F671d0a89-b70f-4214-be91-8007caf55737_879x323.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!yqKs!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F671d0a89-b70f-4214-be91-8007caf55737_879x323.png 424w, https://substackcdn.com/image/fetch/$s_!yqKs!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F671d0a89-b70f-4214-be91-8007caf55737_879x323.png 848w, https://substackcdn.com/image/fetch/$s_!yqKs!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F671d0a89-b70f-4214-be91-8007caf55737_879x323.png 1272w, https://substackcdn.com/image/fetch/$s_!yqKs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F671d0a89-b70f-4214-be91-8007caf55737_879x323.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ol><li><p>This yields a Beta-Binomial distribution.</p></li></ol><p>A subtlety is that you might not do a formal Beta-Binomial integration for each k, but in software you can easily sample from the posterior for p and then sample 10 flips from each sample of p, building an empirical distribution. That gives you a credible interval for how many heads you expect in 10 flips, capturing uncertainty in p and the inherent randomness of flipping.</p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[ML Interview Q Series: Determining Experiment Duration: Beyond Fixed P-Values Using Power Analysis and Sequential Testing.]]></title><description><![CDATA[Browse all the Probability Interview Questions here.]]></description><link>https://www.rohan-paul.com/p/ml-interview-q-series-determining-a57</link><guid isPermaLink="false">https://www.rohan-paul.com/p/ml-interview-q-series-determining-a57</guid><pubDate>Sun, 01 Jun 2025 10:51:18 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!dqPc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f3578ce-48fb-4d53-9817-01b7d226cc10_1920x1080.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dqPc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f3578ce-48fb-4d53-9817-01b7d226cc10_1920x1080.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dqPc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f3578ce-48fb-4d53-9817-01b7d226cc10_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!dqPc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f3578ce-48fb-4d53-9817-01b7d226cc10_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!dqPc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f3578ce-48fb-4d53-9817-01b7d226cc10_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!dqPc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f3578ce-48fb-4d53-9817-01b7d226cc10_1920x1080.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dqPc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f3578ce-48fb-4d53-9817-01b7d226cc10_1920x1080.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2f3578ce-48fb-4d53-9817-01b7d226cc10_1920x1080.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1889552,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164927049?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f3578ce-48fb-4d53-9817-01b7d226cc10_1920x1080.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dqPc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f3578ce-48fb-4d53-9817-01b7d226cc10_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!dqPc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f3578ce-48fb-4d53-9817-01b7d226cc10_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!dqPc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f3578ce-48fb-4d53-9817-01b7d226cc10_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!dqPc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f3578ce-48fb-4d53-9817-01b7d226cc10_1920x1080.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Browse all the <strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">Probability Interview Questions here</a></strong><a href="https://www.rohan-paul.com/s/probability-interview-series/archive?sort=new">.</a></p><h2><strong>2. How can you decide how long to run an experiment? What are some problems with just using a fixed p-value threshold and how do you work around them?</strong></h2><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://x.com/rohanpaul_ai&quot;,&quot;text&quot;:&quot;Connect with me on X (Twitter)&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://x.com/rohanpaul_ai"><span>Connect with me on X (Twitter)</span></a></p><p>Deciding how long to run an experiment is deeply connected to statistical power, effect size, and the variance of the metric of interest. Stopping criteria are rarely as simple as &#8220;run until we reach a fixed p-value threshold.&#8221; When relying solely on a fixed p-value approach, certain pitfalls arise that can lead to false conclusions or suboptimal business decisions. Below is a thorough discussion of these nuances and how practitioners commonly mitigate them.</p><p>Choosing the Duration of an Experiment</p><p>One practical way to figure out how long an experiment should run is to estimate the number of samples required to detect a prespecified effect size with a desired statistical power and significance level. In typical hypothesis testing scenarios, we pick a significance levelalpha (often 0.05) and a desired power (often 0.8 or 0.9). The effect size you hope to detect is the smallest difference worth acting on. Once you have a sense of the effect size, the standard deviation of your metrics, and your significance and power requirements, you can solve for the required sample size.</p><h2><strong>n = 2 * ((z_(1 - &#945;/2) + z_(1 - &#946;)) / (&#948; / &#963;))^2</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-dFJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb99cb8a7-9836-4ec3-8155-6d62667e1048_922x375.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-dFJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb99cb8a7-9836-4ec3-8155-6d62667e1048_922x375.png 424w, https://substackcdn.com/image/fetch/$s_!-dFJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb99cb8a7-9836-4ec3-8155-6d62667e1048_922x375.png 848w, https://substackcdn.com/image/fetch/$s_!-dFJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb99cb8a7-9836-4ec3-8155-6d62667e1048_922x375.png 1272w, https://substackcdn.com/image/fetch/$s_!-dFJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb99cb8a7-9836-4ec3-8155-6d62667e1048_922x375.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-dFJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb99cb8a7-9836-4ec3-8155-6d62667e1048_922x375.png" width="922" height="375" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b99cb8a7-9836-4ec3-8155-6d62667e1048_922x375.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:375,&quot;width&quot;:922,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:73760,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.rohan-paul.com/i/164927049?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb99cb8a7-9836-4ec3-8155-6d62667e1048_922x375.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!-dFJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb99cb8a7-9836-4ec3-8155-6d62667e1048_922x375.png 424w, https://substackcdn.com/image/fetch/$s_!-dFJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb99cb8a7-9836-4ec3-8155-6d62667e1048_922x375.png 848w, https://substackcdn.com/image/fetch/$s_!-dFJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb99cb8a7-9836-4ec3-8155-6d62667e1048_922x375.png 1272w, https://substackcdn.com/image/fetch/$s_!-dFJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb99cb8a7-9836-4ec3-8155-6d62667e1048_922x375.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In real-world scenarios, the standard deviation and effect size might be partially unknown, so pilot data or historical data can help estimate them. Once you know your required samples, you can estimate how long it takes to gather enough observations, considering average traffic or user engagement. If you run an A/B test on a website with one million visits a day, you can quickly gather enough observations. If you have an internal tool with only a few hundred daily active users, you might need more days or even weeks to gather a statistically meaningful sample. Moreover, if your experiment has metrics that vary over time (for instance, behavior might differ on weekdays versus weekends), you should run the test for enough time to capture those potential temporal patterns.</p><p>Drawbacks of Using a Fixed p-value Threshold</p><p>A major issue with deciding upon a fixed p-value threshold at the outset is that real experiments rarely proceed under ideal conditions. People often peek at the p-value during the experiment and might stop early if they see significance. This repeated significance testing inflates the Type I error rate, meaning you are more likely to claim a difference when there is none. Another pitfall is that p-values do not communicate the magnitude of the difference; a small effect in a huge sample might yield a very tiny p-value that is &#8220;significant&#8221; but operationally unimportant. Conversely, a practically important effect might fail to reach significance if the sample size is too small or the experiment is not run for a sufficient length of time.</p><p>Problems like p-hacking or optional stopping (repeatedly checking the p-value, and as soon as you see significance, you stop) effectively change the distribution of the test statistic. The nominalalpha<em> </em>is no longer accurate in reflecting your true false-positive probability. There can also be time trends or novelty effects in user behavior, which might produce fleeting significance if you look at the wrong time or too frequently. If you only rely on a fixed threshold of 0.05, you may see an artificially inflated number of &#8220;statistically significant&#8221; findings.</p><p>Working Around These Pitfalls</p><p>One standard strategy is to define a fixed sample size in advance based on power calculations. You collect data until you hit the predetermined sample size (or duration) and then conduct a single significance test. By specifying how many observations you want ahead of time (and not peeking too often), you preserve the nominal Type I error rate. However, in many real business scenarios, it is impractical to avoid interim checks, because early stopping can be beneficial if an experiment is obviously detrimental to user experience or revenue.</p><p>To handle repeated significance checks, approaches such as alpha spending or group sequential methods can be used. Alpha spending plans allow you to partition your overall Type I error budget across multiple checks. You might say, for example, you want to spend half of your alpha budget on early checks and the remaining half on a final confirmatory test. Group sequential approaches (like Pocock&#8217;s method or O&#8217;Brien-Fleming) adjust critical p-value thresholds depending on the number of looks you plan to make. This ensures that your overall experiment-wide false positive rate remains near the nominalalpha. Another approach, known as a Bayesian framework, allows you to continuously update your posterior estimates of the difference between variants without relying solely on p-values. However, Bayesian methods come with their own complexity and require you to interpret posterior distributions and credible intervals.</p><p>Methods like sequential testing (e.g., the Sequential Probability Ratio Test) or a repeated measure that monitors the running experiment&#8217;s metrics in real time can also mitigate p-hacking by offering principled stopping rules. Power-based stopping criteria, or ensuring a minimal clinically important difference, can also help keep the experiment&#8217;s duration within practical limits while maintaining statistical rigor.</p><p>Below is a Python snippet that illustrates how you might perform a power calculation for a basic A/B test with a known baseline conversion rate, an expected minimum detectable effect, and a significance level:</p><pre><code><code>import math
from statsmodels.stats.power import NormalIndPower
from statsmodels.stats.proportion import proportion_effectsize

# Suppose your baseline conversion rate is 0.1 (10%)
# You expect a 1% improvement (from 0.1 to 0.11)
# So the effect size is difference between proportion 0.1 and 0.11

baseline_rate = 0.10
new_rate = 0.11
effect_size = proportion_effectsize(new_rate, baseline_rate)

# We want alpha=0.05 and power=0.8
alpha = 0.05
power = 0.80

analysis = NormalIndPower()
# Solve for sample size in each group
sample_size_per_group = analysis.solve_power(effect_size=effect_size,
                                             alpha=alpha,
                                             power=power,
                                             alternative='larger')

print("Required sample size per group:", math.ceil(sample_size_per_group))
</code></code></pre><p>This example shows how, by specifying alpha, power, baseline rate, and the desired improvement, you can derive the sample size per group. You then multiply by two for a two-arm test to see the total needed across both variants. This approach helps you avoid artificially short experiments. It also discourages deciding on the fly by looking at p-values every few hours.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.rohan-paul.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">I write everyday for my readers on actionable AI. Subscribe and instantly get a 1300+ page Python book.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2><strong>What if We Want to Stop the Experiment Early if the Results Are Clearly Significant or Clearly Bad?</strong></h2><p>In many real settings, people want a chance to intervene early if a test variant is performing very poorly. For that scenario, group sequential designs can be used. You pre-plan the number of &#8220;looks&#8221; at the data, each with a stricter threshold for significance. If you see a massive difference at an interim look, you can stop early. If not, you continue until the final planned sample size. This preserves the overall significance levelalpha.</p><p>A typical approach is the O&#8217;Brien-Fleming boundary, which sets a very stringent early boundary for detection. The threshold might be extremely low early on, allowing you to stop the experiment only if it is overwhelmingly obvious that the difference is real. At later looks, the threshold becomes less stringent. This ensures you do not inflate Type I error.</p><h2><strong>Why Do p-values Become Problematic When We Look Too Often?</strong></h2><p>If you perform multiple hypothesis tests and check the p-value after every new batch of data, you are inflating the chance of observing at least one random fluctuation that meets the p &lt; 0.05 threshold. The probability of at least one false positive over many repeated checks can become much larger than 0.05. A naive approach that stops as soon as p &lt; 0.05 is reached will systematically bias your experiment and lead to a large fraction of false discoveries.</p><p>One practical approach to mitigate this is alpha spending. Suppose you plan a total of, say, five interim looks. You decide how to &#8220;spend&#8221; your alpha budget of 0.05 across these looks. If you reach significance early, you stop and declare a difference; if not, you continue until you have used your entire alpha budget or you reach your final look. This ensures the overall false-positive probability across all these checks stays around 0.05.</p><h2><strong>What If the Observed Effect Size Differs from Our Assumptions?</strong></h2><p>Sample size calculations necessarily rely on estimates of the standard deviation and effect size. If you overestimate the effect size, you might end up with insufficient power for the actual (smaller) effect. If you underestimate the standard deviation, you might also be underpowered. Conversely, if you overestimate the variance or the effect size is bigger than assumed, you may reach significance more quickly. The best practice is to rely on historical data or pilot tests to refine these assumptions. If you discover during the experiment that your assumptions were drastically off, you might need to recast your hypothesis or rerun the power calculation.</p><h2><strong>How Do We Account for Type II Error and Power?</strong></h2><p>Many beginners focus primarily on p-values and Type I error (false positives), but failing to detect a real effect (Type II error) is equally critical. That&#8217;s why deciding how long to run an experiment (i.e., how many samples you collect) depends so heavily on the effect size you want to detect and the power you require. If you do not want to miss an improvement that would have a sizable business impact, you need to gather enough data. Underpowered experiments lead to inconclusive or misleading results: you risk shipping beneficial features late or discarding good ideas prematurely.</p><p>Power calculations before running the experiment help ensure you can detect the effect you care about within a confidence margin. You can also do a sensitivity analysis: for example, if the effect size is smaller than your threshold, maybe you are okay with missing that effect, because it is not worth the engineering or user disruption cost. This shapes the minimal clinically or practically meaningful difference you aim for.</p><h2><strong>Could a Bayesian Approach Solve These Issues?</strong></h2><p>A Bayesian approach shifts the framing from &#8220;Is the p-value &lt; 0.05?&#8221; to &#8220;What does the posterior distribution of the difference between the two variants look like?&#8221; One can continuously update the posterior as data arrives and potentially stop when the posterior probability that one variant is better than the other crosses a certain threshold. This can be more intuitive for business stakeholders, because you can say something like, &#8220;We are 95% sure that the new variant is at least 0.5% better than the old one.&#8221; However, Bayesian methods require careful choice of priors, credible interval thresholds, and an understanding that these thresholds serve a role similar to alpha in a frequentist test. Moreover, if you continuously look at the posterior, you still need guidelines for when to stop. This might take the form of a region of practical equivalence or a certain posterior probability boundary.</p><h2><strong>Follow-up Question: How Should We Think About Time-based Variations During the Experiment?</strong></h2><p>Sometimes user behavior changes over days of the week or from one month to another. You might run into a scenario where the difference is significant one week but not the next. A recommended practice is to run the experiment over complete &#8220;blocks&#8221; of time that represent cyclical patterns, such as ensuring you have at least one complete weekend cycle for each experimental arm. If your product usage is highly seasonal, you might need to account for that or run the experiment over multiple relevant weeks or months. A more advanced approach is &#8220;blocking&#8221; or &#8220;stratified randomization,&#8221; where you randomize within relevant demographic or time blocks to reduce variance and ensure each variant sees a fair share of different times or user segments.</p><h2><strong>Follow-up Question: Is There a Danger in Using a Running Average or Real-time Visualization to Decide When to Stop?</strong></h2><p>Teams often watch their experiment metrics in real time. That is not inherently bad, as it is important to ensure you do not harm users or degrade key performance indicators. The danger is drawing premature conclusions. If you see the running average for the new variant is trending upward initially, you might be tempted to declare victory early. To mitigate that, you can use a group sequential design with alpha spending so that your repeated looks are statistically valid. Alternatively, you can maintain real-time monitoring strictly for safety checks, but only do the formal significance test at the predetermined end or at scheduled interim analyses.</p><h2><strong>Follow-up Question: What is the Difference Between Hypothesis Testing with a p-value vs. Confidence Intervals?</strong></h2><p>Confidence intervals communicate the range of plausible values for the difference between the control and treatment. If a 95% confidence interval for the difference does not include zero, it corresponds to p &lt; 0.05 in a two-sided test. However, intervals are often more interpretable for business stakeholders, as you can say something like, &#8220;We estimate the difference in the conversion rate is between 0.8% and 1.3%.&#8221; You can track how that confidence interval evolves over time. But you still need to be cautious about repeated looks, as your intervals can also be biased if you stop the experiment as soon as the interval excludes zero.</p><h2><strong>Follow-up Question: Could We Use Non-parametric Methods If We Are Unsure of the Distribution?</strong></h2><p>If your data are not normally distributed or you suspect heavy tails, you can use non-parametric tests such as the Mann-Whitney U test (also called the Wilcoxon rank-sum test) for comparing two independent samples. The same considerations about sample size, effect size, repeated looks, and alpha inflation still apply. Power analysis can be more involved, but modern statistical software packages include procedures for non-parametric power calculations too. You also might transform the data or use robust statistical methods. The fundamental principle remains that you should plan how many observations to collect, how frequently to look at your results, and how to avoid p-hacking.</p><h2><strong>Follow-up Question: How Do We Communicate Results to Stakeholders Who Only Know About p-values?</strong></h2><p>Translating test outcomes to business stakeholders can be done by focusing on metrics like the estimated lift, confidence intervals, and potential business impact. You can explain that a &#8220;significant p-value at 0.05&#8221; means that if there were truly no difference, data this extreme or more so would only occur about 5% of the time in repeated experiments. Stakeholders often want to know the likely improvement in revenue, conversion, or user satisfaction, rather than just a p-value. It&#8217;s important to mention that peeking early can produce false positives. Explaining alpha spending and the importance of a well-powered test can help them appreciate why you have to wait the full run period or follow a well-structured stopping rule.</p><h2><strong>Follow-up Question: Could We Use a Multi-armed Bandit Instead?</strong></h2><p>Multi-armed bandits shift the question from purely offline hypothesis testing to online learning of which variant is better. If you want to adaptively allocate traffic to better-performing variants, a bandit method is ideal. However, bandit methods typically do not provide as direct a measure of p-value or confidence intervals in the classical sense. They aim at maximizing cumulative reward rather than a once-and-done significance statement. If your ultimate goal is to identify the best variation while minimizing regret, bandits can be a good choice. If you need a confirmatory test or want to do standard hypothesis testing, a bandit approach may not be as straightforward, although you can design confidence-based bandit approaches or incorporate Bayesian bandits.</p><p>In conclusion, you should generally pre-plan the sample size or experiment duration based on power calculations and effect sizes. You need to be mindful of how many times you peek at the data and adopt alpha spending or group sequential methods if you must stop early. Relying on a single fixed p-value threshold without pre-specifications leads to inflated Type I error and can mislead decision-making. A well-structured design that either uses classical hypothesis testing with careful alpha control or a Bayesian framework with a clear stopping rule is the best way to ensure accurate conclusions from your experiments.</p><div><hr></div><h2><strong>Below are additional follow-up questions</strong></h2><h2><strong>How do you handle experiments where multiple metrics need to be tested simultaneously?</strong></h2><p>When running an A/B test (or any controlled experiment), it&#8217;s common to track more than one metric. For instance, you might look at conversion rate, average order value, and user engagement time. Each of these metrics may serve a different business goal, and the effect of a new feature could differ across them.</p><p>One pitfall is that if you run statistical tests on multiple metrics independently using the same alpha level (for example, 0.05), you inflate the probability of at least one false positive. This is known as the multiple comparisons problem. Even if each test individually has a 5% chance of a Type I error, the chance that at least one returns a false positive is greater than 5% when you consider multiple tests together.</p><p>To work around this, one strategy is to apply a correction procedure such as the Bonferroni correction or a more powerful method like the Holm-Bonferroni or Benjamini-Hochberg procedure. These methods adjust your p-value threshold or your confidence intervals so that the overall false positive rate remains close to the nominal alpha. For example, if you have three metrics and you use a Bonferroni correction with alpha = 0.05, you would test each metric at alpha = 0.05 / 3 = 0.0167. This ensures that the family-wide Type I error rate remains near 0.05 across the three tests.</p><p>Another approach is to designate a single primary metric, which is the primary outcome you care about most. You apply the standard alpha threshold (e.g., 0.05) for that primary metric. Other metrics can be considered secondary, and you might apply more exploratory or descriptive thresholds or correct for multiple comparisons to get a sense of how the feature performs along other dimensions.</p><p>Real-world pitfalls and edge cases:</p><ul><li><p>If you see conflicting results (for example, the experiment improves one metric significantly but another metric significantly worsens), there can be confusion on what to do next. In such cases, you need to decide which metric is most critical or whether you can accept a negative trade-off in a secondary metric.</p></li><li><p>The correlation structure among the metrics can complicate your interpretation. If the metrics are highly correlated (e.g., two ways of measuring conversion), the classical Bonferroni correction might be too conservative. More sophisticated corrections or multivariate testing approaches might be warranted.</p></li><li><p>Sometimes your secondary metrics will serve as guardrail metrics that should not worsen beyond an acceptable threshold. For example, you might allow a new feature to degrade performance by up to 2% on some secondary metric. If it degrades beyond that, you call the experiment unsuccessful even if your primary metric is positive.</p></li></ul><p>In practice, the best approach is to:</p><ol><li><p>Decide on a single primary metric.</p></li><li><p>Carefully consider which metrics are purely exploratory or &#8220;nice to have&#8221; and which are critical guardrails.</p></li><li><p>Use corrections for multiple comparisons if you will make decisions from multiple p-values.</p></li></ol><h2><strong>How do you design experiments when your metric of interest is extremely volatile?</strong></h2><p>Some metrics, such as revenue or time-on-site, can have a heavy-tailed distribution, where a small fraction of users account for a large share of the total. This can make the variance of your metric large and the distribution highly skewed, which complicates classical power calculations and standard parametric tests.</p><p>Potential pitfalls:</p><ul><li><p>Outliers can dominate your analysis. You might see a few users who purchase in huge quantities or spend hours on the site. This can inflate standard deviations and might require an impractically large sample to detect the effect you want.</p></li><li><p>The naive use of the standard two-sample t-test might be inappropriate if the normality assumptions are severely violated. Even with the central limit theorem eventually applying, you may need an extremely large sample size before the distribution becomes approximately normal.</p></li></ul><p>Ways to deal with this:</p><ul><li><p>Consider a non-parametric test like the Mann-Whitney U test (also known as the Wilcoxon rank-sum test), which relies less on assumptions of normality. However, interpreting the results can be less straightforward, and the effect size measure is not directly about the mean difference.</p></li><li><p>Winsorize or trim your data. You might cap the top 1% of extreme values to reduce the variance. This must be done carefully, as it can distort the interpretation if high-value users are truly part of your target population.</p></li><li><p>Use metrics that reduce variance, such as log-transforming revenue. Log transformations can help handle multiplicative effects and reduce the influence of extremely large values.</p></li><li><p>Employ robust statistical methods or specialized parametric distributions (e.g., heavy-tailed distributions like the Pareto or lognormal). If you use a Bayesian approach, choose priors that better capture heavy-tailed data.</p></li><li><p>Consider median-based comparisons if you care about typical users rather than outliers. However, a median test might miss improvements that occur mostly in the high-spending minority.</p></li></ul><p>Edge cases to watch for:</p><ul><li><p>If your user base is highly segmented (for instance, enterprise users vs. individual consumers), a single heavy-spending enterprise user in the test group could skew results. Stratifying or segmenting could help you analyze subsets of users separately.</p></li><li><p>You may find yourself collecting data for a very long time if your effect is subtle and overshadowed by outlier noise. Re-check your experimental design to ensure your effect size is realistically detectable given the variance.</p></li></ul><h2><strong>How do you handle experiments where the control or baseline changes over time?</strong></h2><p>In some cases, the &#8220;control&#8221; variant is not static but is itself evolving. This can happen if your baseline system is frequently updated for other product reasons, or if user behavior drifts over time. Traditional A/B test assumptions presume that the control is stable during the experiment.</p><p>Potential pitfalls:</p><ul><li><p>If the control changes in the middle of the experiment, it&#8217;s effectively a new experiment. Your original baseline assumptions (for example, around baseline metrics or variance) may no longer hold.</p></li><li><p>The results you get might partially conflate improvements made to the control variant with changes in the test variant, making it difficult to interpret the net effect of the new feature you are testing.</p></li></ul><p>Strategies to mitigate:</p><ul><li><p>Freeze the control environment for the duration of the experiment if possible. This ensures the only significant difference between the test and control is the feature being tested.</p></li><li><p>If you must update the control side, treat it as a new experiment period. You can break your experiment into phases (Control vs. Test in Phase 1, then Control vs. Test in Phase 2 after the update) and analyze each phase separately.</p></li><li><p>Keep thorough logs of all changes deployed to the control environment. If an emergency fix is unavoidable, record it meticulously to ensure you can interpret the data properly.</p></li></ul><p>Edge cases to consider:</p><ul><li><p>Unexpected external events like major market changes or holidays that cause a shift in user behavior. This can appear like a &#8220;change in the control,&#8221; although it is external. Blocking by time or using a difference-in-differences approach can help separate a global time effect from the effect of your specific feature.</p></li><li><p>If you are running continuous deployment where small updates happen daily, consider a more advanced approach such as a multi-armed bandit or a short, repeated testing cycle. Alternatively, do not run multi-week experiments that are overshadowed by many rolling changes to the system.</p></li></ul><h2><strong>How do you analyze the results if user assignment was not truly random?</strong></h2><p>Randomization is the bedrock of controlled experiments. However, in real-world settings, your assignment might inadvertently be non-random due to technical glitches, user self-selection, or certain constraints in your data pipeline. If your assignment is not truly random, the standard assumptions for hypothesis testing do not hold and your p-values can be misleading.</p><p>Pitfalls:</p><ul><li><p>If certain segments of users (e.g., advanced users or specific geographic regions) disproportionately end up in one treatment group, the observed difference might reflect these segment differences rather than the feature effect.</p></li><li><p>If partial rollouts or gating features cause new sign-ups to land in the treatment more often than returning users, your test is confounded by user tenure differences.</p></li></ul><p>Approaches to mitigate:</p><ul><li><p>Conduct thorough checks to confirm the randomization process. For instance, compare user demographics or pre-experiment behavior in the control vs. treatment group. If they differ significantly, your randomization might be broken.</p></li><li><p>If you discover biases, attempt to re-weight or re-match data post-hoc. One example is propensity score matching, in which you model the probability of being assigned to treatment based on user characteristics. You then match users across groups to reduce the imbalance. This is not as good as truly random assignment, but it can partially correct for known biases.</p></li><li><p>Segment your analysis. If you find that the test group has proportionally more new users, analyze new vs. returning users separately to isolate the effect.</p></li><li><p>Fix the assignment process and re-run the experiment if that is a viable option. This might be necessary if the bias is large and unstoppable.</p></li></ul><p>Subtle real-world issues:</p><ul><li><p>Your user ID generation might be flawed, causing collisions or skew. Some systems might inadvertently bucket certain user IDs into the same variant.</p></li><li><p>If a feature is discoverable only by power users, those users might gravitate to it even if you &#8220;randomly&#8221; assign them. This effectively introduces self-selection. A solution is to forcibly push the new variant to users in the treatment group in a way that does not rely on them opting in.</p></li></ul><h2><strong>What if the experiment&#8217;s impact is delayed?</strong></h2><p>In many cases, you won&#8217;t see an immediate effect of your change. Perhaps you release a new feature that improves user retention over a span of weeks or months, or you change the onboarding flow that only affects new sign-ups. If your primary metric is something that manifests slowly (like long-term retention or lifetime value), a typical short A/B test might not capture the full effect.</p><p>Pitfalls:</p><ul><li><p>If you only measure immediate conversion events, you might underestimate the benefit (or harm) of a feature whose main impact surfaces later.</p></li><li><p>If you decide to run the experiment long enough to see the effect, you might run into user and environment changes that confound your results (control environment changes, seasonality, competitor actions).</p></li></ul><p>Ways to approach it:</p><ul><li><p>Collect data over the entire user lifecycle relevant to the change. For instance, if the feature primarily affects new users, you might track each new cohort for a sufficient period.</p></li><li><p>Use delayed feedback models that attribute future events back to the original assignment at sign-up.</p></li><li><p>If your key metric is something like &#8220;retention at day 30,&#8221; you must ensure your experiment collects enough new users and then waits at least 30 days (possibly more) to measure that retention outcome.</p></li><li><p>Sometimes you can use leading indicators (short-term proxies) that correlate strongly with the eventual long-term outcome. For instance, if you know that 80% of users who come back for a second session become weekly active users, then second-session rate might be a leading metric you can measure sooner.</p></li></ul><p>Edge cases:</p><ul><li><p>If you run the test for several months, there is a higher risk of changes in the product or external environment.</p></li><li><p>You might have partial data for some cohorts (e.g., a user who joined near the end of the experiment window). You need to decide whether to wait until they reach day 30 or drop them from the analysis. This can create left-truncation or right-censoring issues in your data.</p></li></ul><h2><strong>How do you interpret experiments when there is a learning or novelty effect?</strong></h2><p>When a new feature is introduced, users might initially be curious and engage with it more than they will in the long run. Conversely, some features require a learning curve before users can reap their benefits. These novelty or learning effects can distort your measurements.</p><p>Pitfalls:</p><ul><li><p>You might see a strong positive spike in the early days of the experiment that diminishes over time. If you run a short test, you might incorrectly conclude that the feature is a big success, only to see metrics revert to baseline later.</p></li><li><p>A new interface might initially annoy users, leading to lower engagement, but over a longer period, they might adapt and find it beneficial.</p></li></ul><p>Mitigations:</p><ul><li><p>Monitor your metric&#8217;s trajectory over time to see if it is trending up or down. Look at day-by-day or week-by-week breakdowns rather than just an aggregate.</p></li><li><p>If the effect is purely novelty-driven, you might see an initial spike that flattens. Consider extending the experiment until the metric stabilizes.</p></li><li><p>You can compare new vs. returning users to see if the feature&#8217;s effect depends on prior user familiarity. A feature that benefits novices might have a more lasting effect among brand-new users.</p></li><li><p>If you suspect a learning curve, you might run user training or tooltips to help them adopt the new feature. The eventual success might hinge on how well you guide them.</p></li></ul><p>Edge cases:</p><ul><li><p>Seasonal or marketing events might coincide with your launch, artificially boosting usage overall. This can mask or confound novelty effects.</p></li><li><p>Certain user segments (advanced vs. casual) might adopt the feature differently. Understanding that segmentation can help you see if the novelty effect is universal or restricted to a certain segment.</p></li></ul><h2><strong>How do you handle continuity and rollback after concluding the experiment?</strong></h2><p>Once you have run an experiment for the planned duration, you typically decide whether to ship the new feature to all users or revert entirely. However, in some scenarios, the experiment might show a mixed outcome, or the difference might be significant but the effect size is smaller than you hoped.</p><p>Pitfalls:</p><ul><li><p>If you gradually roll out the feature to all users after seeing a promising result, it&#8217;s no longer a strict A/B environment. Any subsequent changes might be confounded by the newly introduced feature.</p></li><li><p>If the experiment is inconclusive, you might be tempted to run it longer or repeatedly. But repeated experiments without changes can degrade user trust or cause repeated user churn.</p></li></ul><p>Strategies:</p><ul><li><p>If the result is clearly positive and meets your success criteria, adopt the new feature with a planned rollout schedule. Monitor key metrics during the rollout to the full user base to ensure no unanticipated side effects occur.</p></li><li><p>If it is marginally positive but you see potential, you might do an internal or partial rollout for advanced users or employees, gathering more feedback qualitatively.</p></li><li><p>If the test indicates a negative or neutral effect, strongly consider rolling back. However, if you suspect the test was underpowered or external factors skewed the results, you might plan a new experiment with improved design or a different timeframe.</p></li><li><p>Have a plan to preserve or archive the data. The experiment logs can serve future analysis, especially if you revisit the feature idea later.</p></li></ul><p>Edge cases:</p><ul><li><p>The feature might be beneficial for certain subsets of users but harmful for others. You might do a &#8220;targeted rollout&#8221; or personalization approach, rolling it out only to the users who see a net positive. This requires careful segmentation analysis to ensure you do not inadvertently exclude large groups or hamper fairness.</p></li><li><p>If you discovered that the test variant had certain side effects (e.g., more user support tickets), weigh that operational cost against the benefit on your main metrics.</p></li></ul><h2><strong>How do you handle experiments in systems where metrics are updated in near real-time (e.g., streaming data systems)?</strong></h2><p>In fast-moving data environments (e.g., certain ad-tech platforms or real-time recommender systems), you might collect metrics continuously and potentially react in real time to signals from the experiment. Traditional &#8220;collect all data, analyze at the end&#8221; may be less relevant when decisions happen moment by moment.</p><p>Potential pitfalls:</p><ul><li><p>Real-time adaptation can cause non-stationarity in the user population. For instance, if the system starts favoring the better variant more aggressively, you lose the strict randomization that underpins your standard test.</p></li><li><p>The environment might shift during the test, or competing product changes might happen simultaneously.</p></li></ul><p>Best practices:</p><ul><li><p>If you need real-time adaptation, consider multi-armed bandit algorithms or Bayesian adaptive experiments. These are designed to allocate more traffic to better-performing arms over time while still maintaining some exploration.</p></li><li><p>If you want a final &#8220;statistical test&#8221; conclusion, you might keep a small portion of traffic randomized to each arm consistently for a fixed period to preserve a clean comparison group. Meanwhile, the rest of the traffic is adaptively allocated in real time.</p></li><li><p>Keep a stable logging mechanism and identify whether data is missing or delayed in the streaming pipeline. In some real-time systems, partial data might be processed out of order or not at all, which complicates measurement.</p></li></ul><p>Subtle real-world issues:</p><ul><li><p>In streaming ad systems, a single user might generate events many times a day, so your user-level randomization must be consistently enforced across those repeated interactions to maintain the validity of the test.</p></li><li><p>If the real-time system modifies bids or recommendations based on the performance observed, you effectively have a feedback loop. This can lead to scenario drift, where each group sees different segments of traffic over time due to the system&#8217;s adaptation.</p></li></ul><h2><strong>How do you interpret results when some participants encounter technical errors that prevent them from experiencing the test properly?</strong></h2><p>In large-scale online experiments, there can be technology failures where some fraction of the &#8220;treatment&#8221; group never actually sees the intended treatment (perhaps due to front-end JavaScript errors or partial outages). That means your &#8220;treatment&#8221; group is effectively a mixture of participants who got the new experience and participants who remained on something akin to the control.</p><p>Risks:</p><ul><li><p>Your measured effect size might be underestimated because not everyone is actually treated.</p></li><li><p>If the errors are not random and systematically affect certain user types (for example, certain browsers, network speeds, or countries), this introduces bias.</p></li></ul><p>Mitigations:</p><ul><li><p>Conduct &#8220;intent-to-treat&#8221; analysis, which compares everyone assigned to treatment vs. everyone assigned to control, regardless of whether they actually received the treatment. This preserves randomization but might dilute the measured effect if many treatment assignments failed.</p></li><li><p>Also conduct a &#8220;treatment-on-the-treated&#8221; analysis by filtering out users who did not receive the feature, but be aware that this filtering might break the randomization assumption if there is a systematic reason they did not receive it.</p></li><li><p>Track the fraction of users in the treatment group who actually experience the new feature. If that fraction is too low, address the root causes of these technical failures first before concluding the experiment&#8217;s effect is minimal.</p></li></ul><p>Edge cases:</p><ul><li><p>A small, random glitch might be acceptable if it impacts only a tiny percentage of users similarly across control and treatment. But if it disproportionately affects treatment, your results are confounded.</p></li><li><p>If the glitch is widespread, it may be better to fix the error, re-randomize users, and restart the experiment to ensure a valid measurement.</p></li></ul><h2><strong>How do you set the correct alpha level and confidence interval coverage in extremely large-scale experiments?</strong></h2><p>In massive-scale experiments, even tiny differences can become statistically significant if you have enough data. Consequently, using a standard alpha of 0.05 might result in declaring many small but operationally insignificant differences as &#8220;significant.&#8221;</p><p>Challenges:</p><ul><li><p>You risk shipping changes that are &#8220;statistically significant&#8221; but have a negligible business impact. Over time, this can clutter your product with minor changes that add complexity without real value.</p></li><li><p>Conversely, you might repeatedly declare significance on minuscule effects, leading to a high false discovery rate overall if you are running many parallel experiments daily.</p></li></ul><p>Strategies:</p><ul><li><p>Lower your alpha threshold or consider the practical significance. For example, you might say you need at least a 0.1% absolute lift that is significant at alpha = 0.01 to be actionable.</p></li><li><p>Use confidence intervals and effect size estimates to check whether the observed difference is truly meaningful. If your 95% confidence interval is (0.05%, 0.08%), maybe it is statistically significant, but the effect might be too small to justify engineering resources.</p></li><li><p>Keep track of how many experiments you run per unit time. If you run dozens or hundreds of experiments in parallel, you need to control the overall false discovery rate across them. A method like the Benjamini-Hochberg correction can help manage many p-values simultaneously.</p></li></ul><p>Edge cases:</p><ul><li><p>A small effect might accumulate large business value if you have a massive user base. For example, a 0.1% improvement in a multi-billion-dollar operation is still substantial. So even seemingly tiny lifts can matter if they impact a huge scale.</p></li><li><p>If you are uncertain about the minimal meaningful difference, consult with stakeholders on cost-benefit analyses. Sometimes it is worth acting on a tiny improvement if the cost is low and the user experience remains clean.</p></li></ul>]]></content:encoded></item></channel></rss>