<?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[VertoxQuant]]></title><description><![CDATA[Applied quantitative research on trading, risk, and systematic strategy design.]]></description><link>https://www.vertoxquant.com</link><image><url>https://substackcdn.com/image/fetch/$s_!ufaQ!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png</url><title>VertoxQuant</title><link>https://www.vertoxquant.com</link></image><generator>Substack</generator><lastBuildDate>Fri, 01 May 2026 00:03:20 GMT</lastBuildDate><atom:link href="https://www.vertoxquant.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Vertox]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[vertox@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[vertox@substack.com]]></itunes:email><itunes:name><![CDATA[Vertox]]></itunes:name></itunes:owner><itunes:author><![CDATA[Vertox]]></itunes:author><googleplay:owner><![CDATA[vertox@substack.com]]></googleplay:owner><googleplay:email><![CDATA[vertox@substack.com]]></googleplay:email><googleplay:author><![CDATA[Vertox]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Backtests Lie: Building a Stress-Test Framework for Trading Signals]]></title><description><![CDATA[Synthetic nulls, falsification audits, and backtest inflation diagnostics in Python.]]></description><link>https://www.vertoxquant.com/p/backtests-lie</link><guid isPermaLink="false">https://www.vertoxquant.com/p/backtests-lie</guid><dc:creator><![CDATA[Vertox]]></dc:creator><pubDate>Wed, 22 Apr 2026 21:57:16 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!NzDd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c5a0ac2-d023-4c25-a9e6-9b9450d9f31d_790x490.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Look at this backtest I found online:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!svQw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2047df2c-3000-48bc-9349-3f4214af42b7_1838x816.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!svQw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2047df2c-3000-48bc-9349-3f4214af42b7_1838x816.png 424w, https://substackcdn.com/image/fetch/$s_!svQw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2047df2c-3000-48bc-9349-3f4214af42b7_1838x816.png 848w, https://substackcdn.com/image/fetch/$s_!svQw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2047df2c-3000-48bc-9349-3f4214af42b7_1838x816.png 1272w, https://substackcdn.com/image/fetch/$s_!svQw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2047df2c-3000-48bc-9349-3f4214af42b7_1838x816.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!svQw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2047df2c-3000-48bc-9349-3f4214af42b7_1838x816.png" width="1456" height="646" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2047df2c-3000-48bc-9349-3f4214af42b7_1838x816.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:646,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:90931,&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.vertoxquant.com/i/194942463?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2047df2c-3000-48bc-9349-3f4214af42b7_1838x816.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!svQw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2047df2c-3000-48bc-9349-3f4214af42b7_1838x816.png 424w, https://substackcdn.com/image/fetch/$s_!svQw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2047df2c-3000-48bc-9349-3f4214af42b7_1838x816.png 848w, https://substackcdn.com/image/fetch/$s_!svQw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2047df2c-3000-48bc-9349-3f4214af42b7_1838x816.png 1272w, https://substackcdn.com/image/fetch/$s_!svQw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2047df2c-3000-48bc-9349-3f4214af42b7_1838x816.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>One of your first thoughts when looking at a stranger&#8217;s backtest is probably that it&#8217;s overfit, or that there is some look-ahead somewhere.</p><p>When you go a step further, you are probably constantly worried about overfitting your own backtests too!</p><p>In this article, we will introduce a framework that allows you to identify both! It&#8217;s a two-stage approach introduced in <a href="https://arxiv.org/pdf/2604.15531">D. Nikolopoulos (2026)</a>. We will introduce the method, develop the two-stage approach, test the methodology empirically on a crypto dataset, look at some limitations, and also add some improvements of my own!</p><p>This article is free to read. You can support me immensely by sharing this article:</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.vertoxquant.com/p/backtests-lie?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.vertoxquant.com/p/backtests-lie?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><div><hr></div><p>I write about quantitative trading the way it&#8217;s actually practiced:<br>Robust models and portfolios, combining signals and strategies, understanding the assumptions behind your models.</p><p>More broadly, I write about:</p><ul><li><p>Statistical and cross-sectional arbitrage</p></li><li><p>Managing multiple strategies and signals</p></li><li><p>Risk and capital allocation</p></li><li><p>Research tooling and methodology</p></li><li><p>In-depth model assumptions and derivations</p></li></ul><p>If this way of thinking resonates, you&#8217;ll probably like what I publish.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.vertoxquant.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">VertoxQuant is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</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><hr></div><h1>How Backtests Lie</h1><p>There are three main failure modes in backtests: Leakage, selection bias, and specification error. Let&#8217;s go over them.</p><h2>Leakage</h2><p>Leakage is when you are making decisions based on information not yet available at that time. This doesn&#8217;t have to be something extreme like using future price data when calculating momentum, or using the current day&#8217;s low as a stop loss when still mid-day; it can be more subtle things like normalizing based on the full-sample volatility.</p><p>We can describe this mathematically with the help of filtrations. If you are unfamiliar with this concept, please read the following article:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;561e0c24-6c58-4db0-9173-db4629964819&quot;,&quot;caption&quot;:&quot;An options contract gives the buyer the right to buy or sell (call or put) the underlying asset at an agreed upon price and time.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Option Pricing Basics&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:128680675,&quot;name&quot;:&quot;Vertox&quot;,&quot;bio&quot;:&quot;Quantitative Researcher in Digital Asset Markets | Market Making | Statistical Arbitrage | Options &quot;,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!HGUA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bf3fd86-d46a-4caa-969a-d80059b72cb9_128x128.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2025-04-25T23:15:24.078Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59ceed79-b3e8-47d4-b6c5-19eaaef87b43_825x429.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.vertoxquant.com/p/option-pricing-basics&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:162092496,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:12,&quot;comment_count&quot;:0,&quot;publication_id&quot;:1726874,&quot;publication_name&quot;:&quot;VertoxQuant&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!ufaQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>A signal x_t is valid if and only if it is measurable with respect to F_{t-1}:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;x_t \\in \\mathcal{F}_{t-1}.&quot;,&quot;id&quot;:&quot;CSQLHXFSQI&quot;}" data-component-name="LatexBlockToDOM"></div><p>F_{t-1} reflects everything that is knowable at time t-1, like all past prices p_1, &#8230;, p_{t-1}, all past return r_1, &#8230;, r_{t-1}, all past volumes, etc.</p><p>As time progresses, it only grows:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;...\\subseteq \\mathcal{F}_{t-1} \\subseteq \\mathcal{F}_{t} \\subseteq \\mathcal{F}_{t+1} \\subseteq...&quot;,&quot;id&quot;:&quot;DMGJQJBAVJ&quot;}" data-component-name="LatexBlockToDOM"></div><p>You never forget information; you only accumulate more.</p><p>The full-sample normalization is NOT measurable:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\tilde{x}_t = \\frac{x_t - \\mu_T}{\\sigma_t} \\notin \\mathcal{F}_{t-1},&quot;,&quot;id&quot;:&quot;PYUDTIEFSH&quot;}" data-component-name="LatexBlockToDOM"></div><p>since mu_T and sigma_t depend on observations you haven&#8217;t seen yet at time t. The correct expanding window version restores measurability:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\tilde{x}_t = \\frac{x_t - \\mu_{t-1}}{\\sigma_{t-1}} \\in \\mathcal{F}_{t-1}&quot;,&quot;id&quot;:&quot;PMQUEHUUYS&quot;}" data-component-name="LatexBlockToDOM"></div><h2>Selection Bias</h2><p>Selection bias, or overfitting, is when you test many different strategies (or configurations of one strategy) and report the best one. Even on a dataset that is not predictable at all, like white noise, this will produce performance better than 0.</p><p>Formally, assume returns follow a martingale difference sequence under the null hypothesis:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;H_0: \\mathbb{E}[r_t|\\mathcal{F}_{t-1}] = 0.&quot;,&quot;id&quot;:&quot;FFTLNCOEQJ&quot;}" data-component-name="LatexBlockToDOM"></div><p>For each candidate strategy k, we compute its in-sample mean return R, and measure its statistical significance using a HAC t-statistic (A t-statistic that accounts for autocorrelation and heteroskedasticity commonly observed in financial markets):</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;Z_{IS,k} = \\frac{\\bar{R}_{IS,k}}{\\sqrt{\\hat{V}_{HAC}(\\bar{R}_{IS,k})}},&quot;,&quot;id&quot;:&quot;IFKTEXPUFZ&quot;}" data-component-name="LatexBlockToDOM"></div><p>where V_HAC is the Newey-West variance estimator. For more on Newest-West and HAC t-statistics, read the following article:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;482aa59d-553b-4a61-9ec9-b752f69644cb&quot;,&quot;caption&quot;:&quot;People keep telling you to take what works in equities and apply it to crypto.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;The Myth of Factor-Free Crypto&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:128680675,&quot;name&quot;:&quot;Vertox&quot;,&quot;bio&quot;:&quot;Quantitative Researcher in Digital Asset Markets | Market Making | Statistical Arbitrage | Options &quot;,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!HGUA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bf3fd86-d46a-4caa-969a-d80059b72cb9_128x128.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2026-01-27T11:58:38.274Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!XkCB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34bf8966-164f-4e82-b241-c63702a902d9_1189x390.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.vertoxquant.com/p/the-myth-of-factor-free-crypto&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:185829391,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:9,&quot;comment_count&quot;:0,&quot;publication_id&quot;:1726874,&quot;publication_name&quot;:&quot;VertoxQuant&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!ufaQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>Under H_0, Z_{IS,k} is standard normally distributed asymptotically; values above 1.96 should only occur 5% of the time by chance.</p><p>But when you search over K configurations and always report the best one:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;Z_{IS}^* = \\max_{1\\leq k\\leq K}|Z_{IS,k}|,&quot;,&quot;id&quot;:&quot;IMODVTARDM&quot;}" data-component-name="LatexBlockToDOM"></div><p>This grows with K even under H_0:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\mathbb{E}[Z_{IS}^*] \\approx a_{2K} + \\gamma b_{2K}&quot;,&quot;id&quot;:&quot;KRGLLFOBGB&quot;}" data-component-name="LatexBlockToDOM"></div><p>where gamma (the Euler-Mascheroni constant) is roughly 0.5772 and</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;a_{2K} = \\sqrt{2 \\ln 2K} - \\frac{\\ln \\ln 2K + \\ln 4\\pi}{2\\sqrt{2 \\ln 2K}}, \\qquad b_{2K} = \\frac{1}{\\sqrt{2 \\ln 2K}}.&quot;,&quot;id&quot;:&quot;TIEZDQGVRY&quot;}" data-component-name="LatexBlockToDOM"></div><p>This is a result of Extreme Value Theory; you don&#8217;t need to memorize the formula.</p><p>At K=100, your expected best t-statistic is already around 2.79, well above the 1.96 significance threshold.</p><h2>Specification Error</h2><p>Specification error is when your model technically makes money, but you misinterpret <em>why </em>it makes money.</p><p>A classic example of this is exposure to factors like market, momentum, liquidity, etc.</p><p>Formally, assume your returns follow the following factor model:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;r_t = \\alpha_t + \\beta_t f_t + \\epsilon_t,&quot;,&quot;id&quot;:&quot;IDDJWIIMWX&quot;}" data-component-name="LatexBlockToDOM"></div><p>where f_t is a known risk factor, beta_t is your exposure to it, and alpha_t is the true time-varying alpha not captured by your factor (You can, of course, extend this to multiple factors). Specification error here would be thinking alpha_t is bigger than it actually is. </p><p>The second form of specification error is fitting a transient regime. Your model found a pattern specific to a particular market period or regime that doesn&#8217;t reflect a structural inefficiency. It worked in your backtest window, but it won&#8217;t persist in live trading.</p><div><hr></div><h1>Our Pipeline</h1><p>Before going into the stress-test framework, let&#8217;s first introduce the pipeline we will test this on. We will explore a moving-average crossover strategy on daily BTCUSD data from CoinAPI, optimized and tested walk-forward with an In-sample of 2 years and an out-of-sample of 6 months.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;905e4ac3-e6cb-4a4e-810c-2d9dee804980&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">df = pd.read_csv("C:\\QuantData\\CoinAPI Survivorship Bias Free\\BTC_USD_1DAY_COMPOSITE.csv").set_index("date")["close"]
returns = df.pct_change().dropna()</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Dw_I!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F734421c5-a70c-43a5-b7f5-327a1b4105eb_322x247.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Dw_I!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F734421c5-a70c-43a5-b7f5-327a1b4105eb_322x247.png 424w, https://substackcdn.com/image/fetch/$s_!Dw_I!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F734421c5-a70c-43a5-b7f5-327a1b4105eb_322x247.png 848w, https://substackcdn.com/image/fetch/$s_!Dw_I!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F734421c5-a70c-43a5-b7f5-327a1b4105eb_322x247.png 1272w, https://substackcdn.com/image/fetch/$s_!Dw_I!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F734421c5-a70c-43a5-b7f5-327a1b4105eb_322x247.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Dw_I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F734421c5-a70c-43a5-b7f5-327a1b4105eb_322x247.png" width="322" height="247" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/734421c5-a70c-43a5-b7f5-327a1b4105eb_322x247.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:247,&quot;width&quot;:322,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:11499,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/194942463?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F734421c5-a70c-43a5-b7f5-327a1b4105eb_322x247.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Dw_I!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F734421c5-a70c-43a5-b7f5-327a1b4105eb_322x247.png 424w, https://substackcdn.com/image/fetch/$s_!Dw_I!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F734421c5-a70c-43a5-b7f5-327a1b4105eb_322x247.png 848w, https://substackcdn.com/image/fetch/$s_!Dw_I!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F734421c5-a70c-43a5-b7f5-327a1b4105eb_322x247.png 1272w, https://substackcdn.com/image/fetch/$s_!Dw_I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F734421c5-a70c-43a5-b7f5-327a1b4105eb_322x247.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="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;2fbe1d31-9b7f-42d3-815e-6198e98d781f&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python"># --- Signal ---
def ma_signal(returns, short, long):
    prices = (1 + returns).cumprod()
    short_ma = prices.rolling(short).mean()
    long_ma = prices.rolling(long).mean()
    signal = np.where(short_ma &gt; long_ma, 1, -1)
    return pd.Series(signal, index=returns.index)

# --- HAC t-statistic ---
def hac_tstat(rets, max_lag=None):
    x = np.asarray(rets)  # ensures positional behavior
    T = len(x)
    
    if max_lag is None:
        max_lag = int(4 * (T / 100) ** (2/9))
    
    mu = x.mean()
    gamma0 = np.mean((x - mu) ** 2)
    
    V_hac = gamma0
    for l in range(1, max_lag + 1):
        w = 1 - l / (max_lag + 1)
        gamma_l = np.mean((x[l:] - mu) * (x[:-l] - mu))
        V_hac += 2 * w * gamma_l
    
    return mu / np.sqrt(V_hac / T)

# --- Walk-Forward ---
def walk_forward(returns, in_sample_days=365*2, out_sample_days=180):
    short_grid = range(5, 51, 5)
    long_grid = range(20, 201, 20)
    
    results = []
    starts = range(0, len(returns) - in_sample_days - out_sample_days, out_sample_days)
    
    for start in starts:
        r_IS = returns.iloc[start : start + in_sample_days]
        r_OOS = returns.iloc[start + in_sample_days : start + in_sample_days + out_sample_days]
        
        best_z, best_short, best_long = -np.inf, None, None
        for s in short_grid:
            for l in long_grid:
                if s &gt;= l:
                    continue
                sig = ma_signal(r_IS, s, l).shift(1).dropna()
                strat_rets = (r_IS * sig).dropna()
                if len(strat_rets) &lt; 30:
                    continue
                z = hac_tstat(strat_rets)
                if z &gt; best_z:
                    best_z = z
                    best_short, best_long = s, l
        
        sig_OOS = ma_signal(r_OOS, best_short, best_long).shift(1).dropna()
        strat_rets_OOS = (r_OOS * sig_OOS).dropna()
        z_OOS = hac_tstat(strat_rets_OOS)
        
        results.append({
            "start": returns.index[start],
            "best_short": best_short,
            "best_long": best_long,
            "z_IS": best_z,
            "z_OOS": z_OOS,
            "rets_OOS": strat_rets_OOS
        })
    
    return pd.DataFrame(results)</code></pre></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;6deb1705-d5a7-4b87-94b1-eafd124669c9&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">results = walk_forward(returns)
print(results[["start", "best_short", "best_long", "z_IS", "z_OOS"]])</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aCDB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa47dfc9-5726-4b12-846f-af8c9b742881_442x103.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aCDB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa47dfc9-5726-4b12-846f-af8c9b742881_442x103.png 424w, https://substackcdn.com/image/fetch/$s_!aCDB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa47dfc9-5726-4b12-846f-af8c9b742881_442x103.png 848w, https://substackcdn.com/image/fetch/$s_!aCDB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa47dfc9-5726-4b12-846f-af8c9b742881_442x103.png 1272w, https://substackcdn.com/image/fetch/$s_!aCDB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa47dfc9-5726-4b12-846f-af8c9b742881_442x103.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aCDB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa47dfc9-5726-4b12-846f-af8c9b742881_442x103.png" width="442" height="103" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fa47dfc9-5726-4b12-846f-af8c9b742881_442x103.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:103,&quot;width&quot;:442,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:10020,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/194942463?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa47dfc9-5726-4b12-846f-af8c9b742881_442x103.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!aCDB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa47dfc9-5726-4b12-846f-af8c9b742881_442x103.png 424w, https://substackcdn.com/image/fetch/$s_!aCDB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa47dfc9-5726-4b12-846f-af8c9b742881_442x103.png 848w, https://substackcdn.com/image/fetch/$s_!aCDB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa47dfc9-5726-4b12-846f-af8c9b742881_442x103.png 1272w, https://substackcdn.com/image/fetch/$s_!aCDB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa47dfc9-5726-4b12-846f-af8c9b742881_442x103.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h1>Stage 1: Falsification</h1><p>The core idea of Stage 1 is simple: If your pipeline finds alpha in data where alpha cannot exist by construction, your pipeline is broken.</p><p>We introduce 5 null environments that try to target different failure modes:</p><h3>Environment A: White Noise</h3><p>Returns are i.i.d. Gaussian with zero mean:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;r_t = \\sigma_{\\text{daily}} \\epsilon_t, \\quad \\epsilon_t \\sim \\mathcal{N}(0,1).&quot;,&quot;id&quot;:&quot;SGIGGXYHUF&quot;}" data-component-name="LatexBlockToDOM"></div><p>Then </p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\mathbb{E}[r_t|\\mathcal{F}_{t-1}^{(r)}] = 0, \\quad \\text{Cov}(r_t, r_{t-l})=0, \\forall l \\geq 1.&quot;,&quot;id&quot;:&quot;SSLBSPFJSZ&quot;}" data-component-name="LatexBlockToDOM"></div><p>Annualized volatility target sigma_ann = 0.20, giving</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\sigma_{\\text{daily}} = \\frac{0.20}{\\sqrt{365}}.&quot;,&quot;id&quot;:&quot;ZLMUVOBVOO&quot;}" data-component-name="LatexBlockToDOM"></div><p>If your pipeline finds alpha here, it is purely selection bias.</p><p>Let&#8217;s test our moving-average crossover walk-forward pipeline with this:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;b7bf04fa-f922-4205-ac91-60ce84a31a44&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">def generate_env_a(returns, sigma_ann=0.20, seed=None):
    if seed is not None:
        np.random.seed(seed)
    sigma_daily = sigma_ann / np.sqrt(365)
    null_returns = pd.Series(
        np.random.normal(0, sigma_daily, len(returns)),
        index=returns.index
    )
    return null_returns</code></pre></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;e190f7e4-ef76-452d-a2fd-b62dd3fc57fa&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">null_rets = generate_env_a(returns, seed=42)
null_results = walk_forward(null_rets)
print(null_results[["start", "best_short", "best_long", "z_IS", "z_OOS"]])</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!231r!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd157536a-6557-4206-a379-43245d62c8dd_441x100.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!231r!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd157536a-6557-4206-a379-43245d62c8dd_441x100.png 424w, https://substackcdn.com/image/fetch/$s_!231r!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd157536a-6557-4206-a379-43245d62c8dd_441x100.png 848w, https://substackcdn.com/image/fetch/$s_!231r!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd157536a-6557-4206-a379-43245d62c8dd_441x100.png 1272w, https://substackcdn.com/image/fetch/$s_!231r!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd157536a-6557-4206-a379-43245d62c8dd_441x100.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!231r!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd157536a-6557-4206-a379-43245d62c8dd_441x100.png" width="441" height="100" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d157536a-6557-4206-a379-43245d62c8dd_441x100.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:100,&quot;width&quot;:441,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:10764,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/194942463?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd157536a-6557-4206-a379-43245d62c8dd_441x100.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!231r!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd157536a-6557-4206-a379-43245d62c8dd_441x100.png 424w, https://substackcdn.com/image/fetch/$s_!231r!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd157536a-6557-4206-a379-43245d62c8dd_441x100.png 848w, https://substackcdn.com/image/fetch/$s_!231r!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd157536a-6557-4206-a379-43245d62c8dd_441x100.png 1272w, https://substackcdn.com/image/fetch/$s_!231r!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd157536a-6557-4206-a379-43245d62c8dd_441x100.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The results are exactly what we expect: In-sample Z_IS^* values between 0.58 and 0.77 reflect modest inflation from grid search, while out-of-sample Z_OOS values hover around zero. There is no consistent OOS edge.</p><h3>Environment B: Regime-Switching Volatility</h3><p>This environment detects predictability arising from improper normalization rules that leak future volatility states, regime leakage, or scale-based trading rules that inadvertently exploit volatility regimes. Let s_t in {1,2} be a two-state Markov chain with transition matrix</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;P = \\begin{pmatrix} p_{11} &amp; 1-p_{11} \\\\ 1-p_{22} &amp; p_{22} \\end{pmatrix}.&quot;,&quot;id&quot;:&quot;SPLGFIZVHQ&quot;}" data-component-name="LatexBlockToDOM"></div><p>Returns are generated as </p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;r_t = \\sigma_{s_t} \\epsilon_t, \\quad \\epsilon_t \\sim \\mathcal{N}(0,1),&quot;,&quot;id&quot;:&quot;NLXHSIBZQQ&quot;}" data-component-name="LatexBlockToDOM"></div><p>with epsilon_t independent of F_{t-1}^(r). Therefore E[r_t|F_{t-1}^(r)] = 0.</p><p>The paper chooses the following values:</p><p>Low-regime annualized volatility sigma_ann = 0.10, high regime volatility multiplier m=3.0, regime presistence p_11 = p_22 = 0.98. Hence</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\sigma_1 = \\frac{0.10}{\\sqrt{365}}, \\quad \\sigma_2 = \\frac{0.10 m}{\\sqrt{365}} = \\frac{0.30 }{\\sqrt{365}}.&quot;,&quot;id&quot;:&quot;JACLTLXNMB&quot;}" data-component-name="LatexBlockToDOM"></div><p>Here&#8217;s the implementation:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;e27b5a77-3cc9-4d4d-9929-113182284971&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">def generate_env_b(returns, p11=0.98, p22=0.98, sigma_ann_low=0.10, sigma_ann_high=0.30, seed=None):
    if seed is not None:
        np.random.seed(seed)
    sigma_low = sigma_ann_low / np.sqrt(365)
    sigma_high = sigma_ann_high / np.sqrt(365)
    
    T = len(returns)
    states = np.zeros(T, dtype=int)
    states[0] = 0
    for t in range(1, T):
        if states[t-1] == 0:
            states[t] = 0 if np.random.rand() &lt; p11 else 1
        else:
            states[t] = 1 if np.random.rand() &lt; p22 else 0
    
    sigmas = np.where(states == 0, sigma_low, sigma_high)
    null_returns = pd.Series(
        np.random.normal(0, sigmas),
        index=returns.index
    )
    return null_returns</code></pre></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;5df1c2cf-223d-4573-94f5-94deae8ba852&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">null_rets_b = generate_env_b(returns, seed=42)
results_b = walk_forward(null_rets_b)
print(results_b[["start", "best_short", "best_long", "z_IS", "z_OOS"]])</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!h4K2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43f149a0-f776-465d-a92b-d80dfc6dce92_442x98.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!h4K2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43f149a0-f776-465d-a92b-d80dfc6dce92_442x98.png 424w, https://substackcdn.com/image/fetch/$s_!h4K2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43f149a0-f776-465d-a92b-d80dfc6dce92_442x98.png 848w, https://substackcdn.com/image/fetch/$s_!h4K2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43f149a0-f776-465d-a92b-d80dfc6dce92_442x98.png 1272w, https://substackcdn.com/image/fetch/$s_!h4K2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43f149a0-f776-465d-a92b-d80dfc6dce92_442x98.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!h4K2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43f149a0-f776-465d-a92b-d80dfc6dce92_442x98.png" width="442" height="98" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/43f149a0-f776-465d-a92b-d80dfc6dce92_442x98.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:98,&quot;width&quot;:442,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:10684,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/194942463?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43f149a0-f776-465d-a92b-d80dfc6dce92_442x98.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!h4K2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43f149a0-f776-465d-a92b-d80dfc6dce92_442x98.png 424w, https://substackcdn.com/image/fetch/$s_!h4K2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43f149a0-f776-465d-a92b-d80dfc6dce92_442x98.png 848w, https://substackcdn.com/image/fetch/$s_!h4K2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43f149a0-f776-465d-a92b-d80dfc6dce92_442x98.png 1272w, https://substackcdn.com/image/fetch/$s_!h4K2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43f149a0-f776-465d-a92b-d80dfc6dce92_442x98.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3>Environment C: Friction Placebo (Bid-Ask Bounce)</h3><p>Let u_t be the latent efficient return, the &#8220;true&#8221; return of the asset satisfying the martingale null (E[u_t | F_{t-1}^(u)] = 0):</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;u_t = \\sigma_{epsilon} \\epsilon_t, \\quad \\epsilon_t \\sim \\mathcal{N}(0,1).&quot;,&quot;id&quot;:&quot;HOZNVCBHFB&quot;}" data-component-name="LatexBlockToDOM"></div><p>The observed return is then contaminated by bid-ask bounce via an MA(1) process:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;r_t = u_t + \\theta u_{t-1},  \\ \\theta < 0.&quot;,&quot;id&quot;:&quot;WQCRFHOKQE&quot;}" data-component-name="LatexBlockToDOM"></div><p>The negative theta creates negative first-order autocorrelation in observed returns, which are predictable, but NOT tradable! Short-term mean reversion strategies suffer especially hard from this bias. </p><p>Innovations are scaled to match a target annualised volatility sigma_ann. Let</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\sigma_{\\text{daily}} = \\frac{\\sigma_{\\text{ann}}}{\\sqrt{365}}, \\quad \\sigma_\\epsilon = \\frac{\\sigma_{daily}}{\\sqrt{1+\\theta^2}},&quot;,&quot;id&quot;:&quot;PONKZOVXCJ&quot;}" data-component-name="LatexBlockToDOM"></div><p>so that </p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\text{Var}(r_t) = \\sigma_{\\text{daily}}^2.&quot;,&quot;id&quot;:&quot;FUUUMSYXZZ&quot;}" data-component-name="LatexBlockToDOM"></div><p>The paper picks sigma_ann = 0.20 and theta = -0.5.</p><p>If your pipeline profits from this, it has timing errors, indexing bugs, or execution misalignment. Your pipeline isn&#8217;t statistically broken, but economically.</p><p>Note: We are working with daily prices here, where the bid-ask bounce is typically no longer significant.</p><p>Here&#8217;s the implementation:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;7fd191f6-7c35-4425-a2dd-1b5e688b8607&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">def generate_env_c(returns, theta=-0.5, sigma_ann=0.20, seed=None):
    if seed is not None:
        np.random.seed(seed)
    sigma_daily = sigma_ann / np.sqrt(365)
    sigma_eps = sigma_daily / np.sqrt(1 + theta**2)
    
    T = len(returns)
    u = np.random.normal(0, sigma_eps, T + 1)
    r = u[1:] + theta * u[:-1]
    
    null_returns = pd.Series(r, index=returns.index)
    return null_returnsnull_rets_c = generate_env_c(returns, seed=42)
results_c = walk_forward(null_rets_c)
print(results_c[["start", "best_short", "best_long", "z_IS", "z_OOS"]])</code></pre></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;2b8bc6ac-e43c-41b1-b420-255388e1b5ae&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">null_rets_c = generate_env_c(returns, seed=42)
results_c = walk_forward(null_rets_c)
print(results_c[["start", "best_short", "best_long", "z_IS", "z_OOS"]])</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SNm5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fae678a-67cd-4f32-bd22-1d656f53196e_439x105.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SNm5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fae678a-67cd-4f32-bd22-1d656f53196e_439x105.png 424w, https://substackcdn.com/image/fetch/$s_!SNm5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fae678a-67cd-4f32-bd22-1d656f53196e_439x105.png 848w, https://substackcdn.com/image/fetch/$s_!SNm5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fae678a-67cd-4f32-bd22-1d656f53196e_439x105.png 1272w, https://substackcdn.com/image/fetch/$s_!SNm5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fae678a-67cd-4f32-bd22-1d656f53196e_439x105.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SNm5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fae678a-67cd-4f32-bd22-1d656f53196e_439x105.png" width="439" height="105" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0fae678a-67cd-4f32-bd22-1d656f53196e_439x105.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:105,&quot;width&quot;:439,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:9282,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/194942463?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fae678a-67cd-4f32-bd22-1d656f53196e_439x105.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!SNm5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fae678a-67cd-4f32-bd22-1d656f53196e_439x105.png 424w, https://substackcdn.com/image/fetch/$s_!SNm5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fae678a-67cd-4f32-bd22-1d656f53196e_439x105.png 848w, https://substackcdn.com/image/fetch/$s_!SNm5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fae678a-67cd-4f32-bd22-1d656f53196e_439x105.png 1272w, https://substackcdn.com/image/fetch/$s_!SNm5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fae678a-67cd-4f32-bd22-1d656f53196e_439x105.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3>Environment D: Factor Null (One-Factor, Zero Alpha)</h3><p>Returns are driven by a mean-zero risk factor with zero alpha:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;r_t = \\beta f_t + e_t,&quot;,&quot;id&quot;:&quot;YFLCIVJVPA&quot;}" data-component-name="LatexBlockToDOM"></div><p>with</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;f_t \\sim \\mathcal{N}(0, \\sigma_f^2), \\quad e_t \\sim \\mathcal{N}(0, \\sigma_e^2), \\quad f_t \\perp e_t,&quot;,&quot;id&quot;:&quot;NQAWRKBHWH&quot;}" data-component-name="LatexBlockToDOM"></div><p>and (f_t, e_t) independent of F_{t-1}^(r). Hence E[r_t |F_{t-1}^(r)] = 0.</p><p>The paper&#8217;s default calibration is beta = 1.0 and daily volatilities</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\sigma_f = \\frac{0.20}{\\sqrt{365}}, \\quad \\sigma_e = \\frac{0.10}{\\sqrt{365}}.&quot;,&quot;id&quot;:&quot;FZATIWJOOA&quot;}" data-component-name="LatexBlockToDOM"></div><p>This catches strategies mistaking beta for alpha. If your pipeline finds alpha here, it&#8217;s just harvesting systematic factor exposure rather than a genuine edge.</p><p>Here&#8217;s the implementation:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;a5f3aa62-0817-4bb6-9fca-f06b527e07b5&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">def generate_env_d(returns, beta=1.0, sigma_ann_f=0.20, sigma_ann_e=0.10, seed=None):
    if seed is not None:
        np.random.seed(seed)
    sigma_f = sigma_ann_f / np.sqrt(365)
    sigma_e = sigma_ann_e / np.sqrt(365)
    
    T = len(returns)
    f = np.random.normal(0, sigma_f, T)
    e = np.random.normal(0, sigma_e, T)
    r = beta * f + e
    
    null_returns = pd.Series(r, index=returns.index)
    return null_returns</code></pre></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;39c8372e-05f7-475a-8f94-92197ab2b9d8&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">null_rets_d = generate_env_d(returns, seed=42)
results_d = walk_forward(null_rets_d)
print(results_d[["start", "best_short", "best_long", "z_IS", "z_OOS"]])</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CPKM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc771e02a-b909-410d-aacf-ffa276b0f4f7_446x100.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CPKM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc771e02a-b909-410d-aacf-ffa276b0f4f7_446x100.png 424w, https://substackcdn.com/image/fetch/$s_!CPKM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc771e02a-b909-410d-aacf-ffa276b0f4f7_446x100.png 848w, https://substackcdn.com/image/fetch/$s_!CPKM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc771e02a-b909-410d-aacf-ffa276b0f4f7_446x100.png 1272w, https://substackcdn.com/image/fetch/$s_!CPKM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc771e02a-b909-410d-aacf-ffa276b0f4f7_446x100.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CPKM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc771e02a-b909-410d-aacf-ffa276b0f4f7_446x100.png" width="446" height="100" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c771e02a-b909-410d-aacf-ffa276b0f4f7_446x100.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:100,&quot;width&quot;:446,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:10485,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/194942463?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc771e02a-b909-410d-aacf-ffa276b0f4f7_446x100.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!CPKM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc771e02a-b909-410d-aacf-ffa276b0f4f7_446x100.png 424w, https://substackcdn.com/image/fetch/$s_!CPKM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc771e02a-b909-410d-aacf-ffa276b0f4f7_446x100.png 848w, https://substackcdn.com/image/fetch/$s_!CPKM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc771e02a-b909-410d-aacf-ffa276b0f4f7_446x100.png 1272w, https://substackcdn.com/image/fetch/$s_!CPKM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc771e02a-b909-410d-aacf-ffa276b0f4f7_446x100.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3>Environment E: Volatility Clustering Null (GARCH(1,1), Zero Mean)</h3><p>This environment produces volatility clustering while preserving a zero conditional mean:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\begin{align}\nr_t &amp;= \\sqrt{h_t}z_t, \\quad z_t \\sim \\mathcal{N}(0,1), \\\\\nh_t &amp;= \\omega + \\alpha r_{t-1}^2 + \\beta h_{t-1}.\n\\end{align}&quot;,&quot;id&quot;:&quot;QIBVMOKLHZ&quot;}" data-component-name="LatexBlockToDOM"></div><p>Conditional on F_{t-1}^(r), h_t is measurable and E[z_t] = 0, hence E[r_t | F_{t-1}^(r)] = 0.</p><p>The paper sets alpha = 0.10, beta = 0.85 (so alpha + beta = 0.95 &lt; 1). They chose omega to match the target daily variance. Let</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\sigma_{\\text{daily}} = \\frac{\\sigma_{\\text{ann}}}{\\sqrt{365}}, \\quad \\sigma_{\\text{ann}} = 0.20.&quot;,&quot;id&quot;:&quot;DXYUCBJZQP&quot;}" data-component-name="LatexBlockToDOM"></div><p>Then</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\omega = (1-\\alpha-\\beta)\\sigma^2_{\\text{daily}}.&quot;,&quot;id&quot;:&quot;WRBXZGPBKH&quot;}" data-component-name="LatexBlockToDOM"></div><p>When volatility is highly persistent (high alpha + beta), your return series has strong conditional heteroskedasticity. The HAC t-statistic assumes the variance estimator converges to the true long-run variance, but with finite OOS windows (6 months in our case) and persistent GARCH dynamics, the Newey-West estimator can underestimate the true variance, making your t-statistic look more significant than it really is. So we might report a significant Z_OOS^* not because we found alpha, but because the GARCH vol clustering causes the standard error to be underestimated, inflating the t-statistic artificially.</p><p>Here&#8217;s the implementation:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;b69fe347-0194-4206-bcaa-0149a870125a&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">def generate_env_e(returns, alpha=0.10, beta=0.85, sigma_ann=0.20, seed=None):
    if seed is not None:
        np.random.seed(seed)
    sigma_daily = sigma_ann / np.sqrt(365)
    omega = (1 - alpha - beta) * sigma_daily**2
    
    T = len(returns)
    r = np.zeros(T)
    h = np.zeros(T)
    h[0] = sigma_daily**2
    
    z = np.random.normal(0, 1, T)
    for t in range(1, T):
        h[t] = omega + alpha * r[t-1]**2 + beta * h[t-1]
        r[t] = np.sqrt(h[t]) * z[t]
    
    null_returns = pd.Series(r, index=returns.index)
    return null_returns</code></pre></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;239a5174-fee5-495d-b67d-1eeef62e93c2&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">null_rets_e = generate_env_e(returns, seed=42)
results_e = walk_forward(null_rets_e)
print(results_e[["start", "best_short", "best_long", "z_IS", "z_OOS"]])</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!kOKl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc22a7b83-576a-4660-9a6d-0b53731a0d65_437x102.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kOKl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc22a7b83-576a-4660-9a6d-0b53731a0d65_437x102.png 424w, https://substackcdn.com/image/fetch/$s_!kOKl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc22a7b83-576a-4660-9a6d-0b53731a0d65_437x102.png 848w, https://substackcdn.com/image/fetch/$s_!kOKl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc22a7b83-576a-4660-9a6d-0b53731a0d65_437x102.png 1272w, https://substackcdn.com/image/fetch/$s_!kOKl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc22a7b83-576a-4660-9a6d-0b53731a0d65_437x102.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kOKl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc22a7b83-576a-4660-9a6d-0b53731a0d65_437x102.png" width="437" height="102" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c22a7b83-576a-4660-9a6d-0b53731a0d65_437x102.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:102,&quot;width&quot;:437,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:10003,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/194942463?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc22a7b83-576a-4660-9a6d-0b53731a0d65_437x102.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!kOKl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc22a7b83-576a-4660-9a6d-0b53731a0d65_437x102.png 424w, https://substackcdn.com/image/fetch/$s_!kOKl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc22a7b83-576a-4660-9a6d-0b53731a0d65_437x102.png 848w, https://substackcdn.com/image/fetch/$s_!kOKl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc22a7b83-576a-4660-9a6d-0b53731a0d65_437x102.png 1272w, https://substackcdn.com/image/fetch/$s_!kOKl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc22a7b83-576a-4660-9a6d-0b53731a0d65_437x102.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3>Full Stage 1 Run</h3><p>So far, we&#8217;ve only tested one realization per null-environment, which can look good or bad by chance. It&#8217;s much better to run on each null environment M (= 100) times and compute Z_OOS^* for each run. The pipeline is falsified for the environment e if the fraction of runs exceeding 1.96 is significantly higher than 5%:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\text{Rejection Rate}_e = \\frac{1}{M} \\sum_{m=1}^M \\textbf{1}(Z_{OOS,e,m}^* > 1.96).&quot;,&quot;id&quot;:&quot;BTDMSCCZPC&quot;}" data-component-name="LatexBlockToDOM"></div><p>Under the null, this should be ~5% by construction. If it&#8217;s materially higher, your pipeline is systematically finding significance in null data, which means it&#8217;s broken. </p><p>Under the null, each run has a 5% chance of exceeding 1.96. With M=100 runs, the number of rejections follows</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot; X \\sim \\text{Binomial}(100, 0.05).&quot;,&quot;id&quot;:&quot;SFODYVCTAX&quot;}" data-component-name="LatexBlockToDOM"></div><p>The 95th percentile of this distribution gives you the threshold that is exceeded only 5% of the time by chance.</p><p>Note: This part differs from how the paper things! </p><p>Let&#8217;s run this for our pipeline:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;a0d5d9d2-6325-41e1-800f-819403939117&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">from scipy.stats import binom

def run_null_environment(generate_fn, returns, M=100, **kwargs):
    z_IS_list = []
    z_OOS_list = []
    
    for m in range(M):
        null_rets = generate_fn(returns, seed=m, **kwargs)
        results = walk_forward(null_rets)
        all_rets_OOS = pd.concat(results["rets_OOS"].tolist())
        z_star_IS = results["z_IS"].abs().mean()
        z_star_OOS = abs(hac_tstat(all_rets_OOS))
        z_IS_list.append(z_star_IS)
        z_OOS_list.append(z_star_OOS)
    
    return {
        "z_IS_mean": np.mean(z_IS_list),
        "z_IS_std": np.std(z_IS_list),
        "z_OOS_mean": np.mean(z_OOS_list),
        "z_OOS_std": np.std(z_OOS_list),
        "z_OOS_99pct": np.quantile(z_OOS_list, 0.99),
        "rejection_rate": np.mean(np.array(z_OOS_list) &gt; 1.96)
    }

rejection_rate_threshold = binom.ppf(0.95, n=100, p=0.05) / 100

envs = {
    "A: White Noise": (generate_env_a, {}),
    "B: Regime Vol": (generate_env_b, {}),
    "C: Bid-Ask Bounce": (generate_env_c, {}),
    "D: Factor Null": (generate_env_d, {}),
    "E: GARCH": (generate_env_e, {})
}

rows = []
for name, (fn, kwargs) in envs.items():
    print(f"Running {name}...")
    res = run_null_environment(fn, returns, M=100, **kwargs)
    rows.append({"Environment": name, **res})

summary = pd.DataFrame(rows).set_index("Environment")
summary["Falsified"] = summary["rejection_rate"] &gt; rejection_rate_threshold
print(f"\nRejection rate threshold (5% significance): {rejection_rate_threshold:.3f}")
print(summary[["z_IS_mean", "z_IS_std", "z_OOS_mean", "z_OOS_std", "z_OOS_99pct", "rejection_rate", "Falsified"]])</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NIHc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45dd70cc-ed89-4db0-b43c-b7ac21365546_604x419.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NIHc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45dd70cc-ed89-4db0-b43c-b7ac21365546_604x419.png 424w, https://substackcdn.com/image/fetch/$s_!NIHc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45dd70cc-ed89-4db0-b43c-b7ac21365546_604x419.png 848w, https://substackcdn.com/image/fetch/$s_!NIHc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45dd70cc-ed89-4db0-b43c-b7ac21365546_604x419.png 1272w, https://substackcdn.com/image/fetch/$s_!NIHc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45dd70cc-ed89-4db0-b43c-b7ac21365546_604x419.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NIHc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45dd70cc-ed89-4db0-b43c-b7ac21365546_604x419.png" width="604" height="419" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/45dd70cc-ed89-4db0-b43c-b7ac21365546_604x419.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:419,&quot;width&quot;:604,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:41283,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/194942463?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45dd70cc-ed89-4db0-b43c-b7ac21365546_604x419.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!NIHc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45dd70cc-ed89-4db0-b43c-b7ac21365546_604x419.png 424w, https://substackcdn.com/image/fetch/$s_!NIHc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45dd70cc-ed89-4db0-b43c-b7ac21365546_604x419.png 848w, https://substackcdn.com/image/fetch/$s_!NIHc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45dd70cc-ed89-4db0-b43c-b7ac21365546_604x419.png 1272w, https://substackcdn.com/image/fetch/$s_!NIHc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45dd70cc-ed89-4db0-b43c-b7ac21365546_604x419.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>As you can see, our pipeline only has a significantly high rejection rate for the Factor Null, which is to be expected with a strategy like ours and doesn&#8217;t mean we have a look-ahead or anything. We can safely proceed to stage 2.</p><div><hr></div><h1>Stage 2: Inflation Quantification</h1><p>Now that we know that our pipeline itself is not broken, we wanna figure out how inflated the in-sample results are. </p><h3>Effective Multiplicity K_eff</h3><p>When you search over K configurations and pick the best one, not all K configurations are truly independent. Two MA crossover strategies with parameters (10, 50) and (10, 60) will produce highly correlated return streams. Treating them as independent searches overstates how much you&#8217;ve actually explored the strategy space. </p><p>K_eff measures the true dimensionality of your search, how many genuinely independent configurations you actually tried.</p><p>Here&#8217;s how to compute it: <br>For each candidate configuration k, collect its in-sample return stream </p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\{R_{t,k}\\}_{t\\in T_{IS}}&quot;,&quot;id&quot;:&quot;NSAMBUHVYA&quot;}" data-component-name="LatexBlockToDOM"></div><p> Stack all K return streams into a T_{IS} x K matrix and compute the K x K correlation matrix Sigma, where entry (i,j) is the correlation between strategy i and strategy j&#8217;s returns.</p><p>The effective multiplicity is the spectral participation ratio of Sigma:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;K_{\\text{eff}} = \\frac{(\\text{tr} \\Sigma)^2}{||\\Sigma||^2_F}=\\frac{(\\sum_i \\lambda_i)^2}{\\sum_i \\lambda_i^2}&quot;,&quot;id&quot;:&quot;JXLPBOPLIA&quot;}" data-component-name="LatexBlockToDOM"></div><p>where lambda_i are the eigenvalues of Sigma. Since Sigma is a correlation matrix, we have tr Sigma = K, so</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;K_\\text{eff} = \\frac{K^2}{||\\Sigma||_F^2}.&quot;,&quot;id&quot;:&quot;KGLYADUMRL&quot;}" data-component-name="LatexBlockToDOM"></div><p>If all strategies are identical, one eigenvalue equals K, the rest are 0, so K_eff = 1.<br>If, on the other hand, all strategies are independent, all eigenvalues equal 1, and K_eff = K.</p><p>When K is large relative to your in-sample period T_IS, the sample correlation matrix becomes numerically unreliable. You can improve the reliability of your correlation matrix using shrinkage techniques, which I discuss in the following article:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;282e5efd-51af-4e92-9972-e4d5c323728c&quot;,&quot;caption&quot;:&quot;2 of the most common problems we face when building trading models are overfitting and colinearity. Regularization is a technique that we can use to combat both of those problems.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Avoiding Overfitting and Colinearity with Regularization&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:128680675,&quot;name&quot;:&quot;Vertox&quot;,&quot;bio&quot;:&quot;Quantitative Researcher in Digital Asset Markets | Market Making | Statistical Arbitrage | Options &quot;,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!HGUA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bf3fd86-d46a-4caa-969a-d80059b72cb9_128x128.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2025-05-05T12:53:54.222Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f6d2a7e-aec1-43d6-b904-19e9921e6da3_562x455.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.vertoxquant.com/p/avoiding-overfitting-and-colinearity&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:162838681,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:11,&quot;comment_count&quot;:0,&quot;publication_id&quot;:1726874,&quot;publication_name&quot;:&quot;VertoxQuant&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!ufaQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>Your expected best in-sample t-statistic under the null is</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\mathbb{E}[Z_{IS}^*] \\approx a_{2 K_\\text{eff}} +\\gamma b_{2 K_\\text{eff}}.&quot;,&quot;id&quot;:&quot;PYBNCRQMFP&quot;}" data-component-name="LatexBlockToDOM"></div><p>So K_eff directly determines how inflated your in-sample results are expected to be.</p><p>Now, different optimization techniques will yield different K_eff for the same K. A grid search is likely gonna result in a larger K_eff than Bayesian optimization with optuna. Let&#8217;s put this to the test. To prevent numerical issues, since we are working with daily data and only have 1477 observations, I will use the full dataset as an 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_!NzDd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c5a0ac2-d023-4c25-a9e6-9b9450d9f31d_790x490.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NzDd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c5a0ac2-d023-4c25-a9e6-9b9450d9f31d_790x490.png 424w, https://substackcdn.com/image/fetch/$s_!NzDd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c5a0ac2-d023-4c25-a9e6-9b9450d9f31d_790x490.png 848w, https://substackcdn.com/image/fetch/$s_!NzDd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c5a0ac2-d023-4c25-a9e6-9b9450d9f31d_790x490.png 1272w, https://substackcdn.com/image/fetch/$s_!NzDd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c5a0ac2-d023-4c25-a9e6-9b9450d9f31d_790x490.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NzDd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c5a0ac2-d023-4c25-a9e6-9b9450d9f31d_790x490.png" width="790" height="490" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6c5a0ac2-d023-4c25-a9e6-9b9450d9f31d_790x490.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:490,&quot;width&quot;:790,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:43533,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/194942463?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c5a0ac2-d023-4c25-a9e6-9b9450d9f31d_790x490.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!NzDd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c5a0ac2-d023-4c25-a9e6-9b9450d9f31d_790x490.png 424w, https://substackcdn.com/image/fetch/$s_!NzDd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c5a0ac2-d023-4c25-a9e6-9b9450d9f31d_790x490.png 848w, https://substackcdn.com/image/fetch/$s_!NzDd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c5a0ac2-d023-4c25-a9e6-9b9450d9f31d_790x490.png 1272w, https://substackcdn.com/image/fetch/$s_!NzDd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c5a0ac2-d023-4c25-a9e6-9b9450d9f31d_790x490.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 result is REALLY interesting. Because optuna causes all our candidates to cluster in one space, K_eff actually DECREASES as you increase K. For grid search, it increases as expected. It&#8217;s also bigger than Grid Search for small values of K because it&#8217;s still in its exploration phase. TPE hasn&#8217;t accumulated enough trials to identify the promising region yet, so it samples more diversely across the parameter space. This gives a higher K_eff than grid search, which randomly but uniformly samples. As K grows, Optuna transitions to exploitation; it concentrates trials around the best configs it found, collapsing K_eff.</p><p>Our K_eff are also really small; we effectively only test 1-2 unique configurations. This makes sense with our simple moving average crossover strategy, though; there is not much variation across strategies.</p><h3>Backtest Inflation: Delta Z</h3><p>We now have a way to measure how many truly independent searches we performed. But we still need to quantify how much our in-sample result was inflated by that search.</p><p>The absolute magnitude gap Delta Z measures the divergence between your optimized in-sample evidence and its walk-forward realization:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\Delta Z = Z_{IS}^* - Z_{OOS}^*.&quot;,&quot;id&quot;:&quot;XLRIMTMUCS&quot;}" data-component-name="LatexBlockToDOM"></div><p>Z_OOS^* stays bound regardless of how much you searched. Meanwhile, Z_IS^* grows with K_eff, so Delta Z directly captures the inflation induced by your search.</p><p>The expected Delta Z under the null, when there is no real alpha, is:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\mathbb{E}[\\Delta Z| H_0] \\approx a_{2 K_\\text{eff}} + \\gamma b_{2 K_\\text{eff}} - \\sqrt{\\frac{2}{\\pi}},&quot;,&quot;id&quot;:&quot;HUGUORAQQR&quot;}" data-component-name="LatexBlockToDOM"></div><p>where sqrt(2/pi), around 0.80, is the expected absolute value of a standard normal, which Z_OOS^* should be under the null. </p><p>Let&#8217;s use this to test our walk-forward pipeline using both optuna and a grid-search for K=50:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;a30a38d3-6574-479c-bbc1-fd31af37de0d&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">def walk_forward_grid(returns, K=50, in_sample_days=365*2, out_sample_days=180):
    short_grid = range(2, 201, 1)
    long_grid = range(10, 1001, 1)
    configs = [(s, l) for s in short_grid for l in long_grid if s &lt; l]
    np.random.seed(42)
    configs = [configs[i] for i in np.random.choice(len(configs), min(K, len(configs)), replace=False)]
    
    results = []
    starts = range(0, len(returns) - in_sample_days - out_sample_days, out_sample_days)
    
    for start in starts:
        r_IS = returns.iloc[start : start + in_sample_days]
        r_OOS = returns.iloc[start + in_sample_days : start + in_sample_days + out_sample_days]
        
        best_z, best_short, best_long = -np.inf, None, None
        for s, l in configs:
            sig = ma_signal(r_IS, s, l).shift(1).dropna()
            strat_rets = (r_IS * sig).dropna()
            if len(strat_rets) &lt; 30:
                continue
            z = hac_tstat(strat_rets)
            if z &gt; best_z:
                best_z = z
                best_short, best_long = s, l
        
        sig_OOS = ma_signal(r_OOS, best_short, best_long).shift(1).dropna()
        strat_rets_OOS = (r_OOS * sig_OOS).dropna()
        z_OOS = hac_tstat(strat_rets_OOS)
        
        results.append({
            "start": returns.index[start],
            "best_short": best_short,
            "best_long": best_long,
            "z_IS": best_z,
            "z_OOS": z_OOS,
            "rets_OOS": strat_rets_OOS
        })
    
    return pd.DataFrame(results)

def walk_forward_optuna(returns, K=50, in_sample_days=365*2, out_sample_days=180):
    results = []
    starts = range(0, len(returns) - in_sample_days - out_sample_days, out_sample_days)
    
    for start in starts:
        r_IS = returns.iloc[start : start + in_sample_days]
        r_OOS = returns.iloc[start + in_sample_days : start + in_sample_days + out_sample_days]
        
        def objective(trial):
            s = trial.suggest_int("short", 2, 200)
            l = trial.suggest_int("long", 10, 1000)
            if s &gt;= l:
                return -np.inf
            sig = ma_signal(r_IS, s, l).shift(1)
            strat_ret = (r_IS * sig).dropna()
            if len(strat_ret) &lt; 30:
                return -np.inf
            return hac_tstat(strat_ret)
        
        study = optuna.create_study(direction="maximize",
                                    sampler=optuna.samplers.TPESampler(seed=42))
        optuna.logging.set_verbosity(optuna.logging.WARNING)
        study.optimize(objective, n_trials=K)
        
        best_short = study.best_params["short"]
        best_long = study.best_params["long"]
        best_z = study.best_value
        
        sig_OOS = ma_signal(r_OOS, best_short, best_long).shift(1).dropna()
        strat_rets_OOS = (r_OOS * sig_OOS).dropna()
        z_OOS = hac_tstat(strat_rets_OOS)
        
        results.append({
            "start": returns.index[start],
            "best_short": best_short,
            "best_long": best_long,
            "z_IS": best_z,
            "z_OOS": z_OOS,
            "rets_OOS": strat_rets_OOS
        })
    
    return pd.DataFrame(results)

results_grid = walk_forward_grid(returns, K=50)
results_optuna = walk_forward_optuna(returns, K=50)

fig, axes = plt.subplots(1, 2, figsize=(12, 5))

for ax, (name, res) in zip(axes, [("Grid Search", results_grid), ("Optuna", results_optuna)]):
    delta_z = res["z_IS"] - res["z_OOS"]
    x = range(len(res))
    
    ax.bar(x, res["z_IS"], label="$Z^*_{IS}$", alpha=0.7)
    ax.bar(x, res["z_OOS"], label="$Z^*_{OOS}$", alpha=0.7)
    ax.axhline(0, color="black", linewidth=0.8)
    ax.set_xticks(list(x))
    ax.set_xticklabels(res["start"].tolist(), rotation=45, ha="right")
    ax.set_title(f"{name} &#8212; $\\Delta Z$ = {delta_z.mean():.2f}")
    ax.set_ylabel("$Z$")
    ax.legend()

plt.tight_layout()
plt.show()</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dGT1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa69b2d3c-9b3d-4061-acc8-187a879e5537_1189x490.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dGT1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa69b2d3c-9b3d-4061-acc8-187a879e5537_1189x490.png 424w, https://substackcdn.com/image/fetch/$s_!dGT1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa69b2d3c-9b3d-4061-acc8-187a879e5537_1189x490.png 848w, https://substackcdn.com/image/fetch/$s_!dGT1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa69b2d3c-9b3d-4061-acc8-187a879e5537_1189x490.png 1272w, https://substackcdn.com/image/fetch/$s_!dGT1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa69b2d3c-9b3d-4061-acc8-187a879e5537_1189x490.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dGT1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa69b2d3c-9b3d-4061-acc8-187a879e5537_1189x490.png" width="1189" height="490" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a69b2d3c-9b3d-4061-acc8-187a879e5537_1189x490.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:490,&quot;width&quot;:1189,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:34992,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/194942463?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa69b2d3c-9b3d-4061-acc8-187a879e5537_1189x490.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dGT1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa69b2d3c-9b3d-4061-acc8-187a879e5537_1189x490.png 424w, https://substackcdn.com/image/fetch/$s_!dGT1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa69b2d3c-9b3d-4061-acc8-187a879e5537_1189x490.png 848w, https://substackcdn.com/image/fetch/$s_!dGT1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa69b2d3c-9b3d-4061-acc8-187a879e5537_1189x490.png 1272w, https://substackcdn.com/image/fetch/$s_!dGT1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa69b2d3c-9b3d-4061-acc8-187a879e5537_1189x490.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>Both produce pretty bad strategies OOS. Let&#8217;s compare for different values of K now:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;bb959ae0-10f6-4c79-bc87-76bec6be5d00&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">def theoretical_z_IS(keff):
    a = np.sqrt(2 * np.log(2 * keff)) - (np.log(np.log(2 * keff)) + np.log(4 * np.pi)) / (2 * np.sqrt(2 * np.log(2 * keff)))
    b = 1 / np.sqrt(2 * np.log(2 * keff))
    gamma = 0.5772
    return a + gamma * b

all_grid_results = {}
all_optuna_results = {}
all_keff_grid = {}
all_keff_optuna = {}

for K in K_values:
    print(f"K={K}...")
    all_grid_results[K] = walk_forward_grid(returns, K=K)
    all_optuna_results[K] = walk_forward_optuna(returns, K=K)
    all_keff_grid[K] = compute_keff(get_grid_search_returns(returns.iloc[:365*2], K))
    all_keff_optuna[K] = compute_keff(get_optuna_returns(returns.iloc[:365*2], K))

fig, axes = plt.subplots(4, 2, figsize=(12, 16))

for fold_idx in range(4):
    ax_z = axes[fold_idx, 0]
    ax_dz = axes[fold_idx, 1]

    grid_z_IS = [all_grid_results[K]["z_IS"].iloc[fold_idx] for K in K_values]
    optuna_z_IS = [all_optuna_results[K]["z_IS"].iloc[fold_idx] for K in K_values]
    theoretical_grid = [theoretical_z_IS(all_keff_grid[K]) for K in K_values]
    theoretical_optuna = [theoretical_z_IS(all_keff_optuna[K]) for K in K_values]
    grid_delta_z = [all_grid_results[K]["z_IS"].iloc[fold_idx] - all_grid_results[K]["z_OOS"].iloc[fold_idx] for K in K_values]
    optuna_delta_z = [all_optuna_results[K]["z_IS"].iloc[fold_idx] - all_optuna_results[K]["z_OOS"].iloc[fold_idx] for K in K_values]

    ax_z.plot(K_values, grid_z_IS, marker="o", label="Grid Search")
    ax_z.plot(K_values, optuna_z_IS, marker="s", label="Optuna (TPE)")
    ax_z.plot(K_values, theoretical_grid, linestyle="--", color="blue", label="Theoretical (Grid)")
    ax_z.plot(K_values, theoretical_optuna, linestyle="--", color="orange", label="Theoretical (Optuna)")
    ax_z.set_xlabel("Nominal $K$")
    ax_z.set_ylabel("$Z^*_{IS}$")
    ax_z.set_title(f"Fold {fold_idx + 1} &#8212; $Z^*_{{IS}}$")
    ax_z.legend()

    ax_dz.plot(K_values, grid_delta_z, marker="o", label="Grid Search")
    ax_dz.plot(K_values, optuna_delta_z, marker="s", label="Optuna (TPE)")
    ax_dz.set_xlabel("Nominal $K$")
    ax_dz.set_ylabel("$\\Delta Z$")
    ax_dz.set_title(f"Fold {fold_idx + 1} &#8212; $\\Delta Z$")
    ax_dz.legend()

plt.tight_layout()
plt.show()</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ZHFH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdb51381-effc-488e-9408-638e0279e12d_1189x1590.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZHFH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdb51381-effc-488e-9408-638e0279e12d_1189x1590.png 424w, https://substackcdn.com/image/fetch/$s_!ZHFH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdb51381-effc-488e-9408-638e0279e12d_1189x1590.png 848w, https://substackcdn.com/image/fetch/$s_!ZHFH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdb51381-effc-488e-9408-638e0279e12d_1189x1590.png 1272w, https://substackcdn.com/image/fetch/$s_!ZHFH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdb51381-effc-488e-9408-638e0279e12d_1189x1590.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZHFH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdb51381-effc-488e-9408-638e0279e12d_1189x1590.png" width="1189" height="1590" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bdb51381-effc-488e-9408-638e0279e12d_1189x1590.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1590,&quot;width&quot;:1189,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:164508,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/194942463?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdb51381-effc-488e-9408-638e0279e12d_1189x1590.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ZHFH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdb51381-effc-488e-9408-638e0279e12d_1189x1590.png 424w, https://substackcdn.com/image/fetch/$s_!ZHFH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdb51381-effc-488e-9408-638e0279e12d_1189x1590.png 848w, https://substackcdn.com/image/fetch/$s_!ZHFH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdb51381-effc-488e-9408-638e0279e12d_1189x1590.png 1272w, https://substackcdn.com/image/fetch/$s_!ZHFH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdb51381-effc-488e-9408-638e0279e12d_1189x1590.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>Your goal when designing a parameter optimization pipeline is to minimize Delta Z, while maximizing Z_OOS^*.</p><p>One decision rule for rejecting our pipeline could be:</p><p>Run M (= 100) white noise simulations, compute Delta Z for each, take the 99th percentile as your threshold, and if your observed Delta Z on real data exceeds this, falsify the pipeline.</p><div><hr></div><h1>Limitations</h1><h3>Sparse signals won&#8217;t be detected</h3><p>If you have a strategy that rarely trades, like an event-based strategy, the walk-forward window simply won&#8217;t contain enough activations to reach significance even if the signal is genuine.</p><h3>Passing doesn&#8217;t guarantee live performance</h3><p>The audit is a stress test. A strategy can pass all 5 null environments, have a small Delta Z, and still lose money in live trading due to regime changes, liquidity constraints, or market impact. The audit only tells you your pipeline isn&#8217;t obviously broken.</p><h3>Only for return prediction</h3><p>The framework, as implemented, is designed for directional strategies with a well-defined trading lag. It doesn&#8217;t directly extend to portfolio optimization, classification tasks, volatility forecasting, or multi-asset strategies without adaptation.</p><div><hr></div><h1>Conclusion</h1><p>Most quant researchers stress test their strategies manually and sporadically. This falsification framework can be permanently built into your research pipeline, running automatically every time you evaluate a new strategy or retune an existing one. Think of it like unit tests in software engineering: you don&#8217;t run them once before shipping, you run them on every commit.</p><p>Concretely, this means: every time your walk-forward backtest completes, Stage 1 and Stage 2 run automatically alongside it. Your research dashboard shows not just the equity curve and Sharpe ratio, but K_eff, Delta Z, and the Stage 1 rejection rates for all 5 environments. A strategy only advances to paper trading if it passes all steps, not because it looked good in-sample.</p><p>Join Quant Corner: <a href="https://discord.gg/X7TsxKNbXg">https://discord.gg/X7TsxKNbXg</a></p>]]></content:encoded></item><item><title><![CDATA[Strategy Decay Detection: Building a Warning System for Alpha Erosion]]></title><description><![CDATA[Knowing when to pull the plug]]></description><link>https://www.vertoxquant.com/p/strategy-decay-detection</link><guid isPermaLink="false">https://www.vertoxquant.com/p/strategy-decay-detection</guid><dc:creator><![CDATA[Vertox]]></dc:creator><pubDate>Tue, 14 Apr 2026 09:17:32 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Yd5E!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4f0da95-24ec-4bd1-9b6f-73a13887cf7a_1189x2390.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Imagine the following: You spend weeks working on a strategy, the backtest looks great, a Sharpe of 1.5. You decide to go live, and it slowly and quietly stops working.<br>Did you overfit? Or maybe it&#8217;s alpha decay? </p><p>Everyone talks about alpha decay, but no one tells you how to actually quantify it. In this article, we&#8217;ll figure out how to do so and build a warning system that tells you when it&#8217;s time to pull the plug on a strategy.</p><p>We do this by implementing Minimum Regime Performance (MRP), a framework introduced by Alexander and Fabozzi (2026) that measures how a strategy holds up across structurally distinct market regimes. We will apply this method to a universe of crypto factors.</p><p>Beyond signal monitoring, MRP is also relevant in portfolio construction. Just as you would punish strategy tail risk like Value at Risk, you can also punish strategies that have a high tendency to decay. </p><p>The article will use the factors discussed in the following article:</p><div class="embedded-post-wrap" data-attrs="{&quot;id&quot;:185829391,&quot;url&quot;:&quot;https://www.vertoxquant.com/p/the-myth-of-factor-free-crypto&quot;,&quot;publication_id&quot;:1726874,&quot;publication_name&quot;:&quot;VertoxQuant&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!ufaQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png&quot;,&quot;title&quot;:&quot;The Myth of Factor-Free Crypto&quot;,&quot;truncated_body_text&quot;:&quot;People keep telling you to take what works in equities and apply it to crypto.&quot;,&quot;date&quot;:&quot;2026-01-27T11:58:38.274Z&quot;,&quot;like_count&quot;:9,&quot;comment_count&quot;:0,&quot;bylines&quot;:[{&quot;id&quot;:128680675,&quot;name&quot;:&quot;Vertox&quot;,&quot;handle&quot;:&quot;vertox&quot;,&quot;previous_name&quot;:null,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!HGUA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bf3fd86-d46a-4caa-969a-d80059b72cb9_128x128.jpeg&quot;,&quot;bio&quot;:&quot;Quantitative Researcher in Digital Asset Markets | Market Making | Statistical Arbitrage | Options &quot;,&quot;profile_set_up_at&quot;:&quot;2023-06-12T09:38:30.926Z&quot;,&quot;reader_installed_at&quot;:&quot;2023-06-12T09:50:35.665Z&quot;,&quot;publicationUsers&quot;:[{&quot;id&quot;:1706583,&quot;user_id&quot;:128680675,&quot;publication_id&quot;:1726874,&quot;role&quot;:&quot;admin&quot;,&quot;public&quot;:true,&quot;is_primary&quot;:true,&quot;publication&quot;:{&quot;id&quot;:1726874,&quot;name&quot;:&quot;VertoxQuant&quot;,&quot;subdomain&quot;:&quot;vertox&quot;,&quot;custom_domain&quot;:&quot;www.vertoxquant.com&quot;,&quot;custom_domain_optional&quot;:false,&quot;hero_text&quot;:&quot;Applied quantitative research on trading, risk, and systematic strategy design.&quot;,&quot;logo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png&quot;,&quot;author_id&quot;:128680675,&quot;primary_user_id&quot;:128680675,&quot;theme_var_background_pop&quot;:&quot;#9A6600&quot;,&quot;created_at&quot;:&quot;2023-06-12T09:38:54.325Z&quot;,&quot;email_from_name&quot;:null,&quot;copyright&quot;:&quot;Vertox&quot;,&quot;founding_plan_name&quot;:null,&quot;community_enabled&quot;:true,&quot;invite_only&quot;:false,&quot;payments_state&quot;:&quot;enabled&quot;,&quot;language&quot;:null,&quot;explicit&quot;:false,&quot;homepage_type&quot;:&quot;newspaper&quot;,&quot;is_personal_mode&quot;:false,&quot;logo_url_wide&quot;:null}}],&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100,&quot;status&quot;:{&quot;bestsellerTier&quot;:100,&quot;subscriberTier&quot;:null,&quot;leaderboard&quot;:null,&quot;vip&quot;:false,&quot;badge&quot;:{&quot;type&quot;:&quot;bestseller&quot;,&quot;tier&quot;:100},&quot;paidPublicationIds&quot;:[],&quot;subscriber&quot;:null}}],&quot;utm_campaign&quot;:null,&quot;belowTheFold&quot;:false,&quot;type&quot;:&quot;newsletter&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="EmbeddedPostToDOM"><a class="embedded-post" native="true" href="https://www.vertoxquant.com/p/the-myth-of-factor-free-crypto?utm_source=substack&amp;utm_campaign=post_embed&amp;utm_medium=web"><div class="embedded-post-header"><img class="embedded-post-publication-logo" src="https://substackcdn.com/image/fetch/$s_!ufaQ!,w_56,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png"><span class="embedded-post-publication-name">VertoxQuant</span></div><div class="embedded-post-title-wrapper"><div class="embedded-post-title">The Myth of Factor-Free Crypto</div></div><div class="embedded-post-body">People keep telling you to take what works in equities and apply it to crypto&#8230;</div><div class="embedded-post-cta-wrapper"><span class="embedded-post-cta">Read more</span></div><div class="embedded-post-meta">3 months ago &#183; 9 likes &#183; Vertox</div></a></div><p>Knowledge of regime switching models is NOT required.</p><div><hr></div><p>I write about quantitative trading the way it&#8217;s actually practiced:<br>Robust models and portfolios, combining signals and strategies, understanding the assumptions behind your models.</p><p>More broadly, I write about:</p><ul><li><p>Statistical and cross-sectional arbitrage</p></li><li><p>Managing multiple strategies and signals</p></li><li><p>Risk and capital allocation</p></li><li><p>Research tooling and methodology</p></li><li><p>In-depth model assumptions and derivations</p></li></ul><p>If this way of thinking resonates, you&#8217;ll probably like what I publish.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.vertoxquant.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">VertoxQuant is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</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>
          <a href="https://www.vertoxquant.com/p/strategy-decay-detection">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[If you share this, you get paid back]]></title><description><![CDATA[Referral rewards are now live]]></description><link>https://www.vertoxquant.com/p/if-you-share-this-you-get-paid-back</link><guid isPermaLink="false">https://www.vertoxquant.com/p/if-you-share-this-you-get-paid-back</guid><dc:creator><![CDATA[Vertox]]></dc:creator><pubDate>Wed, 08 Apr 2026 10:52:46 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ufaQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The Substack grows almost entirely through word of mouth. So I&#8217;m rewarding people who share it: </p><ul><li><p>1 referral &#8594; 20% off</p></li><li><p>5 referrals &#8594; 1 month free</p></li><li><p>25 referrals &#8594; 6 months free</p></li></ul><p>If you&#8217;ve gotten value from it, help me grow by recommending it. It costs you nothing! </p><p>You can find your personal referral link at the bottom of this email or right here: </p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.vertoxquant.com/leaderboard&quot;,&quot;text&quot;:&quot;Leaderboard&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.vertoxquant.com/leaderboard"><span>Leaderboard</span></a></p><p>Thanks!</p><p>-Vertox</p>]]></content:encoded></item><item><title><![CDATA[Looking Inside The Black Box]]></title><description><![CDATA[Model-agnostic interpretable machine learning]]></description><link>https://www.vertoxquant.com/p/looking-inside-the-black-box</link><guid isPermaLink="false">https://www.vertoxquant.com/p/looking-inside-the-black-box</guid><dc:creator><![CDATA[Vertox]]></dc:creator><pubDate>Sun, 05 Apr 2026 01:24:47 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!JtoU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b1c8fb9-1162-43d1-8c86-ade28ac62021_889x390.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>People often criticise how ML models are just black boxes that take in some features and spit out a prediction. While some models (like linear regression) are naturally a lot more interpretable than others (like neural networks), it&#8217;s wrong that you can&#8217;t figure out why a model made a certain prediction and how the different features affect the prediction.</p><p>In this article, we will look at some useful model-agnostic methods (meaning that it doesn&#8217;t matter what model we apply it to) for figuring out why one specific prediction is what it is (Local Methods) and why predictions are what they are on average (Global Methods).</p><p>This is important for a few very important reasons.</p><ol><li><p><strong>Detecting problems in the model:</strong><br>Say you built a model that forecasts raw returns, and you see that the error has a lower error than some baseline model. A lot of people would quit here, but you dig deeper and find out that the only feature that matters to the model is volatility, and that the only thing that the model learned to do well is predict the magnitude of the return, not the sign. Suddenly, the model is completely useless for what it was supposed to do!</p></li><li><p><strong>Regulatory &amp; risk management requirements</strong>:</p><p>Regulators increasingly require that automated trading and risk models be explainable. If your model flags a position as too risky or generates a trade signal, compliance needs to know <em>why</em>. A black box doesn&#8217;t pass that bar.</p></li><li><p><strong>Detecting data leakage</strong>:</p><p>If your model is suspiciously good, interpretability tells you what it&#8217;s actually learning. Example: a return-prediction model that learned to exploit a look-ahead bias in a feature, e.g., using end-of-day prices to predict intraday moves, shows up immediately as one feature with overwhelming importance.</p></li><li><p><strong>Feature engineering feedback loop:</strong></p><p>Once you know which features are actually driving predictions, you can iterate intelligently; drop redundant factors, identify which alpha signals are being ignored, or understand why a signal that worked in research is being suppressed by the model in production.</p></li><li><p><strong>Regime analysis:</strong></p><p>Local methods let you compare <em>why</em> the model made a prediction in a bull market vs. a crisis period. If the feature importances shift dramatically across regimes, that&#8217;s a red flag for out-of-sample robustness; your model may have overfit to one regime&#8217;s dynamics.</p></li></ol><p>More interpretable models are often less accurate, and model-agnostic post-hoc methods let you have both: full model flexibility <em>and</em> explanations.</p><div><hr></div><p>I write about quantitative trading the way it&#8217;s actually practiced:<br>Robust models and portfolios, combining signals and strategies, understanding the assumptions behind your models.</p><p>More broadly, I write about:</p><ul><li><p>Statistical and cross-sectional arbitrage</p></li><li><p>Managing multiple strategies and signals</p></li><li><p>Risk and capital allocation</p></li><li><p>Research tooling and methodology</p></li><li><p>In-depth model assumptions and derivations</p></li></ul><p>If this way of thinking resonates, you&#8217;ll probably like what I publish.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.vertoxquant.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">VertoxQuant is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</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><hr></div><h1>1. Local Model-agnostic Methods</h1><p>Local methods answer a specific question: <strong>why did the model predict </strong><em><strong>this</strong></em><strong> value for </strong><em><strong>this</strong></em><strong> observation?</strong> Rather than summarising model behaviour across the entire dataset, they explain a single prediction by attributing it to the input features of that one data point.</p><p>Example: Your model predicts a large positive return for a particular asset on a particular day. A global method might tell you that momentum is generally the most important feature in your model. But a local method tells you that <em>for this specific prediction</em>, the signal was driven almost entirely by a spike in order flow imbalance, while momentum actually pushed the prediction slightly lower. That distinction matters enormously when you're trying to understand a model's live behaviour, debug an unexpected signal, or explain a specific trade to a risk committee.</p><p>Let&#8217;s go over some of the most popular methods.</p><h2>1.1 Ceteris Paribus Plots</h2><p>The name sounds really complicated, but it&#8217;s actually the simplest method you could use. Ceteris Paribus is Latin for "all other things being equal". As the name implies, to analyze a certain feature, you simply change its value while keeping all other features unchanged and look at the resulting predictions.</p><p>Before looking more into this method, let us train a model that we will keep using as an example for all methods. We will do a 1-day-ahead prediction of SPY returns using some basic features like momentum, RSI, etc. Doesn&#8217;t matter if the model is garbage as long as we can run our analysis on it.</p><p>First we load our data:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;e1bacc22-c222-48ca-865b-7a316c675030&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import yfinance as yf</code></pre></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;17cfc353-cbba-42e1-b94a-4e3e6eecca22&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">def load_spy():
    df = yf.download("SPY", start="2010-01-01", end="2026-03-27", auto_adjust=True)
    df.columns = df.columns.droplevel(1)

    df["ret"] = df["Close"].pct_change()
    df["target"] = df["ret"].shift(-1)  # next-day return

    # Momentum
    df["mom_5"]   = df["ret"].rolling(5).mean()
    df["mom_20"]  = df["ret"].rolling(20).mean()
    df["mom_60"]  = df["ret"].rolling(60).mean()

    # Volatility
    df["vol_5"]   = df["ret"].rolling(5).std()
    df["vol_20"]  = df["ret"].rolling(20).std()
    df["vol_ratio"] = df["vol_5"] / df["vol_20"]  # vol regime indicator

    # Mean reversion
    df["rsi_14"]  = _rsi(df["Close"], 14)
    df["zscore_20"] = (df["Close"] - df["Close"].rolling(20).mean()) / df["Close"].rolling(20).std()

    # Volume
    df["volume_z"] = (df["Volume"] - df["Volume"].rolling(20).mean()) / df["Volume"].rolling(20).std()

    # Price-based
    df["hl_range"] = (df["High"] - df["Low"]) / df["Close"]  # normalized daily range
    df["gap"]      = (df["Open"] - df["Close"].shift(1)) / df["Close"].shift(1)  # overnight gap

    # Autocorrelation signal
    df["ret_lag1"] = df["ret"].shift(1)
    df["ret_lag2"] = df["ret"].shift(2)

    features = [
        "mom_5", "mom_20", "mom_60",
        "vol_5", "vol_20", "vol_ratio",
        "rsi_14", "zscore_20",
        "volume_z", "hl_range", "gap",
        "ret_lag1", "ret_lag2"
    ]

    df = df[["target"] + features].dropna()
    return df

def _rsi(close, period=14):
    delta = close.diff()
    gain = delta.clip(lower=0).rolling(period).mean()
    loss = (-delta.clip(upper=0)).rolling(period).mean()
    rs = gain / loss
    return 100 - (100 / (1 + rs))</code></pre></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;3377e323-f1a3-47ba-a4d3-fa8e9ecec89d&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">df = load_spy()
df</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jDOZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb489db4-8418-4e59-b184-cb5451885de3_1167x424.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jDOZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb489db4-8418-4e59-b184-cb5451885de3_1167x424.png 424w, https://substackcdn.com/image/fetch/$s_!jDOZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb489db4-8418-4e59-b184-cb5451885de3_1167x424.png 848w, https://substackcdn.com/image/fetch/$s_!jDOZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb489db4-8418-4e59-b184-cb5451885de3_1167x424.png 1272w, https://substackcdn.com/image/fetch/$s_!jDOZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb489db4-8418-4e59-b184-cb5451885de3_1167x424.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jDOZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb489db4-8418-4e59-b184-cb5451885de3_1167x424.png" width="1167" height="424" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cb489db4-8418-4e59-b184-cb5451885de3_1167x424.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:424,&quot;width&quot;:1167,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:64232,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/193204015?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb489db4-8418-4e59-b184-cb5451885de3_1167x424.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!jDOZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb489db4-8418-4e59-b184-cb5451885de3_1167x424.png 424w, https://substackcdn.com/image/fetch/$s_!jDOZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb489db4-8418-4e59-b184-cb5451885de3_1167x424.png 848w, https://substackcdn.com/image/fetch/$s_!jDOZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb489db4-8418-4e59-b184-cb5451885de3_1167x424.png 1272w, https://substackcdn.com/image/fetch/$s_!jDOZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb489db4-8418-4e59-b184-cb5451885de3_1167x424.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>And now let&#8217;s train an XGBoost model to predict the next day&#8217;s return using our features (We won&#8217;t be doing any train-test splits or other important steps here, this is purely an exercise model!):</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;7996d73f-dfe5-4848-a589-5ce3937ef09b&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">from xgboost import XGBRegressor
from sklearn.metrics import r2_score</code></pre></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;f02f950e-90c7-415d-a56d-9e1e043a8204&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">FEATURES = [c for c in df.columns if c != "target"]
X = df[FEATURES]
y = df["target"]
 
model = XGBRegressor(n_estimators=300, max_depth=4, learning_rate=0.05,
                     subsample=0.8, colsample_bytree=0.8, random_state=42)
model.fit(X, y)</code></pre></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;d8267f57-3758-417a-80d6-0dc475ea5d72&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">preds = model.predict(X)
df["forecast"] = preds
df[["target", "forecast"]].to_csv("forecasts.csv")</code></pre></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;0762b2ae-e10b-4338-9600-d5b44397e16e&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Price         target  forecast
Date                          
2010-03-31  0.006837  0.000646
2010-04-01  0.008149  0.000556
2010-04-05  0.002358 -0.000046
2010-04-06 -0.005712  0.000146
2010-04-07  0.003464  0.001303</code></pre></div><p>Back to Ceteris Paribus.</p><p>Here is an implementation of it:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;78eca2f1-d68f-4656-9b0a-40bb0b491a51&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">def cp_profile(model, X, obs_idx, feature, n_points=100):
    x_obs = X.iloc[[obs_idx]].copy()
    grid = np.linspace(X[feature].min(), X[feature].max(), n_points)
    preds = []
    for val in grid:
        x_obs[feature] = val
        preds.append(model.predict(x_obs)[0])
    return grid, np.array(preds)</code></pre></div><p>Let&#8217;s try it on the 2026-03-03 prediction for the features "mom_20", "vol_20", "rsi_14", "zscore_20":</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;9ccb0edd-04b7-43df-8bc0-22b795c1b224&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Price
target        0.007055
mom_5        -0.002033
mom_20       -0.001063
mom_60       -0.000015
vol_5         0.006754
vol_20        0.008314
vol_ratio     0.812388
rsi_14       39.089484
zscore_20    -1.367428
volume_z      1.027870
hl_range      0.019035
gap          -0.016492
ret_lag1      0.000569
ret_lag2     -0.004802
forecast      0.001172
Name: 2026-03-03 00:00:00, dtype: float64</code></pre></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;8e836a53-08d3-4dfa-b7af-b522cddc6946&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">obs_idx = X.index.get_loc("2026-03-03")
features_to_plot = ["mom_20", "vol_20", "rsi_14", "zscore_20"]

fig, axes = plt.subplots(len(features_to_plot), 1, figsize=(9, 14))
fig.suptitle("Ceteris Paribus Profiles &#8212; SPY XGBoost (2026-03-01)", fontsize=14, fontweight="bold")

for ax, feat in zip(axes, features_to_plot):
    grid, preds = cp_profile(model, X, obs_idx, feat)
    ax.plot(grid, preds, linewidth=1.8)
    ax.axvline(X.iloc[obs_idx][feat], color="red", linestyle="--", label="observed value")
    ax.axhline(0, color="black", linewidth=0.8, linestyle="--")
    ax.set_xlabel(feat, fontsize=11)
    ax.set_ylabel("Predicted return", fontsize=10)
    ax.legend(fontsize=9)
    ax.grid(True, alpha=0.3)

plt.tight_layout()</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Wub_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8923b7db-7ec0-480e-8604-4adb9dd72c26_889x1377.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Wub_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8923b7db-7ec0-480e-8604-4adb9dd72c26_889x1377.png 424w, https://substackcdn.com/image/fetch/$s_!Wub_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8923b7db-7ec0-480e-8604-4adb9dd72c26_889x1377.png 848w, https://substackcdn.com/image/fetch/$s_!Wub_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8923b7db-7ec0-480e-8604-4adb9dd72c26_889x1377.png 1272w, https://substackcdn.com/image/fetch/$s_!Wub_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8923b7db-7ec0-480e-8604-4adb9dd72c26_889x1377.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Wub_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8923b7db-7ec0-480e-8604-4adb9dd72c26_889x1377.png" width="889" height="1377" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8923b7db-7ec0-480e-8604-4adb9dd72c26_889x1377.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1377,&quot;width&quot;:889,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:146329,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/193204015?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8923b7db-7ec0-480e-8604-4adb9dd72c26_889x1377.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Wub_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8923b7db-7ec0-480e-8604-4adb9dd72c26_889x1377.png 424w, https://substackcdn.com/image/fetch/$s_!Wub_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8923b7db-7ec0-480e-8604-4adb9dd72c26_889x1377.png 848w, https://substackcdn.com/image/fetch/$s_!Wub_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8923b7db-7ec0-480e-8604-4adb9dd72c26_889x1377.png 1272w, https://substackcdn.com/image/fetch/$s_!Wub_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8923b7db-7ec0-480e-8604-4adb9dd72c26_889x1377.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 momentum were even more negative, we would have predicted an even more positive return (mean reversion effect).  If volatility were higher, we would have flipped to strongly negative instead (flipping from mean reversion to momentum).</p><p>Many of the methods we will look at are creative combinations of multiple Ceteris Paribus plots that tell us more.</p><p>The BIG problem with this (and many other) methods is correlation among features.<br>Changing one feature while keeping the others unchanged can give us unrealistic feature combinations, like huge recent momentum while volatility is very low.</p><h2>1.2 Individual Conditional Expectation (ICE)</h2><p>An ICE plot is simply many Ceteris Paribus plots overlaid, one per observation.</p><p>Here is an implementation:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;df548425-168c-4796-9605-9c79a2cfbee9&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">def ice_plot(model, X, feature, n_obs=100, n_points=100):
    sample = X.sample(n_obs, random_state=42)
    grid = np.linspace(X[feature].min(), X[feature].max(), n_points)
    
    fig, ax = plt.subplots(figsize=(9, 4))
    for idx in range(len(sample)):
        _, preds = cp_profile(model, sample.reset_index(drop=True), idx, feature, n_points)
        ax.plot(grid, preds, color="steelblue", alpha=0.4, linewidth=0.8)
    
    ax.axhline(0, color="black", linewidth=0.8, linestyle="--")
    ax.set_xlabel(feature)
    ax.set_ylabel("Predicted return")
    ax.grid(True, alpha=0.3)
    plt.title(f"ICE Plot &#8212; {feature}")
    plt.tight_layout()</code></pre></div><p>Let&#8217;s run it for &#8220;mom_20&#8221;:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;b560fb2a-969e-4b5b-afd8-1bb302ea2308&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">ice_plot(model, X, "mom_20")</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!luzM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935753a8-53c8-4fc8-bc80-92b3c441f148_889x390.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!luzM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935753a8-53c8-4fc8-bc80-92b3c441f148_889x390.png 424w, https://substackcdn.com/image/fetch/$s_!luzM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935753a8-53c8-4fc8-bc80-92b3c441f148_889x390.png 848w, https://substackcdn.com/image/fetch/$s_!luzM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935753a8-53c8-4fc8-bc80-92b3c441f148_889x390.png 1272w, https://substackcdn.com/image/fetch/$s_!luzM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935753a8-53c8-4fc8-bc80-92b3c441f148_889x390.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!luzM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935753a8-53c8-4fc8-bc80-92b3c441f148_889x390.png" width="889" height="390" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/935753a8-53c8-4fc8-bc80-92b3c441f148_889x390.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:390,&quot;width&quot;:889,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:89828,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/193204015?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935753a8-53c8-4fc8-bc80-92b3c441f148_889x390.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!luzM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935753a8-53c8-4fc8-bc80-92b3c441f148_889x390.png 424w, https://substackcdn.com/image/fetch/$s_!luzM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935753a8-53c8-4fc8-bc80-92b3c441f148_889x390.png 848w, https://substackcdn.com/image/fetch/$s_!luzM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935753a8-53c8-4fc8-bc80-92b3c441f148_889x390.png 1272w, https://substackcdn.com/image/fetch/$s_!luzM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F935753a8-53c8-4fc8-bc80-92b3c441f148_889x390.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>We can explore interactions with this method by using colors.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;27a011f1-9730-4adf-8291-97f58a0c38bc&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">def ice_plot(model, X, feature, color_by=None, n_obs=100, n_points=100):
    sample = X.sample(n_obs, random_state=42).reset_index(drop=True)
    grid = np.linspace(X[feature].quantile(0.01), X[feature].quantile(0.99), n_points)

    fig, ax = plt.subplots(figsize=(9, 4))
    for idx in range(len(sample)):
        _, preds = cp_profile(model, sample, idx, feature, n_points)
        if color_by is not None:
            median = sample[color_by].median()
            color = "#d62728" if sample[color_by].iloc[idx] &gt; median else "#1f77b4"
        else:
            color = "steelblue"
        ax.plot(grid, preds, color=color, alpha=0.4, linewidth=0.8)

    if color_by is not None:
        ax.plot([], [], color="#d62728", label=f"{color_by} high")
        ax.plot([], [], color="#1f77b4", label=f"{color_by} low")
        ax.legend(fontsize=9)

    ax.axhline(0, color="black", linewidth=0.8, linestyle="--")
    ax.set_xlabel(feature)
    ax.set_ylabel("Predicted return")
    ax.grid(True, alpha=0.3)
    plt.title(f"ICE Plot &#8212; {feature}" + (f" | colored by {color_by}" if color_by else ""))
    plt.tight_layout()</code></pre></div><p>Let&#8217;s color in low/high volatility:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;76383872-406c-42ac-a042-458bdb3989f2&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">ice_plot(model, X, "mom_20", "vol_20")</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6Zcg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00d16e2f-60f9-4eff-a86a-f78e881620e3_889x390.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6Zcg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00d16e2f-60f9-4eff-a86a-f78e881620e3_889x390.png 424w, https://substackcdn.com/image/fetch/$s_!6Zcg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00d16e2f-60f9-4eff-a86a-f78e881620e3_889x390.png 848w, https://substackcdn.com/image/fetch/$s_!6Zcg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00d16e2f-60f9-4eff-a86a-f78e881620e3_889x390.png 1272w, https://substackcdn.com/image/fetch/$s_!6Zcg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00d16e2f-60f9-4eff-a86a-f78e881620e3_889x390.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6Zcg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00d16e2f-60f9-4eff-a86a-f78e881620e3_889x390.png" width="889" height="390" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/00d16e2f-60f9-4eff-a86a-f78e881620e3_889x390.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:390,&quot;width&quot;:889,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:101474,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/193204015?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00d16e2f-60f9-4eff-a86a-f78e881620e3_889x390.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!6Zcg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00d16e2f-60f9-4eff-a86a-f78e881620e3_889x390.png 424w, https://substackcdn.com/image/fetch/$s_!6Zcg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00d16e2f-60f9-4eff-a86a-f78e881620e3_889x390.png 848w, https://substackcdn.com/image/fetch/$s_!6Zcg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00d16e2f-60f9-4eff-a86a-f78e881620e3_889x390.png 1272w, https://substackcdn.com/image/fetch/$s_!6Zcg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00d16e2f-60f9-4eff-a86a-f78e881620e3_889x390.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>Centered ICE Plot:</h3><p>It can be hard to tell if the different curves are affected equally by the feature of interest because they have different levels.</p><p>A simple solution is to subtract each curve's value at some specific value of x. This removes the vertical spread caused by other features and lets you focus purely on the effect of varying the feature of interest.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;d3b296e6-d85f-41a0-8f63-1a5dddf22222&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">def cp_profile(model, X, obs_idx, feature, grid):
    x_obs = X.iloc[[obs_idx]].copy()
    preds = [model.predict(x_obs.assign(**{feature: val}))[0] for val in grid]
    return np.array(preds)

def ice_plot(model, X, feature, color_by=None, centered=False, ref_value=None, n_obs=100, n_points=100):
    sample = X.sample(n_obs, random_state=42).reset_index(drop=True)
    grid = np.linspace(X[feature].quantile(0.01), X[feature].quantile(0.99), n_points)
    if centered and ref_value is not None:
        grid = np.sort(np.append(grid, ref_value))  # ensure ref_value is exactly in grid

    fig, ax = plt.subplots(figsize=(9, 4))
    for idx in range(len(sample)):
        preds = cp_profile(model, sample, idx, feature, grid)
        if centered:
            ref = ref_value if ref_value is not None else grid[0]
            ref_pred = preds[np.searchsorted(grid, ref)]
            preds = preds - ref_pred
        color = "steelblue"
        if color_by is not None:
            color = "#d62728" if sample[color_by].iloc[idx] &gt; sample[color_by].median() else "#1f77b4"
        ax.plot(grid, preds, color=color, alpha=0.3, linewidth=0.8)

    if color_by is not None:
        ax.plot([], [], color="#d62728", label=f"{color_by} high")
        ax.plot([], [], color="#1f77b4", label=f"{color_by} low")
        ax.legend(fontsize=9)

    ax.axhline(0, color="black", linewidth=0.8, linestyle="--")
    ax.set_xlabel(feature)
    ax.set_ylabel("Change in predicted return" if centered else "Predicted return")
    ax.grid(True, alpha=0.3)
    plt.title(f"{'c-ICE' if centered else 'ICE'} Plot &#8212; {feature}" + (f" | colored by {color_by}" if color_by else ""))
    plt.tight_layout()</code></pre></div><p>A natural reference point for momentum is 0:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;34ff0696-eb56-43d3-aeac-96af1f906251&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">ice_plot(model, X, "mom_20", "vol_20", centered=True, ref_value=0)</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JtoU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b1c8fb9-1162-43d1-8c86-ade28ac62021_889x390.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JtoU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b1c8fb9-1162-43d1-8c86-ade28ac62021_889x390.png 424w, https://substackcdn.com/image/fetch/$s_!JtoU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b1c8fb9-1162-43d1-8c86-ade28ac62021_889x390.png 848w, https://substackcdn.com/image/fetch/$s_!JtoU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b1c8fb9-1162-43d1-8c86-ade28ac62021_889x390.png 1272w, https://substackcdn.com/image/fetch/$s_!JtoU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b1c8fb9-1162-43d1-8c86-ade28ac62021_889x390.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JtoU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b1c8fb9-1162-43d1-8c86-ade28ac62021_889x390.png" width="889" height="390" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3b1c8fb9-1162-43d1-8c86-ade28ac62021_889x390.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:390,&quot;width&quot;:889,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:108287,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/193204015?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b1c8fb9-1162-43d1-8c86-ade28ac62021_889x390.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!JtoU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b1c8fb9-1162-43d1-8c86-ade28ac62021_889x390.png 424w, https://substackcdn.com/image/fetch/$s_!JtoU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b1c8fb9-1162-43d1-8c86-ade28ac62021_889x390.png 848w, https://substackcdn.com/image/fetch/$s_!JtoU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b1c8fb9-1162-43d1-8c86-ade28ac62021_889x390.png 1272w, https://substackcdn.com/image/fetch/$s_!JtoU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b1c8fb9-1162-43d1-8c86-ade28ac62021_889x390.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>Can see a pretty clear pattern on the left! When volatility is high, momentum works. When volatility is low, mean reversion works.</p><h2>1.3 Local interpretable model-agnostic explanations (LIME)</h2><p>CP profiles and ICE show you how the prediction changes as you vary one feature. But they don&#8217;t give you a single number answering: <em><strong>how much did feature x contribute to this specific prediction?</strong></em> LIME does exactly that.</p><p>The basic idea is that our black box method f is too complex to interpret globally, so we interpret near a specific observation x (all our features at one specific date) by training a simpler model (for example linear) in a small neighborhood of x.</p><p>Here is how LIME does this exactly (using linear regression as an example for the interpretable model):</p><ol><li><p><strong>Perturbing the observation:</strong><br>Generate N synthetic samples by randomly perturbing the features around x. For tabular data, this is done by sampling each feature from its marginal distribution. For continuous data, this is done by sampling from a normal distribution with equal means and standard deviations to the training set (This again ignores correlations! A typical weakness of LIME).</p></li><li><p><strong>Weighing by proximity:<br></strong>Each synthetic sample z is weighted by how close it is to x using an exponential kernel:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\pi_x(z) = \\exp(-\\frac{d(x,z)^2}{\\sigma^2})&quot;,&quot;id&quot;:&quot;LEIOEOAQFB&quot;}" data-component-name="LatexBlockToDOM"></div><p>In our case, d will be euclidian distance, but other measures of distance can be chosen too.</p></li><li><p><strong>Fitting a weighted linear model:<br></strong>Run the black-box model on all synthetic samples to get labels, then fit a weighted linear regression:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\hat{g} = \\arg \\min_g \\sum_z \\pi_x(z) (\\hat{f}(z) - g(z))^2&quot;,&quot;id&quot;:&quot;RDDSQYLKUL&quot;}" data-component-name="LatexBlockToDOM"></div></li><li><p><strong>Reading the explanation:</strong><br>Now we interpret the resulting model. In the case of linear regression, that&#8217;s easy, as we simply look at the coefficients.</p></li></ol><p>Let&#8217;s implement this with ridge regression, which handles our correlated features better:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;91cabe3b-eeeb-47ff-8182-4f8202c3abb2&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">def lime_explain(model, X, obs_idx, n_samples=1000, sigma=1.0, ridge_alpha=1.0):
    x_obs = X.iloc[obs_idx].values
    means = X.mean().values
    stds  = X.std().values

    # 1. perturb
    Z = np.random.normal(means, stds, size=(n_samples, X.shape[1]))

    # 2. weights
    Z_std = (Z - x_obs) / stds
    distances = np.sqrt((Z_std ** 2).sum(axis=1))
    weights = np.exp(-distances ** 2 / sigma ** 2)

    # 3. black-box labels
    labels = model.predict(Z)

    # 4. fit weighted linear model
    lr = Ridge(alpha=ridge_alpha)
    lr.fit(Z, labels, sample_weight=weights)

    return dict(zip(X.columns, lr.coef_))</code></pre></div><p>And run it again for our 2026-03-03 forecast:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;8d33caa2-4341-47de-b038-3b8d2535e695&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">obs_idx = X.index.get_loc("2026-03-03")
explanation = lime_explain(model, X, obs_idx)
print(explanation)</code></pre></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;6109c00f-163c-4e26-bf7c-a640072f7662&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">mom_5       -2.096855e-09
mom_20      -4.942316e-09
mom_60       4.846428e-09
vol_5        4.087705e-08
vol_20       1.238100e-08
vol_ratio    5.578009e-07
rsi_14      -1.130377e-05
zscore_20   -2.909305e-06
volume_z    -1.143078e-06
hl_range    -4.011315e-08
gap          2.016699e-08
ret_lag1     1.007680e-08
ret_lag2     5.326466e-08</code></pre></div><p>Another challenge in using LIME is choosing the neighborhood of x. There is no clear solution to this, and results can generally be unstable as well.</p><h2>1.4 SHAP</h2><p>SHAP (SHapley Additive exPlanations) is a game-theoretic approach.</p><p>The question SHAP asks is: Given that the model made a prediction hat{y}, how do we <em>fairly </em>distribute the difference between this prediction and the average prediction E[y] among the features?</p><p>Think of the features as players in a cooperative game, where the "payout" is the model's prediction. The Shapley value of feature j is its average marginal contribution across all possible orderings (coalitions) of features:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\phi_j = \\sum_{S \\subseteq F\\backslash\\{j\\}} \\frac{|S|!(|F|-|S|-1)!}{|F|!}[\\hat{f}_{S \\cup \\{j\\}}(x) - \\hat{f}_S(x)]&quot;,&quot;id&quot;:&quot;COTPSRDXXZ&quot;}" data-component-name="LatexBlockToDOM"></div><p>where F is the full set of features, S is a subset excluding feature j, and \hat{f}_S is the model&#8217;s prediction using only features in S.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\hat{f}_S(x) = \\mathbb{E}[\\hat{f}(z)|z_S = x_S]&quot;,&quot;id&quot;:&quot;TKMCYJIDYK&quot;}" data-component-name="LatexBlockToDOM"></div><p>The Shapley values must satisfy the following four properties (and is the only attribution method that does so):</p><h4><strong>Efficiency:</strong></h4><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\hat{f}(x) = \\mathbb{E}[\\hat{f}(\\cdot)] + \\sum_{j=1}^p \\phi_j,&quot;,&quot;id&quot;:&quot;HAVFZWFTTS&quot;}" data-component-name="LatexBlockToDOM"></div><p>so the contributions exactly decompose the prediction relative to the baseline.</p><h4><strong>Symmetry:</strong></h4><p>If two features j and k contribute equally to every coalition, i.e., for all</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;S \\subseteq F \\backslash \\{j,k\\}&quot;,&quot;id&quot;:&quot;YYQGEUTQYP&quot;}" data-component-name="LatexBlockToDOM"></div><p>we have</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\hat{f}_{S \\cup \\{j\\}} = \\hat{f}_{S \\cup \\{k\\}}&quot;,&quot;id&quot;:&quot;JQWTCHBJCC&quot;}" data-component-name="LatexBlockToDOM"></div><p>then they must have the same Shapley value</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\phi_j = \\phi_k.&quot;,&quot;id&quot;:&quot;PFAWISJVSM&quot;}" data-component-name="LatexBlockToDOM"></div><h4><strong>Dummy:</strong></h4><p>If feature j contributes nothing to any coalition, i.e., for all </p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;S \\subseteq F \\backslash \\{j\\}&quot;,&quot;id&quot;:&quot;LPTPXGWUNJ&quot;}" data-component-name="LatexBlockToDOM"></div><p>we have</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\hat{f}_{S \\cup \\{j\\}} = \\hat{f}_S&quot;,&quot;id&quot;:&quot;BIUHFHRWVZ&quot;}" data-component-name="LatexBlockToDOM"></div><p>then the Shapley value must be zero </p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\phi_j = 0.&quot;,&quot;id&quot;:&quot;DWYTWKAGVN&quot;}" data-component-name="LatexBlockToDOM"></div><h4><strong>Linearity:</strong></h4><p>If the model can be decomposed as f = f^A + f^B, then</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\phi_j(\\hat{f}) = \\phi_j(\\hat{f}^A) + \\phi_j(\\hat{f}^B)&quot;,&quot;id&quot;:&quot;GOPIIZAUZV&quot;}" data-component-name="LatexBlockToDOM"></div><h3>Estimating Shapley values:</h3><p>The number of possible coalitions increases exponentially as you increase the number of features in your model (2^|F|). You therefore typically want to approximate it via Monte-Carlo sampling. Instead of summing over all coalitions, sample random permutations pi of the features and estimate the marginal contribution of j in each:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\hat{f}_j = \\frac{1}{M} \\sum_{m=1}^M [\\hat{f}_{S^m \\cup \\{j\\}}(x) - \\hat{f}_{S^m}(x)]&quot;,&quot;id&quot;:&quot;KTDITHEJQC&quot;}" data-component-name="LatexBlockToDOM"></div><p>where S^m is the set of features appearing before j in the m-th random permutation. This converges to the true Shapley value as M &#8594; infinity.</p><p>You want M to be reasonably big, so the variance of your estimated Shapley value is small. This means that for big models doing a SHAP analysis can take a long time, which is one major drawback of it.</p><p>For tree-based models (XGBoost, LightGBM, Random Forests, etc.), there is an exact polynomial-time algorithm that exploits the tree structure to compute exact Shapley values in O(TLD^2) time, where T is the number of trees, L is the number of leaves, and D is the maximum depth.</p><p>Let&#8217;s implement this with the shap library. There are a ton of useful tools!</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;6a2cb586-4bdc-4ac9-8df1-c3b196f2e1d9&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">import shap
import copy

explainer  = shap.TreeExplainer(model)
shap_values = explainer(X)

obs_idx = X.index.get_loc("2026-03-03")

# Transforming to basis-points for better readability
sv_bps = copy.deepcopy(shap_values)
sv_bps.values = shap_values.values * 10000
sv_bps.base_values = shap_values.base_values * 10000
sv_bps.data = shap_values.data</code></pre></div><h3>waterfall_plot:</h3><p>Shows how each feature pushes the prediction up/down from the baseline E[f(.)] to the final prediction f(x).</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;c3f41532-2a65-4b79-8dd8-c71e78ba8f2c&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">shap.waterfall_plot(sv_bps[obs_idx])</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!evMK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4ec5ae5-d9ee-4ba1-bf70-8a63b1b3769e_893x600.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!evMK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4ec5ae5-d9ee-4ba1-bf70-8a63b1b3769e_893x600.png 424w, https://substackcdn.com/image/fetch/$s_!evMK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4ec5ae5-d9ee-4ba1-bf70-8a63b1b3769e_893x600.png 848w, https://substackcdn.com/image/fetch/$s_!evMK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4ec5ae5-d9ee-4ba1-bf70-8a63b1b3769e_893x600.png 1272w, https://substackcdn.com/image/fetch/$s_!evMK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4ec5ae5-d9ee-4ba1-bf70-8a63b1b3769e_893x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!evMK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4ec5ae5-d9ee-4ba1-bf70-8a63b1b3769e_893x600.png" width="893" height="600" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f4ec5ae5-d9ee-4ba1-bf70-8a63b1b3769e_893x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:893,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:59079,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/193204015?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4ec5ae5-d9ee-4ba1-bf70-8a63b1b3769e_893x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!evMK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4ec5ae5-d9ee-4ba1-bf70-8a63b1b3769e_893x600.png 424w, https://substackcdn.com/image/fetch/$s_!evMK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4ec5ae5-d9ee-4ba1-bf70-8a63b1b3769e_893x600.png 848w, https://substackcdn.com/image/fetch/$s_!evMK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4ec5ae5-d9ee-4ba1-bf70-8a63b1b3769e_893x600.png 1272w, https://substackcdn.com/image/fetch/$s_!evMK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff4ec5ae5-d9ee-4ba1-bf70-8a63b1b3769e_893x600.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>As you can see, momentum pushed the prediction in one direction, but volume_z and RSI pushed it back in the other direction.</p><h3>force_plot:</h3><p>Same information as waterfall, but horizontal.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;d86d6018-7cf9-4a6a-80b4-c4f97b0722ba&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">shap.initjs()
shap.force_plot(sv_bps[obs_idx])</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Xyiw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41aa8f9a-f2ce-465f-ad0c-7f5d42d08c74_1146x112.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Xyiw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41aa8f9a-f2ce-465f-ad0c-7f5d42d08c74_1146x112.png 424w, https://substackcdn.com/image/fetch/$s_!Xyiw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41aa8f9a-f2ce-465f-ad0c-7f5d42d08c74_1146x112.png 848w, https://substackcdn.com/image/fetch/$s_!Xyiw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41aa8f9a-f2ce-465f-ad0c-7f5d42d08c74_1146x112.png 1272w, https://substackcdn.com/image/fetch/$s_!Xyiw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41aa8f9a-f2ce-465f-ad0c-7f5d42d08c74_1146x112.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Xyiw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41aa8f9a-f2ce-465f-ad0c-7f5d42d08c74_1146x112.png" width="1146" height="112" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/41aa8f9a-f2ce-465f-ad0c-7f5d42d08c74_1146x112.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:112,&quot;width&quot;:1146,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:24118,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/193204015?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41aa8f9a-f2ce-465f-ad0c-7f5d42d08c74_1146x112.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Xyiw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41aa8f9a-f2ce-465f-ad0c-7f5d42d08c74_1146x112.png 424w, https://substackcdn.com/image/fetch/$s_!Xyiw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41aa8f9a-f2ce-465f-ad0c-7f5d42d08c74_1146x112.png 848w, https://substackcdn.com/image/fetch/$s_!Xyiw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41aa8f9a-f2ce-465f-ad0c-7f5d42d08c74_1146x112.png 1272w, https://substackcdn.com/image/fetch/$s_!Xyiw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41aa8f9a-f2ce-465f-ad0c-7f5d42d08c74_1146x112.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3>decision_plot:</h3><p>Also gives the same information by showing the cumulative sum of SHAP values as a path from the baseline E[f(.)] to the final prediction.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;e2f8c33f-c6e2-4a84-a89b-801a54e077ea&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">shap.decision_plot(explainer.expected_value, shap_values[obs_idx].values, X.iloc[obs_idx])</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_Pw7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F651e9932-4b80-4319-9b4c-92f3bfaec0f3_763x608.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_Pw7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F651e9932-4b80-4319-9b4c-92f3bfaec0f3_763x608.png 424w, https://substackcdn.com/image/fetch/$s_!_Pw7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F651e9932-4b80-4319-9b4c-92f3bfaec0f3_763x608.png 848w, https://substackcdn.com/image/fetch/$s_!_Pw7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F651e9932-4b80-4319-9b4c-92f3bfaec0f3_763x608.png 1272w, https://substackcdn.com/image/fetch/$s_!_Pw7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F651e9932-4b80-4319-9b4c-92f3bfaec0f3_763x608.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_Pw7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F651e9932-4b80-4319-9b4c-92f3bfaec0f3_763x608.png" width="763" height="608" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/651e9932-4b80-4319-9b4c-92f3bfaec0f3_763x608.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:608,&quot;width&quot;:763,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:67871,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/193204015?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F651e9932-4b80-4319-9b4c-92f3bfaec0f3_763x608.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_Pw7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F651e9932-4b80-4319-9b4c-92f3bfaec0f3_763x608.png 424w, https://substackcdn.com/image/fetch/$s_!_Pw7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F651e9932-4b80-4319-9b4c-92f3bfaec0f3_763x608.png 848w, https://substackcdn.com/image/fetch/$s_!_Pw7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F651e9932-4b80-4319-9b4c-92f3bfaec0f3_763x608.png 1272w, https://substackcdn.com/image/fetch/$s_!_Pw7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F651e9932-4b80-4319-9b4c-92f3bfaec0f3_763x608.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>You can also pass multiple observations to compare them side by side:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;31c78cec-6f17-4a3d-ab97-9feb744e567e&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">shap.decision_plot(explainer.expected_value, shap_values.values[:50], X.iloc[:50])</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vKqo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F559ef0e3-097b-4204-b531-15a608278919_739x608.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vKqo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F559ef0e3-097b-4204-b531-15a608278919_739x608.png 424w, https://substackcdn.com/image/fetch/$s_!vKqo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F559ef0e3-097b-4204-b531-15a608278919_739x608.png 848w, https://substackcdn.com/image/fetch/$s_!vKqo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F559ef0e3-097b-4204-b531-15a608278919_739x608.png 1272w, https://substackcdn.com/image/fetch/$s_!vKqo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F559ef0e3-097b-4204-b531-15a608278919_739x608.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vKqo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F559ef0e3-097b-4204-b531-15a608278919_739x608.png" width="739" height="608" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/559ef0e3-097b-4204-b531-15a608278919_739x608.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:608,&quot;width&quot;:739,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:157119,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/193204015?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F559ef0e3-097b-4204-b531-15a608278919_739x608.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vKqo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F559ef0e3-097b-4204-b531-15a608278919_739x608.png 424w, https://substackcdn.com/image/fetch/$s_!vKqo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F559ef0e3-097b-4204-b531-15a608278919_739x608.png 848w, https://substackcdn.com/image/fetch/$s_!vKqo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F559ef0e3-097b-4204-b531-15a608278919_739x608.png 1272w, https://substackcdn.com/image/fetch/$s_!vKqo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F559ef0e3-097b-4204-b531-15a608278919_739x608.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>We will get back to SHAP again when looking at global model-agnostic methods!</p><div><hr></div><h1>2. Global Model-agnostic Methods</h1><p>Global methods answer a different question: not why did the model predict <em>this</em> value for <em>this</em> observation, but how does the model behave <em>on average</em> across the entire dataset? Rather than explaining a single prediction, they summarise the overall relationship between features and the target learned by the model.</p><p>Example: You&#8217;ve trained a return-forecasting model on SPY, and it performs well out of sample. A local method tells you why the model predicted a large positive return on one specific day. But a global method tells you that across all predictions, volatility is the dominant driver, momentum matters mainly in low-volatility regimes, and the overnight gap feature is essentially ignored by the model. </p><p>Let&#8217;s go over some of the most popular methods.</p><h2>2.1 Partial Dependence Plot (PDP)</h2><p>Remember Individual Conditional Expectation (ICE)? PDP is simply the average of all ICE curves. This also means the PDP inherits the main weakness of ICE: It assumes the feature is independent of the others.</p><p>Just like with ICE, a centered version also exists. Let&#8217;s implement it as a thick line inside our centered ICE plot:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;17e64388-a293-407b-aea7-842aff3d1735&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">def ice_plot(model, X, feature, color_by=None, centered=False, ref_value=None, n_obs=100, n_points=100):
    sample = X.sample(n_obs, random_state=42).reset_index(drop=True)
    grid = np.linspace(X[feature].quantile(0.01), X[feature].quantile(0.99), n_points)
    if centered and ref_value is not None:
        grid = np.sort(np.append(grid, ref_value))

    fig, ax = plt.subplots(figsize=(9, 4))
    all_preds = []
    for idx in range(len(sample)):
        preds = cp_profile(model, sample, idx, feature, grid)
        if centered:
            ref = ref_value if ref_value is not None else grid[0]
            ref_pred = preds[np.searchsorted(grid, ref)]
            preds = preds - ref_pred
        all_preds.append(preds)
        color = "steelblue"
        if color_by is not None:
            color = "#d62728" if sample[color_by].iloc[idx] &gt; sample[color_by].median() else "#1f77b4"
        ax.plot(grid, preds, color=color, alpha=0.3, linewidth=0.8)

    pdp = np.mean(all_preds, axis=0)
    ax.plot(grid, pdp, color="black", linewidth=2.5, label="PDP")

    if color_by is not None:
        ax.plot([], [], color="#d62728", label=f"{color_by} high")
        ax.plot([], [], color="#1f77b4", label=f"{color_by} low")

    ax.legend(fontsize=9)
    ax.axhline(0, color="black", linewidth=0.8, linestyle="--")
    ax.set_xlabel(feature)
    ax.set_ylabel("Change in predicted return" if centered else "Predicted return")
    ax.grid(True, alpha=0.3)
    plt.title(f"{'c-ICE' if centered else 'ICE'} Plot &#8212; {feature}" + (f" | colored by {color_by}" if color_by else ""))
    plt.tight_layout()</code></pre></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;a9e46e79-2c47-41cf-8e75-653897460f9d&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">ice_plot(model, X, "mom_20", "vol_20", centered=True, ref_value=0)</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!g00b!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6da03327-5ad3-43cd-9726-64a53f05bf02_889x390.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!g00b!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6da03327-5ad3-43cd-9726-64a53f05bf02_889x390.png 424w, https://substackcdn.com/image/fetch/$s_!g00b!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6da03327-5ad3-43cd-9726-64a53f05bf02_889x390.png 848w, https://substackcdn.com/image/fetch/$s_!g00b!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6da03327-5ad3-43cd-9726-64a53f05bf02_889x390.png 1272w, https://substackcdn.com/image/fetch/$s_!g00b!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6da03327-5ad3-43cd-9726-64a53f05bf02_889x390.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!g00b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6da03327-5ad3-43cd-9726-64a53f05bf02_889x390.png" width="889" height="390" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6da03327-5ad3-43cd-9726-64a53f05bf02_889x390.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:390,&quot;width&quot;:889,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:107936,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/193204015?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6da03327-5ad3-43cd-9726-64a53f05bf02_889x390.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!g00b!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6da03327-5ad3-43cd-9726-64a53f05bf02_889x390.png 424w, https://substackcdn.com/image/fetch/$s_!g00b!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6da03327-5ad3-43cd-9726-64a53f05bf02_889x390.png 848w, https://substackcdn.com/image/fetch/$s_!g00b!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6da03327-5ad3-43cd-9726-64a53f05bf02_889x390.png 1272w, https://substackcdn.com/image/fetch/$s_!g00b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6da03327-5ad3-43cd-9726-64a53f05bf02_889x390.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>2.2 Accumulated Local Effects (ALE)</h2><p>PDP&#8217;s main weakness is that it sweeps feature x_j across its range while holding other features fixed at their observed values, generating unrealistic feature combinations when features are correlated. ALE fixes this by only looking at the effect of x_j locally, within small neighbourhoods where the feature combinations are realistics, and then accumulating these local effects to get a global picture.</p><p>Partition the range of x_j into K intervals [z_{k-1}, z_k]. For each interval, compute the local effect of x_j by averaging the finite difference of predictions over observations that actually fall in that interval:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\text{ALE}_j(x) = \\sum_{k=1}^{K(x)} \\frac{1}{n_k} \\sum_{i:x_j^{(i)} \\in [z_{k-1}, z_k]}[\\hat{f}(x_{-j}^{(i)}, z_k) - \\hat{f}(x_{-j}^{(i)},z_{k-1})]&quot;,&quot;id&quot;:&quot;CIPJLBIVEZ&quot;}" data-component-name="LatexBlockToDOM"></div><p>where K(x) is the index of the inerval containing x, and n_k is the number of observations in interval k. x_{-j}^(i), z_k means that the j-th feature value in x^(i) got replaced with z_k (here i stays for the i-th observation).</p><p>Let&#8217;s implement this:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;3a64c849-4ca7-420a-8a06-28295552042c&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">def ale_plot(model, X, feature, n_bins=20):
    quantiles = np.quantile(X[feature], np.linspace(0, 1, n_bins + 1))
    quantiles = np.unique(quantiles)

    ale = np.zeros(len(quantiles) - 1)
    bin_centers = np.zeros(len(quantiles) - 1)

    for k in range(len(quantiles) - 1):
        mask = (X[feature] &gt;= quantiles[k]) &amp; (X[feature] &lt; quantiles[k + 1])
        if mask.sum() == 0:
            continue
        X_bin = X[mask].copy()
        preds_high = model.predict(X_bin.assign(**{feature: quantiles[k + 1]}))
        preds_low  = model.predict(X_bin.assign(**{feature: quantiles[k]}))
        ale[k] = (preds_high - preds_low).mean()
        bin_centers[k] = (quantiles[k] + quantiles[k + 1]) / 2

    ale = np.cumsum(ale)
    ale -= ale.mean()

    fig, ax = plt.subplots(figsize=(9, 4))
    ax.plot(bin_centers, ale, color="steelblue", linewidth=2)
    ax.axhline(0, color="black", linewidth=0.8, linestyle="--")
    ax.set_xlabel(feature)
    ax.set_ylabel("ALE")
    ax.grid(True, alpha=0.3)
    plt.title(f"ALE Plot &#8212; {feature}")
    plt.tight_layout()</code></pre></div><p>And run it for &#8220;mom_20&#8221;:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jX8_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feda6d14e-23d7-4250-a2e7-c39a0de11a7a_887x390.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jX8_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feda6d14e-23d7-4250-a2e7-c39a0de11a7a_887x390.png 424w, https://substackcdn.com/image/fetch/$s_!jX8_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feda6d14e-23d7-4250-a2e7-c39a0de11a7a_887x390.png 848w, https://substackcdn.com/image/fetch/$s_!jX8_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feda6d14e-23d7-4250-a2e7-c39a0de11a7a_887x390.png 1272w, https://substackcdn.com/image/fetch/$s_!jX8_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feda6d14e-23d7-4250-a2e7-c39a0de11a7a_887x390.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jX8_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feda6d14e-23d7-4250-a2e7-c39a0de11a7a_887x390.png" width="887" height="390" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/eda6d14e-23d7-4250-a2e7-c39a0de11a7a_887x390.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:390,&quot;width&quot;:887,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:37025,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/193204015?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feda6d14e-23d7-4250-a2e7-c39a0de11a7a_887x390.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!jX8_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feda6d14e-23d7-4250-a2e7-c39a0de11a7a_887x390.png 424w, https://substackcdn.com/image/fetch/$s_!jX8_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feda6d14e-23d7-4250-a2e7-c39a0de11a7a_887x390.png 848w, https://substackcdn.com/image/fetch/$s_!jX8_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feda6d14e-23d7-4250-a2e7-c39a0de11a7a_887x390.png 1272w, https://substackcdn.com/image/fetch/$s_!jX8_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feda6d14e-23d7-4250-a2e7-c39a0de11a7a_887x390.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>2.3 Friedman&#8217;s H statistic</h2><p>So far, all methods look at the effect of one feature at a time. But in practice, features often interact; the effect of mom_20 on the prediction might be very different in high-volatility vs low-volatility regimes. Friedman&#8217;s H-statistic measures the strength of such interactions.</p><p>If two features x_j and x_k do not interact, then the point partial dependence can be decomposed as the sum of the individual partial dependences:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\text{PDP}_{jk}(x_j, x_k) = \\text{PDP}_j(x_j) + \\text{PDP}_k(x_k)&quot;,&quot;id&quot;:&quot;GBLEPNIBDD&quot;}" data-component-name="LatexBlockToDOM"></div><p>The H-statistic measures how much of the joint PDP&#8217;s variance is <em><strong>not </strong></em>explained by the sum of the individual PDPs:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;H_{jk}^2 = \\frac{\\sum_{i=1}^n[\\text{PDP}_{jk}(x_j^{(i)},x_k^{(i)})-\\text{PDP}_j(x_j^{(i)})-\\text{PDP}_k(x_k^{(i)})]^2}{\\sum_{i=1}^n [\\text{PDP}_{jk}(x_j^{(i)}, x_k^{(i)})]^2}&quot;,&quot;id&quot;:&quot;NOLSXKAGHC&quot;}" data-component-name="LatexBlockToDOM"></div><p>H_{jk}^2 is in [0,1], where 0 means no interaction and 1 means the entire joint effect is due to interaction.</p><p>There is also a <em><strong>total </strong></em>interaction statistic for feature j measuring its interaction with <em><strong>all</strong></em> other features simultaneously:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;H_j^2 = \\frac{\\sum_{i=1}^n[\\text{PDP}_j(x_j^{(i)})-\\hat{f}(x^{(i)})+\\text{PDP}_{-j}(x_{-j}^{(i)})]^2}{\\sum_{i=1}^n \\hat{f}(x^{(i)})^2}&quot;,&quot;id&quot;:&quot;HMBBLNAZRM&quot;}" data-component-name="LatexBlockToDOM"></div><p>Let&#8217;s implement both:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;0b3070e2-4027-4b4b-af37-c073ea5f3a7f&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">from sklearn.inspection import partial_dependence

def h_stat_pairwise(model, X, feat1, feat2, n_samples=500):
    X_s = X.sample(n_samples, random_state=42)
    
    pd12 = partial_dependence(model, X_s, [feat1, feat2], kind="average", grid_resolution=20)
    pd1  = partial_dependence(model, X_s, [feat1], kind="average", grid_resolution=20)
    pd2  = partial_dependence(model, X_s, [feat2], kind="average", grid_resolution=20)
    
    grid1 = pd12["grid_values"][0]
    grid2 = pd12["grid_values"][1]
    joint = pd12["average"][0]
    
    joint -= joint.mean()
    v1 = pd1["average"][0] - pd1["average"][0].mean()
    v2 = pd2["average"][0] - pd2["average"][0].mean()
    
    numerator, denominator = 0.0, 0.0
    for _, row in X_s.iterrows():
        f12 = joint[np.argmin(np.abs(grid1 - row[feat1])), np.argmin(np.abs(grid2 - row[feat2]))]
        f1  = v1[np.argmin(np.abs(pd1["grid_values"][0] - row[feat1]))]
        f2  = v2[np.argmin(np.abs(pd2["grid_values"][0] - row[feat2]))]
        numerator   += (f12 - f1 - f2) ** 2
        denominator += f12 ** 2
    
    return np.sqrt(numerator / denominator)

def h_stat_total(model, X, feature, n_samples=500):
    X_s = X.sample(n_samples, random_state=42).reset_index(drop=True)
    
    f_hats = model.predict(X_s)
    
    # PD_j: marginalise out all features except j (standard 1D PDP)
    pd_j = partial_dependence(model, X_s, [feature], kind="average", grid_resolution=20)
    grid_j = pd_j["grid_values"][0]
    v_j = pd_j["average"][0]

    # PD_{-j}: for each observation, fix x_{-j} and average over x_j
    pd_minus_j = np.zeros(len(X_s))
    for idx in range(len(X_s)):
        X_temp = X_s.copy()
        X_temp[feature] = X_s[feature]  # vary x_j over training dist
        X_temp.loc[:, [c for c in X_s.columns if c != feature]] = \
            X_s.iloc[idx][[c for c in X_s.columns if c != feature]].values
        pd_minus_j[idx] = model.predict(X_temp).mean()

    numerator, denominator = 0.0, 0.0
    for idx, (_, row) in enumerate(X_s.iterrows()):
        fj    = v_j[np.argmin(np.abs(grid_j - row[feature]))]
        f_hat = f_hats[idx]
        numerator   += (f_hat - fj - pd_minus_j[idx]) ** 2
        denominator += f_hat ** 2

    return np.sqrt(numerator / denominator)</code></pre></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;152741a3-b54b-471d-95be-0f97776390bf&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">from tqdm import tqdm
import seaborn as sns

features = X.columns.tolist()
h_matrix = np.zeros((len(features), len(features)))

pairs = [(i, j, f1, f2) for i, f1 in enumerate(features) for j, f2 in enumerate(features) if i &lt; j]

for i, j, f1, f2 in tqdm(pairs, desc="Pairwise H"):
    h = h_stat_pairwise(model, X, f1, f2)
    h_matrix[i, j] = h
    h_matrix[j, i] = h

total_h = []
for f in tqdm(features, desc="Total H"):
    total_h.append(h_stat_total(model, X, f))

features_sorted, total_h_sorted = zip(*sorted(zip(features, total_h), key=lambda x: x[1]))

fig, axes = plt.subplots(1, 2, figsize=(16, 5))

sns.heatmap(h_matrix, xticklabels=features, yticklabels=features,
            annot=True, fmt=".2f", cmap="YlOrRd", ax=axes[0],
            linewidths=0.5, cbar_kws={"label": "H-statistic"}, vmin=0, vmax=1)
axes[0].set_title("Pairwise H-statistics", fontsize=13, fontweight="bold")

axes[1].barh(features_sorted, total_h_sorted, color="steelblue")
axes[1].axvline(0, color="black", linewidth=0.8)
axes[1].set_xlabel("H-statistic")
axes[1].set_title("Total H-statistics", fontsize=13, fontweight="bold")
axes[1].grid(True, alpha=0.3, axis="x")

plt.tight_layout()</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!kjcw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127e2312-c62c-4036-821c-87ed0938507e_1590x490.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kjcw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127e2312-c62c-4036-821c-87ed0938507e_1590x490.png 424w, https://substackcdn.com/image/fetch/$s_!kjcw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127e2312-c62c-4036-821c-87ed0938507e_1590x490.png 848w, https://substackcdn.com/image/fetch/$s_!kjcw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127e2312-c62c-4036-821c-87ed0938507e_1590x490.png 1272w, https://substackcdn.com/image/fetch/$s_!kjcw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127e2312-c62c-4036-821c-87ed0938507e_1590x490.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kjcw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127e2312-c62c-4036-821c-87ed0938507e_1590x490.png" width="1456" height="449" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/127e2312-c62c-4036-821c-87ed0938507e_1590x490.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:449,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:156912,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/193204015?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127e2312-c62c-4036-821c-87ed0938507e_1590x490.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!kjcw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127e2312-c62c-4036-821c-87ed0938507e_1590x490.png 424w, https://substackcdn.com/image/fetch/$s_!kjcw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127e2312-c62c-4036-821c-87ed0938507e_1590x490.png 848w, https://substackcdn.com/image/fetch/$s_!kjcw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127e2312-c62c-4036-821c-87ed0938507e_1590x490.png 1272w, https://substackcdn.com/image/fetch/$s_!kjcw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127e2312-c62c-4036-821c-87ed0938507e_1590x490.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 suffers from the typical drawback of all interpretable machine learning methods: It&#8217;s computationally expensive. It also only tells us the strength of the interactions, not what those interactions look like. A good workflow is to measure the interaction strengths with this method and then examine the strongest interactions in more detail using other methods (like specific SHAP plots that we will get to soon).</p><h2>2.4 SHAP</h2><p>We already covered how SHAP works so I will only showcase the plots that focus on global effect here.</p><h3>beeswarm:</h3><p>Shows the distribution of SHAP values for every feature across all observations.<br>Each dot is one observation, color indicates the feature value (red=high, blue=low).<br>Features are sorted by mean absolute SHAP 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_!qeS8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e815aa8-4b3f-4836-90cd-ddb8c6f92be3_758x660.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qeS8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e815aa8-4b3f-4836-90cd-ddb8c6f92be3_758x660.png 424w, https://substackcdn.com/image/fetch/$s_!qeS8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e815aa8-4b3f-4836-90cd-ddb8c6f92be3_758x660.png 848w, https://substackcdn.com/image/fetch/$s_!qeS8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e815aa8-4b3f-4836-90cd-ddb8c6f92be3_758x660.png 1272w, https://substackcdn.com/image/fetch/$s_!qeS8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e815aa8-4b3f-4836-90cd-ddb8c6f92be3_758x660.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qeS8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e815aa8-4b3f-4836-90cd-ddb8c6f92be3_758x660.png" width="758" height="660" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1e815aa8-4b3f-4836-90cd-ddb8c6f92be3_758x660.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:660,&quot;width&quot;:758,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:80226,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/193204015?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e815aa8-4b3f-4836-90cd-ddb8c6f92be3_758x660.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!qeS8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e815aa8-4b3f-4836-90cd-ddb8c6f92be3_758x660.png 424w, https://substackcdn.com/image/fetch/$s_!qeS8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e815aa8-4b3f-4836-90cd-ddb8c6f92be3_758x660.png 848w, https://substackcdn.com/image/fetch/$s_!qeS8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e815aa8-4b3f-4836-90cd-ddb8c6f92be3_758x660.png 1272w, https://substackcdn.com/image/fetch/$s_!qeS8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e815aa8-4b3f-4836-90cd-ddb8c6f92be3_758x660.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>Can see here that very negative momentum causes very SHAP values (mean reversion).</p><h3>mean absolute SHAP:</h3><p>Mean absolute SHAP value per feature (global feature importance).<br>Simpler than beeswarm, good for reporting which features matter most on average.</p><p>shap.summary_plot(sv_bps, X, plot_type="bar")</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!EVo6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe140671f-d93b-41e9-b5d9-1245f4f584cc_790x659.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!EVo6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe140671f-d93b-41e9-b5d9-1245f4f584cc_790x659.png 424w, https://substackcdn.com/image/fetch/$s_!EVo6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe140671f-d93b-41e9-b5d9-1245f4f584cc_790x659.png 848w, https://substackcdn.com/image/fetch/$s_!EVo6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe140671f-d93b-41e9-b5d9-1245f4f584cc_790x659.png 1272w, https://substackcdn.com/image/fetch/$s_!EVo6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe140671f-d93b-41e9-b5d9-1245f4f584cc_790x659.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!EVo6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe140671f-d93b-41e9-b5d9-1245f4f584cc_790x659.png" width="790" height="659" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e140671f-d93b-41e9-b5d9-1245f4f584cc_790x659.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:659,&quot;width&quot;:790,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:36951,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/193204015?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe140671f-d93b-41e9-b5d9-1245f4f584cc_790x659.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!EVo6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe140671f-d93b-41e9-b5d9-1245f4f584cc_790x659.png 424w, https://substackcdn.com/image/fetch/$s_!EVo6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe140671f-d93b-41e9-b5d9-1245f4f584cc_790x659.png 848w, https://substackcdn.com/image/fetch/$s_!EVo6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe140671f-d93b-41e9-b5d9-1245f4f584cc_790x659.png 1272w, https://substackcdn.com/image/fetch/$s_!EVo6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe140671f-d93b-41e9-b5d9-1245f4f584cc_790x659.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>Dependence Plots:</h3><p>For each feature, it plots phi_j vs x_j across all observations.<br>Color is automatically chosen as the feature that interacts most with x_j, revealing how the effect of x_j changes depending on another feature's value.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;5faa21fb-f275-47d3-99f4-f4a839cba66d&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">for feat in X.columns:
    shap.dependence_plot(feat, sv_bps.values, X, interaction_index="auto")</code></pre></div><p>Here is a notable ones:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Rnof!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97938be7-05ca-4076-b72b-7d32415a661b_685x453.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Rnof!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97938be7-05ca-4076-b72b-7d32415a661b_685x453.png 424w, https://substackcdn.com/image/fetch/$s_!Rnof!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97938be7-05ca-4076-b72b-7d32415a661b_685x453.png 848w, https://substackcdn.com/image/fetch/$s_!Rnof!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97938be7-05ca-4076-b72b-7d32415a661b_685x453.png 1272w, https://substackcdn.com/image/fetch/$s_!Rnof!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97938be7-05ca-4076-b72b-7d32415a661b_685x453.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Rnof!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97938be7-05ca-4076-b72b-7d32415a661b_685x453.png" width="685" height="453" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/97938be7-05ca-4076-b72b-7d32415a661b_685x453.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:453,&quot;width&quot;:685,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:49461,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/193204015?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97938be7-05ca-4076-b72b-7d32415a661b_685x453.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Rnof!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97938be7-05ca-4076-b72b-7d32415a661b_685x453.png 424w, https://substackcdn.com/image/fetch/$s_!Rnof!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97938be7-05ca-4076-b72b-7d32415a661b_685x453.png 848w, https://substackcdn.com/image/fetch/$s_!Rnof!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97938be7-05ca-4076-b72b-7d32415a661b_685x453.png 1272w, https://substackcdn.com/image/fetch/$s_!Rnof!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97938be7-05ca-4076-b72b-7d32415a661b_685x453.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 momentum is very negative and volume is very low, SHAP values become positive. The other ones didn&#8217;t have obvious interactions:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!de_V!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38b0cb-1d4a-48fa-9360-e22b7132398e_684x453.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!de_V!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38b0cb-1d4a-48fa-9360-e22b7132398e_684x453.png 424w, https://substackcdn.com/image/fetch/$s_!de_V!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38b0cb-1d4a-48fa-9360-e22b7132398e_684x453.png 848w, https://substackcdn.com/image/fetch/$s_!de_V!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38b0cb-1d4a-48fa-9360-e22b7132398e_684x453.png 1272w, https://substackcdn.com/image/fetch/$s_!de_V!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38b0cb-1d4a-48fa-9360-e22b7132398e_684x453.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!de_V!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38b0cb-1d4a-48fa-9360-e22b7132398e_684x453.png" width="430" height="284.780701754386" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ef38b0cb-1d4a-48fa-9360-e22b7132398e_684x453.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:453,&quot;width&quot;:684,&quot;resizeWidth&quot;:430,&quot;bytes&quot;:43260,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/193204015?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38b0cb-1d4a-48fa-9360-e22b7132398e_684x453.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!de_V!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38b0cb-1d4a-48fa-9360-e22b7132398e_684x453.png 424w, https://substackcdn.com/image/fetch/$s_!de_V!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38b0cb-1d4a-48fa-9360-e22b7132398e_684x453.png 848w, https://substackcdn.com/image/fetch/$s_!de_V!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38b0cb-1d4a-48fa-9360-e22b7132398e_684x453.png 1272w, https://substackcdn.com/image/fetch/$s_!de_V!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38b0cb-1d4a-48fa-9360-e22b7132398e_684x453.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_!f1uo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a02db6e-3806-4be1-a4bb-61793e7dbfd1_675x453.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!f1uo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a02db6e-3806-4be1-a4bb-61793e7dbfd1_675x453.png 424w, https://substackcdn.com/image/fetch/$s_!f1uo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a02db6e-3806-4be1-a4bb-61793e7dbfd1_675x453.png 848w, https://substackcdn.com/image/fetch/$s_!f1uo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a02db6e-3806-4be1-a4bb-61793e7dbfd1_675x453.png 1272w, https://substackcdn.com/image/fetch/$s_!f1uo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a02db6e-3806-4be1-a4bb-61793e7dbfd1_675x453.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!f1uo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a02db6e-3806-4be1-a4bb-61793e7dbfd1_675x453.png" width="431" height="289.24888888888887" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1a02db6e-3806-4be1-a4bb-61793e7dbfd1_675x453.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:453,&quot;width&quot;:675,&quot;resizeWidth&quot;:431,&quot;bytes&quot;:59493,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/193204015?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a02db6e-3806-4be1-a4bb-61793e7dbfd1_675x453.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!f1uo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a02db6e-3806-4be1-a4bb-61793e7dbfd1_675x453.png 424w, https://substackcdn.com/image/fetch/$s_!f1uo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a02db6e-3806-4be1-a4bb-61793e7dbfd1_675x453.png 848w, https://substackcdn.com/image/fetch/$s_!f1uo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a02db6e-3806-4be1-a4bb-61793e7dbfd1_675x453.png 1272w, https://substackcdn.com/image/fetch/$s_!f1uo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a02db6e-3806-4be1-a4bb-61793e7dbfd1_675x453.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_!rwJ6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde4b9ba9-3037-449b-80c3-0a7285f5b49a_682x453.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rwJ6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde4b9ba9-3037-449b-80c3-0a7285f5b49a_682x453.png 424w, https://substackcdn.com/image/fetch/$s_!rwJ6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde4b9ba9-3037-449b-80c3-0a7285f5b49a_682x453.png 848w, https://substackcdn.com/image/fetch/$s_!rwJ6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde4b9ba9-3037-449b-80c3-0a7285f5b49a_682x453.png 1272w, https://substackcdn.com/image/fetch/$s_!rwJ6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde4b9ba9-3037-449b-80c3-0a7285f5b49a_682x453.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rwJ6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde4b9ba9-3037-449b-80c3-0a7285f5b49a_682x453.png" width="436" height="289.6011730205279" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/de4b9ba9-3037-449b-80c3-0a7285f5b49a_682x453.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:453,&quot;width&quot;:682,&quot;resizeWidth&quot;:436,&quot;bytes&quot;:74402,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/193204015?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde4b9ba9-3037-449b-80c3-0a7285f5b49a_682x453.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rwJ6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde4b9ba9-3037-449b-80c3-0a7285f5b49a_682x453.png 424w, https://substackcdn.com/image/fetch/$s_!rwJ6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde4b9ba9-3037-449b-80c3-0a7285f5b49a_682x453.png 848w, https://substackcdn.com/image/fetch/$s_!rwJ6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde4b9ba9-3037-449b-80c3-0a7285f5b49a_682x453.png 1272w, https://substackcdn.com/image/fetch/$s_!rwJ6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde4b9ba9-3037-449b-80c3-0a7285f5b49a_682x453.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>Headmap:</h3><p>Shows phi_j for every feature j and every observation i simultaneously, features as rows and observations as columns. Each cell is colored by the SHAP value: red means the feature pushed the prediction up, blue means it pushed it down.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;b9ae0a1f-275b-4b7a-9b91-394a4aa388f3&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">shap.plots.heatmap(sv_bps)</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AanD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa1c95f2-16bc-4e00-a4ce-2fb7af44c5ff_929x558.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AanD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa1c95f2-16bc-4e00-a4ce-2fb7af44c5ff_929x558.png 424w, https://substackcdn.com/image/fetch/$s_!AanD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa1c95f2-16bc-4e00-a4ce-2fb7af44c5ff_929x558.png 848w, https://substackcdn.com/image/fetch/$s_!AanD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa1c95f2-16bc-4e00-a4ce-2fb7af44c5ff_929x558.png 1272w, https://substackcdn.com/image/fetch/$s_!AanD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa1c95f2-16bc-4e00-a4ce-2fb7af44c5ff_929x558.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AanD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa1c95f2-16bc-4e00-a4ce-2fb7af44c5ff_929x558.png" width="929" height="558" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fa1c95f2-16bc-4e00-a4ce-2fb7af44c5ff_929x558.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:558,&quot;width&quot;:929,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:59924,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/193204015?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa1c95f2-16bc-4e00-a4ce-2fb7af44c5ff_929x558.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!AanD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa1c95f2-16bc-4e00-a4ce-2fb7af44c5ff_929x558.png 424w, https://substackcdn.com/image/fetch/$s_!AanD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa1c95f2-16bc-4e00-a4ce-2fb7af44c5ff_929x558.png 848w, https://substackcdn.com/image/fetch/$s_!AanD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa1c95f2-16bc-4e00-a4ce-2fb7af44c5ff_929x558.png 1272w, https://substackcdn.com/image/fetch/$s_!AanD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa1c95f2-16bc-4e00-a4ce-2fb7af44c5ff_929x558.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>2.5 Permutation Feature Importance (PFI)</h2><p>We already know about mean absolute SHAP as a general measure of how important a feature is in a model. PFI is another such singular value. If a feature x_j is important, then randomly shuffling its values across observations will destroy its relationship with the target and cause the model&#8217;s performance to degrade. If it&#8217;s unimportant, shuffling it changes nothing.</p><p>We first fit the model and compute a baseline performance metric L (e.g. MSE, R^2, IC) on the dataset. Then, for each feature j, we randomly permute the values of x_j across all observations, leaving all other features unchanged. We recompute the performance metric L^(j) on the permuted dataset, and the importance of feature j becomes</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\Delta L_j = L^{(j)} - L&quot;,&quot;id&quot;:&quot;QRDBYDNPYM&quot;}" data-component-name="LatexBlockToDOM"></div><p>A large Delta L_j means the model relied heavily on x_j, and destroying it hurt performance a lot.</p><p>Since permutation is random, it&#8217;s standard to repeat this K times and average:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\text{PFI}_j = \\frac{1}{K} \\sum_{k=1}^K [L^{(j,k)}-L]&quot;,&quot;id&quot;:&quot;FSOOPWAFTV&quot;}" data-component-name="LatexBlockToDOM"></div><p>This is much faster to compute than SHAP and is directly tied to model performance, which is what we ultimately care about.</p><p>One BIG disadvantage is that if two features are highly correlated, then shuffling one leaves the other intact, and therefore both will receive a lot of permutation importance, even if they are super important to the model performance.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;02e2bc11-86dd-445e-9cd8-caefcb35bb62&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">from sklearn.inspection import permutation_importance

result = permutation_importance(model, X, y, n_repeats=30, random_state=42, scoring="r2")

sorted_idx = result.importances_mean.argsort()

fig, ax = plt.subplots(figsize=(8, 5))
ax.barh(X.columns[sorted_idx], result.importances_mean[sorted_idx], 
        xerr=result.importances_std[sorted_idx], color="steelblue", capsize=3)
ax.axvline(0, color="black", linewidth=0.8)
ax.set_xlabel("Mean decrease in $R^2$")
ax.set_title("Permutation Feature Importance", fontsize=13, fontweight="bold")
ax.grid(True, alpha=0.3, axis="x")
plt.tight_layout()</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7GB5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d5e11e8-ec5c-4596-9543-b68115f662c8_790x489.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7GB5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d5e11e8-ec5c-4596-9543-b68115f662c8_790x489.png 424w, https://substackcdn.com/image/fetch/$s_!7GB5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d5e11e8-ec5c-4596-9543-b68115f662c8_790x489.png 848w, https://substackcdn.com/image/fetch/$s_!7GB5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d5e11e8-ec5c-4596-9543-b68115f662c8_790x489.png 1272w, https://substackcdn.com/image/fetch/$s_!7GB5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d5e11e8-ec5c-4596-9543-b68115f662c8_790x489.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7GB5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d5e11e8-ec5c-4596-9543-b68115f662c8_790x489.png" width="790" height="489" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7d5e11e8-ec5c-4596-9543-b68115f662c8_790x489.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:489,&quot;width&quot;:790,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:32574,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/193204015?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d5e11e8-ec5c-4596-9543-b68115f662c8_790x489.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!7GB5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d5e11e8-ec5c-4596-9543-b68115f662c8_790x489.png 424w, https://substackcdn.com/image/fetch/$s_!7GB5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d5e11e8-ec5c-4596-9543-b68115f662c8_790x489.png 848w, https://substackcdn.com/image/fetch/$s_!7GB5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d5e11e8-ec5c-4596-9543-b68115f662c8_790x489.png 1272w, https://substackcdn.com/image/fetch/$s_!7GB5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d5e11e8-ec5c-4596-9543-b68115f662c8_790x489.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>2.6 Leave One Feature Out (LOFO) Importance</h2><p>Instead of permuting a feature and evaluating with the same model, we completely drop a feature and retrain the model without it. LOFO Importance then measures the performance drop compared to the full model:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\text{LOFO}_j = L_{\\text{full}} - L_{-j}&quot;,&quot;id&quot;:&quot;KBYSOYURWS&quot;}" data-component-name="LatexBlockToDOM"></div><p>This is extremely useful for feature selection, but it is incredibly expensive and suffers from the same issue that highly correlated features get low LOFO importance. If you remove features one at a time, that problem becomes less relevant, as when one of them drops, the other increases in importance and won&#8217;t be dropped again. </p><p>Let&#8217;s implement this with R^2 as our performance metric:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;79b16a3f-8b29-464a-adf7-f0904a694e0a&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">from sklearn.metrics import r2_score

baseline = r2_score(y, model.predict(X))

loo_importance = {}
for feat in tqdm(features, desc="LOO"):
    X_loo = X.drop(columns=[feat])
    m = XGBRegressor(n_estimators=300, max_depth=4, learning_rate=0.05,
                     subsample=0.8, colsample_bytree=0.8, random_state=42)
    m.fit(X_loo, y)
    loo_importance[feat] = baseline - r2_score(y, m.predict(X_loo))

sorted_feats, sorted_vals = zip(*sorted(loo_importance.items(), key=lambda x: x[1]))

fig, ax = plt.subplots(figsize=(8, 5))
ax.barh(sorted_feats, sorted_vals, color="steelblue")
ax.axvline(0, color="black", linewidth=0.8)
ax.set_xlabel("Decrease in $R^2$")
ax.set_title("Leave-One-Out Feature Importance", fontsize=13, fontweight="bold")
ax.grid(True, alpha=0.3, axis="x")
plt.tight_layout()</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HkR0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6426b196-097f-4807-9eab-9cdf8342d560_789x489.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HkR0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6426b196-097f-4807-9eab-9cdf8342d560_789x489.png 424w, https://substackcdn.com/image/fetch/$s_!HkR0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6426b196-097f-4807-9eab-9cdf8342d560_789x489.png 848w, https://substackcdn.com/image/fetch/$s_!HkR0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6426b196-097f-4807-9eab-9cdf8342d560_789x489.png 1272w, https://substackcdn.com/image/fetch/$s_!HkR0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6426b196-097f-4807-9eab-9cdf8342d560_789x489.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HkR0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6426b196-097f-4807-9eab-9cdf8342d560_789x489.png" width="789" height="489" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6426b196-097f-4807-9eab-9cdf8342d560_789x489.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:489,&quot;width&quot;:789,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:30358,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/193204015?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6426b196-097f-4807-9eab-9cdf8342d560_789x489.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!HkR0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6426b196-097f-4807-9eab-9cdf8342d560_789x489.png 424w, https://substackcdn.com/image/fetch/$s_!HkR0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6426b196-097f-4807-9eab-9cdf8342d560_789x489.png 848w, https://substackcdn.com/image/fetch/$s_!HkR0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6426b196-097f-4807-9eab-9cdf8342d560_789x489.png 1272w, https://substackcdn.com/image/fetch/$s_!HkR0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6426b196-097f-4807-9eab-9cdf8342d560_789x489.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><hr></div><h1>3. Conclusion</h1><p>I&#8217;ve never really written about ML before. If you enjoyed this article and would like to read more about ML, please let me know!</p><div class="poll-embed" data-attrs="{&quot;id&quot;:489630}" data-component-name="PollToDOM"></div><p>Join Quant Corner: <a href="https://discord.gg/X7TsxKNbXg">https://discord.gg/X7TsxKNbXg</a></p><p>If you enjoyed this article, please share it!</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.vertoxquant.com/p/looking-inside-the-black-box?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.vertoxquant.com/p/looking-inside-the-black-box?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><p>If you want to read more, consider subscribing!</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.vertoxquant.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">VertoxQuant is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</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></p>]]></content:encoded></item><item><title><![CDATA[Finding the Best Portfolio Optimization Technique]]></title><description><![CDATA[A comparative study of modern portfolio construction methods on crypto markets]]></description><link>https://www.vertoxquant.com/p/finding-the-best-portfolio-optimization</link><guid isPermaLink="false">https://www.vertoxquant.com/p/finding-the-best-portfolio-optimization</guid><dc:creator><![CDATA[Vertox]]></dc:creator><pubDate>Tue, 17 Mar 2026 22:32:28 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/29087727-5b71-4b01-9d0f-0a8aebd991f8_986x584.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Introduction</h2><p>This article provides a rigorous, hands-on walkthrough of portfolio optimization methods used in both research and industry. Rather than focusing on theory alone, we emphasize how these approaches behave in practice; what they optimize, which constraints matter, and the trade-offs they impose.</p><p>After briefly introducing the minimal notation, we move directly into the major families of portfolio construction techniques, including mean&#8211;variance, risk-based, and hierarchical approaches. The goal is not just to present these methods, but to understand when and why they work (or fail), especially in noisy and high-volatility environments.</p><p><strong>Prerequisite (recommended):</strong><br>This article assumes basic familiarity with Markowitz Mean&#8211;Variance Optimization (MVO). For full derivations of the efficient frontier, the tangency portfolio, and a detailed discussion of estimation error and its practical remedies (e.g., shrinkage, factor models, Black&#8211;Litterman, and robust optimization), see:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;78f039c9-df53-4801-9164-3b180e73ab1d&quot;,&quot;caption&quot;:&quot;Introduction&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;md&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Why Mean-Variance Optimization Breaks Down&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:128680675,&quot;name&quot;:&quot;Vertox&quot;,&quot;bio&quot;:&quot;Quantitative Researcher in Digital Asset Markets | Market Making | Statistical Arbitrage | Options &quot;,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!HGUA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bf3fd86-d46a-4caa-969a-d80059b72cb9_128x128.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2026-02-03T23:01:54.857Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!aB9w!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc64a161-9abb-481e-b211-33545c699a4d_824x464.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.vertoxquant.com/p/why-mean-variance-optimization-breaks&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:186718680,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:16,&quot;comment_count&quot;:0,&quot;publication_id&quot;:1726874,&quot;publication_name&quot;:&quot;VertoxQuant&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!ufaQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><h2><strong>Notation and Setup</strong></h2><p>Consider n risky assets with (random) single-period returns r &#8712; &#8477;&#8319;. A portfolio is represented by weights w &#8712; &#8477;&#8319;. In the simplest setting, the portfolio return is</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;r_p = w^\\top r.&quot;,&quot;id&quot;:&quot;YLGDOMNGNP&quot;}" data-component-name="LatexBlockToDOM"></div><p>Let the expected returns be</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\mu = \\mathbb{E}[r] \\in \\mathbb{R}^n,&quot;,&quot;id&quot;:&quot;MTKLSFMJOM&quot;}" data-component-name="LatexBlockToDOM"></div><p>and the covariance matrix be</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\Sigma = \\mathrm{Cov}(r) = \\mathbb{E}\\big[(r-\\mu)(r-\\mu)^\\top\\big] \\in \\mathbb{R}^{n \\times n}.&quot;,&quot;id&quot;:&quot;XFAJOAUUBQ&quot;}" data-component-name="LatexBlockToDOM"></div><p>Then the portfolio&#8217;s expected return and variance are</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\mathbb{E}[r_p] = w^\\top \\mu,\\qquad \\mathrm{Var}(r_p) = w^\\top \\Sigma w.&quot;,&quot;id&quot;:&quot;IHXCWXDKGK&quot;}" data-component-name="LatexBlockToDOM"></div><p>A standard budget constraint is</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\mathbf{1}^\\top w = 1,&quot;,&quot;id&quot;:&quot;GDTVTKQMDL&quot;}" data-component-name="LatexBlockToDOM"></div><p>where the left 1 is the all-ones vector in &#8477;&#8319;. Additional constraints may include long-only constraints w &gt;= 0, leverage limits |w|_1 &lt;= L, box constraints l &lt;= w &lt;= u, factor exposure constraints, and turnover constraints. Note: if w &gt;= 0 and 1^&#8868; w = 1, then |w|_1 = 1 is constant; l_1 leverage constraints/penalties matter primarily for long/short portfolios, active weights a = w - w_b, or turnover terms |wt - w_(t-1)|_1.</p><p>To set us up let&#8217;s first import the necessary libraries and set plot styles:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;fcbdc1f0-d58a-4116-a9b4-5765cc112240&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">import os
import glob
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

from scipy import linalg
from scipy import optimize
from scipy.optimize import linprog
from scipy.cluster.hierarchy import linkage, to_tree, dendrogram
from scipy.spatial.distance import squareform

# Plot style defaults.
plt.rcParams.update(
    {
        &#8220;figure.figsize&#8221;: (10, 6),
        &#8220;axes.grid&#8221;: True,
        &#8220;grid.alpha&#8221;: 0.3,
        &#8220;axes.titlesize&#8221;: 14,
        &#8220;axes.labelsize&#8221;: 12,
        &#8220;legend.fontsize&#8221;: 10,
    }
)</code></pre></div><p>We don&#8217;t  wanna be trading stablecoins, so we&#8217;ll exclude them:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;4dc3fad0-7f6b-4157-87e7-c33578c2ae7b&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">STABLE_SYMBOLS = {
    &#8220;USDT&#8221;, &#8220;USDC&#8221;, &#8220;USDS&#8221;, &#8220;USDE&#8221;, &#8220;DAI&#8221;, &#8220;PYUSD&#8221;, &#8220;USD1&#8221;, &#8220;XAUT&#8221;, &#8220;USDF&#8221;,
    &#8220;PAXG&#8221;, &#8220;USDG&#8221;, &#8220;RLUSD&#8221;, &#8220;BFUSD&#8221;, &#8220;USDD&#8221;, &#8220;USDTB&#8221;, &#8220;USD0&#8221;, &#8220;FDUSD&#8221;, &#8220;A7A5&#8221;,
    &#8220;GHO&#8221;, &#8220;TUSD&#8221;, &#8220;CUSD&#8221;, &#8220;USDB&#8221;, &#8220;USR&#8221;, &#8220;KAU&#8221;, &#8220;EURC&#8221;, &#8220;CRVUSD&#8221;, &#8220;KAG&#8221;,
    &#8220;BUSD&#8221;, &#8220;USX&#8221;, &#8220;FRAX&#8221;, &#8220;USDC.N&#8221;, &#8220;YLDS&#8221;, &#8220;USDA&#8221;, &#8220;AUSD&#8221;, &#8220;DUSD&#8221;, &#8220;SATUSD&#8221;,
    &#8220;GUSD&#8221;, &#8220;EURS&#8221;, &#8220;DOLA&#8221;, &#8220;FRXUSD&#8221;, &#8220;PUSD&#8221;, &#8220;AIDAUSDC&#8221;, &#8220;USDZ&#8221;, &#8220;AVUSD&#8221;, &#8220;MNEE&#8221;,
    &#8220;USDR&#8221;, &#8220;PGOLD&#8221;, &#8220;CASH&#8221;, &#8220;EURCV&#8221;, &#8220;SUSDA&#8221;, &#8220;USDO&#8221;, &#8220;FEUSD&#8221;, &#8220;USDX&#8221;, &#8220;YZUSD&#8221;,
    &#8220;MIM&#8221;, &#8220;USDKG&#8221;, &#8220;REUSD&#8221;, &#8220;USDM&#8221;, &#8220;USD+&#8221;, &#8220;USDP&#8221;, &#8220;YUSD&#8221;, &#8220;XUSD&#8221;, &#8220;BOLD&#8221;,
    &#8220;HYUSD&#8221;, &#8220;LISUSD&#8221;, &#8220;USTC&#8221;, &#8220;USDN&#8221;, &#8220;LUSD&#8221;, &#8220;FXUSD&#8221;, &#8220;HBD&#8221;, &#8220;XTUSD&#8221;, &#8220;HONEY&#8221;,
    &#8220;EUSD&#8221;, &#8220;ZCHF&#8221;, &#8220;MIMATIC&#8221;, &#8220;USN&#8221;, &#8220;SUSD&#8221;, &#8220;EURE&#8221;, &#8220;BUCK&#8221;, &#8220;MUSD&#8221;, &#8220;EURA&#8221;,
    &#8220;GYD&#8221;, &#8220;USDH&#8221;, &#8220;MSUSD&#8221;, &#8220;UTY&#8221;, &#8220;WEMIX$&#8221;, &#8220;YU&#8221;, &#8220;HOLLAR&#8221;, &#8220;ALUSD&#8221;, &#8220;XSGD&#8221;,
    &#8220;EURR&#8221;,
}</code></pre></div><p>Next, some useful helper function:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;431831cd-9592-4f79-ad10-6a82c487db55&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">def _normalize_symbol(symbol: str) -&gt; str:
    return &#8220;&#8221;.join(ch for ch in str(symbol).upper() if ch.isalnum())


def _base_symbol_from_ticker(ticker: str) -&gt; str:
    t = str(ticker).upper()
    suffix = &#8220;_USD_1DAY_COMPOSITE&#8221;
    if t.endswith(suffix):
        return t[:-len(suffix)]
    return t.split(&#8221;_&#8221;)[0]


STABLE_SYMBOLS_NORM = {_normalize_symbol(s) for s in STABLE_SYMBOLS}</code></pre></div><p>Whenever data isn&#8217;t available for a coin, we&#8217;ll be using synthetic data for demonstration purposes:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;f63a8b20-c774-4d6c-987c-a0ddb218e370&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python"># Synthetic fallback data.
def synthetic_crypto_like_returns(
    n_assets: int = 12,
    n_obs: int = 1200,
    seed: int = 42,
    df_t: float = 5.0,
    regime_switch_prob: float = 0.02,
) -&gt; pd.DataFrame:

    rng = np.random.default_rng(seed)
    dates = pd.date_range(&#8221;2020-01-01&#8221;, periods=n_obs, freq=&#8221;D&#8221;)

    # Build three correlation clusters.
    n_clusters = 3
    cluster_sizes = [n_assets // n_clusters] * n_clusters
    for i in range(n_assets % n_clusters):
        cluster_sizes[i] += 1
    clusters = np.concatenate([[k] * sz for k, sz in enumerate(cluster_sizes)])

    base_corr = np.eye(n_assets)
    for i in range(n_assets):
        for j in range(n_assets):
            if i == j:
                continue
            base_corr[i, j] = 0.55 if clusters[i] == clusters[j] else 0.15

    # Add symmetric jitter and keep the matrix positive definite.
    jitter = rng.normal(scale=0.03, size=(n_assets, n_assets))
    jitter = 0.5 * (jitter + jitter.T)
    corr = base_corr + jitter
    np.fill_diagonal(corr, 1.0)

    eig = np.linalg.eigvalsh(corr)
    if eig.min() &lt;= 1e-6:
        corr += (abs(eig.min()) + 1e-3) * np.eye(n_assets)

    # Give each asset a different daily volatility.
    base_vol = rng.uniform(0.02, 0.08, size=n_assets)
    cov = np.outer(base_vol, base_vol) * corr
    L = np.linalg.cholesky(cov)

    # Switch between low- and high-volatility regimes.
    vol_mult = np.ones(n_obs)
    state = 0
    for t in range(1, n_obs):
        if rng.random() &lt; regime_switch_prob:
            state = 1 - state
        vol_mult[t] = 1.0 if state == 0 else 2.0

    # Student-t shocks via normal / sqrt(chi2/df).
    Z = rng.standard_normal(size=(n_obs, n_assets))
    chi2 = rng.chisquare(df=df_t, size=n_obs) / df_t
    t_innov = Z / np.sqrt(chi2)[:, None]

    rets = (t_innov @ L.T) * vol_mult[:, None]
    cols = [f&#8221;Asset_{i:02d}&#8220; for i in range(n_assets)]
    return pd.DataFrame(rets, index=dates, columns=cols)</code></pre></div><p>The function for loading actual data (We are using CoinAPI):</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;76b92c84-b949-4414-a048-b4203fe0c749&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python"># Loader for real data files.
def load_crypto_dataset_from_dir(
    data_dir: str = &#8220;/Users/admin/Documents/Projects/PortfolioOptimization/data&#8221;,
    max_assets: int = 100,
    min_obs: int = 365,
    coverage_threshold: float = 0.98,
    selection_metric: str = &#8220;mean_volume&#8221;,  # &#8216;mean_volume&#8217; or &#8216;n_obs&#8217;
    verbose: bool = True,
):

    if not os.path.isdir(data_dir):
        raise FileNotFoundError(f&#8221;Directory not found: {data_dir}&#8220;)

    csv_files = sorted(glob.glob(os.path.join(data_dir, &#8220;*.csv&#8221;)))
    if len(csv_files) == 0:
        raise FileNotFoundError(f&#8221;No CSV files found in {data_dir}&#8220;)

    records = []
    price_series = {}
    excluded_stables = []

    for fp in csv_files:
        sym = os.path.splitext(os.path.basename(fp))[0].upper()
        base_sym = _base_symbol_from_ticker(sym)
        if _normalize_symbol(base_sym) in STABLE_SYMBOLS_NORM:
            excluded_stables.append(base_sym)
            continue
        try:
            df = pd.read_csv(fp)
        except Exception as e:
            if verbose:
                print(f&#8221;[WARN] Skipping {fp} (read error: {e})&#8221;)
            continue

        if &#8220;date&#8221; not in df.columns or &#8220;close&#8221; not in df.columns:
            if verbose:
                print(f&#8221;[WARN] Skipping {fp} (missing required columns &#8216;date&#8217;/&#8217;close&#8217;)&#8221;)
            continue

        keep_cols = [c for c in df.columns if c in (&#8221;date&#8221;, &#8220;close&#8221;, &#8220;volume_usd&#8221;)]
        df = df.loc[:, keep_cols].copy()

        df[&#8221;date&#8221;] = pd.to_datetime(df[&#8221;date&#8221;], errors=&#8221;coerce&#8221;)
        df[&#8221;close&#8221;] = pd.to_numeric(df[&#8221;close&#8221;], errors=&#8221;coerce&#8221;)
        df = df.dropna(subset=[&#8221;date&#8221;, &#8220;close&#8221;]).sort_values(&#8221;date&#8221;)
        df = df.drop_duplicates(subset=[&#8221;date&#8221;], keep=&#8221;last&#8221;)

        if df.shape[0] &lt; min_obs:
            continue

        s = df.set_index(&#8221;date&#8221;)[&#8221;close&#8221;].astype(float)
        price_series[sym] = s

        mean_volume = float(df[&#8221;volume_usd&#8221;].astype(float).mean()) if &#8220;volume_usd&#8221; in df.columns else np.nan
        records.append(
            {
                &#8220;symbol&#8221;: sym,
                &#8220;n_obs&#8221;: int(df.shape[0]),
                &#8220;start&#8221;: df[&#8221;date&#8221;].min(),
                &#8220;end&#8221;: df[&#8221;date&#8221;].max(),
                &#8220;mean_volume_usd&#8221;: mean_volume,
                &#8220;file&#8221;: fp,
            }
        )

    if len(price_series) &lt; 2:
        raise ValueError(f&#8221;Insufficient usable assets in {data_dir} after filtering (min_obs={min_obs}).&#8221;)

    info = pd.DataFrame(records).set_index(&#8221;symbol&#8221;)

    # Pick the sorting column.
    if selection_metric == &#8220;mean_volume&#8221; and info[&#8221;mean_volume_usd&#8221;].notna().any():
        sort_by = &#8220;mean_volume_usd&#8221;
    else:
        sort_by = &#8220;n_obs&#8221;

    info = info.sort_values(by=sort_by, ascending=False, na_position=&#8221;last&#8221;)
    selected = list(info.index[:max_assets])

    prices = pd.concat({sym: price_series[sym] for sym in selected}, axis=1).sort_index()
    rets = np.log(prices).diff()

    # Filter assets again after return coverage is computed.
    coverage = rets.notna().mean()
    keep_cols = coverage[coverage &gt;= coverage_threshold].index.tolist()
    prices = prices[keep_cols]
    rets = rets[keep_cols]
    info = info.loc[keep_cols]

    before_rows = rets.shape[0]
    rets = rets.dropna(how=&#8221;any&#8221;)  # intersection of dates
    prices = prices.loc[rets.index]
    after_rows = rets.shape[0]

    if verbose:
        if excluded_stables:
            print(f&#8221;[DATA] Excluded {len(set(excluded_stables))} stable symbols before selection.&#8221;)
        print(f&#8221;[DATA] Loaded {len(keep_cols)} assets from {data_dir} (sorted by {sort_by}).&#8221;)
        print(f&#8221;[DATA] Date range: {rets.index.min().date()} &#8594; {rets.index.max().date()} ({after_rows} daily obs).&#8221;)
        print(
            &#8220;[DATA] Missing-data policy: drop any date with any missing return across selected assets &#8220;
            f&#8221;(kept {after_rows}/{before_rows} rows after alignment).&#8221;
        )

    if after_rows &lt; 120:
        raise ValueError(&#8221;Not enough aligned observations after missing-data handling.&#8221;)

    return prices, rets, info</code></pre></div><p>The following function computes returns from price data:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;ad1757ed-67d5-4c87-8cb7-026864b6f501&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">def get_crypto_returns(
    data_dir: str = &#8220;/Users/admin/Documents/Projects/PortfolioOptimization/data&#8221;,
    max_assets: int = 100,
    min_obs: int = 365,
    coverage_threshold: float = 0.98,
    seed_fallback: int = 42,
    verbose: bool = True,
):

    try:
        prices, rets, info = load_crypto_dataset_from_dir(
            data_dir=data_dir,
            max_assets=max_assets,
            min_obs=min_obs,
            coverage_threshold=coverage_threshold,
            verbose=verbose,
        )
        source = &#8220;real&#8221;
    except Exception as e:
        if verbose:
            print(f&#8221;[FALLBACK] Using synthetic data because real /Users/admin/Documents/Projects/PortfolioOptimization/data load failed: {e}&#8220;)
        prices = None
        rets = synthetic_crypto_like_returns(n_assets=max_assets, n_obs=1200, seed=seed_fallback)
        info = pd.DataFrame({&#8221;symbol&#8221;: rets.columns, &#8220;n_obs&#8221;: len(rets), &#8220;mean_volume_usd&#8221;: np.nan}).set_index(&#8221;symbol&#8221;)
        source = &#8220;synthetic&#8221;
    return prices, rets, info, source</code></pre></div><p>Next, some helpful mathematical helper functions:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;cb549ce8-1521-4a0b-9789-95883a33ae8c&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python"># Basic math helpers.
def regularize_cov(S: np.ndarray, eps: float = 1e-8) -&gt; np.ndarray:
    &#8220;&#8221;&#8220;Symmetrize and add a small diagonal jitter for numerical stability.&#8221;&#8220;&#8221;
    S = np.asarray(S)
    S = 0.5 * (S + S.T)
    return S + eps * np.eye(S.shape[0])

def annualized_return(log_r: pd.Series, periods_per_year: int = 365) -&gt; float:
    &#8220;&#8221;&#8220;Geometric annualized return from log returns.&#8221;&#8220;&#8221;
    years = len(log_r) / periods_per_year
    return float(np.exp(log_r.sum() / years) - 1.0) if years &gt; 0 else np.nan

def annualized_vol(log_r: pd.Series, periods_per_year: int = 365) -&gt; float:
    return float(log_r.std(ddof=1) * np.sqrt(periods_per_year))

def sharpe_ratio(log_r: pd.Series, rf_annual: float = 0.0, periods_per_year: int = 365) -&gt; float:
    rf_log = np.log1p(rf_annual) / periods_per_year
    ex = log_r - rf_log
    vol = ex.std(ddof=1) * np.sqrt(periods_per_year)
    mean = ex.mean() * periods_per_year
    return float(mean / vol) if vol &gt; 0 else np.nan

def max_drawdown(log_r: pd.Series) -&gt; float:
    equity = np.exp(log_r.cumsum())
    peak = equity.cummax()
    dd = equity / peak - 1.0
    return float(dd.min())

def empirical_cvar(log_r: np.ndarray, alpha: float = 0.95) -&gt; float:
    &#8220;&#8221;&#8220;
    Empirical CVaR of *losses* using simple returns:
      loss = - (exp(log_r) - 1)
    &#8220;&#8221;&#8220;
    simple = np.expm1(log_r)
    losses = -simple
    k = max(1, int(np.ceil((1 - alpha) * len(losses))))
    tail = np.sort(losses)[-k:]
    return float(tail.mean())</code></pre></div><p>The following data loads our data and does some quick diagnostics:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;ebcfe3d4-a41a-4621-b131-e7031520b1b8&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python"># Load real data if available, otherwise use synthetic data.
crypto_prices, crypto_returns, asset_info, DATA_SOURCE = get_crypto_returns(
    data_dir=&#8221;/Users/admin/Documents/Projects/PortfolioOptimization/data&#8221;,
    max_assets=40,
    min_obs=365,
    coverage_threshold=0.98,
    seed_fallback=42,
    verbose=True,
)

print(f&#8221;\n[INFO] Data source: {DATA_SOURCE}&#8220;)
print(f&#8221;[INFO] Returns shape: {crypto_returns.shape[0]} dates &#215; {crypto_returns.shape[1]} assets&#8221;)
print(f&#8221;[INFO] Assets: {list(crypto_returns.columns)}&#8220;)
print(&#8221;\n[INFO] Asset info (head):&#8221;)
print(asset_info.head())

# Quick diagnostics before the experiments.
pooled = crypto_returns.stack()
print(f&#8221;\n[DIAGNOSTIC] Pooled daily log-return mean: {pooled.mean():.6f}&#8220;)
print(f&#8221;[DIAGNOSTIC] Pooled daily log-return std : {pooled.std(ddof=1):.6f}&#8220;)
print(f&#8221;[DIAGNOSTIC] Pooled excess kurtosis      : {pooled.kurt():.2f}&#8220;)

# Plot pooled return histogram and correlation heatmap.
fig, ax = plt.subplots()
ax.hist(pooled.values, bins=80, density=True)
ax.set_title(&#8221;Pooled daily log returns (all assets)&#8221;)
ax.set_xlabel(&#8221;log return&#8221;)
ax.set_ylabel(&#8221;density&#8221;)
plt.tight_layout()
plt.show()

corr = crypto_returns.corr().values
fig, ax = plt.subplots()
im = ax.imshow(corr, aspect=&#8221;auto&#8221;)
ax.set_title(&#8221;Correlation matrix (aligned returns)&#8221;)
ax.set_xticks(range(crypto_returns.shape[1]))
ax.set_yticks(range(crypto_returns.shape[1]))
ax.set_xticklabels(crypto_returns.columns, rotation=90)
ax.set_yticklabels(crypto_returns.columns)
plt.colorbar(im, ax=ax, fraction=0.046, pad=0.04)
plt.tight_layout()
plt.show()
</code></pre></div><pre><code>[DATA] Excluded 17 stable symbols before selection.
[DATA] Loaded 18 assets from /Users/admin/Documents/Projects/PortfolioOptimization/data (sorted by mean_volume_usd).
[DATA] Date range: 2022-01-04 &#8594; 2026-01-16 (1472 daily obs).
[DATA] Missing-data policy: drop any date with any missing return across selected assets (kept 1472/1477 rows after alignment).

[INFO] Data source: real
[INFO] Returns shape: 1472 dates &#215; 18 assets
[INFO] Assets: [&#8217;BTC_USD_1DAY_COMPOSITE&#8217;, &#8216;ETH_USD_1DAY_COMPOSITE&#8217;, &#8216;SOL_USD_1DAY_COMPOSITE&#8217;, &#8216;XRP_USD_1DAY_COMPOSITE&#8217;, &#8216;DOGE_USD_1DAY_COMPOSITE&#8217;, &#8216;ADA_USD_1DAY_COMPOSITE&#8217;, &#8216;FTM_USD_1DAY_COMPOSITE&#8217;, &#8216;RUNE_USD_1DAY_COMPOSITE&#8217;, &#8216;LINK_USD_1DAY_COMPOSITE&#8217;, &#8216;AVAX_USD_1DAY_COMPOSITE&#8217;, &#8216;SHIB_USD_1DAY_COMPOSITE&#8217;, &#8216;CFX_USD_1DAY_COMPOSITE&#8217;, &#8216;LTC_USD_1DAY_COMPOSITE&#8217;, &#8216;XLM_USD_1DAY_COMPOSITE&#8217;, &#8216;HBAR_USD_1DAY_COMPOSITE&#8217;, &#8216;CAKE_USD_1DAY_COMPOSITE&#8217;, &#8216;DYDX_USD_1DAY_COMPOSITE&#8217;, &#8216;XMR_USD_1DAY_COMPOSITE&#8217;]

[INFO] Asset info (head):
                         n_obs      start        end  mean_volume_usd  \
symbol                                                                  
BTC_USD_1DAY_COMPOSITE    1477 2022-01-01 2026-01-16     1.168389e+09   
ETH_USD_1DAY_COMPOSITE    1477 2022-01-01 2026-01-16     6.636419e+08   
SOL_USD_1DAY_COMPOSITE    1477 2022-01-01 2026-01-16     2.891621e+08   
XRP_USD_1DAY_COMPOSITE    1477 2022-01-01 2026-01-16     2.603798e+08   
DOGE_USD_1DAY_COMPOSITE   1477 2022-01-01 2026-01-16     1.068017e+08   

                                                                      file  
symbol                                                                      
BTC_USD_1DAY_COMPOSITE   /Users/admin/Documents/Projects/PortfolioOptim...  
ETH_USD_1DAY_COMPOSITE   /Users/admin/Documents/Projects/PortfolioOptim...  
SOL_USD_1DAY_COMPOSITE   /Users/admin/Documents/Projects/PortfolioOptim...  
XRP_USD_1DAY_COMPOSITE   /Users/admin/Documents/Projects/PortfolioOptim...  
DOGE_USD_1DAY_COMPOSITE  /Users/admin/Documents/Projects/PortfolioOptim...  

[DIAGNOSTIC] Pooled daily log-return mean: -0.000667
[DIAGNOSTIC] Pooled daily log-return std : 0.049747
[DIAGNOSTIC] Pooled excess kurtosis      : 13.75
</code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Un4E!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaeda4cb-8fe6-4d0a-a3c8-4dfc19c89331_989x590.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Un4E!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaeda4cb-8fe6-4d0a-a3c8-4dfc19c89331_989x590.png 424w, https://substackcdn.com/image/fetch/$s_!Un4E!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaeda4cb-8fe6-4d0a-a3c8-4dfc19c89331_989x590.png 848w, https://substackcdn.com/image/fetch/$s_!Un4E!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaeda4cb-8fe6-4d0a-a3c8-4dfc19c89331_989x590.png 1272w, https://substackcdn.com/image/fetch/$s_!Un4E!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaeda4cb-8fe6-4d0a-a3c8-4dfc19c89331_989x590.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Un4E!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaeda4cb-8fe6-4d0a-a3c8-4dfc19c89331_989x590.png" width="989" height="590" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/daeda4cb-8fe6-4d0a-a3c8-4dfc19c89331_989x590.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:590,&quot;width&quot;:989,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;plot&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="plot" title="plot" srcset="https://substackcdn.com/image/fetch/$s_!Un4E!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaeda4cb-8fe6-4d0a-a3c8-4dfc19c89331_989x590.png 424w, https://substackcdn.com/image/fetch/$s_!Un4E!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaeda4cb-8fe6-4d0a-a3c8-4dfc19c89331_989x590.png 848w, https://substackcdn.com/image/fetch/$s_!Un4E!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaeda4cb-8fe6-4d0a-a3c8-4dfc19c89331_989x590.png 1272w, https://substackcdn.com/image/fetch/$s_!Un4E!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaeda4cb-8fe6-4d0a-a3c8-4dfc19c89331_989x590.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_!9wcG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ee54e3f-fc96-4eea-98a7-357bed22da4a_985x590.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9wcG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ee54e3f-fc96-4eea-98a7-357bed22da4a_985x590.png 424w, https://substackcdn.com/image/fetch/$s_!9wcG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ee54e3f-fc96-4eea-98a7-357bed22da4a_985x590.png 848w, https://substackcdn.com/image/fetch/$s_!9wcG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ee54e3f-fc96-4eea-98a7-357bed22da4a_985x590.png 1272w, https://substackcdn.com/image/fetch/$s_!9wcG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ee54e3f-fc96-4eea-98a7-357bed22da4a_985x590.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9wcG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ee54e3f-fc96-4eea-98a7-357bed22da4a_985x590.png" width="985" height="590" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8ee54e3f-fc96-4eea-98a7-357bed22da4a_985x590.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:590,&quot;width&quot;:985,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;plot&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="plot" title="plot" srcset="https://substackcdn.com/image/fetch/$s_!9wcG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ee54e3f-fc96-4eea-98a7-357bed22da4a_985x590.png 424w, https://substackcdn.com/image/fetch/$s_!9wcG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ee54e3f-fc96-4eea-98a7-357bed22da4a_985x590.png 848w, https://substackcdn.com/image/fetch/$s_!9wcG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ee54e3f-fc96-4eea-98a7-357bed22da4a_985x590.png 1272w, https://substackcdn.com/image/fetch/$s_!9wcG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ee54e3f-fc96-4eea-98a7-357bed22da4a_985x590.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><hr></div><h1><strong>1. Baseline: MVO Recap</strong></h1><p>We use MVO as the reference point for the rest of this notebook. For full derivations and numerical examples, see the following article:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;8ce370f7-cba0-4d5a-a9fe-f0228fc09474&quot;,&quot;caption&quot;:&quot;Introduction&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;md&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Why Mean-Variance Optimization Breaks Down&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:128680675,&quot;name&quot;:&quot;Vertox&quot;,&quot;bio&quot;:&quot;Quantitative Researcher in Digital Asset Markets | Market Making | Statistical Arbitrage | Options &quot;,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!HGUA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bf3fd86-d46a-4caa-969a-d80059b72cb9_128x128.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2026-02-03T23:01:54.857Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!aB9w!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc64a161-9abb-481e-b211-33545c699a4d_824x464.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.vertoxquant.com/p/why-mean-variance-optimization-breaks&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:186718680,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:16,&quot;comment_count&quot;:0,&quot;publication_id&quot;:1726874,&quot;publication_name&quot;:&quot;VertoxQuant&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!ufaQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><h2><strong>1.1 Canonical formulations</strong></h2><p>(MVO-1) <strong>Minimum variance at target return</strong>: </p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\begin{aligned}\n\\min_{w}\\quad &amp; w^\\top \\Sigma w \\\\\n\\text{s.t.}\\quad &amp; w^\\top \\mu = \\mu_p, \\\\\n&amp; \\mathbf{1}^\\top w = 1, \\\\\n&amp; w \\in \\mathcal{W}.\n\\end{aligned}&quot;,&quot;id&quot;:&quot;DKFEHPXKGB&quot;}" data-component-name="LatexBlockToDOM"></div><p>(MVO-2) <strong>Penalized mean&#8211;variance utility</strong>:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\begin{aligned}\n\\max_{w}\\quad &amp; w^\\top \\mu - \\frac{\\gamma}{2} w^\\top \\Sigma w \\\\\n\\text{s.t.}\\quad &amp; \\mathbf{1}^\\top w = 1, \\\\\n&amp; w \\in \\mathcal{W}.\n\\end{aligned}&quot;,&quot;id&quot;:&quot;BUHODLRPRS&quot;}" data-component-name="LatexBlockToDOM"></div><p>Varying &#956;_p in (MVO-1) or &#947; in (MVO-2) traces the (constraint-dependent) efficient frontier: the set of portfolios that are not dominated in (&#963;, E[r]) space.</p><h2><strong>1.2 Two anchor portfolios</strong></h2><p><strong>Global minimum variance (GMV)</strong> (unconstrained): </p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;w_{\\mathrm{GMV}} = \\frac{\\Sigma^{-1}\\mathbf{1}}{\\mathbf{1}^\\top \\Sigma^{-1}\\mathbf{1}}.&quot;,&quot;id&quot;:&quot;YGPLHYEHAI&quot;}" data-component-name="LatexBlockToDOM"></div><p>With a risk-free rate r_f and excess returns &#956;_e = &#956; - r_f 1, the <strong>tangency / maximum Sharpe</strong> portfolio (unconstrained) is: </p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;w_{\\mathrm{tan}} = \\frac{\\Sigma^{-1}\\mu_e}{\\mathbf{1}^\\top \\Sigma^{-1}\\mu_e}.&quot;,&quot;id&quot;:&quot;SITJLZNIAU&quot;}" data-component-name="LatexBlockToDOM"></div><p>We construct a simple synthetic market with a random covariance matrix and expected returns, allowing us to study the geometry of mean&#8211;variance optimization in a controlled setting.</p><p>Using closed-form solutions, we compute the <strong>global minimum variance (GMV)</strong> portfolio and the <strong>tangency portfolio</strong> (maximum Sharpe ratio). We then sweep across target returns to trace out the <strong>efficient frontier</strong>, which shows the best achievable return for each level of risk.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;95b8e122-212c-4853-8d82-d657b98a95ca&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python"># Synthetic efficient frontier example.
rng = np.random.default_rng(0)

n = 6
A = rng.normal(size=(n, n))
Sigma = A @ A.T  # SPD covariance
mu = rng.normal(loc=0.0005, scale=0.0010, size=n)  # daily expected log returns

ones = np.ones(n)
Sigma = regularize_cov(Sigma, eps=1e-10)
Sigma_inv = linalg.inv(Sigma)

# GMV portfolio.
w_gmv = Sigma_inv @ ones / (ones @ Sigma_inv @ ones)
mu_gmv = float(w_gmv @ mu)
vol_gmv = float(np.sqrt(w_gmv @ Sigma @ w_gmv))

# Tangency portfolio (rf=0).
w_tan_unnorm = Sigma_inv @ mu
w_tan = w_tan_unnorm / (ones @ w_tan_unnorm)
mu_tan = float(w_tan @ mu)
vol_tan = float(np.sqrt(w_tan @ Sigma @ w_tan))

# Closed-form frontier with budget and target-return constraints.
A_ = mu @ Sigma_inv @ mu
B_ = mu @ Sigma_inv @ ones
C_ = ones @ Sigma_inv @ ones
D_ = A_ * C_ - B_**2

# Sweep target returns around GMV.
targets = np.linspace(mu_gmv - 1.5 * np.std(mu), mu_gmv + 1.5 * np.std(mu), 80)
frontier_vol = []
for mu_p in targets:
    # Frontier variance at target return mu_p.
    var = (C_ * mu_p**2 - 2.0 * B_ * mu_p + A_) / D_
    frontier_vol.append(np.sqrt(var))

frontier_vol = np.array(frontier_vol)

# Plot volatility vs expected return.
fig, ax = plt.subplots()
ax.plot(frontier_vol, targets, label=&#8221;Efficient frontier (unconstrained)&#8221;)
ax.scatter([vol_gmv], [mu_gmv], label=&#8221;GMV&#8221;, zorder=3)
ax.scatter([vol_tan], [mu_tan], label=&#8221;Tangency (rf=0)&#8221;, zorder=3)

ax.set_title(&#8221;Markowitz efficient frontier geometry (synthetic &#956;, &#931;)&#8221;)
ax.set_xlabel(&#8221;Portfolio volatility  (&#963;)&#8221;)
ax.set_ylabel(&#8221;Expected portfolio return  (E[r])&#8221;)
ax.legend()
plt.tight_layout()
plt.show()

print(&#8221;[SYNTHETIC SUMMARY]&#8221;)
print(f&#8221;GMV:     E[r]={mu_gmv:.6f},  &#963;={vol_gmv:.6f},  sum(w)={w_gmv.sum():.3f}&#8220;)
print(f&#8221;Tangency E[r]={mu_tan:.6f},  &#963;={vol_tan:.6f},  sum(w)={w_tan.sum():.3f}&#8220;)
print(&#8221;\nGMV weights:&#8221;, np.round(w_gmv, 4))
print(&#8221;Tan weights:&#8221;, np.round(w_tan, 4))
</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8y-j!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f29f164-4563-45a5-9786-37a711aef071_990x590.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8y-j!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f29f164-4563-45a5-9786-37a711aef071_990x590.png 424w, https://substackcdn.com/image/fetch/$s_!8y-j!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f29f164-4563-45a5-9786-37a711aef071_990x590.png 848w, https://substackcdn.com/image/fetch/$s_!8y-j!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f29f164-4563-45a5-9786-37a711aef071_990x590.png 1272w, https://substackcdn.com/image/fetch/$s_!8y-j!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f29f164-4563-45a5-9786-37a711aef071_990x590.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8y-j!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f29f164-4563-45a5-9786-37a711aef071_990x590.png" width="990" height="590" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f29f164-4563-45a5-9786-37a711aef071_990x590.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:590,&quot;width&quot;:990,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;plot&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="plot" title="plot" srcset="https://substackcdn.com/image/fetch/$s_!8y-j!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f29f164-4563-45a5-9786-37a711aef071_990x590.png 424w, https://substackcdn.com/image/fetch/$s_!8y-j!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f29f164-4563-45a5-9786-37a711aef071_990x590.png 848w, https://substackcdn.com/image/fetch/$s_!8y-j!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f29f164-4563-45a5-9786-37a711aef071_990x590.png 1272w, https://substackcdn.com/image/fetch/$s_!8y-j!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f29f164-4563-45a5-9786-37a711aef071_990x590.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><pre><code>[SYNTHETIC SUMMARY]
GMV:     E[r]=0.001123,  &#963;=0.344942,  sum(w)=1.000
Tangency E[r]=0.002090,  &#963;=0.470481,  sum(w)=1.000

GMV weights: [ 0.2473  0.3281 -0.0938 -0.0937 -0.0412  0.6533]
Tan weights: [ 0.1141  0.7469 -0.174  -0.1761 -0.512   1.0012]
</code></pre><h2><strong>1.3 Assumptions (why the baseline is clean, and why it breaks)</strong></h2><p>MVO is exact under normality or quadratic utility (more generally, elliptical return families) in a single-period setting with known (&#956;,&#931;). In practice, (&#956;,&#931;) are estimated, markets are non-stationary, and constraints/transaction costs are unavoidable. The rest of this notebook is largely about methods that either (i) reduce dependence on fragile estimates, (ii) change the risk objective, or (iii) impose structure to improve out-of-sample stability.</p><div><hr></div><h1><strong>2. How We&#8217;ll Compare Portfolio Optimization Methods in Practice</strong></h1><p>I write about quantitative trading the way it&#8217;s actually practiced:<br>Robust models and portfolios, combining signals and strategies, understanding the assumptions behind your models.</p><p>More broadly, I write about:</p><ul><li><p>Statistical and cross-sectional arbitrage</p></li><li><p>Managing multiple strategies and signals</p></li><li><p>Risk and capital allocation</p></li><li><p>Research tooling and methodology</p></li><li><p>In-depth model assumptions and derivations</p></li></ul><p>If this way of thinking resonates, you&#8217;ll probably like what I publish.</p>
      <p>
          <a href="https://www.vertoxquant.com/p/finding-the-best-portfolio-optimization">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[95% of Stat Arb Strategies Are Built Wrong]]></title><description><![CDATA[Learning to Rank for Cross-Sectional Strategies]]></description><link>https://www.vertoxquant.com/p/learning-to-rank</link><guid isPermaLink="false">https://www.vertoxquant.com/p/learning-to-rank</guid><dc:creator><![CDATA[Vertox]]></dc:creator><pubDate>Thu, 05 Mar 2026 21:10:16 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!_7Je!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa6c99df1-af88-4fff-96da-0945290cbab8_1995x670.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1>Introduction</h1><p>Most models are trained to predict individual asset returns.</p><p>That seems reasonable. But for cross-sectional strategies, prediction accuracy is often the wrong objective.</p><p>Cross-sectional portfolios turn model outputs into trades by <strong>ranking assets at each rebalance date</strong> and going long the top names while shorting the bottom. Once trades are determined by rank, the absolute level of forecasts often becomes irrelevant: any monotone transformation of model scores produces the same portfolio.</p><p>In other words, <strong>getting the ordering right matters more than predicting returns precisely</strong>.</p><p>This creates a subtle but important mismatch. A model can achieve excellent pointwise accuracy (low RMSE) while producing a weak, or even negative, long&#8211;short spread. Conversely, a model with poor regression metrics may generate strong cross-sectional performance.</p><p>However, ranking is not always all that matters. When position sizing, risk budgeting, transaction cost models, or portfolio optimizers depend on forecast magnitudes and calibration, pointwise accuracy becomes important again.</p><p>In this article, we develop <strong>Learning to Rank (LTR)</strong> as a principled framework for cross-sectional strategies.</p><p>The argument proceeds in three steps:</p><ol><li><p>We formalize the cross-sectional decision problem and show how the score-to-weight mapping determines which properties of model output actually affect PnL.</p></li><li><p>We demonstrate with numerical examples how low RMSE can coexist with negative long&#8211;short spreads, and vice versa.</p></li><li><p>We derive practical LTR objectives for statistical arbitrage, including label engineering, pair weighting, neutralization, and cost-aware evaluation.</p></li></ol><div><hr></div><p>I write about quantitative trading the way it&#8217;s actually practiced:<br>Robust models and portfolios, combining signals and strategies, understanding the assumptions behind your models.</p><p>More broadly, I write about:</p><ul><li><p>Statistical and cross-sectional arbitrage</p></li><li><p>Managing multiple strategies and signals</p></li><li><p>Risk and capital allocation</p></li><li><p>Research tooling and methodology</p></li><li><p>In-depth model assumptions and derivations</p></li></ul><p>If this way of thinking resonates, you&#8217;ll probably like what I publish.</p>
      <p>
          <a href="https://www.vertoxquant.com/p/learning-to-rank">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Discrete Market Making]]></title><description><![CDATA[What every research paper ignores]]></description><link>https://www.vertoxquant.com/p/discrete-market-making</link><guid isPermaLink="false">https://www.vertoxquant.com/p/discrete-market-making</guid><dc:creator><![CDATA[Vertox]]></dc:creator><pubDate>Sat, 28 Feb 2026 14:24:12 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!UTSt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F250b12de-ebfd-440e-ad9c-1d3599bed66e_1349x677.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Classical market-making theory is often developed in a continuous-price setting where quotes can be adjusted by arbitrarily small amounts and fill intensities depend smoothly on the distance to a reference price. </p><p>Real limit order books are discrete: all displayed prices lie on a grid with tick size &gt; 0, and, especially in &#8220;large-tick&#8221; assets, the bid&#8211;ask spread is frequently pinned at one tick. <br>This changes the economics of liquidity provision (where rents come from, how they are competed away, and how adverse selection manifests) and it changes the mathematics of optimal control (from smooth optimization to discrete choice, hybrid/impulse control, and state augmentation for queue position). </p><p>This article provides a rigorous, pedagogical deep-dive that starts from the canonical continuous-time market-making framework and then explains, in detail, why and how tick size and queue priority alter optimal quoting. <br>We then survey the spectrum of modeling and control approaches used in practice: exact discrete-state dynamic programming, queue-aware Markov models, continuous relaxations with discrete corrections, and pragmatic heuristics used when the exact discrete control problem is computationally intractable.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.vertoxquant.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">VertoxQuant is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</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>I write about quantitative trading the way it&#8217;s actually practiced:<br>Robust models and portfolios, combining signals and strategies, understanding the assumptions behind your models.</p><p>More broadly, I write about:</p><ul><li><p>Statistical and cross-sectional arbitrage</p></li><li><p>Managing multiple strategies and signals</p></li><li><p>Risk and capital allocation</p></li><li><p>Research tooling and methodology</p></li><li><p>In-depth model assumptions and derivations</p></li></ul><p>If this way of thinking resonates, you&#8217;ll probably like what I publish.</p>
      <p>
          <a href="https://www.vertoxquant.com/p/discrete-market-making">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Advanced Regime Algorithms]]></title><description><![CDATA[Final Part of the Regime Series]]></description><link>https://www.vertoxquant.com/p/advanced-regime-algorithms</link><guid isPermaLink="false">https://www.vertoxquant.com/p/advanced-regime-algorithms</guid><dc:creator><![CDATA[Vertox]]></dc:creator><pubDate>Sun, 15 Feb 2026 17:52:35 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!KMs0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbce0297-f708-47f5-8fde-bd933e7bef19_630x470.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the previous 2 parts of this series, we&#8217;ve looked at all the math behind regime switching models and how you can fit them to real data.</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;e090f01e-40bd-4fc5-baf8-c877d7d4682d&quot;,&quot;caption&quot;:&quot;Introduction&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Regime Switching Models for Microstructure Features&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:128680675,&quot;name&quot;:&quot;Vertox&quot;,&quot;bio&quot;:&quot;Quantitative Researcher in Digital Asset Markets | Market Making | Statistical Arbitrage | Options &quot;,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!HGUA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bf3fd86-d46a-4caa-969a-d80059b72cb9_128x128.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2026-01-16T10:19:54.829Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/55b4c663-1e6f-4679-9526-16d93f2985ec_607x392.jpeg&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.vertoxquant.com/p/regime-switching-models-for-microstructure&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:184740440,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:7,&quot;comment_count&quot;:2,&quot;publication_id&quot;:1726874,&quot;publication_name&quot;:&quot;VertoxQuant&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!ufaQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;3282af87-fe37-44df-ab71-da3830168c54&quot;,&quot;caption&quot;:&quot;Introduction&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Fitting Regime Switching Models to High-Frequency Data&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:128680675,&quot;name&quot;:&quot;Vertox&quot;,&quot;bio&quot;:&quot;Quantitative Researcher in Digital Asset Markets | Market Making | Statistical Arbitrage | Options &quot;,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!HGUA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bf3fd86-d46a-4caa-969a-d80059b72cb9_128x128.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2026-01-22T11:54:30.506Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!wRfA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa704e37a-e30a-405e-961f-ed8a5c020d80_627x470.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.vertoxquant.com/p/fitting-regime-switching-models&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:185342697,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:8,&quot;comment_count&quot;:0,&quot;publication_id&quot;:1726874,&quot;publication_name&quot;:&quot;VertoxQuant&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!ufaQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>In this article, we&#8217;re gonna be covering more advanced regime detection and regime switching algorithms that go beyond HMM, which nobody talks about.</p>
      <p>
          <a href="https://www.vertoxquant.com/p/advanced-regime-algorithms">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Why Mean-Variance Optimization Breaks Down]]></title><description><![CDATA[And how to make it actually work]]></description><link>https://www.vertoxquant.com/p/why-mean-variance-optimization-breaks</link><guid isPermaLink="false">https://www.vertoxquant.com/p/why-mean-variance-optimization-breaks</guid><dc:creator><![CDATA[Vertox]]></dc:creator><pubDate>Tue, 03 Feb 2026 23:01:54 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!aB9w!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc64a161-9abb-481e-b211-33545c699a4d_824x464.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1>Introduction</h1><p>Mean&#8211;Variance Optimization (MVO) is a central framework for portfolio construction: choose weights that balance expected return against risk as measured by variance. </p><p>In its classical form, MVO is elegant, convex (under mild conditions), and analytically tractable. Yet practitioners quickly encounter a paradox: the mathematically &#8220;optimal&#8221; portfolio built from estimated inputs is often unstable, highly leveraged (explicitly or implicitly), and disappoints out-of-sample. </p><p>This is not a minor implementation detail; it is a structural consequence of combining a high-dimensional optimizer with noisy estimates of expected returns and covariances.</p><p>This article develops MVO from first principles and then explains, in a mathematically explicit way, why raw MVO tends to <em>maximize estimation error</em>. </p><p>Finally, it surveys the spectrum of practical fixes, organized around two levers: (i) improving or regularizing the <em>inputs</em> (expected returns and covariances), and (ii) constraining or regularizing the <em>optimizer</em> (the feasible set and the objective). </p><p>The unifying theme is that almost every successful &#8220;fix&#8221; works by injecting <em>bias</em> in exchange for a large reduction in <em>variance</em> of the resulting portfolio weights, thereby improving out-of-sample performance and implementability.</p><h1>The Classical Framework</h1><h3>Notation</h3><p>Consider N risky assets. Let the random vector of (excess) returns over a single period be</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;r \\in \\mathbb{R}^N&quot;,&quot;id&quot;:&quot;DXJEASSNKD&quot;}" data-component-name="LatexBlockToDOM"></div><p>Define the (unknown) population mean and covariance</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\mu = \\mathbb{E}[r] \\in \\mathbb{R}^N, \\quad \\Sigma = \\text{Cov}(r) = \\mathbb{E}[(r-\\mu)(r-\\mu)^T] \\in \\mathbb{R}^{N \\times N}&quot;,&quot;id&quot;:&quot;OQAZGOEAXF&quot;}" data-component-name="LatexBlockToDOM"></div><p>A portfolio is a weight vector interpreted as a fraction of capital invested in each asset.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;w \\in \\mathbb{R}^N&quot;,&quot;id&quot;:&quot;VTRUQWXCRE&quot;}" data-component-name="LatexBlockToDOM"></div><p>The basic budget constraint is </p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\textbf{1}^T w = 1&quot;,&quot;id&quot;:&quot;ILZQVLJPCJ&quot;}" data-component-name="LatexBlockToDOM"></div><p>where 1 denotes the all-ones vector in R^N. In other words, the weights should sum up to 1. Additional constraints like no-short, leverage limits, or sector bounds will be presented in the following chapters.</p><p>Under this setup, the portfolio return is linear in weights:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;r_p = w^T r&quot;,&quot;id&quot;:&quot;IZUDEUJGGR&quot;}" data-component-name="LatexBlockToDOM"></div><p>The expected portfolio return and variance are</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\mathbb{E}[r_p] = w^T \\mu,\\quad \\text{Var}(r_p) = w^T \\Sigma w&quot;,&quot;id&quot;:&quot;OKCVBDGETX&quot;}" data-component-name="LatexBlockToDOM"></div><p>Two foundational facts are worth stating explicitly because they explain why MVO becomes a quadratic program:</p><p>1. <strong>Expected return is linear in weights.</strong> This makes the &#8220;reward&#8221; side easy to compute but also extremely sensitive to errors in mu, because the optimizer can exploit tiny differences in mu via large weight changes.</p><p>2. <strong>Variance is quadratic in weights.</strong> The covariance matrix Sigma couples assets through correlations: diversification is precisely the exploitation of off-diagonal terms in Sigma. The quadratic form w^T Sigma w is convex in w if Sigma is positive semidefinite, and strictly convex if Sigma is positive definite, which ensures the uniqueness of the minimum-variance solution under typical linear constraints.</p><h3>The Markowitz Problem in Matrix Form</h3><p>Markowitz&#8217;s original formulation can be stated as: <strong>among all portfolios with a given expected return, choose the one with minimum variance.</strong> Fix a target expected return m. The constrained optimization is</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\begin{aligned}\n\\min_{w \\in \\mathbb{R}^N} \\quad &amp; w^\\top \\Sigma w \\\\\n\\text{s.t.} \\quad &amp; w^\\top \\mu = m, \\\\\n&amp; \\mathbf{1}^\\top w = 1.\n\\end{aligned}\n\\tag{MVO-1}&quot;,&quot;id&quot;:&quot;GYRGSOBCBD&quot;}" data-component-name="LatexBlockToDOM"></div><p>If short-selling is disallowed, one adds w &gt;= 0 componentwise. If leverage is limited, one might add |w|_1 &lt;= L, where |.| denotes the L1 norm, and so on.</p><p>Why is the covariance matrix central here? Because for any two assets i and j,</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;w^\\top \\Sigma w = \\sum_{i=1}^N \\sum_{j=1}^N w_i w_j \\Sigma_{ij}.&quot;,&quot;id&quot;:&quot;JQJAZPFYMX&quot;}" data-component-name="LatexBlockToDOM"></div><p>The diagonal terms w_i^2 Sigma_{ii} represent contributions from each asset&#8217;s variance; the off-diagonal terms w_i w_j Sigma_{ij} represent interaction through co-movement. Diversification is not &#8220;holding many assets&#8221; per se; it is selecting weights so that positive and negative interactions among returns reduce overall variance.</p><p>A subtle but important point: variance is a <em>second-moment</em> object. It treats positive and negative deviations symmetrically and is fully described by Sigma. This makes MVO analytically convenient, but it also means the framework inherits all limitations of second-moment risk measures; non-normality, fat tails, and asymmetry are not captured unless the distribution is (approximately) elliptical. In many institutional contexts, however, variance remains a useful proxy because it aligns with tracking error, volatility targets, and risk budgeting infrastructure.</p><h3>The penalized (risk-aversion) form and its equivalence</h3><p>An equivalent way to pose the trade-off is to maximize a mean-variance utility function:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\begin{aligned}\n\\max_{w \\in \\mathbb{R}^N}\n&amp;\\quad w^\\top \\mu - \\frac{\\gamma}{2} w^\\top \\Sigma w \\\\\n\\text{s.t.}\n&amp;\\quad \\mathbf{1}^\\top w = 1,\n\\end{aligned}\n\\tag{MVO-2}&quot;,&quot;id&quot;:&quot;AFACIPTTPD&quot;}" data-component-name="LatexBlockToDOM"></div><p>where gamma &gt; 0 is the risk-aversion parameter. Larger gamma penalized variance more heavily, shifting the solution toward lower-risk portfolios.</p><p>The equivalence between (MVO-1) and (MVO-2) is practically important. The constrained form (MVO-1) traces the <em>efficient frontier</em> by varying m. The penalized form (MVO-2) traces it by varying gamma. In many production systems, gamma is tuned to meet a risk target or tracking error budget.</p><h3>Solving the classical problem: Lagrangian and closed-form structure</h3><p>To make mechanics concrete, consider (MVO-2) without additional constraints beyond the budget constraint. Form the Lagrangian</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\mathcal{L}(w,\\eta) = w^\\top \\mu - \\frac{\\gamma}{2} w^\\top \\Sigma w - \\eta(\\mathbf{1}^\\top w - 1)&quot;,&quot;id&quot;:&quot;AXGVJDEVCW&quot;}" data-component-name="LatexBlockToDOM"></div><p>with Lagrange multiplier eta enforcing 1^T w = 1.</p><p>First-order optimality (assuming Sigma is positive definite) gives</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\nabla_w \\mathcal{L} = \\mu - \\gamma \\Sigma w - \\eta \\mathbf{1} = 0&quot;,&quot;id&quot;:&quot;HGECWVLMCG&quot;}" data-component-name="LatexBlockToDOM"></div><p>hence</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;w = \\frac{1}{\\gamma}\\Sigma^{-1}(\\mu - \\eta \\mathbf{1}).\n\\tag{1.1}&quot;,&quot;id&quot;:&quot;VFWLAWWKYZ&quot;}" data-component-name="LatexBlockToDOM"></div><p>Imposing the budget constraint 1^T w = 1 yields</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\mathbf{1}^\\top \\left(\\frac{1}{\\gamma}\\Sigma^{-1}(\\mu - \\eta \\mathbf{1})\\right) = 1&quot;,&quot;id&quot;:&quot;DNHOOPRQVN&quot;}" data-component-name="LatexBlockToDOM"></div><p>so</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\eta = \\frac{\\mathbf{1}^\\top \\Sigma^{-1}\\mu - \\gamma}{\\mathbf{1}^\\top \\Sigma^{-1}\\mathbf{1}}.\n\\tag{1.2}&quot;,&quot;id&quot;:&quot;QTGAPENBDF&quot;}" data-component-name="LatexBlockToDOM"></div><p>Substituting (1.2) into (1.1) gives the explicit optimizer.</p><p>This expression reveals a key structural fact that will matter later: the optimal weights are built from Sigma^{-1} mu and Sigma^{-1} 1. In other words, the inverse covariance matrix is the central operator transforming expected returns into weights. When Sigma^{-1} is unstable (ill-conditioned or poorly estimated), the entire solution becomes unstable.</p><p>For the return-target form (MVO-1), the Lagrangian with multiplies lambda, eta is</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\mathcal{L}(w,\\lambda,\\eta) = w^\\top \\Sigma w - \\lambda(w^\\top \\mu - m) - \\eta(\\mathbf{1}^\\top w - 1)&quot;,&quot;id&quot;:&quot;WLXKGLWZBC&quot;}" data-component-name="LatexBlockToDOM"></div><p>The first-order condition is</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\nabla_w \\mathcal{L} = 2\\Sigma w - \\lambda \\mu - \\eta \\mathbf{1} = 0\n\\quad\\Rightarrow\\quad\nw = \\frac{1}{2}\\Sigma^{-1}(\\lambda \\mu + \\eta \\mathbf{1}).\n\\tag{1.3}&quot;,&quot;id&quot;:&quot;PAEDPEDVSD&quot;}" data-component-name="LatexBlockToDOM"></div><p>Define the classical scalars</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;A \\equiv \\mathbf{1}^\\top \\Sigma^{-1}\\mathbf{1},\n\\qquad\nB \\equiv \\mathbf{1}^\\top \\Sigma^{-1}\\mu,\n\\qquad\nC \\equiv \\mu^\\top \\Sigma^{-1}\\mu,\n\\qquad\n\\Delta \\equiv AC - B^2.\n\\tag{1.4}&quot;,&quot;id&quot;:&quot;CCMMOQGFXH&quot;}" data-component-name="LatexBlockToDOM"></div><p>Assuming Sigma is positive definite and mu is not collinear with 1 under Sigma^{-1}, one has Delta &gt; 0. Solving for lambda, eta yields a closed-form frontier, and the efficient frontier in (sigma^2, m) space is a parabola:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\sigma^2(m) = \\frac{1}{\\Delta}\\left(A m^2 - 2 B m + C\\right).\n\\tag{1.5}&quot;,&quot;id&quot;:&quot;OZARCSAANG&quot;}" data-component-name="LatexBlockToDOM"></div><p>The frontier&#8217;s curvature and location are completely determined by (A,B,C), i.e., by Sigma^{-1} and mu. This already hints at the practical challenge: <em>every point</em> on the frontier depends on inverting Sigma and multiplying by mu, precisely the operations most vulnerable to estimation noise.</p><p>Let&#8217;s implement this in Python and look at the resulting efficient frontier. We will also compare our closed-form solution of (MVO-1) to a numerical solution to verify that we did everything right.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!y1i8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4abd3aa2-d2c4-4f74-aaad-2cab602bc66d_636x714.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!y1i8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4abd3aa2-d2c4-4f74-aaad-2cab602bc66d_636x714.png 424w, https://substackcdn.com/image/fetch/$s_!y1i8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4abd3aa2-d2c4-4f74-aaad-2cab602bc66d_636x714.png 848w, https://substackcdn.com/image/fetch/$s_!y1i8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4abd3aa2-d2c4-4f74-aaad-2cab602bc66d_636x714.png 1272w, https://substackcdn.com/image/fetch/$s_!y1i8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4abd3aa2-d2c4-4f74-aaad-2cab602bc66d_636x714.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!y1i8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4abd3aa2-d2c4-4f74-aaad-2cab602bc66d_636x714.png" width="346" height="388.4339622641509" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4abd3aa2-d2c4-4f74-aaad-2cab602bc66d_636x714.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:714,&quot;width&quot;:636,&quot;resizeWidth&quot;:346,&quot;bytes&quot;:100899,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4abd3aa2-d2c4-4f74-aaad-2cab602bc66d_636x714.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!y1i8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4abd3aa2-d2c4-4f74-aaad-2cab602bc66d_636x714.png 424w, https://substackcdn.com/image/fetch/$s_!y1i8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4abd3aa2-d2c4-4f74-aaad-2cab602bc66d_636x714.png 848w, https://substackcdn.com/image/fetch/$s_!y1i8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4abd3aa2-d2c4-4f74-aaad-2cab602bc66d_636x714.png 1272w, https://substackcdn.com/image/fetch/$s_!y1i8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4abd3aa2-d2c4-4f74-aaad-2cab602bc66d_636x714.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><figcaption class="image-caption">Import Libraries</figcaption></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_!ZKMb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2925178-dbf8-4ad9-a78c-e0deac3a6d60_1664x4178.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZKMb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2925178-dbf8-4ad9-a78c-e0deac3a6d60_1664x4178.png 424w, https://substackcdn.com/image/fetch/$s_!ZKMb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2925178-dbf8-4ad9-a78c-e0deac3a6d60_1664x4178.png 848w, https://substackcdn.com/image/fetch/$s_!ZKMb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2925178-dbf8-4ad9-a78c-e0deac3a6d60_1664x4178.png 1272w, https://substackcdn.com/image/fetch/$s_!ZKMb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2925178-dbf8-4ad9-a78c-e0deac3a6d60_1664x4178.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZKMb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2925178-dbf8-4ad9-a78c-e0deac3a6d60_1664x4178.png" width="1456" height="3656" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b2925178-dbf8-4ad9-a78c-e0deac3a6d60_1664x4178.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:3656,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1021950,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2925178-dbf8-4ad9-a78c-e0deac3a6d60_1664x4178.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ZKMb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2925178-dbf8-4ad9-a78c-e0deac3a6d60_1664x4178.png 424w, https://substackcdn.com/image/fetch/$s_!ZKMb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2925178-dbf8-4ad9-a78c-e0deac3a6d60_1664x4178.png 848w, https://substackcdn.com/image/fetch/$s_!ZKMb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2925178-dbf8-4ad9-a78c-e0deac3a6d60_1664x4178.png 1272w, https://substackcdn.com/image/fetch/$s_!ZKMb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2925178-dbf8-4ad9-a78c-e0deac3a6d60_1664x4178.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_!gwOY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F119cf744-dd09-4003-b9a7-27ee00b23847_862x731.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gwOY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F119cf744-dd09-4003-b9a7-27ee00b23847_862x731.png 424w, https://substackcdn.com/image/fetch/$s_!gwOY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F119cf744-dd09-4003-b9a7-27ee00b23847_862x731.png 848w, https://substackcdn.com/image/fetch/$s_!gwOY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F119cf744-dd09-4003-b9a7-27ee00b23847_862x731.png 1272w, https://substackcdn.com/image/fetch/$s_!gwOY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F119cf744-dd09-4003-b9a7-27ee00b23847_862x731.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gwOY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F119cf744-dd09-4003-b9a7-27ee00b23847_862x731.png" width="862" height="731" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/119cf744-dd09-4003-b9a7-27ee00b23847_862x731.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:731,&quot;width&quot;:862,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:100442,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F119cf744-dd09-4003-b9a7-27ee00b23847_862x731.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!gwOY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F119cf744-dd09-4003-b9a7-27ee00b23847_862x731.png 424w, https://substackcdn.com/image/fetch/$s_!gwOY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F119cf744-dd09-4003-b9a7-27ee00b23847_862x731.png 848w, https://substackcdn.com/image/fetch/$s_!gwOY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F119cf744-dd09-4003-b9a7-27ee00b23847_862x731.png 1272w, https://substackcdn.com/image/fetch/$s_!gwOY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F119cf744-dd09-4003-b9a7-27ee00b23847_862x731.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>As you can see, our closed-form solution and numerical solution are pretty much identical, and the (MVO-2) solutions lie on the efficient frontier traced by the (MVO-1) solution, so they are indeed equivalent.</p><h3>Interpreting Sigma: Risk Geometry and Diversification</h3><p>It is useful to interpret the quadratic form geometrically. If Sigma is positive definite, then the set of portfolios with equal variance sigma^2,</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;w : w^T \\Sigma w = \\sigma^2&quot;,&quot;id&quot;:&quot;TPCBCBSCAV&quot;}" data-component-name="LatexBlockToDOM"></div><p>is an ellipsoid in weight space. The optimizer in (MVO-2) chooses the point on the budget hyperplane {1^T w = 1} that maximizes a linear functional w^T mu minus a quadratic penalty. The optimum balances moving &#8220;up&#8221; in the direction of mu while staying within low-risk ellipsoids determined by Sigma.</p><p>This picture is clean when mu and Sigma are known. The moment we replace them with estimates, the ellipsoids tilt and stretch unpredictably, and the direction of &#8220;up&#8221; becomes noisy. The optimizer, being deterministic, will still choose an extreme point, often an extreme point <em>of the wrong geometry</em>. That is the beginning of the &#8220;error maximization&#8221; story.</p><p>Here is an example using two assets:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!UFnE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ed8ab27-157a-45d1-b663-8dc219b9dea5_1460x2502.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!UFnE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ed8ab27-157a-45d1-b663-8dc219b9dea5_1460x2502.png 424w, https://substackcdn.com/image/fetch/$s_!UFnE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ed8ab27-157a-45d1-b663-8dc219b9dea5_1460x2502.png 848w, https://substackcdn.com/image/fetch/$s_!UFnE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ed8ab27-157a-45d1-b663-8dc219b9dea5_1460x2502.png 1272w, https://substackcdn.com/image/fetch/$s_!UFnE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ed8ab27-157a-45d1-b663-8dc219b9dea5_1460x2502.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!UFnE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ed8ab27-157a-45d1-b663-8dc219b9dea5_1460x2502.png" width="1456" height="2495" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1ed8ab27-157a-45d1-b663-8dc219b9dea5_1460x2502.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2495,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:585130,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ed8ab27-157a-45d1-b663-8dc219b9dea5_1460x2502.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!UFnE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ed8ab27-157a-45d1-b663-8dc219b9dea5_1460x2502.png 424w, https://substackcdn.com/image/fetch/$s_!UFnE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ed8ab27-157a-45d1-b663-8dc219b9dea5_1460x2502.png 848w, https://substackcdn.com/image/fetch/$s_!UFnE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ed8ab27-157a-45d1-b663-8dc219b9dea5_1460x2502.png 1272w, https://substackcdn.com/image/fetch/$s_!UFnE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ed8ab27-157a-45d1-b663-8dc219b9dea5_1460x2502.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_!Io61!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd63bea25-aa77-43d6-8593-9d99ccf93dbf_835x714.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Io61!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd63bea25-aa77-43d6-8593-9d99ccf93dbf_835x714.png 424w, https://substackcdn.com/image/fetch/$s_!Io61!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd63bea25-aa77-43d6-8593-9d99ccf93dbf_835x714.png 848w, https://substackcdn.com/image/fetch/$s_!Io61!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd63bea25-aa77-43d6-8593-9d99ccf93dbf_835x714.png 1272w, https://substackcdn.com/image/fetch/$s_!Io61!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd63bea25-aa77-43d6-8593-9d99ccf93dbf_835x714.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Io61!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd63bea25-aa77-43d6-8593-9d99ccf93dbf_835x714.png" width="835" height="714" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d63bea25-aa77-43d6-8593-9d99ccf93dbf_835x714.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:714,&quot;width&quot;:835,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:163769,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd63bea25-aa77-43d6-8593-9d99ccf93dbf_835x714.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Io61!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd63bea25-aa77-43d6-8593-9d99ccf93dbf_835x714.png 424w, https://substackcdn.com/image/fetch/$s_!Io61!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd63bea25-aa77-43d6-8593-9d99ccf93dbf_835x714.png 848w, https://substackcdn.com/image/fetch/$s_!Io61!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd63bea25-aa77-43d6-8593-9d99ccf93dbf_835x714.png 1272w, https://substackcdn.com/image/fetch/$s_!Io61!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd63bea25-aa77-43d6-8593-9d99ccf93dbf_835x714.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>Each ellipse here corresponds to portfolios with equal variance. As you can see, our optimal portfolio just barely touches the 0.03 variance ellipsoid, and any other portfolio on the line (that satisfies the budget constraint) results in a higher variance.</p><h1>The &#8220;Error Maximization&#8221; Problem</h1><p>Raw MVO is often described informally as &#8220;garbage in, garbage out.&#8221; That statement is true, but it understates the severity: MVO does not merely <em>propagate</em> input error; it can <em>amplify</em> it. In high dimensions, the amplification can be dramatic enough that the optimizer effectively learns the noise in the estimated inputs.</p><p>This section makes that mechanism explicit.</p><h3>MVO is not an optimization problem; it is a statistical decision problem</h3><p>In theory, (mu, Sigma) are population quantities. In practice, we never observe mu or Sigma. We observe a finite time series </p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\{r_t\\}_{t=1}^T&quot;,&quot;id&quot;:&quot;UECBRRYTXX&quot;}" data-component-name="LatexBlockToDOM"></div><p>and produce estimators hat{mu} and hat{Sigma}. The most common &#8220;plug-in&#8221; estimators are the sample mean and covariance</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\hat{\\mu} = \\frac{1}{T} \\sum_{t=1}^T r_t,\n\\qquad\n\\hat{\\Sigma} = \\frac{1}{T-1} \\sum_{t=1}^T (r_t - \\hat{\\mu})(r_t - \\hat{\\mu})^\\top.\n\\tag{2.1}&quot;,&quot;id&quot;:&quot;WXOPRVJYJN&quot;}" data-component-name="LatexBlockToDOM"></div><p>Then the raw MVO portfolio is</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\hat{w} = \\arg\\max_{w:\\mathbf{1}^\\top w=1} \\left(w^\\top \\hat{\\mu} - \\frac{\\gamma}{2} w^\\top \\hat{\\Sigma} w\\right)&quot;,&quot;id&quot;:&quot;RLOFYECSIB&quot;}" data-component-name="LatexBlockToDOM"></div><p>or its return-target equivalent.</p><p>Crucially, hat{w} is a function of the random sample; it is itself random. The &#8220;true&#8221; objective we actually care about is out-of-sample performance under the <em>true </em>distribution, e.g., maximizing</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;U(w) \\equiv w^\\top \\mu - \\frac{\\gamma}{2} w^\\top \\Sigma w.\n\n\\tag{2.2}&quot;,&quot;id&quot;:&quot;XQSDDTKVYM&quot;}" data-component-name="LatexBlockToDOM"></div><p>But plug-in MVO maximizes a different random objective,</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\hat{U}(w) \\equiv w^\\top \\hat{\\mu} - \\frac{\\gamma}{2} w^\\top \\hat{\\Sigma} w.\n\n\\tag{2.3}&quot;,&quot;id&quot;:&quot;YKBBLRIQSR&quot;}" data-component-name="LatexBlockToDOM"></div><p>The practical question is not &#8220;is hat{w} optimal for hat{U}?&#8221; (it is, by construction), but &#8220;how does U(hat{w}) compare to U(w^\star), where w^\star maximizes U?&#8221; That gap is the cost of estimation error and model uncertainty.</p><h3>Why expected return estimation is the Achilles&#8217; heel</h3><p>Start with expected returns. For each asset i, the sample mean hat{mu}_i has a standard error on the order of</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\mathrm{SE}(\\hat{\\mu}_i) \\approx \\frac{\\sigma_i}{\\sqrt{T}},\n\n\\tag{2.4}&quot;,&quot;id&quot;:&quot;QBCUWBOKMX&quot;}" data-component-name="LatexBlockToDOM"></div><p>where </p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\sigma_i^2 = \\Sigma_{ii}&quot;,&quot;id&quot;:&quot;ESACLAECCV&quot;}" data-component-name="LatexBlockToDOM"></div><p>In many liquid asset classes, annualized volatilities might be 10% - 30% while annualized expected excess returns might be 2% - 8%. Translating to a monthly scale, the noise in the sample mean can be comparable to, or larger than, the signal. This is a fundamental signal-to-noise limitation, not an implementation defect.</p><p>Now multiply that limitation by dimensionality. MVO compares assets and tries to exploit differences in mu. When mu is noisy, the differences the optimizer sees are often dominated by noise. The optimizer is then rewarded (in-sample) for taking large positions in the assets that happened to have high realized returns in the estimation window, even if that was random luck.</p><p>Because the expected return term w^T mu is linear, <em>any </em>error in mu shifts the gradient of the objective directly. In contrast, the covariance term is quadratic and tends to act as a smoothness penalty. This asymmetry is why MVO is particularly fragile to errors in mu. </p><p>Here is a simple numerical simulation of how much noise can affect our estimate of mu:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oPBm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7be7643d-c3d2-4624-ac66-26c22a86b3cb_1378x1682.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oPBm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7be7643d-c3d2-4624-ac66-26c22a86b3cb_1378x1682.png 424w, https://substackcdn.com/image/fetch/$s_!oPBm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7be7643d-c3d2-4624-ac66-26c22a86b3cb_1378x1682.png 848w, https://substackcdn.com/image/fetch/$s_!oPBm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7be7643d-c3d2-4624-ac66-26c22a86b3cb_1378x1682.png 1272w, https://substackcdn.com/image/fetch/$s_!oPBm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7be7643d-c3d2-4624-ac66-26c22a86b3cb_1378x1682.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oPBm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7be7643d-c3d2-4624-ac66-26c22a86b3cb_1378x1682.png" width="1378" height="1682" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7be7643d-c3d2-4624-ac66-26c22a86b3cb_1378x1682.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1682,&quot;width&quot;:1378,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:417844,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7be7643d-c3d2-4624-ac66-26c22a86b3cb_1378x1682.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!oPBm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7be7643d-c3d2-4624-ac66-26c22a86b3cb_1378x1682.png 424w, https://substackcdn.com/image/fetch/$s_!oPBm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7be7643d-c3d2-4624-ac66-26c22a86b3cb_1378x1682.png 848w, https://substackcdn.com/image/fetch/$s_!oPBm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7be7643d-c3d2-4624-ac66-26c22a86b3cb_1378x1682.png 1272w, https://substackcdn.com/image/fetch/$s_!oPBm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7be7643d-c3d2-4624-ac66-26c22a86b3cb_1378x1682.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_!5ATM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8441174-4f4c-43d9-a982-d81dade42684_834x596.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5ATM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8441174-4f4c-43d9-a982-d81dade42684_834x596.png 424w, https://substackcdn.com/image/fetch/$s_!5ATM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8441174-4f4c-43d9-a982-d81dade42684_834x596.png 848w, https://substackcdn.com/image/fetch/$s_!5ATM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8441174-4f4c-43d9-a982-d81dade42684_834x596.png 1272w, https://substackcdn.com/image/fetch/$s_!5ATM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8441174-4f4c-43d9-a982-d81dade42684_834x596.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5ATM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8441174-4f4c-43d9-a982-d81dade42684_834x596.png" width="834" height="596" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a8441174-4f4c-43d9-a982-d81dade42684_834x596.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:596,&quot;width&quot;:834,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:45358,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8441174-4f4c-43d9-a982-d81dade42684_834x596.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!5ATM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8441174-4f4c-43d9-a982-d81dade42684_834x596.png 424w, https://substackcdn.com/image/fetch/$s_!5ATM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8441174-4f4c-43d9-a982-d81dade42684_834x596.png 848w, https://substackcdn.com/image/fetch/$s_!5ATM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8441174-4f4c-43d9-a982-d81dade42684_834x596.png 1272w, https://substackcdn.com/image/fetch/$s_!5ATM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8441174-4f4c-43d9-a982-d81dade42684_834x596.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>And now the impact on our portfolio weights from MVO. We assume 20 assets with identical true means, so any variation in mu is pure noise.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Dyjw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfadaa02-cddd-41f6-85dc-7802cfb18328_1546x1980.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Dyjw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfadaa02-cddd-41f6-85dc-7802cfb18328_1546x1980.png 424w, https://substackcdn.com/image/fetch/$s_!Dyjw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfadaa02-cddd-41f6-85dc-7802cfb18328_1546x1980.png 848w, https://substackcdn.com/image/fetch/$s_!Dyjw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfadaa02-cddd-41f6-85dc-7802cfb18328_1546x1980.png 1272w, https://substackcdn.com/image/fetch/$s_!Dyjw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfadaa02-cddd-41f6-85dc-7802cfb18328_1546x1980.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Dyjw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfadaa02-cddd-41f6-85dc-7802cfb18328_1546x1980.png" width="1456" height="1865" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dfadaa02-cddd-41f6-85dc-7802cfb18328_1546x1980.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1865,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:553274,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfadaa02-cddd-41f6-85dc-7802cfb18328_1546x1980.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Dyjw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfadaa02-cddd-41f6-85dc-7802cfb18328_1546x1980.png 424w, https://substackcdn.com/image/fetch/$s_!Dyjw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfadaa02-cddd-41f6-85dc-7802cfb18328_1546x1980.png 848w, https://substackcdn.com/image/fetch/$s_!Dyjw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfadaa02-cddd-41f6-85dc-7802cfb18328_1546x1980.png 1272w, https://substackcdn.com/image/fetch/$s_!Dyjw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdfadaa02-cddd-41f6-85dc-7802cfb18328_1546x1980.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_!zLAC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F714d518e-04be-4c8c-9084-c29078ed0ed5_834x576.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zLAC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F714d518e-04be-4c8c-9084-c29078ed0ed5_834x576.png 424w, https://substackcdn.com/image/fetch/$s_!zLAC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F714d518e-04be-4c8c-9084-c29078ed0ed5_834x576.png 848w, https://substackcdn.com/image/fetch/$s_!zLAC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F714d518e-04be-4c8c-9084-c29078ed0ed5_834x576.png 1272w, https://substackcdn.com/image/fetch/$s_!zLAC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F714d518e-04be-4c8c-9084-c29078ed0ed5_834x576.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zLAC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F714d518e-04be-4c8c-9084-c29078ed0ed5_834x576.png" width="834" height="576" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/714d518e-04be-4c8c-9084-c29078ed0ed5_834x576.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:576,&quot;width&quot;:834,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:49704,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F714d518e-04be-4c8c-9084-c29078ed0ed5_834x576.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zLAC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F714d518e-04be-4c8c-9084-c29078ed0ed5_834x576.png 424w, https://substackcdn.com/image/fetch/$s_!zLAC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F714d518e-04be-4c8c-9084-c29078ed0ed5_834x576.png 848w, https://substackcdn.com/image/fetch/$s_!zLAC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F714d518e-04be-4c8c-9084-c29078ed0ed5_834x576.png 1272w, https://substackcdn.com/image/fetch/$s_!zLAC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F714d518e-04be-4c8c-9084-c29078ed0ed5_834x576.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>Our gross exposure is through the roof! A typical MVO portfolio here is equivalent to 200% long and 200% short, 4x leverage. Our right tail on Gross Exposure is also huge, so the portfolio sometimes ends up being 6x levered. The largest single position is also 54% of the portfolio, even though we have 20 assets. </p><p>This shows just how much of an extreme impact estimation noise in mu has on MVO.</p><h3>Why covariance estimation becomes dangerous when inverted</h3><p>The second failure mode is subtler: even if covariance estimates are &#8220;more stable&#8221; than mean estimates, the optimizer requires hat{Sigma}^{-1}. Inversion is the mathematical operation that turns moderate estimation noise into potentially huge weight noise.</p><p>To see why, consider the eigen-decomposition of the true covariance matrix:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\Sigma = Q \\Lambda Q^\\top,&quot;,&quot;id&quot;:&quot;CXNAYUWXTW&quot;}" data-component-name="LatexBlockToDOM"></div><p>where Q is orthonormal and </p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\Lambda = \\mathrm{diag}(\\lambda_1,\\dots,\\lambda_N)&quot;,&quot;id&quot;:&quot;WGXCYPVHLX&quot;}" data-component-name="LatexBlockToDOM"></div><p>with lambda_i &gt; 0$ if Sigma is positive definite. Then</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\Sigma^{-1} = Q \\Lambda^{-1} Q^\\top\n\n\\quad\\text{with}\\quad\n\n\\Lambda^{-1} = \\mathrm{diag}\\left(\\frac{1}{\\lambda_1},\\dots,\\frac{1}{\\lambda_N}\\right).\n\n\\tag{2.5}&quot;,&quot;id&quot;:&quot;CVMINHPAJE&quot;}" data-component-name="LatexBlockToDOM"></div><p>Small eigenvalues become large eigenvalues after inversion. In portfolio terms, eigenvectors associated with small variance directions are precisely the directions the optimizer finds attractive: they offer &#8220;cheap risk.&#8221; But in finite samples, the smallest eigenvalues of hat{Sigma} are often dominated by noise (especially when T is not much larger than N). When the optimizer leans on these noisy low-variance directions, it produces extreme, unstable weights.</p><p>This is not hypothetical. A basic dimensionality fact already creates a hard boundary: if T &lt; N, the sample covariance hat{Sigma} is singular (rank at most T-1), so hat{Sigma}^{-1} does not exist. Even if T is only moderately larger than N, hat{Sigma} can be ill-conditioned, making numerical inversion unstable and conceptually unreliable.</p><p>Let&#8217;s consider three cases: T &lt; N, T &#8776; N, and T &gt; N, and look at the impact that T has on the estimated eigenvalues:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HU4y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1231b88-9651-4502-b7fd-6261a961bcbf_1662x2428.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HU4y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1231b88-9651-4502-b7fd-6261a961bcbf_1662x2428.png 424w, https://substackcdn.com/image/fetch/$s_!HU4y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1231b88-9651-4502-b7fd-6261a961bcbf_1662x2428.png 848w, https://substackcdn.com/image/fetch/$s_!HU4y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1231b88-9651-4502-b7fd-6261a961bcbf_1662x2428.png 1272w, https://substackcdn.com/image/fetch/$s_!HU4y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1231b88-9651-4502-b7fd-6261a961bcbf_1662x2428.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HU4y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1231b88-9651-4502-b7fd-6261a961bcbf_1662x2428.png" width="1456" height="2127" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e1231b88-9651-4502-b7fd-6261a961bcbf_1662x2428.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2127,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:602660,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1231b88-9651-4502-b7fd-6261a961bcbf_1662x2428.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!HU4y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1231b88-9651-4502-b7fd-6261a961bcbf_1662x2428.png 424w, https://substackcdn.com/image/fetch/$s_!HU4y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1231b88-9651-4502-b7fd-6261a961bcbf_1662x2428.png 848w, https://substackcdn.com/image/fetch/$s_!HU4y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1231b88-9651-4502-b7fd-6261a961bcbf_1662x2428.png 1272w, https://substackcdn.com/image/fetch/$s_!HU4y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1231b88-9651-4502-b7fd-6261a961bcbf_1662x2428.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_!Wm1P!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68f5a8b2-f9b5-468b-925a-fcdd0da41f4b_881x685.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Wm1P!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68f5a8b2-f9b5-468b-925a-fcdd0da41f4b_881x685.png 424w, https://substackcdn.com/image/fetch/$s_!Wm1P!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68f5a8b2-f9b5-468b-925a-fcdd0da41f4b_881x685.png 848w, https://substackcdn.com/image/fetch/$s_!Wm1P!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68f5a8b2-f9b5-468b-925a-fcdd0da41f4b_881x685.png 1272w, https://substackcdn.com/image/fetch/$s_!Wm1P!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68f5a8b2-f9b5-468b-925a-fcdd0da41f4b_881x685.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Wm1P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68f5a8b2-f9b5-468b-925a-fcdd0da41f4b_881x685.png" width="881" height="685" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/68f5a8b2-f9b5-468b-925a-fcdd0da41f4b_881x685.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:685,&quot;width&quot;:881,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:95156,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68f5a8b2-f9b5-468b-925a-fcdd0da41f4b_881x685.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Wm1P!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68f5a8b2-f9b5-468b-925a-fcdd0da41f4b_881x685.png 424w, https://substackcdn.com/image/fetch/$s_!Wm1P!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68f5a8b2-f9b5-468b-925a-fcdd0da41f4b_881x685.png 848w, https://substackcdn.com/image/fetch/$s_!Wm1P!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68f5a8b2-f9b5-468b-925a-fcdd0da41f4b_881x685.png 1272w, https://substackcdn.com/image/fetch/$s_!Wm1P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68f5a8b2-f9b5-468b-925a-fcdd0da41f4b_881x685.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>You can clearly see one thing: For the estimates where T = 30, Sigma becomes singular, and the 30th and further smallest eigenvalues just become 0. For T = 80, we can still see that the smaller eigenvalues are systematically underestimated. The estimates become better as we increase T to 300.</p><p>Now, let&#8217;s look at estiamted eigenvalues of Sigma and Sigma^{-1} for T=300:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FSWx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141d26e2-0907-493a-a140-3aa9c2fa1ed6_1396x676.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FSWx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141d26e2-0907-493a-a140-3aa9c2fa1ed6_1396x676.png 424w, https://substackcdn.com/image/fetch/$s_!FSWx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141d26e2-0907-493a-a140-3aa9c2fa1ed6_1396x676.png 848w, https://substackcdn.com/image/fetch/$s_!FSWx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141d26e2-0907-493a-a140-3aa9c2fa1ed6_1396x676.png 1272w, https://substackcdn.com/image/fetch/$s_!FSWx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141d26e2-0907-493a-a140-3aa9c2fa1ed6_1396x676.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FSWx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141d26e2-0907-493a-a140-3aa9c2fa1ed6_1396x676.png" width="1396" height="676" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/141d26e2-0907-493a-a140-3aa9c2fa1ed6_1396x676.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:676,&quot;width&quot;:1396,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:179242,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141d26e2-0907-493a-a140-3aa9c2fa1ed6_1396x676.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!FSWx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141d26e2-0907-493a-a140-3aa9c2fa1ed6_1396x676.png 424w, https://substackcdn.com/image/fetch/$s_!FSWx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141d26e2-0907-493a-a140-3aa9c2fa1ed6_1396x676.png 848w, https://substackcdn.com/image/fetch/$s_!FSWx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141d26e2-0907-493a-a140-3aa9c2fa1ed6_1396x676.png 1272w, https://substackcdn.com/image/fetch/$s_!FSWx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141d26e2-0907-493a-a140-3aa9c2fa1ed6_1396x676.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_!sEAN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0abc3b1-0dbc-41a3-870a-d7a33a9d4d1d_872x536.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sEAN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0abc3b1-0dbc-41a3-870a-d7a33a9d4d1d_872x536.png 424w, https://substackcdn.com/image/fetch/$s_!sEAN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0abc3b1-0dbc-41a3-870a-d7a33a9d4d1d_872x536.png 848w, https://substackcdn.com/image/fetch/$s_!sEAN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0abc3b1-0dbc-41a3-870a-d7a33a9d4d1d_872x536.png 1272w, https://substackcdn.com/image/fetch/$s_!sEAN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0abc3b1-0dbc-41a3-870a-d7a33a9d4d1d_872x536.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sEAN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0abc3b1-0dbc-41a3-870a-d7a33a9d4d1d_872x536.png" width="872" height="536" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d0abc3b1-0dbc-41a3-870a-d7a33a9d4d1d_872x536.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:536,&quot;width&quot;:872,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:52836,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0abc3b1-0dbc-41a3-870a-d7a33a9d4d1d_872x536.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!sEAN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0abc3b1-0dbc-41a3-870a-d7a33a9d4d1d_872x536.png 424w, https://substackcdn.com/image/fetch/$s_!sEAN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0abc3b1-0dbc-41a3-870a-d7a33a9d4d1d_872x536.png 848w, https://substackcdn.com/image/fetch/$s_!sEAN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0abc3b1-0dbc-41a3-870a-d7a33a9d4d1d_872x536.png 1272w, https://substackcdn.com/image/fetch/$s_!sEAN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0abc3b1-0dbc-41a3-870a-d7a33a9d4d1d_872x536.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 smaller the estimated eigenvalues, the larger the estimated eigenvalues of the inverse of Sigma. </p><p>Note: The y-axis is logarithmic on both plots, so linear &#8594; exponential!</p><h3>Sensitivity Analysis: How estimation errors translate into weight errors</h3><p>A useful way to formalize &#8220;error maximization&#8221; is to compute how small perturbations in mu and Sigma affect the optimizer.</p><p>Consider the unconstrained (besides budget) mean&#8211;variance utility maximization (MVO-2). The population optimum satisfies</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;w^\\star = \\frac{1}{\\gamma}\\Sigma^{-1}(\\mu - \\eta^\\star \\mathbf{1})&quot;,&quot;id&quot;:&quot;VFXNRSUXOK&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>with eta^\star chosen to enforce 1^T w^\star = 1. The plug-in estimate is</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\hat{w} = \\frac{1}{\\gamma}\\hat{\\Sigma}^{-1}(\\hat{\\mu} - \\hat{\\eta}\\mathbf{1})&quot;,&quot;id&quot;:&quot;GDXWMHMOZL&quot;}" data-component-name="LatexBlockToDOM"></div><p>Write estimation errors as</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\hat{\\mu} = \\mu + \\delta\\mu,\n\n\\qquad\n\n\\hat{\\Sigma} = \\Sigma + \\delta\\Sigma.\n\n\\tag{2.6}&quot;,&quot;id&quot;:&quot;LFUVSFZICN&quot;}" data-component-name="LatexBlockToDOM"></div><p>A first-order expansion (informally, a matrix Taylor approximation) uses</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;(\\Sigma + \\delta\\Sigma)^{-1} \\approx \\Sigma^{-1} - \\Sigma^{-1}\\delta\\Sigma\\,\\Sigma^{-1}\n\n\\quad\\text{for small }\\delta\\Sigma.\n\n\\tag{2.7}&quot;,&quot;id&quot;:&quot;TLHPIQVRMV&quot;}" data-component-name="LatexBlockToDOM"></div><p>A first-order perturbation of the optimizer gives</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\delta w \\equiv \\hat{w} - w^\\star\n\n\\approx \\frac{1}{\\gamma}\\Sigma^{-1}\\delta\\mu - \\Sigma^{-1}\\delta\\Sigma\\, w^\\star\n\n- \\frac{\\delta\\eta}{\\gamma}\\Sigma^{-1}\\mathbf{1},\n\n\\qquad \\mathbf{1}^\\top \\delta w = 0.\n\n\\tag{2.8}&quot;,&quot;id&quot;:&quot;ZVNQMGQMTJ&quot;}" data-component-name="LatexBlockToDOM"></div><p>The last term enforces the budget constraint (with delta eta the perturbation in the multiplier); dropping it isolates the two main channels.</p><p>Several qualitative conclusions drop out of (2.8):</p><p>1. <strong>Mean error passes through Sigma^{-1}.</strong> Even if delta mu is moderate, multiplying by Sigma^{-1} can produce large changes in w, especially in directions corresponding to small eigenvalues of Sigma (or hat{Sigma}).</p><p>2. <strong>Covariance error enters as a &#8220;sandwich&#8221; with Sigma^{-1}.</strong> The term Sigma^{-1} * delta Sigma, w^\star has Sigma^{-1} on the left; if w^\star already has large exposures along unstable directions, covariance errors further distort them.</p><p>3. <strong>Budget adjustment can amplify instability.</strong> The multiplier eta is computed using 1^T Sigma^{-1} mu and 1^T \Sigma^{-1} 1$. If either of these scalars is unstable due to \Sigma^{-1}, the adjustment needed to enforce 1^T w=1 can itself swing drastically.</p><p>The key is not that delta mu and delta Sigma exist&#8212;of course they do&#8212;but that MVO <em>transforms</em> them with Sigma^{-1}, a potentially high-gain operator.</p><p>Let&#8217;s see how a badly conditioned Sigma affects delta w. We&#8217;ll drop the budget constraint so eta doesn&#8217;t influence the analysis:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ppLK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa98dbee3-740e-4670-a92b-4bc76830655f_1648x3024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ppLK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa98dbee3-740e-4670-a92b-4bc76830655f_1648x3024.png 424w, https://substackcdn.com/image/fetch/$s_!ppLK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa98dbee3-740e-4670-a92b-4bc76830655f_1648x3024.png 848w, https://substackcdn.com/image/fetch/$s_!ppLK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa98dbee3-740e-4670-a92b-4bc76830655f_1648x3024.png 1272w, https://substackcdn.com/image/fetch/$s_!ppLK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa98dbee3-740e-4670-a92b-4bc76830655f_1648x3024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ppLK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa98dbee3-740e-4670-a92b-4bc76830655f_1648x3024.png" width="1456" height="2672" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a98dbee3-740e-4670-a92b-4bc76830655f_1648x3024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2672,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:764905,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa98dbee3-740e-4670-a92b-4bc76830655f_1648x3024.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ppLK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa98dbee3-740e-4670-a92b-4bc76830655f_1648x3024.png 424w, https://substackcdn.com/image/fetch/$s_!ppLK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa98dbee3-740e-4670-a92b-4bc76830655f_1648x3024.png 848w, https://substackcdn.com/image/fetch/$s_!ppLK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa98dbee3-740e-4670-a92b-4bc76830655f_1648x3024.png 1272w, https://substackcdn.com/image/fetch/$s_!ppLK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa98dbee3-740e-4670-a92b-4bc76830655f_1648x3024.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_!QduU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8aa51d0b-0849-45e6-9f27-7ef92e27d4ce_885x575.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QduU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8aa51d0b-0849-45e6-9f27-7ef92e27d4ce_885x575.png 424w, https://substackcdn.com/image/fetch/$s_!QduU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8aa51d0b-0849-45e6-9f27-7ef92e27d4ce_885x575.png 848w, https://substackcdn.com/image/fetch/$s_!QduU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8aa51d0b-0849-45e6-9f27-7ef92e27d4ce_885x575.png 1272w, https://substackcdn.com/image/fetch/$s_!QduU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8aa51d0b-0849-45e6-9f27-7ef92e27d4ce_885x575.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QduU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8aa51d0b-0849-45e6-9f27-7ef92e27d4ce_885x575.png" width="885" height="575" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8aa51d0b-0849-45e6-9f27-7ef92e27d4ce_885x575.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:575,&quot;width&quot;:885,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:61946,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8aa51d0b-0849-45e6-9f27-7ef92e27d4ce_885x575.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!QduU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8aa51d0b-0849-45e6-9f27-7ef92e27d4ce_885x575.png 424w, https://substackcdn.com/image/fetch/$s_!QduU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8aa51d0b-0849-45e6-9f27-7ef92e27d4ce_885x575.png 848w, https://substackcdn.com/image/fetch/$s_!QduU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8aa51d0b-0849-45e6-9f27-7ef92e27d4ce_885x575.png 1272w, https://substackcdn.com/image/fetch/$s_!QduU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8aa51d0b-0849-45e6-9f27-7ef92e27d4ce_885x575.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>You can see clearly that as Sigma becomes ill-conditioned, the error in w grows.</p><h3>Optimizer&#8217;s curse</h3><p>Another lens is the optimizer&#8217;s curse, a general phenomenon in statistical decision-making: if you choose the argmax of a noisy objective, the achieved value is biased upward <em>in-sample</em>, and the chosen decision is biased toward noise.</p><p>Formally, because hat{w} maximizes hat{U}(w),</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\hat{U}(\\hat{w}) \\ge \\hat{U}(w^\\star)&quot;,&quot;id&quot;:&quot;WWAFGHMNUS&quot;}" data-component-name="LatexBlockToDOM"></div><p>but what matters is U(hat{w}). The difference</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;U(w^\\star) - U(\\hat{w})&quot;,&quot;id&quot;:&quot;OTBBIUBGMP&quot;}" data-component-name="LatexBlockToDOM"></div><p>is typically positive and can be large in high dimensions. Intuitively, among many portfolios, some will look exceptionally good in-sample purely due to noise in hat{mu} and hat{Sigma}. MVO systematically selects those portfolios and then &#8220;locks in&#8221; their noisy characteristics via extreme weights.</p><p>This selection effect is strongest when:</p><ul><li><p>The number of assets N is large relative to the sample size T</p></li><li><p>Expected return estimates are weak (low signal-to-noise);</p></li><li><p>Shorting/leverage is permitted (large feasible set);</p></li><li><p>Constraints are loose (optimizer can chase small estimated edges);</p></li><li><p>The covariance matrix has near-collinear assets (ill-conditioning).</p></li></ul><p>Let&#8217;s demonstrate the optimizer&#8217;s curse via Monte-Carlo.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sFf6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7e87dc-5f8e-4b72-a56a-df99179b760a_1648x3248.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sFf6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7e87dc-5f8e-4b72-a56a-df99179b760a_1648x3248.png 424w, https://substackcdn.com/image/fetch/$s_!sFf6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7e87dc-5f8e-4b72-a56a-df99179b760a_1648x3248.png 848w, https://substackcdn.com/image/fetch/$s_!sFf6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7e87dc-5f8e-4b72-a56a-df99179b760a_1648x3248.png 1272w, https://substackcdn.com/image/fetch/$s_!sFf6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7e87dc-5f8e-4b72-a56a-df99179b760a_1648x3248.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sFf6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7e87dc-5f8e-4b72-a56a-df99179b760a_1648x3248.png" width="1456" height="2870" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7f7e87dc-5f8e-4b72-a56a-df99179b760a_1648x3248.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2870,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:836711,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7e87dc-5f8e-4b72-a56a-df99179b760a_1648x3248.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!sFf6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7e87dc-5f8e-4b72-a56a-df99179b760a_1648x3248.png 424w, https://substackcdn.com/image/fetch/$s_!sFf6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7e87dc-5f8e-4b72-a56a-df99179b760a_1648x3248.png 848w, https://substackcdn.com/image/fetch/$s_!sFf6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7e87dc-5f8e-4b72-a56a-df99179b760a_1648x3248.png 1272w, https://substackcdn.com/image/fetch/$s_!sFf6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7e87dc-5f8e-4b72-a56a-df99179b760a_1648x3248.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_!w7iO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb86af9c5-2f20-40f6-8b21-79471b465d99_797x672.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!w7iO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb86af9c5-2f20-40f6-8b21-79471b465d99_797x672.png 424w, https://substackcdn.com/image/fetch/$s_!w7iO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb86af9c5-2f20-40f6-8b21-79471b465d99_797x672.png 848w, https://substackcdn.com/image/fetch/$s_!w7iO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb86af9c5-2f20-40f6-8b21-79471b465d99_797x672.png 1272w, https://substackcdn.com/image/fetch/$s_!w7iO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb86af9c5-2f20-40f6-8b21-79471b465d99_797x672.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!w7iO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb86af9c5-2f20-40f6-8b21-79471b465d99_797x672.png" width="797" height="672" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b86af9c5-2f20-40f6-8b21-79471b465d99_797x672.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:672,&quot;width&quot;:797,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:72334,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb86af9c5-2f20-40f6-8b21-79471b465d99_797x672.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!w7iO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb86af9c5-2f20-40f6-8b21-79471b465d99_797x672.png 424w, https://substackcdn.com/image/fetch/$s_!w7iO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb86af9c5-2f20-40f6-8b21-79471b465d99_797x672.png 848w, https://substackcdn.com/image/fetch/$s_!w7iO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb86af9c5-2f20-40f6-8b21-79471b465d99_797x672.png 1272w, https://substackcdn.com/image/fetch/$s_!w7iO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb86af9c5-2f20-40f6-8b21-79471b465d99_797x672.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_!uri_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1f53245-cbd6-433e-931b-718a9e97b2bd_775x464.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uri_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1f53245-cbd6-433e-931b-718a9e97b2bd_775x464.png 424w, https://substackcdn.com/image/fetch/$s_!uri_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1f53245-cbd6-433e-931b-718a9e97b2bd_775x464.png 848w, https://substackcdn.com/image/fetch/$s_!uri_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1f53245-cbd6-433e-931b-718a9e97b2bd_775x464.png 1272w, https://substackcdn.com/image/fetch/$s_!uri_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1f53245-cbd6-433e-931b-718a9e97b2bd_775x464.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uri_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1f53245-cbd6-433e-931b-718a9e97b2bd_775x464.png" width="775" height="464" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a1f53245-cbd6-433e-931b-718a9e97b2bd_775x464.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:464,&quot;width&quot;:775,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:21218,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1f53245-cbd6-433e-931b-718a9e97b2bd_775x464.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!uri_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1f53245-cbd6-433e-931b-718a9e97b2bd_775x464.png 424w, https://substackcdn.com/image/fetch/$s_!uri_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1f53245-cbd6-433e-931b-718a9e97b2bd_775x464.png 848w, https://substackcdn.com/image/fetch/$s_!uri_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1f53245-cbd6-433e-931b-718a9e97b2bd_775x464.png 1272w, https://substackcdn.com/image/fetch/$s_!uri_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1f53245-cbd6-433e-931b-718a9e97b2bd_775x464.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>You can see that even in an environment with equal true in- and out-of-sample mu and Sigma, due to estimation error, we vastly overestimate our utility in the in-sample.</p><h3>Practical Symptoms: Instability, extreme positions, turnover, and disappointment</h3><p>When raw MVO meets real data, the mathematical mechanisms above manifest in operational ways:</p><ul><li><p><strong>Extreme weights and implicit leverage.</strong> Even with the budget constraint 1^T w = 1, weights can be large positive and large negative (if shorting is allowed), producing large gross exposure |w|_1. Even with no-short constraints, solutions often sit on corners of the feasible region (many weights at bounds), because linear return objectives push to extremes.</p></li><li><p><strong>High sensitivity to small input changes.</strong> Updating the estimation window by one month can materially change hat{mu} and hat{Sigma}, leading to large changes in hat{w}. This is not merely &#8220;rebalancing&#8221;; it is <em>model instability</em>.</p></li><li><p><strong>High turnover and transaction cost drag.</strong> If weights change drastically, realized performance is dominated by trading costs and market impact, neither of which exists in the clean Markowitz formulation unless explicitly modeled.</p></li><li><p><strong>Out-of-sample underperformance relative to naive allocations. </strong>A simple equal-weight or risk-parity portfolio can outperform a naive MVO portfolio after costs, not because those heuristics are theoretically superior, but because they are robust to estimation error.</p></li></ul><p>These observations motivate the central practical conclusion: <strong>raw plug-in MVO is a high-variance estimator of portfolio weights.</strong> In modern terms, it is an overfit model.</p><h1>The Spectrum of Solutions</h1><p><strong>This concludes the theoretical foundation.</strong></p><p>The remaining 40 pages implement and test 11 robust portfolio construction techniques.</p><p>Each technique includes: Mathematical derivation &#8594; Clean implementation &#8594; Parameter tuning &#8594; Comparative results </p><p>Plus: Full research notebook (1250+ lines) with production-ready code. If you've made it this far through the theory, the implementations are where it pays off.</p><p>If raw MVO is fragile because it optimizes a noisy objective with unstable operators, then fixes must do one (or both) of the following:</p><p>1. <strong>Fix the inputs</strong>: replace (hat{mu}, hat{Sigma}) with estimators that have lower estimation error, better conditioning, or an economically grounded structure.</p><p>2. <strong>Constrain or regularize the optimizer</strong>: modify the optimization problem so that it cannot translate small input errors into extreme weight changes.</p><p>These approaches are complementary. Many production-grade systems use both: structured/shrunk inputs and a constrained, regularized optimization.</p><h2>Fixing the inputs</h2><h3>Covariance Shrinkage: Stabilizing \hat{Sigma} and its inverse</h3><p>The sample covariance hat{Sigma} is unbiased under idealized assumptions, but it can have high variance in finite samples, especially for off-diagonal elements. Shrinkage addresses this by pulling the estimate toward a structured target F that is lower variance but potentially biased.</p><p>A canonical shrinkage estimator is</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\tilde{\\Sigma} = (1-\\delta)\\hat{\\Sigma} + \\delta F,\n\n\\qquad \\delta \\in [0,1].\n\n\\tag{3.1}&quot;,&quot;id&quot;:&quot;DNICFUKHSH&quot;}" data-component-name="LatexBlockToDOM"></div><p>Common choices for F include:</p><ul><li><p> a diagonal matrix (imposing zero correlations),</p></li><li><p> a constant-correlation model,</p></li><li><p> a factor-based covariance (discussed next),</p></li><li><p> an identity-scaled matrix (equal variance, no correlation).</p></li></ul><p>Why does shrinkage help? Because it increases the smallest eigenvalues of hat{Sigma} (or, more precisely, it reduces eigenvalue dispersion), improving the condition number and stabilizing inversion. In terms of Sigma^{-1} mu, shrinkage reduces the optimizer&#8217;s ability to exploit noisy &#8220;cheap-risk&#8221; directions created by small sample eigenvalues.</p><p>A useful way to view this is that shrinkage imposes a prior belief: extreme correlation structures are unlikely unless supported by strong data. By nudging the estimate toward a simpler structure, you reduce estimation variance more than you increase bias, improving out-of-sample performance.</p><p><strong>Oracle note:</strong> In the sweep below, the &#8220;best delta&#8221; is chosen by maximizing utility computed with the true (mu, Sigma) to isolate the mechanism. In practice, delta must be selected via an analytic estimator (e.g., Ledoit&#8211;Wolf/OAS) or via walk-forward / nested cross-validation. We also report a held-out test-sample utility proxy for evaluation, not for selection.</p><p>Let&#8217;s look at the effect of choosing different values of delta. We will let F be</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;F = \\frac{\\text{tr}(\\hat{\\Sigma})}{N} I&quot;,&quot;id&quot;:&quot;OYHQPMXZDI&quot;}" data-component-name="LatexBlockToDOM"></div><p>which has the average estimated variance among all assets as its diagonal entries.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!BJvA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b937609-b684-4169-9ba1-7cda4815023f_1716x4252.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BJvA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b937609-b684-4169-9ba1-7cda4815023f_1716x4252.png 424w, https://substackcdn.com/image/fetch/$s_!BJvA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b937609-b684-4169-9ba1-7cda4815023f_1716x4252.png 848w, https://substackcdn.com/image/fetch/$s_!BJvA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b937609-b684-4169-9ba1-7cda4815023f_1716x4252.png 1272w, https://substackcdn.com/image/fetch/$s_!BJvA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b937609-b684-4169-9ba1-7cda4815023f_1716x4252.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BJvA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b937609-b684-4169-9ba1-7cda4815023f_1716x4252.png" width="1456" height="3608" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6b937609-b684-4169-9ba1-7cda4815023f_1716x4252.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:3608,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1179285,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b937609-b684-4169-9ba1-7cda4815023f_1716x4252.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!BJvA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b937609-b684-4169-9ba1-7cda4815023f_1716x4252.png 424w, https://substackcdn.com/image/fetch/$s_!BJvA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b937609-b684-4169-9ba1-7cda4815023f_1716x4252.png 848w, https://substackcdn.com/image/fetch/$s_!BJvA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b937609-b684-4169-9ba1-7cda4815023f_1716x4252.png 1272w, https://substackcdn.com/image/fetch/$s_!BJvA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b937609-b684-4169-9ba1-7cda4815023f_1716x4252.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_!zSMs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F342d039d-a32a-4aaa-8e24-13af62b46e07_839x595.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zSMs!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F342d039d-a32a-4aaa-8e24-13af62b46e07_839x595.png 424w, https://substackcdn.com/image/fetch/$s_!zSMs!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F342d039d-a32a-4aaa-8e24-13af62b46e07_839x595.png 848w, https://substackcdn.com/image/fetch/$s_!zSMs!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F342d039d-a32a-4aaa-8e24-13af62b46e07_839x595.png 1272w, https://substackcdn.com/image/fetch/$s_!zSMs!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F342d039d-a32a-4aaa-8e24-13af62b46e07_839x595.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zSMs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F342d039d-a32a-4aaa-8e24-13af62b46e07_839x595.png" width="839" height="595" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/342d039d-a32a-4aaa-8e24-13af62b46e07_839x595.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:595,&quot;width&quot;:839,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:58007,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F342d039d-a32a-4aaa-8e24-13af62b46e07_839x595.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zSMs!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F342d039d-a32a-4aaa-8e24-13af62b46e07_839x595.png 424w, https://substackcdn.com/image/fetch/$s_!zSMs!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F342d039d-a32a-4aaa-8e24-13af62b46e07_839x595.png 848w, https://substackcdn.com/image/fetch/$s_!zSMs!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F342d039d-a32a-4aaa-8e24-13af62b46e07_839x595.png 1272w, https://substackcdn.com/image/fetch/$s_!zSMs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F342d039d-a32a-4aaa-8e24-13af62b46e07_839x595.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>As you can see, the condition number of our estimated covariance matrix reduces pretty greatly as we increase delta.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!B02s!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F246de843-78dc-4ff1-a6e8-112001957cf4_824x464.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!B02s!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F246de843-78dc-4ff1-a6e8-112001957cf4_824x464.png 424w, https://substackcdn.com/image/fetch/$s_!B02s!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F246de843-78dc-4ff1-a6e8-112001957cf4_824x464.png 848w, https://substackcdn.com/image/fetch/$s_!B02s!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F246de843-78dc-4ff1-a6e8-112001957cf4_824x464.png 1272w, https://substackcdn.com/image/fetch/$s_!B02s!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F246de843-78dc-4ff1-a6e8-112001957cf4_824x464.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!B02s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F246de843-78dc-4ff1-a6e8-112001957cf4_824x464.png" width="824" height="464" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/246de843-78dc-4ff1-a6e8-112001957cf4_824x464.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:464,&quot;width&quot;:824,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:46385,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F246de843-78dc-4ff1-a6e8-112001957cf4_824x464.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!B02s!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F246de843-78dc-4ff1-a6e8-112001957cf4_824x464.png 424w, https://substackcdn.com/image/fetch/$s_!B02s!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F246de843-78dc-4ff1-a6e8-112001957cf4_824x464.png 848w, https://substackcdn.com/image/fetch/$s_!B02s!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F246de843-78dc-4ff1-a6e8-112001957cf4_824x464.png 1272w, https://substackcdn.com/image/fetch/$s_!B02s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F246de843-78dc-4ff1-a6e8-112001957cf4_824x464.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>Utility increases out of sample as we increase delta (This is what we REALLY care about!)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!p5HU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e2e413-a93d-4bfe-9599-4d7d5246ee4f_848x536.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!p5HU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e2e413-a93d-4bfe-9599-4d7d5246ee4f_848x536.png 424w, https://substackcdn.com/image/fetch/$s_!p5HU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e2e413-a93d-4bfe-9599-4d7d5246ee4f_848x536.png 848w, https://substackcdn.com/image/fetch/$s_!p5HU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e2e413-a93d-4bfe-9599-4d7d5246ee4f_848x536.png 1272w, https://substackcdn.com/image/fetch/$s_!p5HU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e2e413-a93d-4bfe-9599-4d7d5246ee4f_848x536.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!p5HU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e2e413-a93d-4bfe-9599-4d7d5246ee4f_848x536.png" width="848" height="536" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/78e2e413-a93d-4bfe-9599-4d7d5246ee4f_848x536.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:536,&quot;width&quot;:848,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:52607,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e2e413-a93d-4bfe-9599-4d7d5246ee4f_848x536.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!p5HU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e2e413-a93d-4bfe-9599-4d7d5246ee4f_848x536.png 424w, https://substackcdn.com/image/fetch/$s_!p5HU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e2e413-a93d-4bfe-9599-4d7d5246ee4f_848x536.png 848w, https://substackcdn.com/image/fetch/$s_!p5HU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e2e413-a93d-4bfe-9599-4d7d5246ee4f_848x536.png 1272w, https://substackcdn.com/image/fetch/$s_!p5HU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78e2e413-a93d-4bfe-9599-4d7d5246ee4f_848x536.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>Small eigenvalues are inflated instead of dropping to extremely low values, which in turn causes the eigenvalues of Sigma^{-1} to not explode.</p><h3>Factor Models</h3><p>A deeper way to control covariance noise is to assume returns are driven by a small number of common factors. A standard linear factor model is</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;r = B f + \\varepsilon,\n\n\\tag{3.2}&quot;,&quot;id&quot;:&quot;XJWUHXHUCF&quot;}" data-component-name="LatexBlockToDOM"></div><p>where</p><ul><li><p>f in R^K are factor returns with K &lt;&lt; N</p></li><li><p>B in R^{N x K} are factor loadings</p></li><li><p>epsilon in R^N are idiosyncratic returns.</p></li></ul><p>Assuming epsilon is uncorrelated with f and has diagonal covariance D, the covariance of r becomes</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\Sigma = B \\Sigma_f B^\\top + D,\n\n\\tag{3.3}&quot;,&quot;id&quot;:&quot;YLBBFIQYTM&quot;}" data-component-name="LatexBlockToDOM"></div><p>where Sigma_f = Cov(f) and D = Cov(epsilon) is typically diagonal.</p><p>The parameter-count reduction is dramatic. A full covariance matrix has N(N+1)/2 unique parameters. A factor model estimates:</p><ul><li><p>NK loadings (often constrained/regularized)</p></li><li><p>K(K+1)/2 factor covariances</p></li><li><p>N idiosyncratic variances.</p></li></ul><p>When K &lt;&lt; N, this is a much lower-dimensional estimation problem, leading to more stable covariance estimates and more stable inverses. Economically, factors capture persistent co-movement structure (industries, styles, macro exposures), while idiosyncratic risk captures asset-specific variance.</p><p>For optimization, (3.3) has another advantage: it makes risk decomposition interpretable and enables direct factor exposure constraints, a major practical tool for controlling unintended bets.</p><p>To test this method, we are gonna assume assets follow some &#8220;true&#8221; factor model, and then we will estimate this factor model to obtain an estimate for Sigma by plugging the estimates into (3.3):</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Qveg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d6cabcd-2c81-499e-aafe-540cb4c437c5_1548x4514.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Qveg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d6cabcd-2c81-499e-aafe-540cb4c437c5_1548x4514.png 424w, https://substackcdn.com/image/fetch/$s_!Qveg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d6cabcd-2c81-499e-aafe-540cb4c437c5_1548x4514.png 848w, https://substackcdn.com/image/fetch/$s_!Qveg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d6cabcd-2c81-499e-aafe-540cb4c437c5_1548x4514.png 1272w, https://substackcdn.com/image/fetch/$s_!Qveg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d6cabcd-2c81-499e-aafe-540cb4c437c5_1548x4514.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Qveg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d6cabcd-2c81-499e-aafe-540cb4c437c5_1548x4514.png" width="1456" height="4246" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4d6cabcd-2c81-499e-aafe-540cb4c437c5_1548x4514.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:4246,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1173035,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d6cabcd-2c81-499e-aafe-540cb4c437c5_1548x4514.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Qveg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d6cabcd-2c81-499e-aafe-540cb4c437c5_1548x4514.png 424w, https://substackcdn.com/image/fetch/$s_!Qveg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d6cabcd-2c81-499e-aafe-540cb4c437c5_1548x4514.png 848w, https://substackcdn.com/image/fetch/$s_!Qveg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d6cabcd-2c81-499e-aafe-540cb4c437c5_1548x4514.png 1272w, https://substackcdn.com/image/fetch/$s_!Qveg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d6cabcd-2c81-499e-aafe-540cb4c437c5_1548x4514.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_!ziKq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F326ef1b1-9a53-4bf7-a43b-f48f0867f258_858x709.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ziKq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F326ef1b1-9a53-4bf7-a43b-f48f0867f258_858x709.png 424w, https://substackcdn.com/image/fetch/$s_!ziKq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F326ef1b1-9a53-4bf7-a43b-f48f0867f258_858x709.png 848w, https://substackcdn.com/image/fetch/$s_!ziKq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F326ef1b1-9a53-4bf7-a43b-f48f0867f258_858x709.png 1272w, https://substackcdn.com/image/fetch/$s_!ziKq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F326ef1b1-9a53-4bf7-a43b-f48f0867f258_858x709.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ziKq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F326ef1b1-9a53-4bf7-a43b-f48f0867f258_858x709.png" width="858" height="709" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/326ef1b1-9a53-4bf7-a43b-f48f0867f258_858x709.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:709,&quot;width&quot;:858,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:59292,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F326ef1b1-9a53-4bf7-a43b-f48f0867f258_858x709.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ziKq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F326ef1b1-9a53-4bf7-a43b-f48f0867f258_858x709.png 424w, https://substackcdn.com/image/fetch/$s_!ziKq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F326ef1b1-9a53-4bf7-a43b-f48f0867f258_858x709.png 848w, https://substackcdn.com/image/fetch/$s_!ziKq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F326ef1b1-9a53-4bf7-a43b-f48f0867f258_858x709.png 1272w, https://substackcdn.com/image/fetch/$s_!ziKq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F326ef1b1-9a53-4bf7-a43b-f48f0867f258_858x709.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>As you can see, our median condition went from 4327 for the naive sample covariance to only 259.3 for the factor-informed covariance. Utility improved 100% of the time out of sample!</p><h3>Time-varying covariance</h3><p>Covariances evolve over time. Using very long histories can reduce sampling error but introduce <em>model error </em>if the distribution is non-stationary. Using short histories reduces model error but increases estimation noise.</p><p>A common compromise is an exponentially weighted covariance estimator. For a finite window, a normalized form is</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\tilde{\\Sigma} = \\frac{1-\\lambda}{1-\\lambda^T}\\sum_{t=1}^{T} \\lambda^{T-t} (r_t - \\bar{r})(r_t - \\bar{r})^\\top,\n\n\\qquad \\lambda \\in (0,1).\n\n\\tag{3.4}&quot;,&quot;id&quot;:&quot;ALUZNROZQC&quot;}" data-component-name="LatexBlockToDOM"></div><p>This places more weight on recent observations, adapting to changing regimes, while keeping the weights normalized for finite T.</p><p>An equivalent way to write the estimator is the recursive form</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\Sigma_t = \\lambda \\Sigma_{t-1} + (1-\\lambda)(r_{t-1}-\\mu_t)(r_{t-1}-\\mu_t)^\\top&quot;,&quot;id&quot;:&quot;WNHONWUOVX&quot;}" data-component-name="LatexBlockToDOM"></div><p>which implicitly normalizes and becomes equivalent to the sum as T &#8594; infinity (since lambda^T &#8594; 0).</p><p>But note: exponential weighting alone does not solve ill-conditioning in high dimensions; it is often combined with shrinkage or factor models.</p><p>The practical point is that &#8220;better covariance&#8221; means balancing <em>estimation variance </em>against <em>non-stationarity</em>. MVO fails when either error dominates, and real markets usually give you both.</p><h3>Expected Returns</h3><p>If covariance estimation is difficult, expected return estimation is usually worse. Many practical systems, therefore, treat mu not as a directly estimated sample mean, but as a <em>forecast </em>that must be heavily regularized.</p><p>A basic shrinkage approach is</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\tilde{\\mu} = (1-\\alpha)\\hat{\\mu} + \\alpha \\mu_0,\n\n\\qquad \\alpha \\in [0,1],\n\n\\tag{3.5}&quot;,&quot;id&quot;:&quot;VUCOPGZURA&quot;}" data-component-name="LatexBlockToDOM"></div><p>where mu_0 is a prior mean. Choices for mu_0 include:</p><ul><li><p>zero (implying no predictability in excess returns),</p></li><li><p>a cross-sectional average (implying mean reversion across assets),</p></li><li><p>factor-model-implied returns,</p></li><li><p>equilibrium-implied returns from a benchmark portfolio.</p></li></ul><p>The key is the logic: because hat{mu} is high-variance, we deliberately introduce bias by shrinking toward a stable prior. This reduces the variance of the resulting weights, which is often the dominant out-of-sample benefit.</p><p>A particularly influential equilibrium anchoring method is to infer implied expected returns pi from an observed &#8220;market&#8221; or benchmark portfolio w_m.</p><p>Before invoking the next equation, it helps to distinguish between two regimes:</p><ul><li><p><strong>Risk-free asset (tangency portfolio).</strong> If a risk-free asset is available and w_m is the tangency portfolio, then pi are excess returns and reverse optimization yields pi = lambda Sigma w_m.</p></li><li><p><strong>Risky-only, fully invested.</strong> If we remain in the 1^T w = 1 setting, the KKT condition is mu = gamma Sigma w_m + eta 1. The intercept term is economically irrelevant under the budget constraint, so one can normalize it away or interpret eta as the baseline rate.</p></li></ul><p>In a mean&#8211;variance world, if w_m is optimal for some representative investor with risk aversion lambda, then</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;w_m \\propto \\Sigma^{-1}\\pi\n\n\\quad\\Rightarrow\\quad\n\n\\pi = \\lambda \\Sigma w_m\n\n\\tag{3.6}&quot;,&quot;id&quot;:&quot;AWTWNJUYPD&quot;}" data-component-name="LatexBlockToDOM"></div><p>This produces a return vector pi consistent with the covariance structure and observed holdings. Even if the exact assumptions are stylized, pi has a crucial practical advantage: it is <em>anchored</em> to a diversified, implementable portfolio, which prevents the optimizer from forming extreme views unsupported by the market&#8217;s aggregate positioning.</p><h3>Black-Litterman as a canonical &#8220;fix-the-inputs&#8221; framework</h3><p>Black&#8211;Litterman formalizes the idea that expected returns should be a blend of (i) equilibrium returns and (ii) investor views. While many variants exist, the classical setup can be summarized as follows.</p><p>Let pi be equilibrium implied returns (e.g., from (3.6)). Model the prior as</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\mu \\sim \\mathcal{N}(\\pi, \\tau \\Sigma),\n\n\\tag{3.7}&quot;,&quot;id&quot;:&quot;TIZZVGBVHE&quot;}" data-component-name="LatexBlockToDOM"></div><p>where tau &gt; 0 scales uncertainty in the prior. Investor views are expressed as</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;P\\mu = q + \\text{noise},\n\n\\tag{3.8}&quot;,&quot;id&quot;:&quot;LLXWXPMXWS&quot;}" data-component-name="LatexBlockToDOM"></div><p>where P in R^{M x N} selects linear combinations of returns, q in R^M are view returns, and view noise has covariance Omega in R^{M x M}$ (often diagonal).</p><p>The posterior mean under Gaussian assumptions is</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\mu_{\\mathrm{BL}}\n\n= \\left( (\\tau \\Sigma)^{-1} + P^\\top \\Omega^{-1} P \\right)^{-1}\n\n\\left( (\\tau \\Sigma)^{-1}\\pi + P^\\top \\Omega^{-1} q \\right).\n\n\\tag{3.9}&quot;,&quot;id&quot;:&quot;OXSWVUEZTB&quot;}" data-component-name="LatexBlockToDOM"></div><p>Why does this help MVO?</p><ul><li><p>It shrinks noisy, unconstrained return estimates toward an equilibrium anchor.</p></li><li><p>It expresses uncertainty explicitly via tau and Omega, preventing overconfidence.</p></li><li><p>It ensures that when views are weak or absent, the optimizer defaults to a diversified baseline rather than a noisy corner solution.</p></li></ul><p>Black&#8211;Litterman is not magic; it is a disciplined way of injecting structure and uncertainty into mu, which is exactly what raw MVO lacks.</p><h3>Resampling and Bayesian Averaging: Stabilizing weights instead of moments</h3><p>Another approach is to accept that inputs are noisy and average over that uncertainty. A simple version is bootstrap resampling:</p><p>1. Generate many synthetic datasets by resampling {r_t}.</p><p>2. For each dataset b, compute hat{mu}^(b), hat{Sigma}^(b) and solve MVO to get hat{w}^(b).</p><p>3. Average weights: </p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\bar{w} = \\frac{1}{B}\\sum_{b=1}^B \\hat{w}^{(b)}&quot;,&quot;id&quot;:&quot;WLVLJORHAL&quot;}" data-component-name="LatexBlockToDOM"></div><p>The intuition is that extreme positions caused by noise tend not to be stable across resamples; averaging dampens them. In decision-theoretic language, this approximates integrating over parameter uncertainty rather than conditioning on a single plug-in estimate.</p><p>This class of methods &#8220;fixes&#8221; MVO not by producing perfect estimates, but by reducing the variance of the <em>decision</em> w.</p><p>Let&#8217;s compare the weights generated by this method with those of MVO using just the sample estimates. We will also enforce long only to make the weights more comparable.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!UPgJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d5b95a-4871-4f26-b19e-524d163a5734_1782x2986.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!UPgJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d5b95a-4871-4f26-b19e-524d163a5734_1782x2986.png 424w, https://substackcdn.com/image/fetch/$s_!UPgJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d5b95a-4871-4f26-b19e-524d163a5734_1782x2986.png 848w, https://substackcdn.com/image/fetch/$s_!UPgJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d5b95a-4871-4f26-b19e-524d163a5734_1782x2986.png 1272w, https://substackcdn.com/image/fetch/$s_!UPgJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d5b95a-4871-4f26-b19e-524d163a5734_1782x2986.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!UPgJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d5b95a-4871-4f26-b19e-524d163a5734_1782x2986.png" width="1456" height="2440" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/13d5b95a-4871-4f26-b19e-524d163a5734_1782x2986.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2440,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:785711,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d5b95a-4871-4f26-b19e-524d163a5734_1782x2986.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!UPgJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d5b95a-4871-4f26-b19e-524d163a5734_1782x2986.png 424w, https://substackcdn.com/image/fetch/$s_!UPgJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d5b95a-4871-4f26-b19e-524d163a5734_1782x2986.png 848w, https://substackcdn.com/image/fetch/$s_!UPgJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d5b95a-4871-4f26-b19e-524d163a5734_1782x2986.png 1272w, https://substackcdn.com/image/fetch/$s_!UPgJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d5b95a-4871-4f26-b19e-524d163a5734_1782x2986.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_!owaT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a9668c3-5a09-41ac-879c-5378e3e965eb_910x599.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!owaT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a9668c3-5a09-41ac-879c-5378e3e965eb_910x599.png 424w, https://substackcdn.com/image/fetch/$s_!owaT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a9668c3-5a09-41ac-879c-5378e3e965eb_910x599.png 848w, https://substackcdn.com/image/fetch/$s_!owaT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a9668c3-5a09-41ac-879c-5378e3e965eb_910x599.png 1272w, https://substackcdn.com/image/fetch/$s_!owaT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a9668c3-5a09-41ac-879c-5378e3e965eb_910x599.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!owaT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a9668c3-5a09-41ac-879c-5378e3e965eb_910x599.png" width="910" height="599" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7a9668c3-5a09-41ac-879c-5378e3e965eb_910x599.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:599,&quot;width&quot;:910,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:77237,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a9668c3-5a09-41ac-879c-5378e3e965eb_910x599.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!owaT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a9668c3-5a09-41ac-879c-5378e3e965eb_910x599.png 424w, https://substackcdn.com/image/fetch/$s_!owaT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a9668c3-5a09-41ac-879c-5378e3e965eb_910x599.png 848w, https://substackcdn.com/image/fetch/$s_!owaT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a9668c3-5a09-41ac-879c-5378e3e965eb_910x599.png 1272w, https://substackcdn.com/image/fetch/$s_!owaT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a9668c3-5a09-41ac-879c-5378e3e965eb_910x599.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>As you can see, half of the weights generated by the plug-in MVO are exactly zero, whereas with the bootstrap-averaged method, we have no zero weights. Those weights that are non-zero are also larger for the plug-in MVO. We are therefore better diversified using the bootstrap-averaged weights method.</p><h2>Constraining and Regularizing the Optimizer</h2><p>Even with improved inputs, the optimizer can still overreact. Constraining the optimization problem is therefore the second major lever. The guiding principle is simple: <strong>if you restrict the feasible set or penalize extreme solutions, the optimizer has fewer degrees of freedom to express estimation noise.</strong></p><h3>Box constraints, no-short constraints, and leverage limits</h3><p>A basic set of implementability constraints is</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;l_i \\le w_i \\le u_i \\quad \\text{for all } i,\n\n\\tag{3.10}&quot;,&quot;id&quot;:&quot;VQJCNBLNPJ&quot;}" data-component-name="LatexBlockToDOM"></div><p>along with the budget constraint 1^T w = 1. The no-short constraint is the special case (l_i = 0). A leverage constraint can be expressed as</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\|w\\|_1 \\le L,\n\n\\tag{3.11}&quot;,&quot;id&quot;:&quot;AHSOKUKJIZ&quot;}" data-component-name="LatexBlockToDOM"></div><p>When shorts are allowed, |w|_1 measures gross exposure; limiting it prevents the optimizer from creating offsetting long/short positions that are highly sensitive to small covariance or mean differences.</p><p>Why do these constraints work? They impose a <em>cap on sensitivity</em>. If the optimizer cannot push weights arbitrarily far, then errors in hat{mu} and hat{Sigma} cannot translate into arbitrarily extreme positions.</p><p>A common misconception is that constraints only reflect operational needs. In practice, they often serve a dual purpose: implementability <em>and </em>robustness.</p><h3>Regularization Penalties: Making MVO behave like a well-posed estimation problem</h3><p>Instead of hard constraints, one can add penalties to the objective. Consider augmenting (MVO-2) with an l2 (ridge) penalty:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\max_{w:\\mathbf{1}^\\top w=1} \\left( w^\\top \\mu - \\frac{\\gamma}{2} w^\\top \\Sigma w - \\frac{\\lambda}{2} \\|w\\|_2^2 \\right), \\qquad \\lambda \\ge 0.\n\n\\tag{3.12}&quot;,&quot;id&quot;:&quot;FGZYUOEEDM&quot;}" data-component-name="LatexBlockToDOM"></div><p>  Because |w|_2^2 = w^T I w, the risk term becomes</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\frac{\\gamma}{2} w^\\top \\Sigma w + \\frac{\\lambda}{2} w^\\top I w\n\n  = \\frac{\\gamma}{2} w^\\top \\left(\\Sigma + \\frac{\\lambda}{\\gamma}I\\right) w.\n\n\\tag{3.13}&quot;,&quot;id&quot;:&quot;RAGBZNJVPM&quot;}" data-component-name="LatexBlockToDOM"></div><p>  So ridge-regularized MVO is equivalent to replacing Sigma with</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\Sigma_{\\text{eff}} = \\Sigma + \\frac{\\lambda}{\\gamma} I\n\n\\tag{3.14}&quot;,&quot;id&quot;:&quot;BCZCIKUDRH&quot;}" data-component-name="LatexBlockToDOM"></div><p>  This is a profound and practical insight: <strong>a simple weight penalty is mathematically identical to eigenvalue inflation of the covariance matrix.</strong> It improves conditioning by pushing all eigenvalues away from zero, directly addressing the instability of Sigma^{-1}. In effect, it says: &#8220;do not trust low-variance directions too much; treat them as riskier than the raw estimate suggests.&#8221;</p><p>One can also use an l1 (lasso) penalty:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\max_{w:\\mathbf{1}^\\top w=1} \\left( w^\\top \\mu - \\frac{\\gamma}{2} w^\\top \\Sigma w - \\lambda \\|w\\|_1 \\right).\n\n\\tag{3.15}&quot;,&quot;id&quot;:&quot;MWJMIQUSTO&quot;}" data-component-name="LatexBlockToDOM"></div><p>  The l1 penalty encourages sparsity (many weights exactly zero) and discourages large gross exposure, especially when shorts are allowed. It is closely related to constraining |w|_1 as in (3.11). Sparse portfolios can be easier to implement and often exhibit lower turnover.</p><p>  Note: if w &gt;= 0 and 1^T w = 1, then |w|_1 = 1 is constant, so an l1 penalty on weights has no effect. l1 becomes meaningful when shorting is allowed (gross exposure varies), when applied to active weights a = w - w_b, or when penalizing turnover |w_t - w_{t-1}|_1.</p><p>Both l1 and l2 regularization can be understood as injecting a preference for &#8220;simple&#8221; portfolios, portfolios that do not require precise estimates to justify intricate long/short structures.</p><p>The following code demonstrates what happens if you adjust the ridge parameter lambda:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!g7A-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25f4bc49-73e3-497b-967e-c18b7287dd7e_1732x2912.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!g7A-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25f4bc49-73e3-497b-967e-c18b7287dd7e_1732x2912.png 424w, https://substackcdn.com/image/fetch/$s_!g7A-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25f4bc49-73e3-497b-967e-c18b7287dd7e_1732x2912.png 848w, https://substackcdn.com/image/fetch/$s_!g7A-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25f4bc49-73e3-497b-967e-c18b7287dd7e_1732x2912.png 1272w, https://substackcdn.com/image/fetch/$s_!g7A-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25f4bc49-73e3-497b-967e-c18b7287dd7e_1732x2912.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!g7A-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25f4bc49-73e3-497b-967e-c18b7287dd7e_1732x2912.png" width="1456" height="2448" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/25f4bc49-73e3-497b-967e-c18b7287dd7e_1732x2912.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2448,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:747931,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25f4bc49-73e3-497b-967e-c18b7287dd7e_1732x2912.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!g7A-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25f4bc49-73e3-497b-967e-c18b7287dd7e_1732x2912.png 424w, https://substackcdn.com/image/fetch/$s_!g7A-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25f4bc49-73e3-497b-967e-c18b7287dd7e_1732x2912.png 848w, https://substackcdn.com/image/fetch/$s_!g7A-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25f4bc49-73e3-497b-967e-c18b7287dd7e_1732x2912.png 1272w, https://substackcdn.com/image/fetch/$s_!g7A-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25f4bc49-73e3-497b-967e-c18b7287dd7e_1732x2912.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_!aB9w!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc64a161-9abb-481e-b211-33545c699a4d_824x464.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aB9w!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc64a161-9abb-481e-b211-33545c699a4d_824x464.png 424w, https://substackcdn.com/image/fetch/$s_!aB9w!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc64a161-9abb-481e-b211-33545c699a4d_824x464.png 848w, https://substackcdn.com/image/fetch/$s_!aB9w!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc64a161-9abb-481e-b211-33545c699a4d_824x464.png 1272w, https://substackcdn.com/image/fetch/$s_!aB9w!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc64a161-9abb-481e-b211-33545c699a4d_824x464.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aB9w!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc64a161-9abb-481e-b211-33545c699a4d_824x464.png" width="824" height="464" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bc64a161-9abb-481e-b211-33545c699a4d_824x464.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:464,&quot;width&quot;:824,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:39536,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc64a161-9abb-481e-b211-33545c699a4d_824x464.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!aB9w!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc64a161-9abb-481e-b211-33545c699a4d_824x464.png 424w, https://substackcdn.com/image/fetch/$s_!aB9w!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc64a161-9abb-481e-b211-33545c699a4d_824x464.png 848w, https://substackcdn.com/image/fetch/$s_!aB9w!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc64a161-9abb-481e-b211-33545c699a4d_824x464.png 1272w, https://substackcdn.com/image/fetch/$s_!aB9w!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc64a161-9abb-481e-b211-33545c699a4d_824x464.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>Higher lambda results in better conditioned Sigma.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!o2ei!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e0ca8bf-a8b3-4463-a556-270fdae2a530_824x464.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!o2ei!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e0ca8bf-a8b3-4463-a556-270fdae2a530_824x464.png 424w, https://substackcdn.com/image/fetch/$s_!o2ei!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e0ca8bf-a8b3-4463-a556-270fdae2a530_824x464.png 848w, https://substackcdn.com/image/fetch/$s_!o2ei!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e0ca8bf-a8b3-4463-a556-270fdae2a530_824x464.png 1272w, https://substackcdn.com/image/fetch/$s_!o2ei!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e0ca8bf-a8b3-4463-a556-270fdae2a530_824x464.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!o2ei!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e0ca8bf-a8b3-4463-a556-270fdae2a530_824x464.png" width="824" height="464" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7e0ca8bf-a8b3-4463-a556-270fdae2a530_824x464.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:464,&quot;width&quot;:824,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:41253,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e0ca8bf-a8b3-4463-a556-270fdae2a530_824x464.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!o2ei!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e0ca8bf-a8b3-4463-a556-270fdae2a530_824x464.png 424w, https://substackcdn.com/image/fetch/$s_!o2ei!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e0ca8bf-a8b3-4463-a556-270fdae2a530_824x464.png 848w, https://substackcdn.com/image/fetch/$s_!o2ei!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e0ca8bf-a8b3-4463-a556-270fdae2a530_824x464.png 1272w, https://substackcdn.com/image/fetch/$s_!o2ei!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e0ca8bf-a8b3-4463-a556-270fdae2a530_824x464.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>Higher lambda results in lower L1 and L2 norm of w (The portfolios become &#8220;simpler&#8221;).</p><h3>Turnover and Transaction Costs: Regularizing changes the weights</h3><p>A portfolio is rarely optimized once. In practice, we solve a sequence of problems over time. Estimation noise then manifests as unstable <em>changes</em> in weights, i.e., turnover.</p><p>A common fix is to add trading costs or turnover penalties. Let w_{t-1} be current holdings and w_t the new decision. A quadratic turnover penalty gives</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\max_{w_t:\\mathbf{1}^\\top w_t = 1} \\left( w_t^\\top \\mu_t - \\frac{\\gamma}{2} w_t^\\top \\Sigma_t w_t - \\frac{\\kappa}{2} \\|w_t - w_{t-1}\\|_2^2 \\right), \\qquad \\kappa > 0.\n\n\\tag{3.16}&quot;,&quot;id&quot;:&quot;SVJROJSZNR&quot;}" data-component-name="LatexBlockToDOM"></div><p>  This makes the optimizer &#8220;reluctant&#8221; to move unless the gain in mean&#8211;variance utility is large enough to justify the change. Importantly, this is also a robustness device: it prevents the optimizer from chasing small, noisy changes in hat{mu} or hat{Sigma}.</p><p>Linear cost models use |w_t - w_{t-1}|_1 instead, which can better capture proportional costs and induce sparse trading (only a subset of names trade each period).</p><p>The deeper point is that multi-period implementation turns MVO into a control problem. Regularizing the control (weight changes) is often more impactful than regularizing the state (weights) alone.</p><p>Let&#8217;s compare the evolution of two portfolios: One via regular MVO and one with the L1 penalty for weight changes. Let&#8217;s also see how changing kappa affects our portfolio.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!e1Uq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F917d1ea0-3719-4a98-9a14-99e657e78697_1548x4328.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!e1Uq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F917d1ea0-3719-4a98-9a14-99e657e78697_1548x4328.png 424w, https://substackcdn.com/image/fetch/$s_!e1Uq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F917d1ea0-3719-4a98-9a14-99e657e78697_1548x4328.png 848w, https://substackcdn.com/image/fetch/$s_!e1Uq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F917d1ea0-3719-4a98-9a14-99e657e78697_1548x4328.png 1272w, https://substackcdn.com/image/fetch/$s_!e1Uq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F917d1ea0-3719-4a98-9a14-99e657e78697_1548x4328.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!e1Uq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F917d1ea0-3719-4a98-9a14-99e657e78697_1548x4328.png" width="1456" height="4071" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/917d1ea0-3719-4a98-9a14-99e657e78697_1548x4328.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:4071,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1092399,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F917d1ea0-3719-4a98-9a14-99e657e78697_1548x4328.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!e1Uq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F917d1ea0-3719-4a98-9a14-99e657e78697_1548x4328.png 424w, https://substackcdn.com/image/fetch/$s_!e1Uq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F917d1ea0-3719-4a98-9a14-99e657e78697_1548x4328.png 848w, https://substackcdn.com/image/fetch/$s_!e1Uq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F917d1ea0-3719-4a98-9a14-99e657e78697_1548x4328.png 1272w, https://substackcdn.com/image/fetch/$s_!e1Uq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F917d1ea0-3719-4a98-9a14-99e657e78697_1548x4328.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_!7OBR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb69f319a-cded-4751-b993-647affdbe943_905x582.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7OBR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb69f319a-cded-4751-b993-647affdbe943_905x582.png 424w, https://substackcdn.com/image/fetch/$s_!7OBR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb69f319a-cded-4751-b993-647affdbe943_905x582.png 848w, https://substackcdn.com/image/fetch/$s_!7OBR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb69f319a-cded-4751-b993-647affdbe943_905x582.png 1272w, https://substackcdn.com/image/fetch/$s_!7OBR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb69f319a-cded-4751-b993-647affdbe943_905x582.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7OBR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb69f319a-cded-4751-b993-647affdbe943_905x582.png" width="905" height="582" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b69f319a-cded-4751-b993-647affdbe943_905x582.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:582,&quot;width&quot;:905,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:77779,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb69f319a-cded-4751-b993-647affdbe943_905x582.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!7OBR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb69f319a-cded-4751-b993-647affdbe943_905x582.png 424w, https://substackcdn.com/image/fetch/$s_!7OBR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb69f319a-cded-4751-b993-647affdbe943_905x582.png 848w, https://substackcdn.com/image/fetch/$s_!7OBR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb69f319a-cded-4751-b993-647affdbe943_905x582.png 1272w, https://substackcdn.com/image/fetch/$s_!7OBR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb69f319a-cded-4751-b993-647affdbe943_905x582.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>Above, we&#8217;ve used a kappa of 50. As you can see, turnover is very heavily reduced.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bqIP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e407acb-9d3c-4a81-8d38-c8e0b3d49f3e_775x488.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bqIP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e407acb-9d3c-4a81-8d38-c8e0b3d49f3e_775x488.png 424w, https://substackcdn.com/image/fetch/$s_!bqIP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e407acb-9d3c-4a81-8d38-c8e0b3d49f3e_775x488.png 848w, https://substackcdn.com/image/fetch/$s_!bqIP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e407acb-9d3c-4a81-8d38-c8e0b3d49f3e_775x488.png 1272w, https://substackcdn.com/image/fetch/$s_!bqIP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e407acb-9d3c-4a81-8d38-c8e0b3d49f3e_775x488.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bqIP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e407acb-9d3c-4a81-8d38-c8e0b3d49f3e_775x488.png" width="775" height="488" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0e407acb-9d3c-4a81-8d38-c8e0b3d49f3e_775x488.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:488,&quot;width&quot;:775,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:41515,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e407acb-9d3c-4a81-8d38-c8e0b3d49f3e_775x488.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!bqIP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e407acb-9d3c-4a81-8d38-c8e0b3d49f3e_775x488.png 424w, https://substackcdn.com/image/fetch/$s_!bqIP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e407acb-9d3c-4a81-8d38-c8e0b3d49f3e_775x488.png 848w, https://substackcdn.com/image/fetch/$s_!bqIP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e407acb-9d3c-4a81-8d38-c8e0b3d49f3e_775x488.png 1272w, https://substackcdn.com/image/fetch/$s_!bqIP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e407acb-9d3c-4a81-8d38-c8e0b3d49f3e_775x488.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 you can see that as you increase your turnover penalty kappa, your improvement vs an unpenalized portfolio becomes better and better, but returns are becoming diminishing with values &gt;= 30.</p><p>In a real market that can change more abruptly, you may want to pick kappa slightly lower to be able to adapt more quickly.</p><h3>Benchmark-relative optimization</h3><p>Many institutional mandates are benchmark-relative. Let w_b be benchmark weights. Define active weights a = w - w_b. Then tracking error variance is</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\mathrm{TE}^2 = a^\\top \\Sigma a.\n\n\\tag{3.17}&quot;,&quot;id&quot;:&quot;ZOUHVKQQPD&quot;}" data-component-name="LatexBlockToDOM"></div><p>A common optimization is to maximize expected active return subject to tracking error:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\begin{aligned}\n\n\\max_{a}\n\n&amp;\\quad a^\\top \\alpha \\\\\n\n\\text{s.t.}\n\n&amp;\\quad a^\\top \\Sigma a \\le \\sigma_{\\mathrm{TE}}^2, \\\\\n\n&amp;\\quad \\mathbf{1}^\\top a = 0,\n\n\\end{aligned}\n\n\\tag{3.18}&quot;,&quot;id&quot;:&quot;ILCPQLZDWD&quot;}" data-component-name="LatexBlockToDOM"></div><p>where alpha represents expected alphas (expected excess returns relative to benchmark). This formulation has an important robustness advantage: it anchors the portfolio near a diversified benchmark, limiting the optimizer&#8217;s ability to create extreme positions driven by noise. In effect, the benchmark provides a strong prior on the weight vector.</p><p>Even if one is not formally benchmarked, this insight generalizes: anchoring optimization around a reference portfolio (market, equal weight, risk parity) often improves stability.</p><h3>Robust Optimization: Optimizing against parameter uncertainty directly</h3><p>A conceptually clean way to address estimation error is to incorporate uncertainty sets for mu and/or Sigma, then optimize a worst-case objective. This approach turns &#8220;garbage in, garbage out&#8221; into &#8220;uncertainty in, robustness out.&#8221;</p><p>One standard robust mean model assumes mu lies in an ellipsoid around hat{mu}:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\mathcal{U}_\\mu = \\left\\{ \\mu: (\\mu - \\hat{\\mu})^\\top \\hat{\\Sigma}^{-1} (\\mu - \\hat{\\mu}) \\le \\kappa^2 \\right\\}\n\n\\tag{3.19}&quot;,&quot;id&quot;:&quot;QHVOHJQZVS&quot;}" data-component-name="LatexBlockToDOM"></div><p>Consider the robust counterpart of maximizing expected return minus risk, taking the worst-case mean:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\max_{w:\\mathbf{1}^\\top w=1} \\left( \\min_{\\mu \\in \\mathcal{U}_\\mu} w^\\top \\mu - \\frac{\\gamma}{2} w^\\top \\hat{\\Sigma} w \\right).\n\n\\tag{3.20}&quot;,&quot;id&quot;:&quot;MCCEVFZQQL&quot;}" data-component-name="LatexBlockToDOM"></div><p>The inner minimization has a closed form:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\min_{\\mu \\in \\mathcal{U}_\\mu} w^\\top \\mu = w^\\top \\hat{\\mu} - \\kappa \\sqrt{w^\\top \\hat{\\Sigma} w}.\n\n\\tag{3.21}&quot;,&quot;id&quot;:&quot;TLEJWZWLRJ&quot;}" data-component-name="LatexBlockToDOM"></div><p>So the robust problem becomes</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\max_{w:\\mathbf{1}^\\top w=1} \\left( w^\\top \\hat{\\mu} - \\kappa \\sqrt{w^\\top \\hat{\\Sigma} w} - \\frac{\\gamma}{2} w^\\top \\hat{\\Sigma} w \\right).\n\n\\tag{3.22}&quot;,&quot;id&quot;:&quot;KXMWSSTEHA&quot;}" data-component-name="LatexBlockToDOM"></div><p>  This is illuminating. The robust adjustment subtracts a term proportional to portfolio volatility, effectively reducing the attractiveness of portfolios whose expected return advantage might be explained by estimation error. The optimizer is forced to find portfolios whose expected return is high <em>relative to uncertainty</em>.</p><p>Robust covariance uncertainty sets lead to related regularization effects, often inflating risk in uncertain directions; again echoing the intuition behind shrinkage and ridge penalties. Robust optimization provides a principled bridge between statistical uncertainty and optimization regularization.</p><p>Let&#8217;s compare this to standard MVO:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RwHk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8331ae8f-c7d0-4b74-b73b-1dde0c5cc95c_1732x3546.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RwHk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8331ae8f-c7d0-4b74-b73b-1dde0c5cc95c_1732x3546.png 424w, https://substackcdn.com/image/fetch/$s_!RwHk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8331ae8f-c7d0-4b74-b73b-1dde0c5cc95c_1732x3546.png 848w, https://substackcdn.com/image/fetch/$s_!RwHk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8331ae8f-c7d0-4b74-b73b-1dde0c5cc95c_1732x3546.png 1272w, https://substackcdn.com/image/fetch/$s_!RwHk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8331ae8f-c7d0-4b74-b73b-1dde0c5cc95c_1732x3546.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RwHk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8331ae8f-c7d0-4b74-b73b-1dde0c5cc95c_1732x3546.png" width="1456" height="2981" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8331ae8f-c7d0-4b74-b73b-1dde0c5cc95c_1732x3546.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2981,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:961128,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8331ae8f-c7d0-4b74-b73b-1dde0c5cc95c_1732x3546.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!RwHk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8331ae8f-c7d0-4b74-b73b-1dde0c5cc95c_1732x3546.png 424w, https://substackcdn.com/image/fetch/$s_!RwHk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8331ae8f-c7d0-4b74-b73b-1dde0c5cc95c_1732x3546.png 848w, https://substackcdn.com/image/fetch/$s_!RwHk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8331ae8f-c7d0-4b74-b73b-1dde0c5cc95c_1732x3546.png 1272w, https://substackcdn.com/image/fetch/$s_!RwHk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8331ae8f-c7d0-4b74-b73b-1dde0c5cc95c_1732x3546.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_!YSLy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89f1c92b-a219-4a6b-afc1-7a900bc204d7_925x675.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YSLy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89f1c92b-a219-4a6b-afc1-7a900bc204d7_925x675.png 424w, https://substackcdn.com/image/fetch/$s_!YSLy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89f1c92b-a219-4a6b-afc1-7a900bc204d7_925x675.png 848w, https://substackcdn.com/image/fetch/$s_!YSLy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89f1c92b-a219-4a6b-afc1-7a900bc204d7_925x675.png 1272w, https://substackcdn.com/image/fetch/$s_!YSLy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89f1c92b-a219-4a6b-afc1-7a900bc204d7_925x675.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YSLy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89f1c92b-a219-4a6b-afc1-7a900bc204d7_925x675.png" width="925" height="675" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/89f1c92b-a219-4a6b-afc1-7a900bc204d7_925x675.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:675,&quot;width&quot;:925,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:88163,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/186718680?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89f1c92b-a219-4a6b-afc1-7a900bc204d7_925x675.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!YSLy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89f1c92b-a219-4a6b-afc1-7a900bc204d7_925x675.png 424w, https://substackcdn.com/image/fetch/$s_!YSLy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89f1c92b-a219-4a6b-afc1-7a900bc204d7_925x675.png 848w, https://substackcdn.com/image/fetch/$s_!YSLy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89f1c92b-a219-4a6b-afc1-7a900bc204d7_925x675.png 1272w, https://substackcdn.com/image/fetch/$s_!YSLy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89f1c92b-a219-4a6b-afc1-7a900bc204d7_925x675.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>Our Robust MVO weights are a lot more &#8220;clean&#8221; compared to the standard MVO weights.</p><h1>Conclusion</h1><p>It is tempting to treat the practical modifications above as an ad hoc toolbox: shrinkage here, constraints there, turnover penalties elsewhere. A more coherent view is that these methods all solve the same underlying problem:</p><p><strong>The plug-in MVO portfolio is a high-variance estimator of the optimal weights.</strong></p><p>Reducing that variance requires injecting structure, equivalently, adding bias.</p><ul><li><p>Shrinkage of Sigma reduces the variance of covariance estimates (and stabilizes inversion) at the cost of bias toward the target structure.</p></li><li><p>Factor models impose a low-rank structure that may be misspecified but dramatically reduces estimation noise.</p></li><li><p>Shrinkage and Bayesian methods for mu explicitly acknowledge that sample means are too noisy to trust fully.</p></li><li><p>Constraints and penalties reduce the effective degrees of freedom of the portfolio, preventing the optimizer from encoding noise into intricate weight patterns.</p></li><li><p>Turnover penalties reduce the variance of <em>changes</em> in weights, which is often the real operational pain point.</p></li><li><p>Robust optimization is an explicit uncertainty-aware form of regularization.</p></li></ul><p>From this perspective, the &#8220;right&#8221; portfolio is not the one that is optimal for the estimated parameters; it is the one that is optimal for the <em>decision problem under uncertainty</em>, including estimation error, non-stationarity, and implementability constraints.</p><p>Quant Corner: <a href="https://discord.gg/X7TsxKNbXg">https://discord.gg/X7TsxKNbXg</a></p><p>Code: <a href="https://gist.github.com/vertoxquant/e417b8afd2abe0e15ae0ff486813842a">https://gist.github.com/vertoxquant/e417b8afd2abe0e15ae0ff486813842a</a></p>]]></content:encoded></item><item><title><![CDATA[The Myth of Factor-Free Crypto]]></title><description><![CDATA[Applying equity-style factors to digital assets]]></description><link>https://www.vertoxquant.com/p/the-myth-of-factor-free-crypto</link><guid isPermaLink="false">https://www.vertoxquant.com/p/the-myth-of-factor-free-crypto</guid><dc:creator><![CDATA[Vertox]]></dc:creator><pubDate>Tue, 27 Jan 2026 11:58:38 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!XkCB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34bf8966-164f-4e82-b241-c63702a902d9_1189x390.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>People keep telling you to take what works in equities and apply it to crypto.<br>Those same people then claim that factors don&#8217;t exist in crypto at all.</p><p>At first glance, that contradiction seems justified. Crypto markets look nothing like equities: trading is continuous, liquidity is fragmented across venues, listings and delistings are frequent, and returns are dominated by a long tail of illiquid tokens.</p><p>Let&#8217;s answer once and for all if equity factors exist in crypto and if you can profit from them.</p><p>By the end of this article, you&#8217;ll have a framework for answering that question yourself. You&#8217;ll see how to test new factors and alphas in a way that is robust to listings and delistings, a changing universe, and the realities of trading crypto markets. The full research notebook used in the analysis is available for download at the end of the article for paid subscribers.</p>
      <p>
          <a href="https://www.vertoxquant.com/p/the-myth-of-factor-free-crypto">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Fitting Regime Switching Models to High-Frequency Data]]></title><description><![CDATA[With derivations]]></description><link>https://www.vertoxquant.com/p/fitting-regime-switching-models</link><guid isPermaLink="false">https://www.vertoxquant.com/p/fitting-regime-switching-models</guid><dc:creator><![CDATA[Vertox]]></dc:creator><pubDate>Thu, 22 Jan 2026 11:54:30 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!wRfA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa704e37a-e30a-405e-961f-ed8a5c020d80_627x470.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1>Introduction</h1><p>In the previous article, we built all of the theory behind HMMs for microstructural data. This article is where it finally gets real, and we fit those models to actual market data efficiently.</p><p>We are going to take something that is completely infeasible in practice, on the order of 10^430 computations. To put that in perspective, if you took every atom in our universe, put a new universe inside each atom, and repeated that process five times, you would reach a number around that size. Then we collapse it down to roughly 9000 computations that you can actually run.</p><p>By the end of this article, you will be able to take real market data, fit an HMM to it, and identify which market regime you are most likely in</p>
      <p>
          <a href="https://www.vertoxquant.com/p/fitting-regime-switching-models">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[The Birth of a Quant Community]]></title><description><![CDATA[Quant Corner]]></description><link>https://www.vertoxquant.com/p/the-birth-of-a-quant-community</link><guid isPermaLink="false">https://www.vertoxquant.com/p/the-birth-of-a-quant-community</guid><dc:creator><![CDATA[Vertox]]></dc:creator><pubDate>Wed, 21 Jan 2026 07:29:57 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/9fa63885-94bf-478b-9908-29f319b0b115_1024x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I&#8217;ve been around on quant discord servers for 6 years now and have always noticed the same trends:</p><ul><li><p>Small communities that are invite only just tend to die down eventually.</p></li><li><p>Big servers don&#8217;t really offer much value or do anything fun.</p></li></ul><p>That&#8217;s exactly what I want to change with <strong><a href="https://discord.gg/X7TsxKNbXg">Quant Corner</a></strong>!</p><p>The goal is simple: build a community that actually <em>does things</em>.<br>Think tournaments, live Q&amp;As, useful resource giveaways, and open discussions where your feedback genuinely shapes what we build next.</p><p>Quant Corner is also the best place to engage directly with me, share ideas, suggest events, and help steer the direction of the community.</p><p>We&#8217;re currently at <strong>~440 members</strong>, and once we hit <strong>800</strong>, I&#8217;ll be hosting something <em><strong>big.</strong></em></p><p>If this sounds like something you&#8217;d want to be part of, join us here:<br><a href="https://discord.gg/X7TsxKNbXg">https://discord.gg/X7TsxKNbXg</a></p>]]></content:encoded></item><item><title><![CDATA[Regime Switching Models for Microstructure Features]]></title><description><![CDATA[Understanding State Dependence in Market Microstructure]]></description><link>https://www.vertoxquant.com/p/regime-switching-models-for-microstructure</link><guid isPermaLink="false">https://www.vertoxquant.com/p/regime-switching-models-for-microstructure</guid><dc:creator><![CDATA[Vertox]]></dc:creator><pubDate>Fri, 16 Jan 2026 10:19:54 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/55b4c663-1e6f-4679-9526-16d93f2985ec_607x392.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1>Introduction</h1><p>Many financial features exhibit regime behavior: low vs. high volatility, choppy vs. trending markets, liquid vs. illiquid conditions.</p><p>These regimes are not directly observable. Instead, we only see their manifestations in market data such as prices, returns, volumes, and spreads.</p><p>As a result, microstructure features may exhibit different statistical behaviour depending on the underlying market state, raising the question of how they should be analysed in practice.</p>
      <p>
          <a href="https://www.vertoxquant.com/p/regime-switching-models-for-microstructure">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[What I'd Teach Someone Starting Quant Trading in 2026]]></title><description><![CDATA[Most quant roadmaps are useless.]]></description><link>https://www.vertoxquant.com/p/2026-quant-crash-course</link><guid isPermaLink="false">https://www.vertoxquant.com/p/2026-quant-crash-course</guid><dc:creator><![CDATA[Vertox]]></dc:creator><pubDate>Tue, 13 Jan 2026 15:16:43 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/b74d988c-38f0-4703-82cd-055678f3bec6_630x470.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Most quant roadmaps are useless.</p><p>They dump every book and paper the author has heard of (but never read). You&#8217;re left with a 50-item reading list and no idea where to start.</p><p>This roadmap is different. Every resource here has been tested. Every month builds on the last. And it contains just what you actually need to become a quant researcher.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.vertoxquant.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">VertoxQuant is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</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><h1><strong>Day 1: Python</strong></h1><p>As a quantitative researcher, 99% of your time will be spent with Python. You don&#8217;t need to be proficient in the language, but you should be able to code up any ideas that come to mind.</p><p>If you have no coding experience whatsoever, you can honestly just get started with any &#8220;Python for Beginners&#8221; YouTube video like this:</p><div id="youtube2-kqtD5dpn9C8" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;kqtD5dpn9C8&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/kqtD5dpn9C8?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><p>By itself, Python isn&#8217;t all that powerful for research. The reason it&#8217;s still the Nr 1 choice for most researchers is the libraries.</p><p>You will see the following 3 libraries in pretty much every project:</p><ul><li><p>numpy (Fast library for working with arrays and matrices)</p></li><li><p>pandas (Data manipulation and analysis, Dataframe data structure)</p></li><li><p>matplotlib (Plotting)</p></li></ul><p>Other than that, you still have many other libraries that make your life easier, like sklearn, scipy, polars, statsmodels, and cvxpy.</p><p>Your main goal when doing research should be to leverage libraries as much as you can to get results as quickly as possible and to move on to the next problem.</p><p>Don&#8217;t spend too much time in this stage. You can spend a day coding up a few small applications to get a basic understanding of the language, but other than that, you&#8217;ll learn the language by doing real quant projects.</p><h1><strong>Week 1 and 2: Calculus and Linear Algebra</strong></h1><p>You don&#8217;t need to be a PhD-level math genius to be doing quant (unless you want to be doing complex derivatives pricing, but we can learn that later).</p><p>A solid understanding on first semester college level Calculus and Linear Algebra will get you really far. There are 2 ways to learn this:</p><ol><li><p>Go to university.</p></li><li><p>Read the following 2 articles that summarize everything in an intuitive way:</p></li></ol><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;f94f1ab5-0147-4470-ba8a-d41943a6ab75&quot;,&quot;caption&quot;:&quot;I get a lot of people asking what math they should learn for quant finance so I&#8217;m gonna summarize all of the most common and useful math that I use in quant finance in a series of articles!&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;lg&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Math for Quant Finance (Calculus)&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:128680675,&quot;name&quot;:&quot;Vertox&quot;,&quot;bio&quot;:&quot;Quantitative Researcher in Digital Asset Markets | Market Making | Statistical Arbitrage | Options &quot;,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!HGUA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bf3fd86-d46a-4caa-969a-d80059b72cb9_128x128.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2023-12-22T22:38:52.920Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc12c9be-e477-4149-8c1c-1f10d8e19f26_2378x1031.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.vertoxquant.com/p/math-for-quant-finance-calculus&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:139901196,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:9,&quot;comment_count&quot;:0,&quot;publication_id&quot;:1726874,&quot;publication_name&quot;:&quot;VertoxQuant&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!ufaQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;5ac90ddf-7ca0-4081-b03a-bc2e166b8056&quot;,&quot;caption&quot;:&quot;Linear Algebra covers linear equations, linear maps, matrices and vectors.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;lg&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Math for Quant Finance (Linear Algebra)&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:128680675,&quot;name&quot;:&quot;Vertox&quot;,&quot;bio&quot;:&quot;Quantitative Researcher in Digital Asset Markets | Market Making | Statistical Arbitrage | Options &quot;,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!HGUA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bf3fd86-d46a-4caa-969a-d80059b72cb9_128x128.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2023-12-30T16:53:17.563Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fceb04045-5351-4822-8451-e9bfb58514d8_534x466.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.vertoxquant.com/p/math-for-quant-finance-linear-algebra&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:140183544,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:3,&quot;comment_count&quot;:0,&quot;publication_id&quot;:1726874,&quot;publication_name&quot;:&quot;VertoxQuant&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!ufaQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>Universities heavily focus on proofs, as that&#8217;s what you need to discover (or invent?) new math. As a quant, I&#8217;ve never used the proof-writing skills that I learned in university before. Proofs can absolutely help with intuitive understanding of math, so if you want to gain a deeper understanding, try proving some things! </p><p>The book &#8220;How to Solve It&#8221; by George Polya teaches you a mental framework for how to approach proofs.</p><p>Just like with coding, you learn math by using it. That can either mean doing quant projects that involve a certain type of math or doing practice problems.</p><p>One of the best resources out there that I can recommend for both learning math and solving practice problems is Paul&#8217;s Online Notes:</p><p>https://tutorial.math.lamar.edu/</p><h1><strong>Week 3 and 4: Statistics</strong></h1><p>With the basic mathematical prerequisites down, you can move on to stuff you will apply more directly when doing research: Statistics!</p><p>There are 2 main branches of statistics:</p><h2><strong>Descriptive Statistics</strong></h2><p>This is all about summarizing data. Mean, Median, Variance, Volatility, Skewness, Correlation, Histograms, Boxplots, etc.</p><p>Those are all things you hear on a daily basis.</p><h2><em><strong>Inferential Statistics</strong></em></h2><p>This is all about inferring things. You are trying to predict the behavior of a non-observed set of information or generalize about a larger population using data from a sample. Things like linear regression, time series analysis, decision trees, and statistical tests are all part of inferential statistics.</p><p>The Organic Chemistry Tutor and StatQuest both have fantastic playlists on statistics:</p><p><a href="https://www.youtube.com/playlist?list=PL0o_zxa4K1BVsziIRdfv4Hl4UIqDZhXWV">https://www.youtube.com/playlist?list=PL0o_zxa4K1BVsziIRdfv4Hl4UIqDZhXWV</a></p><p><a href="https://www.youtube.com/playlist?list=PLblh5JKOoLUK0FLuzwntyYI10UQFUhsY9">https://www.youtube.com/playlist?list=PLblh5JKOoLUK0FLuzwntyYI10UQFUhsY9</a></p><p>And again: Don&#8217;t just watch those videos blindly and try to remember everything, but actually try to apply what you&#8217;ve learned.<br>Just found out about histograms, boxplots, and other visualization techniques? Try to visualize some real financial data to build intuition!</p><h1><strong>Month 2: Machine Learning</strong></h1><p>Machine learning isn&#8217;t all about huge deep neural networks and LLMs. If I were to define it, I&#8217;d say it is &#8220;all about algorithms that learn patterns from data in order to make predictions or decisions, without being explicitly programmed for each task.&#8221;</p><p>You can again categorize types of machine learning models.</p><h2><em><strong>Supervised learning</strong></em></h2><p>You work with labeled data.</p><p>By far the most important models of this type are regression models:</p><ul><li><p>Linear Regression </p></li><li><p>Logistic Regression</p></li><li><p>Polynomial Regression</p></li><li><p>Ridge Regression</p></li><li><p>Lasso Regression</p></li><li><p>Quantile Regression</p></li></ul><p>Those are the machine learning models you&#8217;ll be working with most of the time, so you should get familiar with them.</p><p><a href="https://www.geeksforgeeks.org/machine-learning/types-of-regression-techniques/">https://www.geeksforgeeks.org/machine-learning/types-of-regression-techniques/</a></p><p>Another very powerful type of model is tree-based models, like:</p><ul><li><p>Decision Trees</p></li><li><p>Random Forests</p></li><li><p>Gradient Boosted Trees (XGBoost, LightGBM)</p></li></ul><p>You often see Gradient Boosted Trees winning Kaggle competitions.</p><div id="youtube2-GSMCs3EmlmU" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;GSMCs3EmlmU&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/GSMCs3EmlmU?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><h2><em><strong>Unsupervised Learning</strong></em></h2><p>No labels; you discover structure.</p><p>Examples:</p><ul><li><p>Clustering (Grouping similar data)</p></li><li><p>Dimensionality Reduction (Finding structure in data)</p></li><li><p>Outlier Detection</p></li><li><p>Density Estimation</p></li></ul><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;9974d450-5e89-4cbe-bfef-af36dcf8c473&quot;,&quot;caption&quot;:&quot;In the previous article, we looked at latency arbitrage / lead-lag.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;lg&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Clustering Algorithms - An in-depth view&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:128680675,&quot;name&quot;:&quot;Vertox&quot;,&quot;bio&quot;:&quot;Quantitative Researcher in Digital Asset Markets | Market Making | Statistical Arbitrage | Options &quot;,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!HGUA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bf3fd86-d46a-4caa-969a-d80059b72cb9_128x128.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2023-12-08T14:44:57.956Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8402b391-c775-4035-b1c4-72d1974ceef7_342x308.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.vertoxquant.com/p/clustering-algorithms-an-in-depth&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:139471274,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:7,&quot;comment_count&quot;:0,&quot;publication_id&quot;:1726874,&quot;publication_name&quot;:&quot;VertoxQuant&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!ufaQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><h2><em><strong>Reinforcement Learning</strong></em></h2><p>Learning via interaction and feedback.</p><p>This is pretty niche, and typically other types of models do better anyway, so I wouldn&#8217;t recommend you to learn this if you are starting out.</p><p>StatQuest has a video on pretty much every topic I mentioned here, and more:</p><div id="youtube2-Gv9_4yMHFhI" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;Gv9_4yMHFhI&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/Gv9_4yMHFhI?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><p>Most importantly: If your features and targets are garbage, no amount of model tuning will help you. Keep this in mind when working on projects!</p><h1><strong>Month 3: Optimization</strong></h1><p>Your chef comes up to you and tells you he wants a portfolio with 10% expected yearly return and volatility at most 8%. How do you do that? The answer: Optimization!</p><p>Optimization is an absolutely huge field, including:</p><ul><li><p>Convex Optimization </p></li><li><p>Linear Programming</p></li><li><p>Semidefinite Programming</p></li></ul><p>My favorite introductory book, which I would read myself if I had to start over again, is &#8220;Optimization Methods in Finance - Second Edition&#8221;.</p><p>This will also be your first time dealing with finance specifically (This goes to show how much of quant isn&#8217;t about finance, but about math and science.)</p><p>For a deep dive into Convex Optimization (which you don&#8217;t need at that level!), read &#8220;Convex Optimization&#8221; by Boyd and Vandenberghe.</p><h1><strong>Month 4: Portfolio Optimization and Management</strong></h1><p>You will already learn some portfolio optimization in the book we mentioned in the last section, but what I really like about &#8220;Robust Portfolio Optimization and Management (Frank J. Fabozzi Series)&#8221; is that it tells you about all the practically important techniques you need to know to create <strong>robust </strong>portfolios.</p><p>The truth is that if you just apply the portfolio optimization techniques you&#8217;ve learned about so far blindly to your sample returns and covariance, your portfolio weights will mostly be determined by noise.</p><h1><strong>Month 5: Numerical Methods</strong></h1><p>Most problems can&#8217;t be solved analytically, or it&#8217;s very cumbersome to do so. This is where numerical methods, which are incredibly powerful, come in!</p><h2><strong>Root Finding</strong></h2><p>The goal of root-finding algorithms is to figure out where a function is equal to 0. If you apply this to the derivative of a function, you can find its maxima and minima.</p><p>This is the only playlist you need:</p><p><a href="https://www.youtube.com/playlist?list=PLb0Tx2oJWuYIpNE23qYHGQD42TIR3ThNz">https://www.youtube.com/playlist?list=PLb0Tx2oJWuYIpNE23qYHGQD42TIR3ThNz</a></p><h2><strong>Gradient Descent</strong></h2><p>The goal here is to find minimums / maximums of functions. There are many algorithms that are derived from basic gradient descent, so you should learn about it first:</p><div id="youtube2-fXQXE96r4AY" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;fXQXE96r4AY&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/fXQXE96r4AY?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><h2><strong>Integration</strong></h2><p>Those are used to approximate integrals. Sometimes integrals are difficult or even impossible to solve analytically:</p><div id="youtube2-aY6Y66cc4rE" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;aY6Y66cc4rE&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/aY6Y66cc4rE?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><h2><strong>Differentiation</strong></h2><p>If we can integrate numerically, then we can also differentiate numerically:</p><div id="youtube2-zM2wim4JZd0" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;zM2wim4JZd0&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/zM2wim4JZd0?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><h2><strong>Interpolation and Approximation</strong></h2><p>This is all about curve fitting and smoothing. The theory here can go really deep. This video explains the most important techniques:</p><div id="youtube2-RpxoN9-i7Jc" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;RpxoN9-i7Jc&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/RpxoN9-i7Jc?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><h2><strong>Linear Algebra</strong></h2><p>Whenever you want to solve a linear system (Ax=b), compute eigenvalues and eigenvectors, or perform a matrix factorization, you need numerically stable algorithms. The following playlist covers all of those topics:<br></p><div id="youtube2-8E2858kWVEw" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;8E2858kWVEw&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/8E2858kWVEw?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><p>Those two playlists can be used as a lookup for anything about numerical methods:<br></p><p><a href="https://www.youtube.com/playlist?list=PLDea8VeK4MUTppAXQzHBNz3KiyEd9SQms">https://www.youtube.com/playlist?list=PLDea8VeK4MUTppAXQzHBNz3KiyEd9SQms</a></p><p><a href="https://www.youtube.com/playlist?list=PLkZjai-2Jcxn35XnijUtqqEg0Wi5Sn8ab">https://www.youtube.com/playlist?list=PLkZjai-2Jcxn35XnijUtqqEg0Wi5Sn8ab</a></p><h1><strong>Month 6: Derivatives and Pricing</strong></h1><p>You can&#8217;t talk about derivatives and pricing without mentioning the two most iconic books:</p><ul><li><p>&#8220;Options, Futures, and Other Derivatives&#8221; by John Hull</p></li><li><p>&#8220;Option Volatility and Pricing&#8221; by Natenberg.</p></li></ul><p>The former is about all derivatives, while the latter covers options specifically.</p><p>You shouldn&#8217;t read them front-to-end, though, but look up what you want to become more familiar with.</p><p>QuantStart is a good start (pun not intended) to get familiar with the basics: <br></p><p><a href="https://www.quantstart.com/articles/derivatives-pricing-i-pricing-under-the-black-scholes-model/">https://www.quantstart.com/articles/derivatives-pricing-i-pricing-under-the-black-scholes-model/</a></p><p><a href="https://www.quantstart.com/articles/derivatives-pricing-ii-volatility-is-rough/">https://www.quantstart.com/articles/derivatives-pricing-ii-volatility-is-rough/</a></p><p><a href="https://www.quantstart.com/articles/derivatives-pricing-iii-models-driven-by-levy-processes/">https://www.quantstart.com/articles/derivatives-pricing-iii-models-driven-by-levy-processes/</a></p><h1><strong>Months 7 and 8: Risk Management</strong></h1><p>I&#8217;ve written a huge article on risk management basics:<br></p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;b575688a-0886-49fd-ad82-b6ed5f03c8dd&quot;,&quot;caption&quot;:&quot;This is gonna be by far my biggest article, with the notebook from the risk manager that this was created with containing 1400+ lines of code and tons of visualizations! Actual risk management goes far beyond a stop loss order.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;lg&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;A Full Guide to Risk Management&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:128680675,&quot;name&quot;:&quot;Vertox&quot;,&quot;bio&quot;:&quot;Quantitative Researcher in Digital Asset Markets | Market Making | Statistical Arbitrage | Options &quot;,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!HGUA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bf3fd86-d46a-4caa-969a-d80059b72cb9_128x128.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100},{&quot;id&quot;:104820138,&quot;name&quot;:&quot;malik&quot;,&quot;bio&quot;:&quot;Financial Risk Analyst&quot;,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!edRH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde9e98d1-b3af-4da3-970f-dfd5e016a805_144x144.png&quot;,&quot;is_guest&quot;:true,&quot;bestseller_tier&quot;:null,&quot;primaryPublicationSubscribeUrl&quot;:&quot;https://stopdihode.substack.com/subscribe?&quot;,&quot;primaryPublicationUrl&quot;:&quot;https://stopdihode.substack.com&quot;,&quot;primaryPublicationName&quot;:&quot;malik&quot;,&quot;primaryPublicationId&quot;:6076412}],&quot;post_date&quot;:&quot;2025-06-14T12:57:59.802Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb5bc9fd5-cd71-4e36-9413-4ddd7def6c81_1589x1180.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.vertoxquant.com/p/a-full-guide-to-risk-management&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:165829479,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:60,&quot;comment_count&quot;:0,&quot;publication_id&quot;:1726874,&quot;publication_name&quot;:&quot;VertoxQuant&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!ufaQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>If you care specifically about tail-risk, I recommend you learn about Extreme Value Theory. The following book is a perfect introduction:</p><p>&#8220;An Introduction to Statistical Modeling of Extreme Values&#8221; by Stuart Coles.</p><p>Volatility forecasting is naturally also very important for risk management:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;e24a9770-2021-4ea8-bbcb-5bbce5e0b74b&quot;,&quot;caption&quot;:&quot;Happy New Year, dear reader!&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;lg&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Volatility Forecasting from High-Frequency Quotes&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:128680675,&quot;name&quot;:&quot;Vertox&quot;,&quot;bio&quot;:&quot;Quantitative Researcher in Digital Asset Markets | Market Making | Statistical Arbitrage | Options &quot;,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!HGUA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bf3fd86-d46a-4caa-969a-d80059b72cb9_128x128.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2026-01-04T18:58:32.273Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!CQgt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e78921-9634-46f3-bb20-35c37d1f556e_1012x374.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.vertoxquant.com/p/volatility-forecasting-from-hft&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:183325968,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:3,&quot;comment_count&quot;:0,&quot;publication_id&quot;:1726874,&quot;publication_name&quot;:&quot;VertoxQuant&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!ufaQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>There are many new topics you need to learn here, especially Extreme Value Theory, which is more challenging! Expect to spend some more time on this area. But trust me, it pays off!</p><h1><strong>Conclusion</strong></h1><p>Quant is a huge topic, and you can learn about it for the rest of your life.<br>This article tells you what to learn step by step to start doing real, meaningful research.</p><p>There are, of course, many more topics not covered in this crash course, like market microstructure, time series analysis, data engineering, execution algorithms, and everything high frequency. With the things you learned using the crash course, you are more than ready to dive into those topics yourself, though!</p><p>And again, because it&#8217;s so important: Don&#8217;t just learn by reading resources and watching videos. Apply what you learn to real projects to build REAL understanding and intuition!</p><p>Btw: I have written 77+ articles on everything quant on this site!</p><div class="embedded-publication-wrap" data-attrs="{&quot;id&quot;:1726874,&quot;name&quot;:&quot;VertoxQuant&quot;,&quot;logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!ufaQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png&quot;,&quot;base_url&quot;:&quot;https://www.vertoxquant.com&quot;,&quot;hero_text&quot;:&quot;Quantitative Research&quot;,&quot;author_name&quot;:&quot;Vertox&quot;,&quot;show_subscribe&quot;:true,&quot;logo_bg_color&quot;:&quot;#282828&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="EmbeddedPublicationToDOMWithSubscribe"><div class="embedded-publication show-subscribe"><a class="embedded-publication-link-part" native="true" href="https://www.vertoxquant.com?utm_source=substack&amp;utm_campaign=publication_embed&amp;utm_medium=web"><img class="embedded-publication-logo" src="https://substackcdn.com/image/fetch/$s_!ufaQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png" width="56" height="56" style="background-color: rgb(40, 40, 40);"><span class="embedded-publication-name">VertoxQuant</span><div class="embedded-publication-hero-text">Quantitative Research</div></a><form class="embedded-publication-subscribe" method="GET" action="https://www.vertoxquant.com/subscribe?"><input type="hidden" name="source" value="publication-embed"><input type="hidden" name="autoSubmit" value="true"><input type="email" class="email-input" name="email" placeholder="Type your email..."><input type="submit" class="button primary" value="Subscribe"></form></div></div>]]></content:encoded></item><item><title><![CDATA[Honey, I Shrunk the Sample Betas]]></title><description><![CDATA[Why using raw betas will blow up your portfolio]]></description><link>https://www.vertoxquant.com/p/honey-i-shrunk-the-sample-betas</link><guid isPermaLink="false">https://www.vertoxquant.com/p/honey-i-shrunk-the-sample-betas</guid><dc:creator><![CDATA[Vertox]]></dc:creator><pubDate>Sat, 10 Jan 2026 00:40:07 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/02790364-9c27-4400-90fc-bc3b0d905df6_1312x951.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1><strong>Introduction</strong></h1><p>You build a clean, elegant <strong>beta-neutral portfolio.</strong></p><p>Longs and shorts, carefully balanced, as all things should be.<br>Your regression says market beta is <strong>0.02. </strong>Basically flat.<br>You go to sleep relaxed.</p><p>Then the market sells off <strong>3%.<br></strong>Your &#8220;beta-neutral&#8221; book is down <strong>1.4%.</strong></p><p>You can&#8217;t believe that happened.<br>You start digging:</p><ul><li><p>Did correlations spike?</p></li><li><p>Was it exposure to another factor?</p></li><li><p>Is it all a conspiracy? </p></li></ul><p>No.<br>The problem was already there before the sell-off even happened.<br>Your beta estimates were lying to you!</p><p>SOL doesn&#8217;t actually have a beta of <strong>3.1</strong>; this just screams that it was estimated from noisy data.</p><p>But there&#8217;s a fix. A technique far more powerful than clamping beta estimates. One that <strong>shrinks your betas towards reality</strong> before they blow up your portfolio.</p><h1><strong>Why &#8220;Beta-neutral&#8221; Portfolios Aren&#8217;t Actually Neutral</strong></h1><p>Sample betas are just <strong>estimates. </strong>They&#8217;re noisy, unstable, and prone to exaggeration. The more extreme a beta looks, the more likely it&#8217;s lying.</p><p>The more aggressively you hedge with extreme betas, the more estimation error creeps in, and the less reliable your beta-neutral portfolio becomes.</p><p>Negative betas are especially dangerous. Imagine <strong>Asset A</strong> has a measured beta of <strong>1.5 </strong>while<strong> Asset B </strong>has a measured beta of <strong>-1.5</strong>. You go long both, hoping to be beta-neutral. A few hours pass, and suddenly Asset B&#8217;s beta flips to 1.0, and your portfolio is suddenly long the market.</p><p>One thing many people do is clamp betas, which is not the right approach.<br>If you clamp betas at 2.0, then all your betas beyond that level just clump together at 2.0. There is suddenly no difference between a 2.1 and a 3.9 beta asset. Even within your capped group of assets, some positions are <strong>overweighted, some underweighted.</strong></p><p>Statistically, clamping is crude because it <strong>introduces bias without reducing variance intelligently.</strong></p><h1><strong>The Bias-Variance Tradeoff</strong></h1><p>In statistics and machine learning, every prediction faces a fundamental tradeoff: <strong>Bias vs Variance.</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wfs4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e09a14e-805c-4fc4-bb24-b1a71eb70602_679x610.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wfs4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e09a14e-805c-4fc4-bb24-b1a71eb70602_679x610.png 424w, https://substackcdn.com/image/fetch/$s_!wfs4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e09a14e-805c-4fc4-bb24-b1a71eb70602_679x610.png 848w, https://substackcdn.com/image/fetch/$s_!wfs4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e09a14e-805c-4fc4-bb24-b1a71eb70602_679x610.png 1272w, https://substackcdn.com/image/fetch/$s_!wfs4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e09a14e-805c-4fc4-bb24-b1a71eb70602_679x610.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wfs4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e09a14e-805c-4fc4-bb24-b1a71eb70602_679x610.png" width="679" height="610" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2e09a14e-805c-4fc4-bb24-b1a71eb70602_679x610.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:610,&quot;width&quot;:679,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:138414,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/184082523?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e09a14e-805c-4fc4-bb24-b1a71eb70602_679x610.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!wfs4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e09a14e-805c-4fc4-bb24-b1a71eb70602_679x610.png 424w, https://substackcdn.com/image/fetch/$s_!wfs4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e09a14e-805c-4fc4-bb24-b1a71eb70602_679x610.png 848w, https://substackcdn.com/image/fetch/$s_!wfs4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e09a14e-805c-4fc4-bb24-b1a71eb70602_679x610.png 1272w, https://substackcdn.com/image/fetch/$s_!wfs4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e09a14e-805c-4fc4-bb24-b1a71eb70602_679x610.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>Bias is a <strong>systematic error</strong>: On average, your estimate is off.<br>Variance is the <strong>variability</strong> of your estimates across different samples.</p><p>Our goal now is to introduce some bias in order to reduce variance.<br>But why would we want to be wrong?!<br>Think of it like walking across a tightrope in a windstorm. You could try to react to every gust of wind, but if you misjudge once, you fall.<br>Or you can take a slightly biased, controlled path; You lean a little into the wind, and you make it across safely.</p><p>But instead of walking across a tightrope, you build a beta-neutral portfolio. And instead of falling, you lose the house.</p><h1><strong>Honey, I Shrunk the Betas</strong></h1><p>So how do we stop our &#8220;beta-neutral&#8221; portfolios from blowing up?</p><p>The answer is simple: <strong>shrink your betas.</strong></p><p>Instead of trusting every extreme sample beta, we <strong>pull them toward a sensible center; </strong>usually 1 for market beta, or the average beta across your universe. If you want to be fancy, you could even group your assets by sector and shrink the betas within each sector to the average one.</p><p>Mild betas barely move, while extreme betas get pulled towards the center much more strongly.</p><p>In practice, the simplest form is <strong>linear shrinkage: </strong></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\beta^* = w\\cdot \\hat{\\beta} + (1-w)\\cdot \\beta_{\\text{target}} &quot;,&quot;id&quot;:&quot;QBGSZQTIRY&quot;}" data-component-name="LatexBlockToDOM"></div><p>where </p><ul><li><p>\hat{beta} = raw sample beta</p></li><li><p>beta_target = The center every beta gets pulled towards</p></li><li><p>w = How strong to pull. </p></li></ul><p>w controls your bias-variance tradeoff. A smaller w leads to a lower variance, in exchange for higher bias. The longer the window is that you estimate betas on, the larger you typically want your w to be.</p><p>For those who like to go deeper, there are more advanced ways to shrink betas:</p><ul><li><p><strong>Bayesian shrinkage</strong>: Incorporate prior knowledge about beta distributions.</p></li><li><p><strong>James-Stein</strong>: Learn the target from the cross-sectional distribution of all assets.</p></li></ul><h1><strong>Conclusion</strong></h1><p>Raw beta estimates are noisy. Extreme betas are overconfident.<br>Trying to neutralize the market using raw beta estimates is a disaster waiting to happen.</p><p>Shrinkage is a smarter approach that pulls extreme estimates towards a reasonable center and keeps the portfolio&#8217;s relative structure intact.</p><p>It&#8217;s counterintuitive, but true: <strong>Sometimes being a little wrong on purpose makes you much more right when it matters.</strong></p><p>So next time your regression spits out a 3.1 beta, don&#8217;t panic, don&#8217;t clamp it. Just shrink it.</p><p>If you wish for more practical Quant insights like this one, consider supporting us!<br>What you get:</p><ul><li><p>Access to over <strong>50 premium articles.</strong></p></li><li><p>3 new premium articles per month.</p></li><li><p>Access to all the project code in the premium articles.</p></li><li><p>Access to the premium section of the Discord server.</p></li></ul><p>Here you can have a taste of the premium articles:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;6a4bf26f-8075-4118-b750-0d1e814bbe3b&quot;,&quot;caption&quot;:&quot;Happy New Year, dear reader!&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;md&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Volatility Forecasting from High-Frequency Quotes&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:128680675,&quot;name&quot;:&quot;Vertox&quot;,&quot;bio&quot;:&quot;Quantitative Researcher in Digital Asset Markets | Market Making | Statistical Arbitrage | Options &quot;,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!HGUA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bf3fd86-d46a-4caa-969a-d80059b72cb9_128x128.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2026-01-04T18:58:32.273Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!CQgt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e78921-9634-46f3-bb20-35c37d1f556e_1012x374.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.vertoxquant.com/p/volatility-forecasting-from-hft&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:183325968,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:2,&quot;comment_count&quot;:0,&quot;publication_id&quot;:1726874,&quot;publication_name&quot;:&quot;VertoxQuant&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!ufaQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.vertoxquant.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">VertoxQuant is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</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></p>]]></content:encoded></item><item><title><![CDATA[Volatility Forecasting from High-Frequency Quotes]]></title><description><![CDATA[and the pitfalls to look out for.]]></description><link>https://www.vertoxquant.com/p/volatility-forecasting-from-hft</link><guid isPermaLink="false">https://www.vertoxquant.com/p/volatility-forecasting-from-hft</guid><dc:creator><![CDATA[Vertox]]></dc:creator><pubDate>Sun, 04 Jan 2026 18:58:32 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!CQgt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e78921-9634-46f3-bb20-35c37d1f556e_1012x374.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Happy New Year, dear reader! </p><p>Getting access to high-frequency data in crypto is easier than in any other market. Even if you don&#8217;t want to spend a couple of hundred or thousand dollars on historical data, you can set up data collection yourself pretty cost-efficiently and reliably.</p><p>We show how to use this high-frequency data to get better forecasts of volatility, compare different volatility forecasting models, and show how to properly diagnose a volatility forecasting model.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yGP3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f37b0dd-5553-4372-9b7b-4097cfbef468_694x390.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yGP3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f37b0dd-5553-4372-9b7b-4097cfbef468_694x390.png 424w, https://substackcdn.com/image/fetch/$s_!yGP3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f37b0dd-5553-4372-9b7b-4097cfbef468_694x390.png 848w, https://substackcdn.com/image/fetch/$s_!yGP3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f37b0dd-5553-4372-9b7b-4097cfbef468_694x390.png 1272w, https://substackcdn.com/image/fetch/$s_!yGP3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f37b0dd-5553-4372-9b7b-4097cfbef468_694x390.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yGP3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f37b0dd-5553-4372-9b7b-4097cfbef468_694x390.png" width="694" height="390" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0f37b0dd-5553-4372-9b7b-4097cfbef468_694x390.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:390,&quot;width&quot;:694,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:42046,&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.vertoxquant.com/i/183325968?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f37b0dd-5553-4372-9b7b-4097cfbef468_694x390.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!yGP3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f37b0dd-5553-4372-9b7b-4097cfbef468_694x390.png 424w, https://substackcdn.com/image/fetch/$s_!yGP3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f37b0dd-5553-4372-9b7b-4097cfbef468_694x390.png 848w, https://substackcdn.com/image/fetch/$s_!yGP3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f37b0dd-5553-4372-9b7b-4097cfbef468_694x390.png 1272w, https://substackcdn.com/image/fetch/$s_!yGP3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f37b0dd-5553-4372-9b7b-4097cfbef468_694x390.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><div><hr></div><h2>Table of Contents</h2><ol><li><p><strong>Realised Variance from High-Frequency Returns</strong> &#8212; <em>Our Forecast Target</em></p></li><li><p><strong>Range-based Variance Estimators</strong> &#8212; <em>Sometimes, Less is More</em></p></li><li><p><strong>Sampling Frequency</strong> &#8212; <em>The Problem with High Frequency Data</em></p></li><li><p><strong>Rolling Averages and EWMA</strong> &#8212; <em>Baseline Variance Forecasts</em></p></li><li><p><strong>Tuning EWMA via QLIKE</strong> &#8212; <em>A Proper Scoring Rule for Variance</em></p></li><li><p><strong>GARCH Family</strong> &#8212; <em>Conditional Heteroskedasticity Models</em></p></li><li><p><strong>Stochastic Volatility and Kalman Filters</strong> &#8212; <em>How to Actually Use a Kalman Filter</em></p></li><li><p><strong>Volatility Forecast Diagnostics</strong> &#8212; <em>What Model is The Best?</em></p></li><li><p><strong>Final Remarks</strong> &#8212; <em>Conclusion, Code, and Discord</em></p></li></ol>
      <p>
          <a href="https://www.vertoxquant.com/p/volatility-forecasting-from-hft">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Kelly Criterion in Practice]]></title><description><![CDATA[How it works and how a real desk would use it]]></description><link>https://www.vertoxquant.com/p/kelly-criterion-in-practice</link><guid isPermaLink="false">https://www.vertoxquant.com/p/kelly-criterion-in-practice</guid><dc:creator><![CDATA[Vertox]]></dc:creator><pubDate>Fri, 19 Dec 2025 04:22:29 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!L0Sy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84afce82-ffa0-4952-b5eb-44ef40c07394_622x397.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you&#8217;ve been lurking in quant forums for a while, I bet you&#8217;ve come across a conversation like this before:</p><p>A: &#8220;Kelly is too dangerous, use half-kelly instead!&#8221;<br>B: &#8220;No use 0.75x Kelly, 0.5x is too low!&#8221;<br>C: &#8220;Actually, you should use this formula for continuous Kelly!&#8221;</p><p>In this article, we will delve into the actual math of Kelly, rather than relying on word-of-mouth.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ug8L!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8c9e655-7c52-4ddd-a91d-fd818f4e8ebc_486x658.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ug8L!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8c9e655-7c52-4ddd-a91d-fd818f4e8ebc_486x658.png 424w, https://substackcdn.com/image/fetch/$s_!ug8L!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8c9e655-7c52-4ddd-a91d-fd818f4e8ebc_486x658.png 848w, https://substackcdn.com/image/fetch/$s_!ug8L!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8c9e655-7c52-4ddd-a91d-fd818f4e8ebc_486x658.png 1272w, https://substackcdn.com/image/fetch/$s_!ug8L!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8c9e655-7c52-4ddd-a91d-fd818f4e8ebc_486x658.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ug8L!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8c9e655-7c52-4ddd-a91d-fd818f4e8ebc_486x658.png" width="486" height="658" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d8c9e655-7c52-4ddd-a91d-fd818f4e8ebc_486x658.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:658,&quot;width&quot;:486,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:546690,&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.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8c9e655-7c52-4ddd-a91d-fd818f4e8ebc_486x658.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ug8L!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8c9e655-7c52-4ddd-a91d-fd818f4e8ebc_486x658.png 424w, https://substackcdn.com/image/fetch/$s_!ug8L!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8c9e655-7c52-4ddd-a91d-fd818f4e8ebc_486x658.png 848w, https://substackcdn.com/image/fetch/$s_!ug8L!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8c9e655-7c52-4ddd-a91d-fd818f4e8ebc_486x658.png 1272w, https://substackcdn.com/image/fetch/$s_!ug8L!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8c9e655-7c52-4ddd-a91d-fd818f4e8ebc_486x658.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>Thanks to the amazing support of our premium readers, we are able to release an article for free from time to time. <br>If you wish to unlock over <strong>50 premium articles</strong> like this one, as well as <strong>3 articles per month</strong>, consider supporting us as well!</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.vertoxquant.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">VertoxQuant is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</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><hr></div><h2>Table of Contents</h2><ol><li><p><strong>The Kelly Objective</strong> &#8212; <em>What Are We Even Optimising?</em></p></li><li><p><strong>Classic Kelly</strong> &#8212; <em>Model and Closed-Form Solution</em></p></li><li><p><strong>Fractional Kelly</strong> &#8212; <em>What&#8217;s the point?</em></p></li><li><p><strong>A Bounded-Below Model</strong> &#8212; <em>The Impact of Tail Risk</em></p></li><li><p><strong>A Quadratic Approximation</strong> &#8212; <em>The Dangerous Formula You Find Online</em></p></li><li><p><strong>Continuous-Time Kelly (GBM) &#8212; </strong><em>Moving On From Discrete Models</em></p></li><li><p><strong>Multi-Asset Continuous-Time Kelly &#8212; </strong><em>When We Trade Multiple Assets</em></p></li><li><p><strong>Estimation Error: Bayesian Approach &#8212; </strong><em>Updating Your Beliefs of Odds</em></p></li><li><p><strong>Dynamic Sizing &#8212;</strong><em> Don&#8217;t Use Constant Kelly!</em></p></li><li><p><strong>Final Remarks &#8212; </strong><em>Final Remarks and Discord</em></p></li></ol><div><hr></div><h2><strong>The Kelly Objective</strong> &#8212; <em>What Are We Even Optimising?</em></h2><p>We start with some notation.<br>Let:</p><ul><li><p>r = per-period risk-free simple return</p></li><li><p>X_{t+1} = per-period <strong>excess </strong>simple return of the risky asset</p></li><li><p>f = dollar exposure to the risky asset, as a fraction of current wealth (f=1 means fully invested; f&gt;1 means levered; f&lt;0 means short)</p></li></ul><p>Then discrete-time wealth evolves as:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;W_{t+1} = W_t(1 + r + fX_{t+1})&quot;,&quot;id&quot;:&quot;EHBNGMUSYK&quot;}" data-component-name="LatexBlockToDOM"></div><p>The <strong>Kelly objective</strong> that we want to maximize is the per-period expected log growth:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;g(f) = \\mathbb{E}[\\log(1+r+fX)]&quot;,&quot;id&quot;:&quot;LQJJVFVPGS&quot;}" data-component-name="LatexBlockToDOM"></div><p>Working with the log of wealth has a couple of nice properties:</p><ul><li><p>log(0) = -inf, going bankrupt is <strong>unacceptable.</strong></p></li><li><p>Maximizing E[log(1+R)] maximizes the <strong>long-run growth rate</strong> of wealth.</p></li><li><p>Log utility represents risk aversion: Going from $1000 &#8594; $2000 is much nicer than going from $10.000 &#8594; $11.000.</p></li></ul><p>g(f) is an expected value, and we know that log(0) is -inf, so for g(f) to be finite we have the necessary condition:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\mathbb{P}(1+r+fX \\leq 0) = 0&quot;,&quot;id&quot;:&quot;EMCHYMKEJS&quot;}" data-component-name="LatexBlockToDOM"></div><p>This also explains why you can&#8217;t use an unbound normal distribution to model your returns, since even if the probability of getting a return that wipes out your portfolio is astronomically small, the expected value (g(f)) will be -inf.</p><div><hr></div><h2><strong>Classic Kelly</strong> &#8212; <em>Model and Closed-Form Solution</em></h2><p>Let&#8217;s start with a super simple binary model:</p><ul><li><p>Win probability: p</p></li><li><p>Lose probability: q = 1-p</p></li><li><p>Odds: risk 1, win b</p></li></ul><p>By betting a fraction f of wealth, our new wealth will be multiplied by:</p><ul><li><p>Win: 1 + bf</p></li><li><p>Lose: 1 - f</p></li></ul><p>The Kelly objective g(f) will now look as follows:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\begin{align}\ng(f) &amp;= \\mathbb{E}[\\log(1+fX)] \\\\\n     &amp;= p \\log(1+fb) + q\\log(1-f)\n\\end{align}&quot;,&quot;id&quot;:&quot;EQWEQSPBHB&quot;}" data-component-name="LatexBlockToDOM"></div><p>We can find a closed-form solution for f that maximizes g by taking the derivative and setting it to 0:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\begin{multline}\n\\frac{dg}{df} = \\frac{bp}{bf+1} - \\frac{q}{1-f} \\\\\n\\frac{dg}{df} = 0 \\iff f = \\frac{pb-q}{b}\n\\end{multline}&quot;,&quot;id&quot;:&quot;TVBVJJSGKM&quot;}" data-component-name="LatexBlockToDOM"></div><p>This gives us the traditional formula for the Kelly fraction:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;f^* = \\frac{pb-q}{b}&quot;,&quot;id&quot;:&quot;OXTNCQDYTI&quot;}" data-component-name="LatexBlockToDOM"></div><p>Let&#8217;s code this up!</p><p>First, some imports and configs that we will use in this project:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!YXZb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b94f431-d61a-4615-a0f3-bd5ef0009aec_838x490.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YXZb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b94f431-d61a-4615-a0f3-bd5ef0009aec_838x490.png 424w, https://substackcdn.com/image/fetch/$s_!YXZb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b94f431-d61a-4615-a0f3-bd5ef0009aec_838x490.png 848w, https://substackcdn.com/image/fetch/$s_!YXZb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b94f431-d61a-4615-a0f3-bd5ef0009aec_838x490.png 1272w, https://substackcdn.com/image/fetch/$s_!YXZb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b94f431-d61a-4615-a0f3-bd5ef0009aec_838x490.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YXZb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b94f431-d61a-4615-a0f3-bd5ef0009aec_838x490.png" width="838" height="490" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3b94f431-d61a-4615-a0f3-bd5ef0009aec_838x490.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:490,&quot;width&quot;:838,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:90634,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b94f431-d61a-4615-a0f3-bd5ef0009aec_838x490.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!YXZb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b94f431-d61a-4615-a0f3-bd5ef0009aec_838x490.png 424w, https://substackcdn.com/image/fetch/$s_!YXZb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b94f431-d61a-4615-a0f3-bd5ef0009aec_838x490.png 848w, https://substackcdn.com/image/fetch/$s_!YXZb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b94f431-d61a-4615-a0f3-bd5ef0009aec_838x490.png 1272w, https://substackcdn.com/image/fetch/$s_!YXZb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b94f431-d61a-4615-a0f3-bd5ef0009aec_838x490.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>Now the code to compute the Kelly fraction and the expected log growth:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jHhb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c341d4f-52f0-49fc-a194-bcb9f4ba5172_1024x490.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jHhb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c341d4f-52f0-49fc-a194-bcb9f4ba5172_1024x490.png 424w, https://substackcdn.com/image/fetch/$s_!jHhb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c341d4f-52f0-49fc-a194-bcb9f4ba5172_1024x490.png 848w, https://substackcdn.com/image/fetch/$s_!jHhb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c341d4f-52f0-49fc-a194-bcb9f4ba5172_1024x490.png 1272w, https://substackcdn.com/image/fetch/$s_!jHhb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c341d4f-52f0-49fc-a194-bcb9f4ba5172_1024x490.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jHhb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c341d4f-52f0-49fc-a194-bcb9f4ba5172_1024x490.png" width="1024" height="490" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9c341d4f-52f0-49fc-a194-bcb9f4ba5172_1024x490.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:490,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:77990,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c341d4f-52f0-49fc-a194-bcb9f4ba5172_1024x490.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!jHhb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c341d4f-52f0-49fc-a194-bcb9f4ba5172_1024x490.png 424w, https://substackcdn.com/image/fetch/$s_!jHhb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c341d4f-52f0-49fc-a194-bcb9f4ba5172_1024x490.png 848w, https://substackcdn.com/image/fetch/$s_!jHhb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c341d4f-52f0-49fc-a194-bcb9f4ba5172_1024x490.png 1272w, https://substackcdn.com/image/fetch/$s_!jHhb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c341d4f-52f0-49fc-a194-bcb9f4ba5172_1024x490.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>With p = 0.55 and b = 1.0, we obtain a Kelly fraction of 0.1, meaning we should bet 10% of our entire wealth on this every time.</p><p>We can verify that this is correct using a plot:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Gs5d!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00a74678-86ac-43c3-a40c-b11c26ea4f9f_1210x676.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Gs5d!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00a74678-86ac-43c3-a40c-b11c26ea4f9f_1210x676.png 424w, https://substackcdn.com/image/fetch/$s_!Gs5d!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00a74678-86ac-43c3-a40c-b11c26ea4f9f_1210x676.png 848w, https://substackcdn.com/image/fetch/$s_!Gs5d!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00a74678-86ac-43c3-a40c-b11c26ea4f9f_1210x676.png 1272w, https://substackcdn.com/image/fetch/$s_!Gs5d!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00a74678-86ac-43c3-a40c-b11c26ea4f9f_1210x676.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Gs5d!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00a74678-86ac-43c3-a40c-b11c26ea4f9f_1210x676.png" width="1210" height="676" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/00a74678-86ac-43c3-a40c-b11c26ea4f9f_1210x676.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:676,&quot;width&quot;:1210,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:162199,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00a74678-86ac-43c3-a40c-b11c26ea4f9f_1210x676.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Gs5d!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00a74678-86ac-43c3-a40c-b11c26ea4f9f_1210x676.png 424w, https://substackcdn.com/image/fetch/$s_!Gs5d!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00a74678-86ac-43c3-a40c-b11c26ea4f9f_1210x676.png 848w, https://substackcdn.com/image/fetch/$s_!Gs5d!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00a74678-86ac-43c3-a40c-b11c26ea4f9f_1210x676.png 1272w, https://substackcdn.com/image/fetch/$s_!Gs5d!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00a74678-86ac-43c3-a40c-b11c26ea4f9f_1210x676.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_!Yv3A!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7416bd05-0408-4501-ac9a-bdb5356dd759_625x393.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Yv3A!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7416bd05-0408-4501-ac9a-bdb5356dd759_625x393.png 424w, https://substackcdn.com/image/fetch/$s_!Yv3A!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7416bd05-0408-4501-ac9a-bdb5356dd759_625x393.png 848w, https://substackcdn.com/image/fetch/$s_!Yv3A!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7416bd05-0408-4501-ac9a-bdb5356dd759_625x393.png 1272w, https://substackcdn.com/image/fetch/$s_!Yv3A!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7416bd05-0408-4501-ac9a-bdb5356dd759_625x393.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Yv3A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7416bd05-0408-4501-ac9a-bdb5356dd759_625x393.png" width="625" height="393" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7416bd05-0408-4501-ac9a-bdb5356dd759_625x393.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:393,&quot;width&quot;:625,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:35538,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7416bd05-0408-4501-ac9a-bdb5356dd759_625x393.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Yv3A!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7416bd05-0408-4501-ac9a-bdb5356dd759_625x393.png 424w, https://substackcdn.com/image/fetch/$s_!Yv3A!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7416bd05-0408-4501-ac9a-bdb5356dd759_625x393.png 848w, https://substackcdn.com/image/fetch/$s_!Yv3A!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7416bd05-0408-4501-ac9a-bdb5356dd759_625x393.png 1272w, https://substackcdn.com/image/fetch/$s_!Yv3A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7416bd05-0408-4501-ac9a-bdb5356dd759_625x393.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><hr></div><h2><strong>Fractional Kelly</strong> &#8212; <em>What&#8217;s the point?</em></h2><p>There is one biiiig problem with the Kelly fraction: it just barely avoids ruin.<br>At the Kelly fraction f, our probability of ruin is 0 almost surely. Any increase in f above Kelly gives a positive probability of eventual ruin.</p><p>If you overestimated your probability of winning, then even Kelly will give you a leverage that gives you a non-zero probability of eventually going to 0.</p><p>So the intuitive idea of just using a fraction of Kelly is actually pretty sound, although the execution isn&#8217;t the best (we will get to this later).</p><p>Let&#8217;s compare what happens at Half Kelly, Full Kelly, and Double Kelly.<br>The following function will simulate the binary game with probability of winning p, a payout b, and leverage f:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!XNSe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5855783b-e313-4633-ad87-0c5f9e7c3549_1750x714.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!XNSe!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5855783b-e313-4633-ad87-0c5f9e7c3549_1750x714.png 424w, https://substackcdn.com/image/fetch/$s_!XNSe!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5855783b-e313-4633-ad87-0c5f9e7c3549_1750x714.png 848w, https://substackcdn.com/image/fetch/$s_!XNSe!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5855783b-e313-4633-ad87-0c5f9e7c3549_1750x714.png 1272w, https://substackcdn.com/image/fetch/$s_!XNSe!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5855783b-e313-4633-ad87-0c5f9e7c3549_1750x714.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!XNSe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5855783b-e313-4633-ad87-0c5f9e7c3549_1750x714.png" width="1456" height="594" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5855783b-e313-4633-ad87-0c5f9e7c3549_1750x714.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:594,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:159998,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5855783b-e313-4633-ad87-0c5f9e7c3549_1750x714.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!XNSe!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5855783b-e313-4633-ad87-0c5f9e7c3549_1750x714.png 424w, https://substackcdn.com/image/fetch/$s_!XNSe!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5855783b-e313-4633-ad87-0c5f9e7c3549_1750x714.png 848w, https://substackcdn.com/image/fetch/$s_!XNSe!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5855783b-e313-4633-ad87-0c5f9e7c3549_1750x714.png 1272w, https://substackcdn.com/image/fetch/$s_!XNSe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5855783b-e313-4633-ad87-0c5f9e7c3549_1750x714.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 better compare the 3, I will use the same random numbers in all 3 simulations:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PFmE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F914b1d74-bde7-4cc0-8680-0464d3812ec2_1428x1272.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PFmE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F914b1d74-bde7-4cc0-8680-0464d3812ec2_1428x1272.png 424w, https://substackcdn.com/image/fetch/$s_!PFmE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F914b1d74-bde7-4cc0-8680-0464d3812ec2_1428x1272.png 848w, https://substackcdn.com/image/fetch/$s_!PFmE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F914b1d74-bde7-4cc0-8680-0464d3812ec2_1428x1272.png 1272w, https://substackcdn.com/image/fetch/$s_!PFmE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F914b1d74-bde7-4cc0-8680-0464d3812ec2_1428x1272.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PFmE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F914b1d74-bde7-4cc0-8680-0464d3812ec2_1428x1272.png" width="1428" height="1272" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/914b1d74-bde7-4cc0-8680-0464d3812ec2_1428x1272.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1272,&quot;width&quot;:1428,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:315362,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F914b1d74-bde7-4cc0-8680-0464d3812ec2_1428x1272.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!PFmE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F914b1d74-bde7-4cc0-8680-0464d3812ec2_1428x1272.png 424w, https://substackcdn.com/image/fetch/$s_!PFmE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F914b1d74-bde7-4cc0-8680-0464d3812ec2_1428x1272.png 848w, https://substackcdn.com/image/fetch/$s_!PFmE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F914b1d74-bde7-4cc0-8680-0464d3812ec2_1428x1272.png 1272w, https://substackcdn.com/image/fetch/$s_!PFmE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F914b1d74-bde7-4cc0-8680-0464d3812ec2_1428x1272.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_!oyCt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99381131-7d4f-421f-b31c-4e7457c6ab4b_661x397.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oyCt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99381131-7d4f-421f-b31c-4e7457c6ab4b_661x397.png 424w, https://substackcdn.com/image/fetch/$s_!oyCt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99381131-7d4f-421f-b31c-4e7457c6ab4b_661x397.png 848w, https://substackcdn.com/image/fetch/$s_!oyCt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99381131-7d4f-421f-b31c-4e7457c6ab4b_661x397.png 1272w, https://substackcdn.com/image/fetch/$s_!oyCt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99381131-7d4f-421f-b31c-4e7457c6ab4b_661x397.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oyCt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99381131-7d4f-421f-b31c-4e7457c6ab4b_661x397.png" width="661" height="397" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/99381131-7d4f-421f-b31c-4e7457c6ab4b_661x397.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:397,&quot;width&quot;:661,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:32525,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99381131-7d4f-421f-b31c-4e7457c6ab4b_661x397.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!oyCt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99381131-7d4f-421f-b31c-4e7457c6ab4b_661x397.png 424w, https://substackcdn.com/image/fetch/$s_!oyCt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99381131-7d4f-421f-b31c-4e7457c6ab4b_661x397.png 848w, https://substackcdn.com/image/fetch/$s_!oyCt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99381131-7d4f-421f-b31c-4e7457c6ab4b_661x397.png 1272w, https://substackcdn.com/image/fetch/$s_!oyCt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99381131-7d4f-421f-b31c-4e7457c6ab4b_661x397.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><hr></div><h2><strong>A Bounded-Below Model</strong> &#8212; <em>The Impact of Tail Risk</em></h2><p>We usually only have samples of excess return x_i available.<br>We can then approximate the Kelly objective g via:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;g(f) \\approx \\frac{1}{n} \\sum_{i=1}^n \\log(1 + r + fx_i)&quot;,&quot;id&quot;:&quot;XTCVWDGGRQ&quot;}" data-component-name="LatexBlockToDOM"></div><p>where n is the number of samples available. </p><p>We maximize over a feasible interval where 1+r+fx_i &gt; 0 for all samples.<br>To compute g from samples and to compute the feasible interval, we can use the following functions:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gpMI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdfca10f-858e-4fc7-ae84-931d809aef8a_1834x1832.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gpMI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdfca10f-858e-4fc7-ae84-931d809aef8a_1834x1832.png 424w, https://substackcdn.com/image/fetch/$s_!gpMI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdfca10f-858e-4fc7-ae84-931d809aef8a_1834x1832.png 848w, https://substackcdn.com/image/fetch/$s_!gpMI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdfca10f-858e-4fc7-ae84-931d809aef8a_1834x1832.png 1272w, https://substackcdn.com/image/fetch/$s_!gpMI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdfca10f-858e-4fc7-ae84-931d809aef8a_1834x1832.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gpMI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdfca10f-858e-4fc7-ae84-931d809aef8a_1834x1832.png" width="1456" height="1454" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cdfca10f-858e-4fc7-ae84-931d809aef8a_1834x1832.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1454,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:367556,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdfca10f-858e-4fc7-ae84-931d809aef8a_1834x1832.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!gpMI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdfca10f-858e-4fc7-ae84-931d809aef8a_1834x1832.png 424w, https://substackcdn.com/image/fetch/$s_!gpMI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdfca10f-858e-4fc7-ae84-931d809aef8a_1834x1832.png 848w, https://substackcdn.com/image/fetch/$s_!gpMI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdfca10f-858e-4fc7-ae84-931d809aef8a_1834x1832.png 1272w, https://substackcdn.com/image/fetch/$s_!gpMI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdfca10f-858e-4fc7-ae84-931d809aef8a_1834x1832.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 illustrate how much of an impact tail risk has on Kelly, consider the following scenario:</p><ul><li><p>With probability p_good: Sample normal returns, clipped at a crash floor.</p></li><li><p>With probability 1-p_good: Sample a fixed crash x_crash (a point mass at the floor)</p></li></ul><p>We can sample those returns with the following function:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5ulw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3187089-61cc-4e6b-a234-6373ee7624e0_1716x566.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5ulw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3187089-61cc-4e6b-a234-6373ee7624e0_1716x566.png 424w, https://substackcdn.com/image/fetch/$s_!5ulw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3187089-61cc-4e6b-a234-6373ee7624e0_1716x566.png 848w, https://substackcdn.com/image/fetch/$s_!5ulw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3187089-61cc-4e6b-a234-6373ee7624e0_1716x566.png 1272w, https://substackcdn.com/image/fetch/$s_!5ulw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3187089-61cc-4e6b-a234-6373ee7624e0_1716x566.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5ulw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3187089-61cc-4e6b-a234-6373ee7624e0_1716x566.png" width="1456" height="480" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c3187089-61cc-4e6b-a234-6373ee7624e0_1716x566.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:480,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:148353,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3187089-61cc-4e6b-a234-6373ee7624e0_1716x566.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!5ulw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3187089-61cc-4e6b-a234-6373ee7624e0_1716x566.png 424w, https://substackcdn.com/image/fetch/$s_!5ulw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3187089-61cc-4e6b-a234-6373ee7624e0_1716x566.png 848w, https://substackcdn.com/image/fetch/$s_!5ulw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3187089-61cc-4e6b-a234-6373ee7624e0_1716x566.png 1272w, https://substackcdn.com/image/fetch/$s_!5ulw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3187089-61cc-4e6b-a234-6373ee7624e0_1716x566.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>We can maximise the log growth rate (Kelly objective) on our feasible interval using golden section search:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!V_bv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F969f5975-25b2-49c8-8209-a9d8558dac5c_1850x2092.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!V_bv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F969f5975-25b2-49c8-8209-a9d8558dac5c_1850x2092.png 424w, https://substackcdn.com/image/fetch/$s_!V_bv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F969f5975-25b2-49c8-8209-a9d8558dac5c_1850x2092.png 848w, https://substackcdn.com/image/fetch/$s_!V_bv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F969f5975-25b2-49c8-8209-a9d8558dac5c_1850x2092.png 1272w, https://substackcdn.com/image/fetch/$s_!V_bv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F969f5975-25b2-49c8-8209-a9d8558dac5c_1850x2092.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!V_bv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F969f5975-25b2-49c8-8209-a9d8558dac5c_1850x2092.png" width="1456" height="1646" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/969f5975-25b2-49c8-8209-a9d8558dac5c_1850x2092.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1646,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:415121,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F969f5975-25b2-49c8-8209-a9d8558dac5c_1850x2092.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!V_bv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F969f5975-25b2-49c8-8209-a9d8558dac5c_1850x2092.png 424w, https://substackcdn.com/image/fetch/$s_!V_bv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F969f5975-25b2-49c8-8209-a9d8558dac5c_1850x2092.png 848w, https://substackcdn.com/image/fetch/$s_!V_bv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F969f5975-25b2-49c8-8209-a9d8558dac5c_1850x2092.png 1272w, https://substackcdn.com/image/fetch/$s_!V_bv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F969f5975-25b2-49c8-8209-a9d8558dac5c_1850x2092.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>I talked about the golden section search in more detail in the following article:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;32379ab6-b9c4-490e-8849-4eb2178b2711&quot;,&quot;caption&quot;:&quot;The Statistical Arbitrage Series is a collaboration between Vertox and BowTiedDevil to present stat arb strategies and their application in a blockchain environment.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;md&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Statistical Arbitrage on Uniswap v3 (Full Strategy)&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:128680675,&quot;name&quot;:&quot;Vertox&quot;,&quot;bio&quot;:&quot;Quantitative Researcher in Digital Asset Markets | Market Making | Statistical Arbitrage | Options &quot;,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!HGUA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bf3fd86-d46a-4caa-969a-d80059b72cb9_128x128.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100},{&quot;id&quot;:33970100,&quot;name&quot;:&quot;BowTiedDevil&quot;,&quot;bio&quot;:&quot;Self-taught coder, engineer, blockchain enthusiast, technical writer. &quot;,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/55abe25f-1bc7-46e5-94d4-7d109d5d3a3d_1620x1620.png&quot;,&quot;is_guest&quot;:true,&quot;bestseller_tier&quot;:100,&quot;primaryPublicationSubscribeUrl&quot;:&quot;https://www.degencode.com/subscribe?&quot;,&quot;primaryPublicationUrl&quot;:&quot;https://www.degencode.com&quot;,&quot;primaryPublicationName&quot;:&quot;Degen Code&quot;,&quot;primaryPublicationId&quot;:607913}],&quot;post_date&quot;:&quot;2025-08-20T22:19:14.806Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!cBtW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66eba3a5-16ae-41f2-bda7-841d21dfdbb8_637x578.webp&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.vertoxquant.com/p/statistical-arbitrage-on-uniswap&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:171482598,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:34,&quot;comment_count&quot;:1,&quot;publication_id&quot;:1726874,&quot;publication_name&quot;:&quot;VertoxQuant&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!ufaQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>We will further use the following two functions to summarize information about log wealth:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!V879!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59bf31e7-0996-4eb9-82c3-fa3252d67a78_1648x1720.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!V879!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59bf31e7-0996-4eb9-82c3-fa3252d67a78_1648x1720.png 424w, https://substackcdn.com/image/fetch/$s_!V879!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59bf31e7-0996-4eb9-82c3-fa3252d67a78_1648x1720.png 848w, https://substackcdn.com/image/fetch/$s_!V879!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59bf31e7-0996-4eb9-82c3-fa3252d67a78_1648x1720.png 1272w, https://substackcdn.com/image/fetch/$s_!V879!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59bf31e7-0996-4eb9-82c3-fa3252d67a78_1648x1720.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!V879!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59bf31e7-0996-4eb9-82c3-fa3252d67a78_1648x1720.png" width="1456" height="1520" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/59bf31e7-0996-4eb9-82c3-fa3252d67a78_1648x1720.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1520,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:418845,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59bf31e7-0996-4eb9-82c3-fa3252d67a78_1648x1720.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!V879!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59bf31e7-0996-4eb9-82c3-fa3252d67a78_1648x1720.png 424w, https://substackcdn.com/image/fetch/$s_!V879!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59bf31e7-0996-4eb9-82c3-fa3252d67a78_1648x1720.png 848w, https://substackcdn.com/image/fetch/$s_!V879!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59bf31e7-0996-4eb9-82c3-fa3252d67a78_1648x1720.png 1272w, https://substackcdn.com/image/fetch/$s_!V879!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59bf31e7-0996-4eb9-82c3-fa3252d67a78_1648x1720.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>Let&#8217;s sample from our bounded fat-tailed distribution now and find the optimal fraction to bet:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JSaD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc968c6a-8351-496e-b43c-15a319ec8b7c_1310x378.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JSaD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc968c6a-8351-496e-b43c-15a319ec8b7c_1310x378.png 424w, https://substackcdn.com/image/fetch/$s_!JSaD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc968c6a-8351-496e-b43c-15a319ec8b7c_1310x378.png 848w, https://substackcdn.com/image/fetch/$s_!JSaD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc968c6a-8351-496e-b43c-15a319ec8b7c_1310x378.png 1272w, https://substackcdn.com/image/fetch/$s_!JSaD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc968c6a-8351-496e-b43c-15a319ec8b7c_1310x378.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JSaD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc968c6a-8351-496e-b43c-15a319ec8b7c_1310x378.png" width="1310" height="378" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cc968c6a-8351-496e-b43c-15a319ec8b7c_1310x378.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:378,&quot;width&quot;:1310,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:80165,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc968c6a-8351-496e-b43c-15a319ec8b7c_1310x378.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!JSaD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc968c6a-8351-496e-b43c-15a319ec8b7c_1310x378.png 424w, https://substackcdn.com/image/fetch/$s_!JSaD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc968c6a-8351-496e-b43c-15a319ec8b7c_1310x378.png 848w, https://substackcdn.com/image/fetch/$s_!JSaD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc968c6a-8351-496e-b43c-15a319ec8b7c_1310x378.png 1272w, https://substackcdn.com/image/fetch/$s_!JSaD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc968c6a-8351-496e-b43c-15a319ec8b7c_1310x378.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_!TCeQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd119916e-efb9-45a7-9272-5c1f34f23968_396x104.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!TCeQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd119916e-efb9-45a7-9272-5c1f34f23968_396x104.png 424w, https://substackcdn.com/image/fetch/$s_!TCeQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd119916e-efb9-45a7-9272-5c1f34f23968_396x104.png 848w, https://substackcdn.com/image/fetch/$s_!TCeQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd119916e-efb9-45a7-9272-5c1f34f23968_396x104.png 1272w, https://substackcdn.com/image/fetch/$s_!TCeQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd119916e-efb9-45a7-9272-5c1f34f23968_396x104.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!TCeQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd119916e-efb9-45a7-9272-5c1f34f23968_396x104.png" width="396" height="104" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d119916e-efb9-45a7-9272-5c1f34f23968_396x104.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:104,&quot;width&quot;:396,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:7606,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd119916e-efb9-45a7-9272-5c1f34f23968_396x104.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!TCeQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd119916e-efb9-45a7-9272-5c1f34f23968_396x104.png 424w, https://substackcdn.com/image/fetch/$s_!TCeQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd119916e-efb9-45a7-9272-5c1f34f23968_396x104.png 848w, https://substackcdn.com/image/fetch/$s_!TCeQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd119916e-efb9-45a7-9272-5c1f34f23968_396x104.png 1272w, https://substackcdn.com/image/fetch/$s_!TCeQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd119916e-efb9-45a7-9272-5c1f34f23968_396x104.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_!aGwG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ffbf070-ac13-4f5e-8e0f-f689961e6592_1598x714.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aGwG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ffbf070-ac13-4f5e-8e0f-f689961e6592_1598x714.png 424w, https://substackcdn.com/image/fetch/$s_!aGwG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ffbf070-ac13-4f5e-8e0f-f689961e6592_1598x714.png 848w, https://substackcdn.com/image/fetch/$s_!aGwG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ffbf070-ac13-4f5e-8e0f-f689961e6592_1598x714.png 1272w, https://substackcdn.com/image/fetch/$s_!aGwG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ffbf070-ac13-4f5e-8e0f-f689961e6592_1598x714.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aGwG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ffbf070-ac13-4f5e-8e0f-f689961e6592_1598x714.png" width="1456" height="651" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4ffbf070-ac13-4f5e-8e0f-f689961e6592_1598x714.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:651,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:196504,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ffbf070-ac13-4f5e-8e0f-f689961e6592_1598x714.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!aGwG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ffbf070-ac13-4f5e-8e0f-f689961e6592_1598x714.png 424w, https://substackcdn.com/image/fetch/$s_!aGwG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ffbf070-ac13-4f5e-8e0f-f689961e6592_1598x714.png 848w, https://substackcdn.com/image/fetch/$s_!aGwG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ffbf070-ac13-4f5e-8e0f-f689961e6592_1598x714.png 1272w, https://substackcdn.com/image/fetch/$s_!aGwG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ffbf070-ac13-4f5e-8e0f-f689961e6592_1598x714.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_!5a1s!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57af1ec7-3a22-4c81-bd3b-0904d15346ef_662x451.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5a1s!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57af1ec7-3a22-4c81-bd3b-0904d15346ef_662x451.png 424w, https://substackcdn.com/image/fetch/$s_!5a1s!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57af1ec7-3a22-4c81-bd3b-0904d15346ef_662x451.png 848w, https://substackcdn.com/image/fetch/$s_!5a1s!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57af1ec7-3a22-4c81-bd3b-0904d15346ef_662x451.png 1272w, https://substackcdn.com/image/fetch/$s_!5a1s!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57af1ec7-3a22-4c81-bd3b-0904d15346ef_662x451.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5a1s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57af1ec7-3a22-4c81-bd3b-0904d15346ef_662x451.png" width="662" height="451" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/57af1ec7-3a22-4c81-bd3b-0904d15346ef_662x451.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:451,&quot;width&quot;:662,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:36309,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57af1ec7-3a22-4c81-bd3b-0904d15346ef_662x451.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!5a1s!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57af1ec7-3a22-4c81-bd3b-0904d15346ef_662x451.png 424w, https://substackcdn.com/image/fetch/$s_!5a1s!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57af1ec7-3a22-4c81-bd3b-0904d15346ef_662x451.png 848w, https://substackcdn.com/image/fetch/$s_!5a1s!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57af1ec7-3a22-4c81-bd3b-0904d15346ef_662x451.png 1272w, https://substackcdn.com/image/fetch/$s_!5a1s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57af1ec7-3a22-4c81-bd3b-0904d15346ef_662x451.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>As you can see, we shouldn&#8217;t be betting at all.<br>Let&#8217;s see what happens if we increase the mean of the normal distribution from 0.1% to 1%:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ieKr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce56394d-34d5-4870-b5c0-ade8945462d6_394x104.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ieKr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce56394d-34d5-4870-b5c0-ade8945462d6_394x104.png 424w, https://substackcdn.com/image/fetch/$s_!ieKr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce56394d-34d5-4870-b5c0-ade8945462d6_394x104.png 848w, https://substackcdn.com/image/fetch/$s_!ieKr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce56394d-34d5-4870-b5c0-ade8945462d6_394x104.png 1272w, https://substackcdn.com/image/fetch/$s_!ieKr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce56394d-34d5-4870-b5c0-ade8945462d6_394x104.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ieKr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce56394d-34d5-4870-b5c0-ade8945462d6_394x104.png" width="394" height="104" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ce56394d-34d5-4870-b5c0-ade8945462d6_394x104.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:104,&quot;width&quot;:394,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:7288,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce56394d-34d5-4870-b5c0-ade8945462d6_394x104.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ieKr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce56394d-34d5-4870-b5c0-ade8945462d6_394x104.png 424w, https://substackcdn.com/image/fetch/$s_!ieKr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce56394d-34d5-4870-b5c0-ade8945462d6_394x104.png 848w, https://substackcdn.com/image/fetch/$s_!ieKr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce56394d-34d5-4870-b5c0-ade8945462d6_394x104.png 1272w, https://substackcdn.com/image/fetch/$s_!ieKr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce56394d-34d5-4870-b5c0-ade8945462d6_394x104.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_!3JRv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F614920d3-5baf-4eb2-b215-ccb5752eeaa2_638x393.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3JRv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F614920d3-5baf-4eb2-b215-ccb5752eeaa2_638x393.png 424w, https://substackcdn.com/image/fetch/$s_!3JRv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F614920d3-5baf-4eb2-b215-ccb5752eeaa2_638x393.png 848w, https://substackcdn.com/image/fetch/$s_!3JRv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F614920d3-5baf-4eb2-b215-ccb5752eeaa2_638x393.png 1272w, https://substackcdn.com/image/fetch/$s_!3JRv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F614920d3-5baf-4eb2-b215-ccb5752eeaa2_638x393.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3JRv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F614920d3-5baf-4eb2-b215-ccb5752eeaa2_638x393.png" width="638" height="393" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/614920d3-5baf-4eb2-b215-ccb5752eeaa2_638x393.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:393,&quot;width&quot;:638,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:34136,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F614920d3-5baf-4eb2-b215-ccb5752eeaa2_638x393.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!3JRv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F614920d3-5baf-4eb2-b215-ccb5752eeaa2_638x393.png 424w, https://substackcdn.com/image/fetch/$s_!3JRv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F614920d3-5baf-4eb2-b215-ccb5752eeaa2_638x393.png 848w, https://substackcdn.com/image/fetch/$s_!3JRv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F614920d3-5baf-4eb2-b215-ccb5752eeaa2_638x393.png 1272w, https://substackcdn.com/image/fetch/$s_!3JRv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F614920d3-5baf-4eb2-b215-ccb5752eeaa2_638x393.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>Much better, but we are also pretty close to the leverage that will cause us to reach ruin with probability 1 almost surely.</p><div><hr></div><h2><strong>A Quadratic Approximation</strong> &#8212; <em>The Dangerous Formula You Find Online</em></h2><p>Recall the formula for the Kelly objective:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;g(f) = \\mathbb{E}[\\log(1+r+fX)]&quot;,&quot;id&quot;:&quot;KJJSSBORLH&quot;}" data-component-name="LatexBlockToDOM"></div><p>The Taylor expansion of log(1+y) around y = 0 is:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\log(1+y) = \\sum_{n=1}^\\infty (-1)^{n+1} \\frac{y^n}{n} = y - \\frac{y^2}{2} + \\frac{y^3}{3} + \\frac{y^4}{4} + ...&quot;,&quot;id&quot;:&quot;HBFDTFNIBY&quot;}" data-component-name="LatexBlockToDOM"></div><p>The Second-order approximation is therefore:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\log(1+y) \\approx y - \\frac{y^2}{2}&quot;,&quot;id&quot;:&quot;TDYAICVPBQ&quot;}" data-component-name="LatexBlockToDOM"></div><p>Substitute y = r+fX, then:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\log(1+r+fX) \\approx (r + fX) - \\frac{(r+fX)^2}{2} = r - \\frac{r^2}{2}+ fX(1-r) - \\frac{f^2X^2}{2}&quot;,&quot;id&quot;:&quot;PNEJIYGNJO&quot;}" data-component-name="LatexBlockToDOM"></div><p>Taking expectation on both sides, we finally obtain (since r and f are constants):</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\mathbb{E}[\\log(1 + r + fX)] \\approx r - \\frac{r^2}{2} + f\\mathbb{E}[X](1-r) - \\frac{f^2}{2}\\mathbb{E}[X^2]&quot;,&quot;id&quot;:&quot;GVFMIDEKRC&quot;}" data-component-name="LatexBlockToDOM"></div><p>Now we simplify r - r^2/2 using the second-order approximation of log(1+r) and factor out the (1+r) term to finally obtain:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\mathbb{E}[\\log(1+r+fX)] \\approx \\log(1+r) + \\frac{f\\mathbb{E}[X]}{1+r} - \\frac{1}{2} \\frac{f^2\\mathbb{E}[X^2]}{(1+r)^2}&quot;,&quot;id&quot;:&quot;LFVFEJVXQU&quot;}" data-component-name="LatexBlockToDOM"></div><p>A very naive formula I&#8217;ve seen online now further assumes r &#8776; 0 and E[X^2] &#8776; sigma^2.<br>With this, we get the final formula:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\mathbb{E}[\\log(1+r+fX)] \\approx f\\mu - \\frac{f^2 \\sigma^2}{2}&quot;,&quot;id&quot;:&quot;FJYAZXOKEN&quot;}" data-component-name="LatexBlockToDOM"></div><p>Where mu = E[X].</p><p>To find the f that maximises this, we take the derivative and set it to 0:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\frac{d}{df}[f\\mu - \\frac{f^2\\sigma^2}{2}] = \\mu - f\\sigma^2 = 0&quot;,&quot;id&quot;:&quot;PLBLHHRILY&quot;}" data-component-name="LatexBlockToDOM"></div><p>This has the following solution that you often see online:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;f^* \\approx \\frac{\\mu}{\\sigma^2}&quot;,&quot;id&quot;:&quot;KKROCJYDCQ&quot;}" data-component-name="LatexBlockToDOM"></div><p>We&#8217;ve done so many approximations and assumptions here. This formula becomes extremely unreliable in real markets.</p><p>Here is what this approximation would have given us on our fat-tailed samples:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9UN8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cea8dbf-1acf-47af-bfae-bec9bcbec9f4_1210x378.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9UN8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cea8dbf-1acf-47af-bfae-bec9bcbec9f4_1210x378.png 424w, https://substackcdn.com/image/fetch/$s_!9UN8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cea8dbf-1acf-47af-bfae-bec9bcbec9f4_1210x378.png 848w, https://substackcdn.com/image/fetch/$s_!9UN8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cea8dbf-1acf-47af-bfae-bec9bcbec9f4_1210x378.png 1272w, https://substackcdn.com/image/fetch/$s_!9UN8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cea8dbf-1acf-47af-bfae-bec9bcbec9f4_1210x378.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9UN8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cea8dbf-1acf-47af-bfae-bec9bcbec9f4_1210x378.png" width="1210" height="378" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1cea8dbf-1acf-47af-bfae-bec9bcbec9f4_1210x378.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:378,&quot;width&quot;:1210,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:90673,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cea8dbf-1acf-47af-bfae-bec9bcbec9f4_1210x378.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9UN8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cea8dbf-1acf-47af-bfae-bec9bcbec9f4_1210x378.png 424w, https://substackcdn.com/image/fetch/$s_!9UN8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cea8dbf-1acf-47af-bfae-bec9bcbec9f4_1210x378.png 848w, https://substackcdn.com/image/fetch/$s_!9UN8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cea8dbf-1acf-47af-bfae-bec9bcbec9f4_1210x378.png 1272w, https://substackcdn.com/image/fetch/$s_!9UN8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cea8dbf-1acf-47af-bfae-bec9bcbec9f4_1210x378.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_!s8v0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd350ad4e-6183-414e-9dd5-72bcd7acd4fe_367x63.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!s8v0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd350ad4e-6183-414e-9dd5-72bcd7acd4fe_367x63.png 424w, https://substackcdn.com/image/fetch/$s_!s8v0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd350ad4e-6183-414e-9dd5-72bcd7acd4fe_367x63.png 848w, https://substackcdn.com/image/fetch/$s_!s8v0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd350ad4e-6183-414e-9dd5-72bcd7acd4fe_367x63.png 1272w, https://substackcdn.com/image/fetch/$s_!s8v0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd350ad4e-6183-414e-9dd5-72bcd7acd4fe_367x63.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!s8v0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd350ad4e-6183-414e-9dd5-72bcd7acd4fe_367x63.png" width="367" height="63" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d350ad4e-6183-414e-9dd5-72bcd7acd4fe_367x63.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:63,&quot;width&quot;:367,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:6532,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd350ad4e-6183-414e-9dd5-72bcd7acd4fe_367x63.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!s8v0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd350ad4e-6183-414e-9dd5-72bcd7acd4fe_367x63.png 424w, https://substackcdn.com/image/fetch/$s_!s8v0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd350ad4e-6183-414e-9dd5-72bcd7acd4fe_367x63.png 848w, https://substackcdn.com/image/fetch/$s_!s8v0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd350ad4e-6183-414e-9dd5-72bcd7acd4fe_367x63.png 1272w, https://substackcdn.com/image/fetch/$s_!s8v0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd350ad4e-6183-414e-9dd5-72bcd7acd4fe_367x63.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h2><strong>Continuous-Time Kelly (GBM) &#8212; </strong><em>Moving On From Discrete Models</em></h2><p>One really nice property of continuous-time models is that we avoid the discrete-time &#8220;one-step wipeout&#8221; issue because the wealth process stays strictly positive under diffusion dynamics.</p><p>Let&#8217;s model a risky asset with excess drift mu via Geometric Brownian Motion:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\frac{dS}{S} = (r+\\mu)dt + \\sigma dB_t&quot;,&quot;id&quot;:&quot;TKBIMDLDDU&quot;}" data-component-name="LatexBlockToDOM"></div><p>Let&#8217;s say we have wealth W and maintain constant exposure f to the risky asset.<br>Our wealth changes from two sources:</p><ul><li><p>Cash portion (1-f)*W earns r.</p></li><li><p>Risky asset portion f*W follows the asset&#8217;s dynamics.</p></li></ul><p>Our wealth return dynamics are therefore:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\frac{dW}{W} = r dt + f\\mu dt + f\\sigma dB_t&quot;,&quot;id&quot;:&quot;LJUFHWWYIH&quot;}" data-component-name="LatexBlockToDOM"></div><p>What we care about are the dynamics of log wealth, however. <br>We can apply It&#244;&#8217;s lemma to obtain:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;d(\\log(W)) = [r + f\\mu - \\frac{1}{2}f^2 \\sigma^2]dt + f\\sigma dB_t&quot;,&quot;id&quot;:&quot;EGAREALQOR&quot;}" data-component-name="LatexBlockToDOM"></div><p>The drift component of log wealth is:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\gamma(f) = r + f\\mu - \\frac{1}{2}f^2\\sigma^2&quot;,&quot;id&quot;:&quot;QBUPEISDKG&quot;}" data-component-name="LatexBlockToDOM"></div><p>To maximize the drift of log wealth, we again take the derivative of this with respect to f and set it equal to zero (you know the drill) to obtain:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;f^* = \\frac{\\mu}{\\sigma^2}&quot;,&quot;id&quot;:&quot;DXMEFFBEOI&quot;}" data-component-name="LatexBlockToDOM"></div><p>That&#8217;s the same formula we obtained in our second-order approximation! </p><p>Let&#8217;s code it up and confirm our formula is correct:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QxDY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85b3b5c4-b63c-4921-bf5b-8e56db43e1c7_1378x864.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QxDY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85b3b5c4-b63c-4921-bf5b-8e56db43e1c7_1378x864.png 424w, https://substackcdn.com/image/fetch/$s_!QxDY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85b3b5c4-b63c-4921-bf5b-8e56db43e1c7_1378x864.png 848w, https://substackcdn.com/image/fetch/$s_!QxDY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85b3b5c4-b63c-4921-bf5b-8e56db43e1c7_1378x864.png 1272w, https://substackcdn.com/image/fetch/$s_!QxDY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85b3b5c4-b63c-4921-bf5b-8e56db43e1c7_1378x864.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QxDY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85b3b5c4-b63c-4921-bf5b-8e56db43e1c7_1378x864.png" width="1378" height="864" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/85b3b5c4-b63c-4921-bf5b-8e56db43e1c7_1378x864.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:864,&quot;width&quot;:1378,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:234612,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85b3b5c4-b63c-4921-bf5b-8e56db43e1c7_1378x864.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!QxDY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85b3b5c4-b63c-4921-bf5b-8e56db43e1c7_1378x864.png 424w, https://substackcdn.com/image/fetch/$s_!QxDY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85b3b5c4-b63c-4921-bf5b-8e56db43e1c7_1378x864.png 848w, https://substackcdn.com/image/fetch/$s_!QxDY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85b3b5c4-b63c-4921-bf5b-8e56db43e1c7_1378x864.png 1272w, https://substackcdn.com/image/fetch/$s_!QxDY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85b3b5c4-b63c-4921-bf5b-8e56db43e1c7_1378x864.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_!nN2p!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b30d055-cb8c-4556-a63f-7e0af40bcc83_651x435.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nN2p!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b30d055-cb8c-4556-a63f-7e0af40bcc83_651x435.png 424w, https://substackcdn.com/image/fetch/$s_!nN2p!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b30d055-cb8c-4556-a63f-7e0af40bcc83_651x435.png 848w, https://substackcdn.com/image/fetch/$s_!nN2p!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b30d055-cb8c-4556-a63f-7e0af40bcc83_651x435.png 1272w, https://substackcdn.com/image/fetch/$s_!nN2p!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b30d055-cb8c-4556-a63f-7e0af40bcc83_651x435.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nN2p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b30d055-cb8c-4556-a63f-7e0af40bcc83_651x435.png" width="651" height="435" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3b30d055-cb8c-4556-a63f-7e0af40bcc83_651x435.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:435,&quot;width&quot;:651,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:42107,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b30d055-cb8c-4556-a63f-7e0af40bcc83_651x435.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!nN2p!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b30d055-cb8c-4556-a63f-7e0af40bcc83_651x435.png 424w, https://substackcdn.com/image/fetch/$s_!nN2p!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b30d055-cb8c-4556-a63f-7e0af40bcc83_651x435.png 848w, https://substackcdn.com/image/fetch/$s_!nN2p!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b30d055-cb8c-4556-a63f-7e0af40bcc83_651x435.png 1272w, https://substackcdn.com/image/fetch/$s_!nN2p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b30d055-cb8c-4556-a63f-7e0af40bcc83_651x435.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><hr></div><h2><strong>Multi-Asset Continuous-Time Kelly &#8212; </strong><em>When We Trade Multiple Assets</em></h2><p>Why limit ourselves to one asset when we can trade multiple assets at once?</p><p>Let X be the vector of excess returns in continuous time with drift mu and covariance Sigma. We have the multivariate Gaussian Process:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;dX = \\mu dt + \\Sigma^{1/2} dB_t&quot;,&quot;id&quot;:&quot;UXEAABEWGU&quot;}" data-component-name="LatexBlockToDOM"></div><p>Doing the same process as in the previous section, we arrive at the drift of our log wealth:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\gamma(w) = r + w^T \\mu - \\frac{1}{2}w^2\\Sigma w&quot;,&quot;id&quot;:&quot;EGOCOCCRAQ&quot;}" data-component-name="LatexBlockToDOM"></div><p>with weights w.</p><p>The Kelly solution is:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;w^* = \\Sigma^{-1} \\mu&quot;,&quot;id&quot;:&quot;HXJHLEKZMN&quot;}" data-component-name="LatexBlockToDOM"></div><p>Let&#8217;s compute and verify this:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GJc1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2780fb2-7a8f-43ad-a189-dd41e98e6ac0_1480x1086.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GJc1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2780fb2-7a8f-43ad-a189-dd41e98e6ac0_1480x1086.png 424w, https://substackcdn.com/image/fetch/$s_!GJc1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2780fb2-7a8f-43ad-a189-dd41e98e6ac0_1480x1086.png 848w, https://substackcdn.com/image/fetch/$s_!GJc1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2780fb2-7a8f-43ad-a189-dd41e98e6ac0_1480x1086.png 1272w, https://substackcdn.com/image/fetch/$s_!GJc1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2780fb2-7a8f-43ad-a189-dd41e98e6ac0_1480x1086.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GJc1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2780fb2-7a8f-43ad-a189-dd41e98e6ac0_1480x1086.png" width="1456" height="1068" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b2780fb2-7a8f-43ad-a189-dd41e98e6ac0_1480x1086.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1068,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:289251,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2780fb2-7a8f-43ad-a189-dd41e98e6ac0_1480x1086.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!GJc1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2780fb2-7a8f-43ad-a189-dd41e98e6ac0_1480x1086.png 424w, https://substackcdn.com/image/fetch/$s_!GJc1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2780fb2-7a8f-43ad-a189-dd41e98e6ac0_1480x1086.png 848w, https://substackcdn.com/image/fetch/$s_!GJc1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2780fb2-7a8f-43ad-a189-dd41e98e6ac0_1480x1086.png 1272w, https://substackcdn.com/image/fetch/$s_!GJc1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2780fb2-7a8f-43ad-a189-dd41e98e6ac0_1480x1086.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_!rbHt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe23c496-7937-4792-98e0-b6405c7a5bc5_640x442.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rbHt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe23c496-7937-4792-98e0-b6405c7a5bc5_640x442.png 424w, https://substackcdn.com/image/fetch/$s_!rbHt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe23c496-7937-4792-98e0-b6405c7a5bc5_640x442.png 848w, https://substackcdn.com/image/fetch/$s_!rbHt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe23c496-7937-4792-98e0-b6405c7a5bc5_640x442.png 1272w, https://substackcdn.com/image/fetch/$s_!rbHt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe23c496-7937-4792-98e0-b6405c7a5bc5_640x442.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rbHt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe23c496-7937-4792-98e0-b6405c7a5bc5_640x442.png" width="640" height="442" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fe23c496-7937-4792-98e0-b6405c7a5bc5_640x442.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:442,&quot;width&quot;:640,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:41119,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe23c496-7937-4792-98e0-b6405c7a5bc5_640x442.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rbHt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe23c496-7937-4792-98e0-b6405c7a5bc5_640x442.png 424w, https://substackcdn.com/image/fetch/$s_!rbHt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe23c496-7937-4792-98e0-b6405c7a5bc5_640x442.png 848w, https://substackcdn.com/image/fetch/$s_!rbHt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe23c496-7937-4792-98e0-b6405c7a5bc5_640x442.png 1272w, https://substackcdn.com/image/fetch/$s_!rbHt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe23c496-7937-4792-98e0-b6405c7a5bc5_640x442.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>There is one major issue with the Kelly solution (besides the fact that markets don&#8217;t follow Brownian motion): Sigma^-1 is extremely unstable. Covariance matrices are nearly singular for correlated assets, making small changes to Sigma can give you a vastly different Sigma^-1.</p><p>Our goal is to reduce the <strong>variance</strong> by introducing some <strong>bias</strong>. A simple way to do this is using Ridge Regularisation:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tz6k!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f153499-efce-447b-9187-4dd7f722ed5b_226x57.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tz6k!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f153499-efce-447b-9187-4dd7f722ed5b_226x57.png 424w, https://substackcdn.com/image/fetch/$s_!tz6k!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f153499-efce-447b-9187-4dd7f722ed5b_226x57.png 848w, https://substackcdn.com/image/fetch/$s_!tz6k!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f153499-efce-447b-9187-4dd7f722ed5b_226x57.png 1272w, https://substackcdn.com/image/fetch/$s_!tz6k!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f153499-efce-447b-9187-4dd7f722ed5b_226x57.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tz6k!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f153499-efce-447b-9187-4dd7f722ed5b_226x57.png" width="226" height="57" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7f153499-efce-447b-9187-4dd7f722ed5b_226x57.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:57,&quot;width&quot;:226,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:3443,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f153499-efce-447b-9187-4dd7f722ed5b_226x57.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!tz6k!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f153499-efce-447b-9187-4dd7f722ed5b_226x57.png 424w, https://substackcdn.com/image/fetch/$s_!tz6k!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f153499-efce-447b-9187-4dd7f722ed5b_226x57.png 848w, https://substackcdn.com/image/fetch/$s_!tz6k!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f153499-efce-447b-9187-4dd7f722ed5b_226x57.png 1272w, https://substackcdn.com/image/fetch/$s_!tz6k!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f153499-efce-447b-9187-4dd7f722ed5b_226x57.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>I talk in more detail about regularisation in the following article:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;4dc7c9a8-df86-404a-a98c-04e963fab394&quot;,&quot;caption&quot;:&quot;2 of the most common problems we face when building trading models are overfitting and colinearity. Regularization is a technique that we can use to combat both of those problems.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;md&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Avoiding Overfitting and Colinearity with Regularization&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:128680675,&quot;name&quot;:&quot;Vertox&quot;,&quot;bio&quot;:&quot;Quantitative Researcher in Digital Asset Markets | Market Making | Statistical Arbitrage | Options &quot;,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!HGUA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bf3fd86-d46a-4caa-969a-d80059b72cb9_128x128.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2025-05-05T12:53:54.222Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f6d2a7e-aec1-43d6-b904-19e9921e6da3_562x455.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.vertoxquant.com/p/avoiding-overfitting-and-colinearity&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:162838681,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:10,&quot;comment_count&quot;:0,&quot;publication_id&quot;:1726874,&quot;publication_name&quot;:&quot;VertoxQuant&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!ufaQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>What you need to know here is: The more we increase lambda, the more our weights will shrink towards zero (more bias), but the smaller the variance will be.</p><p>Here is the impact of different values of lambda on our weights:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8R4E!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feed69412-0f52-42a4-9cce-6b39d77655b7_1446x342.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8R4E!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feed69412-0f52-42a4-9cce-6b39d77655b7_1446x342.png 424w, https://substackcdn.com/image/fetch/$s_!8R4E!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feed69412-0f52-42a4-9cce-6b39d77655b7_1446x342.png 848w, https://substackcdn.com/image/fetch/$s_!8R4E!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feed69412-0f52-42a4-9cce-6b39d77655b7_1446x342.png 1272w, https://substackcdn.com/image/fetch/$s_!8R4E!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feed69412-0f52-42a4-9cce-6b39d77655b7_1446x342.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8R4E!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feed69412-0f52-42a4-9cce-6b39d77655b7_1446x342.png" width="1446" height="342" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/eed69412-0f52-42a4-9cce-6b39d77655b7_1446x342.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:342,&quot;width&quot;:1446,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:88776,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feed69412-0f52-42a4-9cce-6b39d77655b7_1446x342.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8R4E!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feed69412-0f52-42a4-9cce-6b39d77655b7_1446x342.png 424w, https://substackcdn.com/image/fetch/$s_!8R4E!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feed69412-0f52-42a4-9cce-6b39d77655b7_1446x342.png 848w, https://substackcdn.com/image/fetch/$s_!8R4E!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feed69412-0f52-42a4-9cce-6b39d77655b7_1446x342.png 1272w, https://substackcdn.com/image/fetch/$s_!8R4E!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feed69412-0f52-42a4-9cce-6b39d77655b7_1446x342.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_!ziDS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76573d72-4f3c-4302-a24f-83739b8f8249_322x84.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ziDS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76573d72-4f3c-4302-a24f-83739b8f8249_322x84.png 424w, https://substackcdn.com/image/fetch/$s_!ziDS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76573d72-4f3c-4302-a24f-83739b8f8249_322x84.png 848w, https://substackcdn.com/image/fetch/$s_!ziDS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76573d72-4f3c-4302-a24f-83739b8f8249_322x84.png 1272w, https://substackcdn.com/image/fetch/$s_!ziDS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76573d72-4f3c-4302-a24f-83739b8f8249_322x84.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ziDS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76573d72-4f3c-4302-a24f-83739b8f8249_322x84.png" width="322" height="84" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/76573d72-4f3c-4302-a24f-83739b8f8249_322x84.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:84,&quot;width&quot;:322,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:5924,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76573d72-4f3c-4302-a24f-83739b8f8249_322x84.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ziDS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76573d72-4f3c-4302-a24f-83739b8f8249_322x84.png 424w, https://substackcdn.com/image/fetch/$s_!ziDS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76573d72-4f3c-4302-a24f-83739b8f8249_322x84.png 848w, https://substackcdn.com/image/fetch/$s_!ziDS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76573d72-4f3c-4302-a24f-83739b8f8249_322x84.png 1272w, https://substackcdn.com/image/fetch/$s_!ziDS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76573d72-4f3c-4302-a24f-83739b8f8249_322x84.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h2><strong>Estimation Error: Bayesian Approach &#8212; </strong><em>Updating Your Beliefs of Odds</em></h2><p>Imagine you are walking around in Las Vegas, and someone in an alley calls you to play a game. Because you have no survival instincts, you decide to give it a try. He suggests throwing a coin. If you win, your payout is b=1. If he wins, his payout is 1.</p><p>You believe the nice gentleman is using a fair coin, but you are sceptical. Your prior belief on the win probability is a Beta(a0, b0) distribution with a0 = 2 and b0 = 2. This is a symmetric distribution centred at p=0.5:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!XfRf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d01c6bb-ab79-4a8c-ab1f-4bef6de42727_633x150.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!XfRf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d01c6bb-ab79-4a8c-ab1f-4bef6de42727_633x150.png 424w, https://substackcdn.com/image/fetch/$s_!XfRf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d01c6bb-ab79-4a8c-ab1f-4bef6de42727_633x150.png 848w, https://substackcdn.com/image/fetch/$s_!XfRf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d01c6bb-ab79-4a8c-ab1f-4bef6de42727_633x150.png 1272w, https://substackcdn.com/image/fetch/$s_!XfRf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d01c6bb-ab79-4a8c-ab1f-4bef6de42727_633x150.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!XfRf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d01c6bb-ab79-4a8c-ab1f-4bef6de42727_633x150.png" width="633" height="150" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9d01c6bb-ab79-4a8c-ab1f-4bef6de42727_633x150.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:150,&quot;width&quot;:633,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:4152,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d01c6bb-ab79-4a8c-ab1f-4bef6de42727_633x150.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!XfRf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d01c6bb-ab79-4a8c-ab1f-4bef6de42727_633x150.png 424w, https://substackcdn.com/image/fetch/$s_!XfRf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d01c6bb-ab79-4a8c-ab1f-4bef6de42727_633x150.png 848w, https://substackcdn.com/image/fetch/$s_!XfRf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d01c6bb-ab79-4a8c-ab1f-4bef6de42727_633x150.png 1272w, https://substackcdn.com/image/fetch/$s_!XfRf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d01c6bb-ab79-4a8c-ab1f-4bef6de42727_633x150.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>You guys decide to play 100 games, and he wins 70 times&#8230; You no longer believe the coin is fair and update your beliefs about the probability of him winning. Your new posterior distribution looks as follows:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!k2fE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb63187be-f1bd-40eb-bc21-ebfc1f946495_656x243.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!k2fE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb63187be-f1bd-40eb-bc21-ebfc1f946495_656x243.png 424w, https://substackcdn.com/image/fetch/$s_!k2fE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb63187be-f1bd-40eb-bc21-ebfc1f946495_656x243.png 848w, https://substackcdn.com/image/fetch/$s_!k2fE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb63187be-f1bd-40eb-bc21-ebfc1f946495_656x243.png 1272w, https://substackcdn.com/image/fetch/$s_!k2fE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb63187be-f1bd-40eb-bc21-ebfc1f946495_656x243.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!k2fE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb63187be-f1bd-40eb-bc21-ebfc1f946495_656x243.png" width="656" height="243" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b63187be-f1bd-40eb-bc21-ebfc1f946495_656x243.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:243,&quot;width&quot;:656,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:7174,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb63187be-f1bd-40eb-bc21-ebfc1f946495_656x243.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!k2fE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb63187be-f1bd-40eb-bc21-ebfc1f946495_656x243.png 424w, https://substackcdn.com/image/fetch/$s_!k2fE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb63187be-f1bd-40eb-bc21-ebfc1f946495_656x243.png 848w, https://substackcdn.com/image/fetch/$s_!k2fE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb63187be-f1bd-40eb-bc21-ebfc1f946495_656x243.png 1272w, https://substackcdn.com/image/fetch/$s_!k2fE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb63187be-f1bd-40eb-bc21-ebfc1f946495_656x243.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>You still decide to play another 300 games, and this time he only wins 162 times.<br>Your new posterior distribution now looks as follows:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3Zlr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff364756f-e36d-4586-8814-b8eacc31f878_657x350.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3Zlr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff364756f-e36d-4586-8814-b8eacc31f878_657x350.png 424w, https://substackcdn.com/image/fetch/$s_!3Zlr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff364756f-e36d-4586-8814-b8eacc31f878_657x350.png 848w, https://substackcdn.com/image/fetch/$s_!3Zlr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff364756f-e36d-4586-8814-b8eacc31f878_657x350.png 1272w, https://substackcdn.com/image/fetch/$s_!3Zlr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff364756f-e36d-4586-8814-b8eacc31f878_657x350.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3Zlr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff364756f-e36d-4586-8814-b8eacc31f878_657x350.png" width="657" height="350" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f364756f-e36d-4586-8814-b8eacc31f878_657x350.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:350,&quot;width&quot;:657,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:8167,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff364756f-e36d-4586-8814-b8eacc31f878_657x350.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!3Zlr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff364756f-e36d-4586-8814-b8eacc31f878_657x350.png 424w, https://substackcdn.com/image/fetch/$s_!3Zlr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff364756f-e36d-4586-8814-b8eacc31f878_657x350.png 848w, https://substackcdn.com/image/fetch/$s_!3Zlr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff364756f-e36d-4586-8814-b8eacc31f878_657x350.png 1272w, https://substackcdn.com/image/fetch/$s_!3Zlr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff364756f-e36d-4586-8814-b8eacc31f878_657x350.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 process we just did is called Bayesian inference, where we compute the posterior probability according to Bayes&#8217; theorem:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\mathbb{P}(H|E) = \\frac{\\mathbb{P}(E|H)\\mathbb{P}(H)}{\\mathbb{P}(E)}&quot;,&quot;id&quot;:&quot;KLQODGJPHP&quot;}" data-component-name="LatexBlockToDOM"></div><p>where:</p><ul><li><p>H is a hypothesis whose probability you are trying to estimate.</p></li><li><p>P(H) is your prior probability for the hypothesis.</p></li><li><p>E is the evidence you collect by playing.</p></li><li><p>P(H|E) is the posterior probability. The probability of H with new evidence E.</p></li></ul><p>Our prior is a Beta(a0, b0) distribution. The density is:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\pi(p) \\propto p^{a_0-1}(1-p)^{b_0-1}=p(1-p)&quot;,&quot;id&quot;:&quot;BCBMBGVINA&quot;}" data-component-name="LatexBlockToDOM"></div><p>We observe n=100 trials with k=70 wins. The likelihood is binomial:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\mathcal{L}(p|\\text{data}) = {70\\choose100}p^{70}(1-p)^{30}&quot;,&quot;id&quot;:&quot;NCJETNKRPO&quot;}" data-component-name="LatexBlockToDOM"></div><p>According to Bayes&#8217; Theorem, we have:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\pi(p|\\text{data}) \\propto \\pi(p) \\times \\mathcal{L}(p|\\text{data})&quot;,&quot;id&quot;:&quot;UBYSQXCWUH&quot;}" data-component-name="LatexBlockToDOM"></div><p>Substituting:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\pi(p|\\text{data}) \\propto p(1-p) \\times p^{70}(1-p)^{30} = p^{71}(1-p)^{31}&quot;,&quot;id&quot;:&quot;HIHJZMJADG&quot;}" data-component-name="LatexBlockToDOM"></div><p>This is the kernel of a Beta distribution:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;p|\\text{data} \\sim \\text{Beta}(a_0 + k, b_0 + n - k)&quot;,&quot;id&quot;:&quot;PXPNDUCBNN&quot;}" data-component-name="LatexBlockToDOM"></div><p>So after our first round of 100 games, our posterior distribution is Beta(72,32).</p><p>Note: The mean of a Beta(a,b) distribution is a/(a+b).</p><p>We are gonna test 4 betting strategies against the mysterious alley guy now. For all 4 strategies we start by playing 100 test games to get an idea of the true probability of heads and tails.</p><ol><li><p>We estimate p as the fraction of games won. We then bet using Kelly: f = 2p-1.</p></li><li><p>Same as strategy 1, but we bet with half-Kelly.</p></li><li><p>We use our Bayesian inference strategy and bet with Kelly using the mean of our posterior distribution as the probability.</p></li><li><p>We use Bayesian inference like in strategy 3, but use the 10th percentile of our posterior distribution instead of the mean.</p></li></ol><p>Here is all of that coded up:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oiew!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15e0d33b-f5d3-4a55-ab6f-f89878707111_1614x2540.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oiew!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15e0d33b-f5d3-4a55-ab6f-f89878707111_1614x2540.png 424w, https://substackcdn.com/image/fetch/$s_!oiew!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15e0d33b-f5d3-4a55-ab6f-f89878707111_1614x2540.png 848w, https://substackcdn.com/image/fetch/$s_!oiew!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15e0d33b-f5d3-4a55-ab6f-f89878707111_1614x2540.png 1272w, https://substackcdn.com/image/fetch/$s_!oiew!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15e0d33b-f5d3-4a55-ab6f-f89878707111_1614x2540.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oiew!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15e0d33b-f5d3-4a55-ab6f-f89878707111_1614x2540.png" width="1456" height="2291" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/15e0d33b-f5d3-4a55-ab6f-f89878707111_1614x2540.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2291,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:627562,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15e0d33b-f5d3-4a55-ab6f-f89878707111_1614x2540.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!oiew!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15e0d33b-f5d3-4a55-ab6f-f89878707111_1614x2540.png 424w, https://substackcdn.com/image/fetch/$s_!oiew!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15e0d33b-f5d3-4a55-ab6f-f89878707111_1614x2540.png 848w, https://substackcdn.com/image/fetch/$s_!oiew!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15e0d33b-f5d3-4a55-ab6f-f89878707111_1614x2540.png 1272w, https://substackcdn.com/image/fetch/$s_!oiew!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15e0d33b-f5d3-4a55-ab6f-f89878707111_1614x2540.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_!a8XS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa0828b0-67f0-4a12-8c2d-fbbdad1735cd_508x84.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!a8XS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa0828b0-67f0-4a12-8c2d-fbbdad1735cd_508x84.png 424w, https://substackcdn.com/image/fetch/$s_!a8XS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa0828b0-67f0-4a12-8c2d-fbbdad1735cd_508x84.png 848w, https://substackcdn.com/image/fetch/$s_!a8XS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa0828b0-67f0-4a12-8c2d-fbbdad1735cd_508x84.png 1272w, https://substackcdn.com/image/fetch/$s_!a8XS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa0828b0-67f0-4a12-8c2d-fbbdad1735cd_508x84.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!a8XS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa0828b0-67f0-4a12-8c2d-fbbdad1735cd_508x84.png" width="508" height="84" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fa0828b0-67f0-4a12-8c2d-fbbdad1735cd_508x84.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:84,&quot;width&quot;:508,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:13634,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa0828b0-67f0-4a12-8c2d-fbbdad1735cd_508x84.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!a8XS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa0828b0-67f0-4a12-8c2d-fbbdad1735cd_508x84.png 424w, https://substackcdn.com/image/fetch/$s_!a8XS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa0828b0-67f0-4a12-8c2d-fbbdad1735cd_508x84.png 848w, https://substackcdn.com/image/fetch/$s_!a8XS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa0828b0-67f0-4a12-8c2d-fbbdad1735cd_508x84.png 1272w, https://substackcdn.com/image/fetch/$s_!a8XS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa0828b0-67f0-4a12-8c2d-fbbdad1735cd_508x84.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Half Kelly has the highest mean log wealth growth, and no strategy ever went bankrupt.</p><p>If we increase our warmup games to 1000 and then play 10000 games in total (across 20000 experiments), those numbers change:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zWPX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb774b882-04fb-43e1-856a-1131b1c59e3a_506x85.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zWPX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb774b882-04fb-43e1-856a-1131b1c59e3a_506x85.png 424w, https://substackcdn.com/image/fetch/$s_!zWPX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb774b882-04fb-43e1-856a-1131b1c59e3a_506x85.png 848w, https://substackcdn.com/image/fetch/$s_!zWPX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb774b882-04fb-43e1-856a-1131b1c59e3a_506x85.png 1272w, https://substackcdn.com/image/fetch/$s_!zWPX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb774b882-04fb-43e1-856a-1131b1c59e3a_506x85.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zWPX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb774b882-04fb-43e1-856a-1131b1c59e3a_506x85.png" width="506" height="85" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b774b882-04fb-43e1-856a-1131b1c59e3a_506x85.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:85,&quot;width&quot;:506,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:13584,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb774b882-04fb-43e1-856a-1131b1c59e3a_506x85.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zWPX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb774b882-04fb-43e1-856a-1131b1c59e3a_506x85.png 424w, https://substackcdn.com/image/fetch/$s_!zWPX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb774b882-04fb-43e1-856a-1131b1c59e3a_506x85.png 848w, https://substackcdn.com/image/fetch/$s_!zWPX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb774b882-04fb-43e1-856a-1131b1c59e3a_506x85.png 1272w, https://substackcdn.com/image/fetch/$s_!zWPX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb774b882-04fb-43e1-856a-1131b1c59e3a_506x85.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The more optimal strategies start to outperform! </p><p>Here are the distributions of the final log wealths:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!IsJ5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbac194b8-5e67-4e22-8c2c-b46450db0f94_2048x676.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!IsJ5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbac194b8-5e67-4e22-8c2c-b46450db0f94_2048x676.png 424w, https://substackcdn.com/image/fetch/$s_!IsJ5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbac194b8-5e67-4e22-8c2c-b46450db0f94_2048x676.png 848w, https://substackcdn.com/image/fetch/$s_!IsJ5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbac194b8-5e67-4e22-8c2c-b46450db0f94_2048x676.png 1272w, https://substackcdn.com/image/fetch/$s_!IsJ5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbac194b8-5e67-4e22-8c2c-b46450db0f94_2048x676.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!IsJ5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbac194b8-5e67-4e22-8c2c-b46450db0f94_2048x676.png" width="1456" height="481" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bac194b8-5e67-4e22-8c2c-b46450db0f94_2048x676.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:481,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:209308,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbac194b8-5e67-4e22-8c2c-b46450db0f94_2048x676.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!IsJ5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbac194b8-5e67-4e22-8c2c-b46450db0f94_2048x676.png 424w, https://substackcdn.com/image/fetch/$s_!IsJ5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbac194b8-5e67-4e22-8c2c-b46450db0f94_2048x676.png 848w, https://substackcdn.com/image/fetch/$s_!IsJ5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbac194b8-5e67-4e22-8c2c-b46450db0f94_2048x676.png 1272w, https://substackcdn.com/image/fetch/$s_!IsJ5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbac194b8-5e67-4e22-8c2c-b46450db0f94_2048x676.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_!L0Sy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84afce82-ffa0-4952-b5eb-44ef40c07394_622x397.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!L0Sy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84afce82-ffa0-4952-b5eb-44ef40c07394_622x397.png 424w, https://substackcdn.com/image/fetch/$s_!L0Sy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84afce82-ffa0-4952-b5eb-44ef40c07394_622x397.png 848w, https://substackcdn.com/image/fetch/$s_!L0Sy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84afce82-ffa0-4952-b5eb-44ef40c07394_622x397.png 1272w, https://substackcdn.com/image/fetch/$s_!L0Sy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84afce82-ffa0-4952-b5eb-44ef40c07394_622x397.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!L0Sy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84afce82-ffa0-4952-b5eb-44ef40c07394_622x397.png" width="622" height="397" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/84afce82-ffa0-4952-b5eb-44ef40c07394_622x397.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:397,&quot;width&quot;:622,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:29138,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84afce82-ffa0-4952-b5eb-44ef40c07394_622x397.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!L0Sy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84afce82-ffa0-4952-b5eb-44ef40c07394_622x397.png 424w, https://substackcdn.com/image/fetch/$s_!L0Sy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84afce82-ffa0-4952-b5eb-44ef40c07394_622x397.png 848w, https://substackcdn.com/image/fetch/$s_!L0Sy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84afce82-ffa0-4952-b5eb-44ef40c07394_622x397.png 1272w, https://substackcdn.com/image/fetch/$s_!L0Sy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84afce82-ffa0-4952-b5eb-44ef40c07394_622x397.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_!6wIN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe689bc38-ced7-45f1-86df-671d3c1f3a3c_781x86.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6wIN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe689bc38-ced7-45f1-86df-671d3c1f3a3c_781x86.png 424w, https://substackcdn.com/image/fetch/$s_!6wIN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe689bc38-ced7-45f1-86df-671d3c1f3a3c_781x86.png 848w, https://substackcdn.com/image/fetch/$s_!6wIN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe689bc38-ced7-45f1-86df-671d3c1f3a3c_781x86.png 1272w, https://substackcdn.com/image/fetch/$s_!6wIN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe689bc38-ced7-45f1-86df-671d3c1f3a3c_781x86.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6wIN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe689bc38-ced7-45f1-86df-671d3c1f3a3c_781x86.png" width="781" height="86" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e689bc38-ced7-45f1-86df-671d3c1f3a3c_781x86.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:86,&quot;width&quot;:781,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19821,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe689bc38-ced7-45f1-86df-671d3c1f3a3c_781x86.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!6wIN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe689bc38-ced7-45f1-86df-671d3c1f3a3c_781x86.png 424w, https://substackcdn.com/image/fetch/$s_!6wIN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe689bc38-ced7-45f1-86df-671d3c1f3a3c_781x86.png 848w, https://substackcdn.com/image/fetch/$s_!6wIN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe689bc38-ced7-45f1-86df-671d3c1f3a3c_781x86.png 1272w, https://substackcdn.com/image/fetch/$s_!6wIN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe689bc38-ced7-45f1-86df-671d3c1f3a3c_781x86.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Note: The true probability of us winning was 55% (Thank you, mysterious coin guy!).</p><div><hr></div><h2><strong>Dynamic Sizing &#8212;</strong><em> Don&#8217;t Use Constant Kelly!</em></h2><p>An even better strategy would be to update your posterior distribution in the Bayesian inference strategy after every single game (or every few games). <br>There is a small problem with this, though: what if the true probability of winning changed over time? The more games we played, the slower Bayesian inference updates.</p><p>There are a few major ways to solve this issue:</p><ol><li><p>Use a sliding window and only use the last N observations for your inference.</p></li><li><p>Weight recent data more heavily.</p></li><li><p>Monitor for regime changes and reset when detected.</p></li></ol><p>Those are left as an exercise to the reader.</p><p>Imagine the shady alley man actually has 2 coins now that he switches between at random, and instead of flipping a coin, he samples from a normal distribution. Further, with a small probability, we get a crash.</p><p>We can simulate this with the following code:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dv2Q!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6490c506-82a7-40ae-bd7e-124320389ae6_1512x1422.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dv2Q!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6490c506-82a7-40ae-bd7e-124320389ae6_1512x1422.png 424w, https://substackcdn.com/image/fetch/$s_!dv2Q!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6490c506-82a7-40ae-bd7e-124320389ae6_1512x1422.png 848w, https://substackcdn.com/image/fetch/$s_!dv2Q!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6490c506-82a7-40ae-bd7e-124320389ae6_1512x1422.png 1272w, https://substackcdn.com/image/fetch/$s_!dv2Q!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6490c506-82a7-40ae-bd7e-124320389ae6_1512x1422.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dv2Q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6490c506-82a7-40ae-bd7e-124320389ae6_1512x1422.png" width="1456" height="1369" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6490c506-82a7-40ae-bd7e-124320389ae6_1512x1422.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1369,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:247963,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6490c506-82a7-40ae-bd7e-124320389ae6_1512x1422.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dv2Q!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6490c506-82a7-40ae-bd7e-124320389ae6_1512x1422.png 424w, https://substackcdn.com/image/fetch/$s_!dv2Q!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6490c506-82a7-40ae-bd7e-124320389ae6_1512x1422.png 848w, https://substackcdn.com/image/fetch/$s_!dv2Q!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6490c506-82a7-40ae-bd7e-124320389ae6_1512x1422.png 1272w, https://substackcdn.com/image/fetch/$s_!dv2Q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6490c506-82a7-40ae-bd7e-124320389ae6_1512x1422.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>We are gonna use a rolling window to bet with Kelly and hopefully adapt to the changing regimes:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oMPV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52447be4-e564-4e78-b81b-7b036cd5be33_1378x864.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oMPV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52447be4-e564-4e78-b81b-7b036cd5be33_1378x864.png 424w, https://substackcdn.com/image/fetch/$s_!oMPV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52447be4-e564-4e78-b81b-7b036cd5be33_1378x864.png 848w, https://substackcdn.com/image/fetch/$s_!oMPV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52447be4-e564-4e78-b81b-7b036cd5be33_1378x864.png 1272w, https://substackcdn.com/image/fetch/$s_!oMPV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52447be4-e564-4e78-b81b-7b036cd5be33_1378x864.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oMPV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52447be4-e564-4e78-b81b-7b036cd5be33_1378x864.png" width="1378" height="864" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/52447be4-e564-4e78-b81b-7b036cd5be33_1378x864.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:864,&quot;width&quot;:1378,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:162623,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52447be4-e564-4e78-b81b-7b036cd5be33_1378x864.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!oMPV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52447be4-e564-4e78-b81b-7b036cd5be33_1378x864.png 424w, https://substackcdn.com/image/fetch/$s_!oMPV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52447be4-e564-4e78-b81b-7b036cd5be33_1378x864.png 848w, https://substackcdn.com/image/fetch/$s_!oMPV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52447be4-e564-4e78-b81b-7b036cd5be33_1378x864.png 1272w, https://substackcdn.com/image/fetch/$s_!oMPV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52447be4-e564-4e78-b81b-7b036cd5be33_1378x864.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>Let&#8217;s test out 3 different strategies now:</p><ol><li><p>A crystal ball that knows what regime we are in and knows all the true probabilities to bet optimally using Kelly.</p></li><li><p>Our rolling Kelly.</p></li><li><p>Play a couple of warm-up games and then play with fixed Kelly.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7L3I!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15cade98-9612-4861-97ce-6ee6a44048f6_1630x2614.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7L3I!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15cade98-9612-4861-97ce-6ee6a44048f6_1630x2614.png 424w, https://substackcdn.com/image/fetch/$s_!7L3I!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15cade98-9612-4861-97ce-6ee6a44048f6_1630x2614.png 848w, https://substackcdn.com/image/fetch/$s_!7L3I!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15cade98-9612-4861-97ce-6ee6a44048f6_1630x2614.png 1272w, https://substackcdn.com/image/fetch/$s_!7L3I!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15cade98-9612-4861-97ce-6ee6a44048f6_1630x2614.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7L3I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15cade98-9612-4861-97ce-6ee6a44048f6_1630x2614.png" width="1456" height="2335" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/15cade98-9612-4861-97ce-6ee6a44048f6_1630x2614.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2335,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:620156,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15cade98-9612-4861-97ce-6ee6a44048f6_1630x2614.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!7L3I!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15cade98-9612-4861-97ce-6ee6a44048f6_1630x2614.png 424w, https://substackcdn.com/image/fetch/$s_!7L3I!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15cade98-9612-4861-97ce-6ee6a44048f6_1630x2614.png 848w, https://substackcdn.com/image/fetch/$s_!7L3I!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15cade98-9612-4861-97ce-6ee6a44048f6_1630x2614.png 1272w, https://substackcdn.com/image/fetch/$s_!7L3I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15cade98-9612-4861-97ce-6ee6a44048f6_1630x2614.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_!hNzs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5394669-f4d2-4b4d-b0ae-0ba80a4cec50_646x546.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hNzs!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5394669-f4d2-4b4d-b0ae-0ba80a4cec50_646x546.png 424w, https://substackcdn.com/image/fetch/$s_!hNzs!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5394669-f4d2-4b4d-b0ae-0ba80a4cec50_646x546.png 848w, https://substackcdn.com/image/fetch/$s_!hNzs!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5394669-f4d2-4b4d-b0ae-0ba80a4cec50_646x546.png 1272w, https://substackcdn.com/image/fetch/$s_!hNzs!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5394669-f4d2-4b4d-b0ae-0ba80a4cec50_646x546.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hNzs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5394669-f4d2-4b4d-b0ae-0ba80a4cec50_646x546.png" width="646" height="546" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d5394669-f4d2-4b4d-b0ae-0ba80a4cec50_646x546.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:546,&quot;width&quot;:646,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:67871,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/182041088?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5394669-f4d2-4b4d-b0ae-0ba80a4cec50_646x546.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!hNzs!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5394669-f4d2-4b4d-b0ae-0ba80a4cec50_646x546.png 424w, https://substackcdn.com/image/fetch/$s_!hNzs!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5394669-f4d2-4b4d-b0ae-0ba80a4cec50_646x546.png 848w, https://substackcdn.com/image/fetch/$s_!hNzs!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5394669-f4d2-4b4d-b0ae-0ba80a4cec50_646x546.png 1272w, https://substackcdn.com/image/fetch/$s_!hNzs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5394669-f4d2-4b4d-b0ae-0ba80a4cec50_646x546.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><hr></div><h2><strong>Final Remarks &#8212; </strong><em>Final Remarks and Discord</em></h2><p>Thanks to the amazing support of our premium readers, we are able to release an article for free from time to time. <br>If you wish to unlock over <strong>50 premium articles</strong> like this one, as well as <strong>3 articles per month</strong>, consider supporting us as well!</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.vertoxquant.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">VertoxQuant is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</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>Discord: <a href="https://discord.gg/X7TsxKNbXg">https://discord.gg/X7TsxKNbXg</a></p>]]></content:encoded></item><item><title><![CDATA[Your favorite Quant articles are now easier to access!]]></title><description><![CDATA[Now only $29.90/month (previously $39.90/month)]]></description><link>https://www.vertoxquant.com/p/your-favorite-quant-articles-are</link><guid isPermaLink="false">https://www.vertoxquant.com/p/your-favorite-quant-articles-are</guid><dc:creator><![CDATA[Vertox]]></dc:creator><pubDate>Fri, 05 Dec 2025 05:59:44 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ufaQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Thanks to growing demand and expansion of the team, we can now offer our premium plan at a lower price. </p><h4>What You Get: </h4><ul><li><p>Full access to 54 premium articles, all significantly longer and more detailed than the 21 free articles.</p></li><li><p>3 new premium deep-dives every month covering high-frequency trading, market making, options, funding-arbitrage, and more.</p></li><li><p>Access to the Premium section of the Discord server.</p></li><li><p>Entry into exclusive giveaways (we recently gave away a brand-new copy of The Elements of Quantitative Investing).</p></li></ul><h4> What subscribers are saying:</h4><ul><li><p> &#8221;Hey thanks for sharing on twitter, subbed to your substack! You content has been extremely valuable and appreciate your work much.&#8221;</p></li><li><p>&#8221;Alot of your writing directly helps with my job!&#8221;</p></li><li><p>&#8221;It&#8217;s clear, concise and to the point.&#8221;</p></li></ul><p><strong>Now only $29.90/month</strong> <em>(previously $39.90/month)</em>:</p><p><a href="https://www.vertoxquant.com/subscribe">https://www.vertoxquant.com/subscribe</a></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3vvg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1f40079-ac25-4bde-9a33-9d939691513f_891x920.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3vvg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1f40079-ac25-4bde-9a33-9d939691513f_891x920.png 424w, https://substackcdn.com/image/fetch/$s_!3vvg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1f40079-ac25-4bde-9a33-9d939691513f_891x920.png 848w, https://substackcdn.com/image/fetch/$s_!3vvg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1f40079-ac25-4bde-9a33-9d939691513f_891x920.png 1272w, https://substackcdn.com/image/fetch/$s_!3vvg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1f40079-ac25-4bde-9a33-9d939691513f_891x920.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3vvg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1f40079-ac25-4bde-9a33-9d939691513f_891x920.png" width="891" height="920" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b1f40079-ac25-4bde-9a33-9d939691513f_891x920.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:920,&quot;width&quot;:891,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:186148,&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.vertoxquant.com/i/180772988?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1f40079-ac25-4bde-9a33-9d939691513f_891x920.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!3vvg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1f40079-ac25-4bde-9a33-9d939691513f_891x920.png 424w, https://substackcdn.com/image/fetch/$s_!3vvg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1f40079-ac25-4bde-9a33-9d939691513f_891x920.png 848w, https://substackcdn.com/image/fetch/$s_!3vvg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1f40079-ac25-4bde-9a33-9d939691513f_891x920.png 1272w, https://substackcdn.com/image/fetch/$s_!3vvg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1f40079-ac25-4bde-9a33-9d939691513f_891x920.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>]]></content:encoded></item><item><title><![CDATA[How to Model Order-Flow in HFT]]></title><description><![CDATA[Using point processes to model order-flow in high frequency trading.]]></description><link>https://www.vertoxquant.com/p/how-to-model-order-flow-in-hft</link><guid isPermaLink="false">https://www.vertoxquant.com/p/how-to-model-order-flow-in-hft</guid><dc:creator><![CDATA[Vertox]]></dc:creator><pubDate>Thu, 04 Dec 2025 11:48:17 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!xfu7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7cb3a04-a38e-4159-a56e-d422b56d4b23_1243x853.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>What do trades, earthquakes, and social media have in common?</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!BMQP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73ea2d76-6c33-43ce-8715-0aaf5e446638_1212x507.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BMQP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73ea2d76-6c33-43ce-8715-0aaf5e446638_1212x507.png 424w, https://substackcdn.com/image/fetch/$s_!BMQP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73ea2d76-6c33-43ce-8715-0aaf5e446638_1212x507.png 848w, https://substackcdn.com/image/fetch/$s_!BMQP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73ea2d76-6c33-43ce-8715-0aaf5e446638_1212x507.png 1272w, https://substackcdn.com/image/fetch/$s_!BMQP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73ea2d76-6c33-43ce-8715-0aaf5e446638_1212x507.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BMQP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73ea2d76-6c33-43ce-8715-0aaf5e446638_1212x507.png" width="1212" height="507" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/73ea2d76-6c33-43ce-8715-0aaf5e446638_1212x507.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:507,&quot;width&quot;:1212,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:83729,&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.vertoxquant.com/i/180594717?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73ea2d76-6c33-43ce-8715-0aaf5e446638_1212x507.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!BMQP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73ea2d76-6c33-43ce-8715-0aaf5e446638_1212x507.png 424w, https://substackcdn.com/image/fetch/$s_!BMQP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73ea2d76-6c33-43ce-8715-0aaf5e446638_1212x507.png 848w, https://substackcdn.com/image/fetch/$s_!BMQP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73ea2d76-6c33-43ce-8715-0aaf5e446638_1212x507.png 1272w, https://substackcdn.com/image/fetch/$s_!BMQP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73ea2d76-6c33-43ce-8715-0aaf5e446638_1212x507.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>At first glance, a trade executing on Binance, an earthquake rupturing along a fault line, and a cat video going viral seem to have nothing in common. Yet they all have one important characteristic: <strong>They cluster in time!</strong></p><p>When an earthquake occurs, the aftershocks that follow can last for days or weeks. When a tweet gains traction, retweets create more traction, causing even more retweets! And when a large trade executes in a financial market, it doesn&#8217;t occur in isolation; You have copy and momentum traders that flock in. Algorithmic order execution creates lots of smaller trades that happen in bursts, and so on.</p><p>In this article, we will be exploring models that are able to capture those phenomena and use them to model order-flow, a very important metric to keep an eye on in high-frequency trading!</p><h4><strong>Full Code available at the End!</strong></h4><div><hr></div><h2>Table of Contents</h2><ol><li><p>Point Process &#8212; <em>The Mathematics of Random Events</em></p></li><li><p>Poisson Process &#8212; <em>Why the Textbook Model Fails</em></p></li><li><p>Poisson-GLM and Binned Intensities &#8212;<em> Smarter Order-Flow Model</em></p></li><li><p>Hawkes Process &#8212; <em>When Past Trades Trigger Future Trades</em></p></li><li><p>Multivariate Hawkes Process &#8212; <em>How Buys Excite Sells (and Vice Versa)</em></p></li><li><p>Extensions and Conclusion &#8212; Extensions, <em>Final Remarks and Discord</em></p></li></ol><div><hr></div><h2>Point Process &#8212; <em>The Mathematics of Random Events</em></h2><p>At its core, a point process is a random collection of points in some space, in our case, time. A point process in space could be where a raindrop hits the ground, for example. When modelling Order-Flow, each event happens at a specific time, and the pattern of these occurrences is random rather than deterministic. </p><p>Formally, a point process N on a space S is a random countable collection of points. For any measurable set A &#8838; S, the quantity N(A) represents the (random) number of points falling within A.</p><h3>Counting Process Representation</h3><p>When working with point processes in time (S = [0, &#8734;)), we often use the <strong>counting process representation</strong>. Define N(t) as the number of events that have occurred in the interval [0, t]:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;N(t) = \\sum_{i=1}^{\\infty} 1_{\\{T_i \\leq t\\}}&quot;,&quot;id&quot;:&quot;MMGKOAULTR&quot;}" data-component-name="LatexBlockToDOM"></div><p>where T_1, T_2, &#8230; are random arrival times of events with 0 &lt; T_1 &lt; T_2 &lt; &#8230;.<br>The function N(t) is non-decreasing, right-continuous, and takes integer values, jumping by 1 at each arrival time.</p><p>Here is one example of a realisation of a point process and the corresponding counting process representation:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Wk0u!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a4e96fc-7309-4ad4-8ae7-155eee43fd89_989x590.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Wk0u!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a4e96fc-7309-4ad4-8ae7-155eee43fd89_989x590.png 424w, https://substackcdn.com/image/fetch/$s_!Wk0u!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a4e96fc-7309-4ad4-8ae7-155eee43fd89_989x590.png 848w, https://substackcdn.com/image/fetch/$s_!Wk0u!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a4e96fc-7309-4ad4-8ae7-155eee43fd89_989x590.png 1272w, https://substackcdn.com/image/fetch/$s_!Wk0u!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a4e96fc-7309-4ad4-8ae7-155eee43fd89_989x590.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Wk0u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a4e96fc-7309-4ad4-8ae7-155eee43fd89_989x590.png" width="989" height="590" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3a4e96fc-7309-4ad4-8ae7-155eee43fd89_989x590.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:590,&quot;width&quot;:989,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:32190,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/180594717?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a4e96fc-7309-4ad4-8ae7-155eee43fd89_989x590.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Wk0u!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a4e96fc-7309-4ad4-8ae7-155eee43fd89_989x590.png 424w, https://substackcdn.com/image/fetch/$s_!Wk0u!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a4e96fc-7309-4ad4-8ae7-155eee43fd89_989x590.png 848w, https://substackcdn.com/image/fetch/$s_!Wk0u!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a4e96fc-7309-4ad4-8ae7-155eee43fd89_989x590.png 1272w, https://substackcdn.com/image/fetch/$s_!Wk0u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a4e96fc-7309-4ad4-8ae7-155eee43fd89_989x590.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>Key Characteristics</h3><p>There are several quantities that characterise the behaviour of a point process. Consider, for example, the following 2 point process realisations:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jvj1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83bce0f0-1cbe-48c9-90de-ef55a77cb9aa_989x590.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jvj1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83bce0f0-1cbe-48c9-90de-ef55a77cb9aa_989x590.png 424w, https://substackcdn.com/image/fetch/$s_!jvj1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83bce0f0-1cbe-48c9-90de-ef55a77cb9aa_989x590.png 848w, https://substackcdn.com/image/fetch/$s_!jvj1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83bce0f0-1cbe-48c9-90de-ef55a77cb9aa_989x590.png 1272w, https://substackcdn.com/image/fetch/$s_!jvj1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83bce0f0-1cbe-48c9-90de-ef55a77cb9aa_989x590.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jvj1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83bce0f0-1cbe-48c9-90de-ef55a77cb9aa_989x590.png" width="989" height="590" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/83bce0f0-1cbe-48c9-90de-ef55a77cb9aa_989x590.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:590,&quot;width&quot;:989,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:43997,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vertoxquant.com/i/180594717?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83bce0f0-1cbe-48c9-90de-ef55a77cb9aa_989x590.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!jvj1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83bce0f0-1cbe-48c9-90de-ef55a77cb9aa_989x590.png 424w, https://substackcdn.com/image/fetch/$s_!jvj1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83bce0f0-1cbe-48c9-90de-ef55a77cb9aa_989x590.png 848w, https://substackcdn.com/image/fetch/$s_!jvj1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83bce0f0-1cbe-48c9-90de-ef55a77cb9aa_989x590.png 1272w, https://substackcdn.com/image/fetch/$s_!jvj1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83bce0f0-1cbe-48c9-90de-ef55a77cb9aa_989x590.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>Right off the bat, you can tell that the second one seems to be more <strong>intense, </strong>whatever that means.</p><p>The so-called <strong>intensity function</strong> described the instantaneous rate at which events occur:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\lambda(t) = \\lim_{\\Delta t \\to 0} \\frac{E[N(t+ \\Delta t) - N(t)]}{\\Delta t}&quot;,&quot;id&quot;:&quot;VFLBRJVFQU&quot;}" data-component-name="LatexBlockToDOM"></div><p>This captures the expected number of events per unit time in an infinitesimal interval after t. For many point processes, we can write the expected number of points in an interval [a,b] as:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;E[N(b)-N(a)] = \\int_a^b\\lambda(s)ds&quot;,&quot;id&quot;:&quot;SCPEJFSIMX&quot;}" data-component-name="LatexBlockToDOM"></div><p>The <strong>conditional intensity </strong>provides even more information by incorporating the history of the process up to time t:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\lambda(t|\\mathcal{F}_t) = \\lim_{\\Delta t \\to 0} \\frac{\\mathbb{P}(N(t+\\Delta t) - N(t) = 1 | \\mathcal{F}_t)}{\\Delta t}&quot;,&quot;id&quot;:&quot;NPJNNQAXQY&quot;}" data-component-name="LatexBlockToDOM"></div><p>with respect to a filtration F_t. You can imagine F_t as the history of events preceding time t. If you need to catch up on filtrations, I recommend that you check out the following article:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;fc396c39-378b-4364-84b8-1b4aafece81d&quot;,&quot;caption&quot;:&quot;An options contract gives the buyer the right to buy or sell (call or put) the underlying asset at an agreed upon price and time.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Option Pricing Basics&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:128680675,&quot;name&quot;:&quot;Vertox&quot;,&quot;bio&quot;:&quot;Quantitative Researcher in Digital Asset Markets | Market Making | Statistical Arbitrage | Options &quot;,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!HGUA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bf3fd86-d46a-4caa-969a-d80059b72cb9_128x128.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2025-04-25T23:15:24.078Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59ceed79-b3e8-47d4-b6c5-19eaaef87b43_825x429.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.vertoxquant.com/p/option-pricing-basics&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:162092496,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:9,&quot;comment_count&quot;:0,&quot;publication_id&quot;:1726874,&quot;publication_name&quot;:&quot;VertoxQuant&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!ufaQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>I explain Filtrations intuitively there.</p>
      <p>
          <a href="https://www.vertoxquant.com/p/how-to-model-order-flow-in-hft">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Pricing Illiquid Options Using Proxy Volatility Surfaces]]></title><description><![CDATA[Pricing Options on Altcoins using BTC and ETH.]]></description><link>https://www.vertoxquant.com/p/pricing-illiquid-options-using-proxy</link><guid isPermaLink="false">https://www.vertoxquant.com/p/pricing-illiquid-options-using-proxy</guid><dc:creator><![CDATA[Vertox]]></dc:creator><pubDate>Mon, 24 Nov 2025 15:22:01 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!4QV3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdafc2860-f4ed-4f90-8d4f-2e445bc10721_1189x790.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the previous article, we talked about how you can figure out the fair price of a polymarket bet using the options market of the underlying.</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;e22e1d56-35c0-44dc-813d-3cbdc8faaf8b&quot;,&quot;caption&quot;:&quot;&#8220;What price will Bitcoin hit in November?&#8221;. This is one of many markets on Polymarket that allows you to speculate on the price of Cryptocurrencies.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;md&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;How to Price Touch-Style Options (Polymarket)&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:128680675,&quot;name&quot;:&quot;Vertox&quot;,&quot;bio&quot;:&quot;Quantitative Researcher in Digital Asset Markets | Market Making | Statistical Arbitrage | Options &quot;,&quot;photo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!HGUA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bf3fd86-d46a-4caa-969a-d80059b72cb9_128x128.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2025-11-16T11:47:27.469Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!b0Jc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb83a77e-44b7-412c-90df-0596f3055eb4_1011x911.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.vertoxquant.com/p/how-to-price-touch-style-options&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:178891025,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:23,&quot;comment_count&quot;:0,&quot;publication_id&quot;:1726874,&quot;publication_name&quot;:&quot;VertoxQuant&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!ufaQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fb77b39-424b-4665-b2a7-7db519ff9e11_128x128.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>This is fine if you are working with BTC and ETH, but what do you do if you want to bet on a coin like SOL, XRP, or DOGE that doesn&#8217;t have a liquid options market?</p><p>We will be covering the answer to that in this article!</p><div><hr></div><h2>Table of Contents</h2><ol><li><p>Project Structure</p></li><li><p>Pricing Model</p></li><li><p>Data Gathering</p></li><li><p>SSVI Model</p></li><li><p>Cross-Asset Statistics</p></li><li><p>Baseline Proxy Model</p></li><li><p>Behaviour-Aware Proxy Model</p></li><li><p>Conclusion</p></li></ol><div><hr></div><h2>Project Structure</h2><p>The project structure looks as follows:</p><pre><code>project/
&#9474;
&#9500;&#9472;&#9472; notebook.ipynb
&#9474;
&#9492;&#9472;&#9472; src/
    &#9500;&#9472;&#9472; analysis/
    &#9474;   &#9492;&#9472;&#9472; factors.py
    &#9474;
    &#9500;&#9472;&#9472; data/
    &#9474;   &#9492;&#9472;&#9472; loader.py
    &#9474;
    &#9500;&#9472;&#9472; models/
    &#9474;   &#9492;&#9472;&#9472; proxy.py
    &#9474;
    &#9492;&#9472;&#9472; numerics/
        &#9500;&#9472;&#9472; black.py
        &#9492;&#9472;&#9472; ssvi.py</code></pre><h3>factors.py:</h3><p>Contains all the functions necessary to compute betas of returns and factors of a volatility surface.</p><h3>loader.py:</h3><p>Handles data gathering from Deribit using CCXT.</p><h3>proxy.py:</h3><p>Contains the proxy model that allows us to map the IV surface of a liquid coin like BTC or ETH, to an altcoin.</p><h3>black.py:</h3><p>Contains the pricing model and functions for computing Greeks and implied volatilities.</p><h3>ssvi.py:</h3><p>Contains all the functions for representing and fitting volatility surfaces using SSVI as well as checking for no-arbitrage conditions.</p><h3>notebook.ipynb</h3><p>Wraps everything together in a structured way, following this article.</p><div><hr></div><h2>Pricing Model</h2>
      <p>
          <a href="https://www.vertoxquant.com/p/pricing-illiquid-options-using-proxy">
              Read more
          </a>
      </p>
   ]]></content:encoded></item></channel></rss>