<?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[The Quant Stack: Pairs Wiki]]></title><description><![CDATA[All about pairs trading]]></description><link>https://www.algos.org/s/pairs-wiki</link><image><url>https://substackcdn.com/image/fetch/$s_!1nam!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d11d4ff-8ca9-48a4-b1d4-9d7cd609f7b2_391x391.png</url><title>The Quant Stack: Pairs Wiki</title><link>https://www.algos.org/s/pairs-wiki</link></image><generator>Substack</generator><lastBuildDate>Sat, 02 May 2026 01:08:13 GMT</lastBuildDate><atom:link href="https://www.algos.org/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Quant Arb]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[quantitativearb67@gmail.com]]></webMaster><itunes:owner><itunes:email><![CDATA[quantitativearb67@gmail.com]]></itunes:email><itunes:name><![CDATA[Quant Arb]]></itunes:name></itunes:owner><itunes:author><![CDATA[Quant Arb]]></itunes:author><googleplay:owner><![CDATA[quantitativearb67@gmail.com]]></googleplay:owner><googleplay:email><![CDATA[quantitativearb67@gmail.com]]></googleplay:email><googleplay:author><![CDATA[Quant Arb]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Pairs Trading Papers - Review]]></title><description><![CDATA[Resources, papers, and comments on pairs trading.]]></description><link>https://www.algos.org/p/pairs-trading-papers-review</link><guid isPermaLink="false">https://www.algos.org/p/pairs-trading-papers-review</guid><dc:creator><![CDATA[Quant Arb]]></dc:creator><pubDate>Sat, 11 Nov 2023 15:23:03 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!QRUo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F759282d6-780f-4f36-8427-b11cbb5c98a9_1280x1001.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QRUo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F759282d6-780f-4f36-8427-b11cbb5c98a9_1280x1001.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QRUo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F759282d6-780f-4f36-8427-b11cbb5c98a9_1280x1001.jpeg 424w, https://substackcdn.com/image/fetch/$s_!QRUo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F759282d6-780f-4f36-8427-b11cbb5c98a9_1280x1001.jpeg 848w, https://substackcdn.com/image/fetch/$s_!QRUo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F759282d6-780f-4f36-8427-b11cbb5c98a9_1280x1001.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!QRUo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F759282d6-780f-4f36-8427-b11cbb5c98a9_1280x1001.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QRUo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F759282d6-780f-4f36-8427-b11cbb5c98a9_1280x1001.jpeg" width="1280" height="1001" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/759282d6-780f-4f36-8427-b11cbb5c98a9_1280x1001.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1001,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:521306,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!QRUo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F759282d6-780f-4f36-8427-b11cbb5c98a9_1280x1001.jpeg 424w, https://substackcdn.com/image/fetch/$s_!QRUo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F759282d6-780f-4f36-8427-b11cbb5c98a9_1280x1001.jpeg 848w, https://substackcdn.com/image/fetch/$s_!QRUo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F759282d6-780f-4f36-8427-b11cbb5c98a9_1280x1001.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!QRUo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F759282d6-780f-4f36-8427-b11cbb5c98a9_1280x1001.jpeg 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><h4>Introduction</h4><div><hr></div><p>I&#8217;ve got quite a few organized papers on the topic, so I figured I&#8217;d share them today, and then do a bit of a literature review in terms of where I see the space.</p><p>It&#8217;s important to abstract away what pairs trading really is, and that&#8217;s just a way to find relationships between assets to price them. The prior article on lead-lag relationships is a distilled example of this but with a bit less hedging. In this case, we are saying that one will do all, or most of, the moving as opposed to convergence between the two equally. Convergence is what we focus on today, but of course, we can draw parallels to lead-lag and other areas because they are really all quite close.</p><p>If you enjoy this, feel free to subscribe. The subscriber number going up makes me write more content and you get the content I write delivered straight to you.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.algos.org/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">The Quant Stack 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>Here is a brief overview of our sections:</p><ol><li><p>Copulas</p></li><li><p>Optimization Based</p><ol><li><p>Multi-Objective Optimization</p></li><li><p>SDP</p></li><li><p>SMRP</p></li><li><p>Misc</p></li></ol></li><li><p>Bivariate</p></li><li><p>Multivariate</p></li><li><p>Lead-Lag (DTW, we focused on graph-based approaches in the last article so these papers are all Dynamic Time Warping)</p></li><li><p>OU / Stochastic Control</p></li><li><p>Regime Shift</p></li><li><p>Metrics</p></li><li><p>Cointegration</p></li><li><p>Math Reading</p></li><li><p>HFT Pairs</p></li><li><p>Clustering &amp; Pre-Selection</p></li><li><p>Misc</p></li><li><p>Notes from me</p></li></ol><p></p><p>Please remember that this is simply a write-up of maybe 100 or so papers from my paper archive. There are thousands of papers in this folder that I&#8217;ve pulled from so I shall try my best here, but papers may be misplaced.</p><p></p><h4>Copulas</h4><div><hr></div><p>Copulas are simply a model for expressing a relationship between two assets. There are roughly 3 areas where copulas exist in the literature:</p><ol><li><p>Low Dimension</p></li><li><p>High Dimension</p></li><li><p>Vine Copulas</p></li></ol><p>The lower dimension copulas are the ones you&#8217;ll read about in most popular papers. It&#8217;s generally seen as a dead approach, but there is often alpha in doing simple things well so I wouldn&#8217;t say it&#8217;s worth skipping entirely. Simpler markets where you optimize txn costs certainly could see this prevail, but there are also more advanced methods in the literature now.</p><p>Higher dimensional copulas are great for performance and certainly represent an improvement by allowing us to incorporate more assets. Sadly, the assumptions are often a bit too rigid as we go up in dimension.</p><p>Vine copulas are the solution we need for higher dimensions and are the most cutting-edge niche in the field of copulas. </p><p>There&#8217;s also some interesting work I did on using Kernel copulas, but I never finished that paper and it kind of became a rabbit hole so we won&#8217;t go into that. Math is hard kids. Do check out the topic though in your own time - it was fun.</p><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Copula Ar Model</div><div class="file-embed-details-h2">742KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/6d328211-a452-45dd-a931-b6c9be34ed8c.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/6d328211-a452-45dd-a931-b6c9be34ed8c.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Analyzing Dependent Data With Vine Copulas A Practical Guide With R By Claudia Czado (z Lib</div><div class="file-embed-details-h2">8.36MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/d05045c6-f849-458c-b3cb-bdfd23defd80.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/d05045c6-f849-458c-b3cb-bdfd23defd80.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Dvinecopula Quantileregression</div><div class="file-embed-details-h2">807KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/864308dd-c188-4955-beac-728f4ab311ff.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/864308dd-c188-4955-beac-728f4ab311ff.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Cvines Maxlikelihood Fxrates</div><div class="file-embed-details-h2">600KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/7866d10a-13d1-420e-be46-cc73f1b9ef68.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/7866d10a-13d1-420e-be46-cc73f1b9ef68.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Dependencemodelling Vinecopulahandbook</div><div class="file-embed-details-h2">4.35MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/89342142-46b9-4041-a41b-3a24461fba4c.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/89342142-46b9-4041-a41b-3a24461fba4c.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Oilhedging Canoncialvinecopulas</div><div class="file-embed-details-h2">1.97MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/0485fca3-6fd5-4a08-a68c-f691d3ade290.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/0485fca3-6fd5-4a08-a68c-f691d3ade290.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Mixture Dvinecopulas Dependencemodelling</div><div class="file-embed-details-h2">2.71MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/4f831e9f-024a-4f8c-a26d-3a6c06be259b.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/4f831e9f-024a-4f8c-a26d-3a6c06be259b.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Rainfall Copula Stochastic</div><div class="file-embed-details-h2">7.72MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/8d269dc7-8376-4dea-9fc6-e4d9d432092e.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/8d269dc7-8376-4dea-9fc6-e4d9d432092e.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Regularvinecopulaefinancialapplications</div><div class="file-embed-details-h2">456KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/207d8fc2-5a56-4512-8147-61bcc8a655f9.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/207d8fc2-5a56-4512-8147-61bcc8a655f9.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Regularvinecopula Financialapplications</div><div class="file-embed-details-h2">456KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/332ea907-391f-4979-b670-1e660a0321d2.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/332ea907-391f-4979-b670-1e660a0321d2.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Simulating Copulas Stochastic Models, Sampling Algorithms, And Applications By Jan Frederik Mai, Matthias Scherer (z Lib</div><div class="file-embed-details-h2">6.81MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/a92bae8e-51b6-44a1-900f-c70d494772dd.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/a92bae8e-51b6-44a1-900f-c70d494772dd.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Statarb Vinecopulas</div><div class="file-embed-details-h2">767KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/90ccfa39-07f9-49f7-afd7-f668b858a2f5.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/90ccfa39-07f9-49f7-afd7-f668b858a2f5.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Vinecopulastrucationgoodnessoffit</div><div class="file-embed-details-h2">632KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/bed87f16-b3fe-43f0-bd03-513497257ae7.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/bed87f16-b3fe-43f0-bd03-513497257ae7.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Vinecopulas Statarb</div><div class="file-embed-details-h2">767KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/c8ccc334-11ab-46ca-a072-f2137d65fe4c.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/c8ccc334-11ab-46ca-a072-f2137d65fe4c.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Var Dvinecopula Garch Multivariate</div><div class="file-embed-details-h2">1.11MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/d7ffa180-168c-4ca6-991d-e88ebbe3c326.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/d7ffa180-168c-4ca6-991d-e88ebbe3c326.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Vine Copula Autoencoders</div><div class="file-embed-details-h2">9.68MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/7e1f8b6f-023c-4bc5-9e1d-930ad93a5255.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/7e1f8b6f-023c-4bc5-9e1d-930ad93a5255.pdf"><span class="file-embed-button-text">Download</span></a></div></div><p></p><h4>Optimization Based</h4><div><hr></div><p>As many of you will already know, I&#8217;ve written a LOT about this part of pairs trading on the research blog and I&#8217;ll link to past articles as well as papers here so I don&#8217;t end up repeating myself. There&#8217;s a ton of cool tricks and it&#8217;s great to be able to walk through the strategies with code and real examples, not just anecdotes from years of fucking around and finding out. </p><p>We have multi-objective-based optimization which is what the name says. We have SDP (Semi Definite Programming) which is a convex optimization method I&#8217;ve written a bit about / have shared code for in prior articles. There are SMRPs (Sparse Mean Reverting Portfolios) which I have spent a lot of time poking around in and even published a working strategy on it. We also have a nice misc section. Most of these I could explain again but you could also just read prior articles for a much better job instead of me skimming through it.</p><p>Starting with prior articles:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;3597ab36-1bf7-4398-8521-dbde92bc957b&quot;,&quot;caption&quot;:&quot;Introduction&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Pairs Trading Framework &amp; Process&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:101799233,&quot;name&quot;:&quot;Quant Arb&quot;,&quot;bio&quot;:&quot;Quantitative Researcher, Digital Assets, Ex-HF. \n\nTalking about:\nStatistical arbitrage, CTA, market making, execution, and other quant things.\n\n\&quot;Break the exchange or the exchange breaks you\&quot;&quot;,&quot;photo_url&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%2F10d4d395-b09b-48b8-aac1-ce630d78e864_400x400.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2023-03-23T03:28:33.709Z&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%2F3181420c-1609-4724-98aa-16e0368920f9_1076x449.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.algos.org/p/pairs-trading-framework-and-process&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:105663862,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:42,&quot;comment_count&quot;:0,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;The Quant Stack&quot;,&quot;publication_logo_url&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%2F10d4d395-b09b-48b8-aac1-ce630d78e864_400x400.jpeg&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;88f651ed-ebc0-4ace-81dc-28fde3e99e6c&quot;,&quot;caption&quot;:&quot;Introduction&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Thinking about stationarity the right way&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:101799233,&quot;name&quot;:&quot;Quant Arb&quot;,&quot;bio&quot;:&quot;Quantitative Researcher, Digital Assets, Ex-HF. \n\nTalking about:\nStatistical arbitrage, CTA, market making, execution, and other quant things.\n\n\&quot;Break the exchange or the exchange breaks you\&quot;&quot;,&quot;photo_url&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%2F10d4d395-b09b-48b8-aac1-ce630d78e864_400x400.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2023-06-23T05:49:52.683Z&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%2F5b28bd7d-57ca-4569-9dff-34012db68e12_903x362.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.algos.org/p/thinking-about-stationarity-the-right&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:127418146,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:7,&quot;comment_count&quot;:0,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;The Quant Stack&quot;,&quot;publication_logo_url&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%2F10d4d395-b09b-48b8-aac1-ce630d78e864_400x400.jpeg&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;8c0a73a3-73b8-4fb8-8bc5-b33736c4cbc5&quot;,&quot;caption&quot;:&quot;Introduction In this article, we will go into detail about an equities strategy I built in 2020. This was traded live for a few months and delivered 30% returns on a 2.7 Sharpe (over about 4 months) until I stopped trading equities (crypto is more exciting).&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;A Real Pairs Trading Strategy&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:101799233,&quot;name&quot;:&quot;Quant Arb&quot;,&quot;bio&quot;:&quot;Quantitative Researcher, Digital Assets, Ex-HF. \n\nTalking about:\nStatistical arbitrage, CTA, market making, execution, and other quant things.\n\n\&quot;Break the exchange or the exchange breaks you\&quot;&quot;,&quot;photo_url&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%2F10d4d395-b09b-48b8-aac1-ce630d78e864_400x400.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2023-06-11T05:35:16.398Z&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%2Ff09c99c9-f0bb-4eb1-bb7e-4580142721ab_958x720.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.algos.org/p/a-real-pairs-trading-strategy&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:127418559,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:22,&quot;comment_count&quot;:0,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;The Quant Stack&quot;,&quot;publication_logo_url&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%2F10d4d395-b09b-48b8-aac1-ce630d78e864_400x400.jpeg&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;062bc374-726f-47ba-a4a6-5e755a65ab01&quot;,&quot;caption&quot;:&quot;Introduction&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Greedy Method for SMRPs&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:101799233,&quot;name&quot;:&quot;Quant Arb&quot;,&quot;bio&quot;:&quot;Quantitative Researcher, Digital Assets, Ex-HF. \n\nTalking about:\nStatistical arbitrage, CTA, market making, execution, and other quant things.\n\n\&quot;Break the exchange or the exchange breaks you\&quot;&quot;,&quot;photo_url&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%2F10d4d395-b09b-48b8-aac1-ce630d78e864_400x400.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2023-03-20T22:33:36.956Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9ff4aed8-f760-4b69-ad38-4e14378a1d77_937x521.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.algos.org/p/greedy-method-for-smrps&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:106841114,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:5,&quot;comment_count&quot;:0,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;The Quant Stack&quot;,&quot;publication_logo_url&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%2F10d4d395-b09b-48b8-aac1-ce630d78e864_400x400.jpeg&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;c9592ad2-0f0b-4cd8-a3cb-2f89212058c4&quot;,&quot;caption&quot;:&quot;Introduction We recently explored the use of the Greedy algorithm for generating Sparse Mean Reverting Portfolios (SMRPs) using the Portmanteau criterion. In this article, we will expand a little on this method and look at 2 other metrics which take a slightly different perspective when optimizing. These two metrics are:&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Greedy Method for SMRPs (PART 2)&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:101799233,&quot;name&quot;:&quot;Quant Arb&quot;,&quot;bio&quot;:&quot;Quantitative Researcher, Digital Assets, Ex-HF. \n\nTalking about:\nStatistical arbitrage, CTA, market making, execution, and other quant things.\n\n\&quot;Break the exchange or the exchange breaks you\&quot;&quot;,&quot;photo_url&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%2F10d4d395-b09b-48b8-aac1-ce630d78e864_400x400.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2023-03-29T00:38:58.862Z&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%2Fae307152-4356-4258-a1d9-56982a761691_911x481.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.algos.org/p/greedy-method-for-smrps-part-2&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:110492742,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:4,&quot;comment_count&quot;:0,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;The Quant Stack&quot;,&quot;publication_logo_url&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%2F10d4d395-b09b-48b8-aac1-ce630d78e864_400x400.jpeg&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;e64dca19-4c69-49dd-8506-1d9fd5b57964&quot;,&quot;caption&quot;:&quot;Introduction We will be building off the previous article on non-sparse synthetic portfolios and look at the truncation method for generating sparse mean reverting portfolios. This is part of a 3 article series where we start with a non-sparse method and then climb into some heuristic approaches to sparsity. Our first heuristic approach is the truncation method. This is quite an easy method to understand so this should be a comfortable introduction; I&#8217;ll also be including code so that readers can follow along themselves.&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Truncation Method for SMRPs&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:101799233,&quot;name&quot;:&quot;Quant Arb&quot;,&quot;bio&quot;:&quot;Quantitative Researcher, Digital Assets, Ex-HF. \n\nTalking about:\nStatistical arbitrage, CTA, market making, execution, and other quant things.\n\n\&quot;Break the exchange or the exchange breaks you\&quot;&quot;,&quot;photo_url&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%2F10d4d395-b09b-48b8-aac1-ce630d78e864_400x400.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2023-03-16T02:40:10.889Z&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%2F2a754691-3b6c-4f2c-9d0a-d6d71f583723_989x472.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.algos.org/p/truncation-method-for-smrps&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:106841076,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:7,&quot;comment_count&quot;:0,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;The Quant Stack&quot;,&quot;publication_logo_url&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%2F10d4d395-b09b-48b8-aac1-ce630d78e864_400x400.jpeg&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;3e24e099-38c1-4916-ac7e-83a36610f880&quot;,&quot;caption&quot;:&quot;Introduction Building on previous articles in the area of synthetic portfolios, we will explore a convex method for building synthetic portfolios without introducing constraints like sparsity. In future research, we will look at 2 heuristic approaches that allow us to build on these methods and introduce sparsity constraints. In this article, we once again look at the portmanteau criterion as our chosen method for generating non-sparse synthetic portfolios. I won&#8217;t dive too much into the theory here since you can read up on that yourself (I&#8217;ll butcher it anyways), but I will walk through a code implementation of this. We do not produce any backtests or strategies here, but we do present a tool every quant should have.&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Non-Sparse Synthetic Portfolios&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:101799233,&quot;name&quot;:&quot;Quant Arb&quot;,&quot;bio&quot;:&quot;Quantitative Researcher, Digital Assets, Ex-HF. \n\nTalking about:\nStatistical arbitrage, CTA, market making, execution, and other quant things.\n\n\&quot;Break the exchange or the exchange breaks you\&quot;&quot;,&quot;photo_url&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%2F10d4d395-b09b-48b8-aac1-ce630d78e864_400x400.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2023-03-08T03:21:12.018Z&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%2Fab951e4d-5b86-4311-9bf3-ffda95f07390_912x466.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.algos.org/p/non-sparse-synthetic-portfolios&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:105702835,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:6,&quot;comment_count&quot;:0,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;The Quant Stack&quot;,&quot;publication_logo_url&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%2F10d4d395-b09b-48b8-aac1-ce630d78e864_400x400.jpeg&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;92baf2cc-ea96-4d2f-a602-27acfcbf5546&quot;,&quot;caption&quot;:&quot;Introduction&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Monte-Carlo Minimization for Synthetic Portfolios&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:101799233,&quot;name&quot;:&quot;Quant Arb&quot;,&quot;bio&quot;:&quot;Quantitative Researcher, Digital Assets, Ex-HF. \n\nTalking about:\nStatistical arbitrage, CTA, market making, execution, and other quant things.\n\n\&quot;Break the exchange or the exchange breaks you\&quot;&quot;,&quot;photo_url&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%2F10d4d395-b09b-48b8-aac1-ce630d78e864_400x400.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2023-02-10T07:19:41.040Z&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%2F475d1e3b-a1da-4026-a956-3f6918049585_1040x437.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.algos.org/p/monte-carlo-minimization-for-synthetic&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:101801801,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:16,&quot;comment_count&quot;:0,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;The Quant Stack&quot;,&quot;publication_logo_url&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%2F10d4d395-b09b-48b8-aac1-ce630d78e864_400x400.jpeg&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;7c5549bb-d5da-44e6-97f7-0d2a3aceef25&quot;,&quot;caption&quot;:&quot;Introduction In the previous research article, we explored the use of Monte-Carlo Minimization (MCM) as a non-convex method for finding mean-reverting portfolios. Here we will use Semi-Definite Programming (SDP) to form mean-reverting portfolios with 2 major constraints. These are variance and sparsity.&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Semi-Definite Programming For SMRPs&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:101799233,&quot;name&quot;:&quot;Quant Arb&quot;,&quot;bio&quot;:&quot;Quantitative Researcher, Digital Assets, Ex-HF. \n\nTalking about:\nStatistical arbitrage, CTA, market making, execution, and other quant things.\n\n\&quot;Break the exchange or the exchange breaks you\&quot;&quot;,&quot;photo_url&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%2F10d4d395-b09b-48b8-aac1-ce630d78e864_400x400.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2023-02-27T03:19:20.131Z&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%2F000a102a-3f87-41c9-923c-75112579db93_910x473.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.algos.org/p/semi-definite-programming-for-mrps&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:101801264,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:5,&quot;comment_count&quot;:0,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;The Quant Stack&quot;,&quot;publication_logo_url&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%2F10d4d395-b09b-48b8-aac1-ce630d78e864_400x400.jpeg&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>For the papers:</p><p><em>Multi-Objective:</em></p><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Boostingml Weaklycointegrated</div><div class="file-embed-details-h2">775KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/6cbbfeac-9687-4771-9a3e-057393bdcb13.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/6cbbfeac-9687-4771-9a3e-057393bdcb13.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Mean Variance Cardinality Evolutionary</div><div class="file-embed-details-h2">1MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/ba156116-71b7-4b42-ba18-15bae48f9b88.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/ba156116-71b7-4b42-ba18-15bae48f9b88.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Intelligentpairstradinggeneticalgorithm</div><div class="file-embed-details-h2">1.81MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/8d7e59ca-f1ad-40d2-bec7-45e0ca76fbe6.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/8d7e59ca-f1ad-40d2-bec7-45e0ca76fbe6.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Pairsgeneticalgo Intelligent</div><div class="file-embed-details-h2">1.81MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/2f944b16-c11e-4a72-92e6-d6d727a91baf.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/2f944b16-c11e-4a72-92e6-d6d727a91baf.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Evolutionary Pairs Multi Objective</div><div class="file-embed-details-h2">3.92MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/ac496acb-06dd-4199-84e9-e566a1670cb4.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/ac496acb-06dd-4199-84e9-e566a1670cb4.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Advancedoptimization Bollingerbands Correlation</div><div class="file-embed-details-h2">5.4MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/ca6fd4a5-6a79-4402-8ddd-cf951e00c956.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/ca6fd4a5-6a79-4402-8ddd-cf951e00c956.pdf"><span class="file-embed-button-text">Download</span></a></div></div><p><em>SDP:</em></p><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Mrp Variance Threshold Cuturi</div><div class="file-embed-details-h2">285KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/c591bad0-972c-43d7-8ff1-ea71774511c6.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/c591bad0-972c-43d7-8ff1-ea71774511c6.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Tradeoffsbetweensparsityandvol Sdp</div><div class="file-embed-details-h2">411KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/7272bb3e-20f7-4141-af9e-8907a6693a25.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/7272bb3e-20f7-4141-af9e-8907a6693a25.pdf"><span class="file-embed-button-text">Download</span></a></div></div><p><em>SMRP (HMM):</em></p><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Sparsemrp Ar Hmm</div><div class="file-embed-details-h2">645KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/3a54957f-dfa3-4aee-baba-3f738076adbc.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/3a54957f-dfa3-4aee-baba-3f738076adbc.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Ar Hmm Secondaryeffects Smrp</div><div class="file-embed-details-h2">645KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/1677066e-197e-4734-8879-384b080baad3.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/1677066e-197e-4734-8879-384b080baad3.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Parralell Ar Hmm Smrp</div><div class="file-embed-details-h2">1.12MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/d13921d1-0e6d-427c-8c7b-e76faced9c21.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/d13921d1-0e6d-427c-8c7b-e76faced9c21.pdf"><span class="file-embed-button-text">Download</span></a></div></div><p><em>SMRP Cont.</em></p><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">103 L1</div><div class="file-embed-details-h2">584KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/e80ee4d1-b193-49e4-8811-8a81897d9db0.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/e80ee4d1-b193-49e4-8811-8a81897d9db0.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Sparse&amp;fast Mrp</div><div class="file-embed-details-h2">471KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/ba1a3c05-f490-4b95-b3b3-e118574ca1ee.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/ba1a3c05-f490-4b95-b3b3-e118574ca1ee.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Novel Smrp 2022</div><div class="file-embed-details-h2">603KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/fb48bec4-4c5d-4274-9de2-3be747422c13.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/fb48bec4-4c5d-4274-9de2-3be747422c13.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Mrp Cyclical Coordinate Descent</div><div class="file-embed-details-h2">1.58MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/17c93eaf-928a-45be-913e-2c955d3f70ed.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/17c93eaf-928a-45be-913e-2c955d3f70ed.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Mean Reverting Portfolio With Budget Constraint</div><div class="file-embed-details-h2">2.1MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/6a5fa01f-d197-4164-a349-91cb0c77f65b.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/6a5fa01f-d197-4164-a349-91cb0c77f65b.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Optimizaingsmrp Nn Feedforward</div><div class="file-embed-details-h2">3.06MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/d9aece76-4711-42b9-b2ad-9de346db9952.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/d9aece76-4711-42b9-b2ad-9de346db9952.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Smrp Simulated Annealing</div><div class="file-embed-details-h2">826KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/729d2aed-a4ba-4034-935f-329519ea68f6.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/729d2aed-a4ba-4034-935f-329519ea68f6.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Sparsemrp Penalized Likelihood</div><div class="file-embed-details-h2">595KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/ca4b0096-27fc-459a-8ac6-d773a65607b0.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/ca4b0096-27fc-459a-8ac6-d773a65607b0.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Sipos Smrp</div><div class="file-embed-details-h2">1.84MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/dcf31a21-a020-4ac6-ad2b-82c647c9427d.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/dcf31a21-a020-4ac6-ad2b-82c647c9427d.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Smrp Full Algorithm System</div><div class="file-embed-details-h2">2.72MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/b96480e4-e997-4c25-8a1c-9c2bf501bea7.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/b96480e4-e997-4c25-8a1c-9c2bf501bea7.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Zhaozhoupalomar Tsp2019 Mrp Leverage</div><div class="file-embed-details-h2">4.46MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/d4762e2d-2c7e-4b10-8613-cd48f0525c75.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/d4762e2d-2c7e-4b10-8613-cd48f0525c75.pdf"><span class="file-embed-button-text">Download</span></a></div></div><p><em>Misc:</em></p><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Spca Smrp</div><div class="file-embed-details-h2">286KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/83dda861-b011-460d-af11-29c5dfb4ae1a.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/83dda861-b011-460d-af11-29c5dfb4ae1a.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Smrp Trading With Lstm</div><div class="file-embed-details-h2">1.28MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/34fa16b6-1c24-4f3a-9805-eceb8ae2fb18.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/34fa16b6-1c24-4f3a-9805-eceb8ae2fb18.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Mixedinteger Nn Solving</div><div class="file-embed-details-h2">4.81MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/ea76c3d2-b656-4d77-bf69-4cabd1e166bb.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/ea76c3d2-b656-4d77-bf69-4cabd1e166bb.pdf"><span class="file-embed-button-text">Download</span></a></div></div><p>Bear with me and maybe skip the neural networks. NNs were fun topics, but they never yielded much results (KISS - Keep it simple stupid).</p><p></p><h4>Bivariate</h4><div><hr></div><p>2 assets, 1 portfolio. Simple as that. Here goes:</p><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Aus Pairs Trading</div><div class="file-embed-details-h2">165KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/68b2fa77-1f1c-420d-8cc9-fc0653cd0ef2.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/68b2fa77-1f1c-420d-8cc9-fc0653cd0ef2.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Bivariateapproachpairs</div><div class="file-embed-details-h2">210KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/276c0cc6-152a-47a3-8920-80a06d59b259.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/276c0cc6-152a-47a3-8920-80a06d59b259.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Pairs Trading And Idiosyncratic Cash Flow Risk</div><div class="file-embed-details-h2">372KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/b17792ac-d06b-4da0-af69-7fffc4527627.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/b17792ac-d06b-4da0-af69-7fffc4527627.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Dynamicmodelling Mr Spreads Statarb</div><div class="file-embed-details-h2">507KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/510544e3-6a79-4fd8-ba6e-6c98ac4deba8.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/510544e3-6a79-4fd8-ba6e-6c98ac4deba8.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Pairs Relativevaluearbrule</div><div class="file-embed-details-h2">319KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/dd174ae7-52e5-443d-8167-0a32d64c19d1.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/dd174ae7-52e5-443d-8167-0a32d64c19d1.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Hmm Ica Pairs</div><div class="file-embed-details-h2">134KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/b6b0d1f2-d84a-4703-ab69-4fc87e0232d1.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/b6b0d1f2-d84a-4703-ab69-4fc87e0232d1.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Vecm Pairs Trading</div><div class="file-embed-details-h2">257KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/7ec57347-2d25-4439-b5c3-66c129d17f09.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/7ec57347-2d25-4439-b5c3-66c129d17f09.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Equitypairstrading</div><div class="file-embed-details-h2">769KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/deb450d2-5223-4b35-9b6f-10669ab91775.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/deb450d2-5223-4b35-9b6f-10669ab91775.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Pairstradinggeneralstatemodels</div><div class="file-embed-details-h2">1.23MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/9d8b8a86-af8b-454c-842f-2b881a0ade75.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/9d8b8a86-af8b-454c-842f-2b881a0ade75.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Pairstradingpptx Bivariate</div><div class="file-embed-details-h2">73.5KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/248692f5-d206-4f63-a7c6-589f3ac4ddd6.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/248692f5-d206-4f63-a7c6-589f3ac4ddd6.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Stochasticmodelling Cointegrated</div><div class="file-embed-details-h2">9.19MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/c64de005-5dcf-4e02-be91-8ad0f4ab9a5e.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/c64de005-5dcf-4e02-be91-8ad0f4ab9a5e.pdf"><span class="file-embed-button-text">Download</span></a></div></div><h4>Multivariate:</h4><div><hr></div><p>This has some interesting relations to the optimization section as well, but I did keep them separate since they generally appear to be two distinct literatures. A lot of the papers in this area tend to reference each other whilst the optimization section tends to reference others in that section. That said, they&#8217;re similar:</p><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Vmat Multi Pairs</div><div class="file-embed-details-h2">397KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/d04c2895-92e9-4221-8999-fd28aa452d07.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/d04c2895-92e9-4221-8999-fd28aa452d07.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Zhaozhouwangpalomar Ssp18 Mrp Portdesign</div><div class="file-embed-details-h2">1.01MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/52448fde-d23e-431d-9d79-3ac04f1e4d5c.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/52448fde-d23e-431d-9d79-3ac04f1e4d5c.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Multivariatepairstrading M Ofakind</div><div class="file-embed-details-h2">182KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/075e1eb2-374e-4729-87b5-e7d043adb302.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/075e1eb2-374e-4729-87b5-e7d043adb302.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Mpo Game Approach</div><div class="file-embed-details-h2">2.64MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/61c29bae-f2ab-40bd-b4aa-d839840da036.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/61c29bae-f2ab-40bd-b4aa-d839840da036.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Multi Pairs Statistical Learning</div><div class="file-embed-details-h2">2.63MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/71d4efe5-b49d-4631-b82e-06f13efa54bc.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/71d4efe5-b49d-4631-b82e-06f13efa54bc.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Statistical Arbitrage In The Us Equities Market</div><div class="file-embed-details-h2">3.03MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/64192eda-40b4-410b-8ef1-4a0691f24830.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/64192eda-40b4-410b-8ef1-4a0691f24830.pdf"><span class="file-embed-button-text">Download</span></a></div></div><h4>Lead-Lag (DTW)</h4><div><hr></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;d6d5fbe2-de77-42da-a984-89b97f538f86&quot;,&quot;caption&quot;:&quot;Introduction Lead-lag strategies are very well-known in the literature, and effects of this type can still be found across many timeframes. There are a few tricks of the trade when it comes to lead-lag that I&#8217;d like to explore + a bit of detail on the popular models behind lead-lag strategies.&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Strategy Discussion: Lead Lag&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:101799233,&quot;name&quot;:&quot;Quant Arb&quot;,&quot;bio&quot;:&quot;Quantitative Researcher, Digital Assets, Ex-HF. \n\nTalking about:\nStatistical arbitrage, CTA, market making, execution, and other quant things.\n\n\&quot;Break the exchange or the exchange breaks you\&quot;&quot;,&quot;photo_url&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%2F10d4d395-b09b-48b8-aac1-ce630d78e864_400x400.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2023-11-04T15:51:47.903Z&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%2Fc78bfbef-5c9f-4202-9dec-38f86cb0c3eb_795x604.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.algos.org/p/strategy-discussion-lead-lag&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:138508503,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:5,&quot;comment_count&quot;:0,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;The Quant Stack&quot;,&quot;publication_logo_url&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%2F10d4d395-b09b-48b8-aac1-ce630d78e864_400x400.jpeg&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>The above article gives quite a few papers on the subject, especially in the graph-based approaches but here are quite a few papers from my dive into DTW:</p><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Derivative Dtw</div><div class="file-embed-details-h2">146KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/a0b6c2a4-66a1-4dc0-9d23-5e20111e1f0b.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/a0b6c2a4-66a1-4dc0-9d23-5e20111e1f0b.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Temporallogicbasedmethods</div><div class="file-embed-details-h2">281KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/868c3464-a8b4-42eb-8862-2ecc04021e61.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/868c3464-a8b4-42eb-8862-2ecc04021e61.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Leadlag Indepth Fx</div><div class="file-embed-details-h2">649KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/03f22b11-4a3d-4aab-af5f-6877a6c2f413.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/03f22b11-4a3d-4aab-af5f-6877a6c2f413.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Symmetric Thermal Optimal Path And Timedependent Leadlag Relatio</div><div class="file-embed-details-h2">910KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/3b583d7d-faf8-40d4-bdd4-c2da63e6615a.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/3b583d7d-faf8-40d4-bdd4-c2da63e6615a.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Ftse100 Leadlag Intraday</div><div class="file-embed-details-h2">313KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/87ebdf08-922d-43a8-895d-f5842dabaf61.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/87ebdf08-922d-43a8-895d-f5842dabaf61.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Ftw</div><div class="file-embed-details-h2">263KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/c2119571-174a-4abd-841f-8c3aec1d51a0.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/c2119571-174a-4abd-841f-8c3aec1d51a0.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Non Parametric Optimalthermalcausalpath Zhou2006</div><div class="file-embed-details-h2">877KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/654f85b3-215b-43ca-ac18-55547ebd6296.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/654f85b3-215b-43ca-ac18-55547ebd6296.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Optimalcausalpath</div><div class="file-embed-details-h2">1.4MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/e8146a26-6d57-4026-a851-540db1394a1e.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/e8146a26-6d57-4026-a851-540db1394a1e.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Optimalthermalpath</div><div class="file-embed-details-h2">747KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/742d4064-486b-4160-b8b2-381bec1ab67e.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/742d4064-486b-4160-b8b2-381bec1ab67e.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Leadlagnetworks Dynamicpatterns</div><div class="file-embed-details-h2">1.72MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/fa660800-e48b-4762-80e8-0318038c3554.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/fa660800-e48b-4762-80e8-0318038c3554.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Evidence Dtw Covid Metals Relationship</div><div class="file-embed-details-h2">5.51MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/f08885eb-880f-4c3a-9a0c-cfe553ca7592.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/f08885eb-880f-4c3a-9a0c-cfe553ca7592.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Varyingleadlag Generalizecausalityalgorithm</div><div class="file-embed-details-h2">11.1MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/c02283b6-a390-4b42-ac56-59203b413741.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/c02283b6-a390-4b42-ac56-59203b413741.pdf"><span class="file-embed-button-text">Download</span></a></div></div><p></p><h4>OU / Stochastic Control</h4><div><hr></div><p>Some people seem to really enjoy this area, maybe it is the math, but I always found that it was too conservative and the assumptions were too rigid to work well in practice. Bollinger bands for the win imo. That said, you can find some very well-behaved spreads, closer to the pure arb part of the trade that this applies well to so I think it&#8217;s worth learning:</p><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Analytical Solutions For Optimal Statistical Arbitrage Trading</div><div class="file-embed-details-h2">348KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/067d0088-1ae9-47fc-9fbc-11d3150b1082.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/067d0088-1ae9-47fc-9fbc-11d3150b1082.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Pairs Trading Optimal Thresholds And Profitability</div><div class="file-embed-details-h2">535KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/266905ba-0984-45dd-90f3-55542d4d2efb.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/266905ba-0984-45dd-90f3-55542d4d2efb.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Finding The Optimal Pre Set Boundaries For Pairs Trading Strategy</div><div class="file-embed-details-h2">245KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/582cd9ca-0c8a-40e8-9a57-25d95fdb751d.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/582cd9ca-0c8a-40e8-9a57-25d95fdb751d.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Optimal Pairs Stochcontrol</div><div class="file-embed-details-h2">506KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/fa202e9f-cfd5-4dbb-b8f2-6912d1100f40.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/fa202e9f-cfd5-4dbb-b8f2-6912d1100f40.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Pairstrading Spread Variability</div><div class="file-embed-details-h2">614KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/5c86e8bd-e9a6-44dc-8938-6b865570db34.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/5c86e8bd-e9a6-44dc-8938-6b865570db34.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Bertramspairs Boundedrisk</div><div class="file-embed-details-h2">1.11MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/6fc31030-3bec-4719-9c89-4a83af5c53fb.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/6fc31030-3bec-4719-9c89-4a83af5c53fb.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Optimalmrp Stoploss Transactioncosts</div><div class="file-embed-details-h2">350KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/a18bf833-b0bb-4e1a-8991-0c6b5c3dc5a2.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/a18bf833-b0bb-4e1a-8991-0c6b5c3dc5a2.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Ou Dynamic Mean Variance</div><div class="file-embed-details-h2">737KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/9cf79ad2-6f7f-4ead-bdb6-c512b932bf34.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/9cf79ad2-6f7f-4ead-bdb6-c512b932bf34.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Ou Pairs</div><div class="file-embed-details-h2">317KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/9dcf7c58-27a0-414e-811e-91d49f84c2f7.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/9dcf7c58-27a0-414e-811e-91d49f84c2f7.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Optimalfastmrpstochastic</div><div class="file-embed-details-h2">396KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/ee9fac4f-5a7c-43d9-96ab-0c3006c651bf.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/ee9fac4f-5a7c-43d9-96ab-0c3006c651bf.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Optimaltradingstrats Levydriven Ou</div><div class="file-embed-details-h2">2.01MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/2c4b7899-d4b5-48f1-9fb2-f2e3c3d7770d.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/2c4b7899-d4b5-48f1-9fb2-f2e3c3d7770d.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Optimalportfoliomrp</div><div class="file-embed-details-h2">769KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/ccb7fea7-a1fa-41a5-aafc-59c305b751dc.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/ccb7fea7-a1fa-41a5-aafc-59c305b751dc.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Realtime Stochastic Portfoliooptimization</div><div class="file-embed-details-h2">2.99MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/2f4607d1-341b-421a-ad5b-73cdce82e1cb.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/2f4607d1-341b-421a-ad5b-73cdce82e1cb.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Multiasset Optimal Ou Pairs</div><div class="file-embed-details-h2">2.74MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/b799e26c-91f7-4967-9800-3a405cb7b6a1.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/b799e26c-91f7-4967-9800-3a405cb7b6a1.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Optimalmrp Textbook</div><div class="file-embed-details-h2">3.31MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/ad814023-281d-43d7-b003-4ee4b4e3455a.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/ad814023-281d-43d7-b003-4ee4b4e3455a.pdf"><span class="file-embed-button-text">Download</span></a></div></div><p></p><h4>Regime Shifts</h4><div><hr></div><p>Honestly, you can find simple proxy metrics that do the job just as well, but there is a bit of a literature. I&#8217;ve spent my time reading and testing these to know they don&#8217;t work that well so now hopefully you won&#8217;t need to either. This is a paper dump though so here they are:</p><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Statarbhmm Regimeshifting</div><div class="file-embed-details-h2">114KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/a7411bc2-bed0-45b3-bc9a-13ca4633608e.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/a7411bc2-bed0-45b3-bc9a-13ca4633608e.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Flexible Hft Regimeshift Pairs</div><div class="file-embed-details-h2">847KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/0a7224c5-0a4b-4e92-b55a-b821b41fcabe.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/0a7224c5-0a4b-4e92-b55a-b821b41fcabe.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Structuralbreakpairstrading</div><div class="file-embed-details-h2">2.69MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/f55d7d7f-c38c-4829-8996-fd5b02569744.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/f55d7d7f-c38c-4829-8996-fd5b02569744.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">A Machine Learning Approach To Regime Modeling Two Sigma Webpage Pdf</div><div class="file-embed-details-h2">3.7MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/6bb0e6ae-a6c8-4a11-89f1-369daab15fc1.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/6bb0e6ae-a6c8-4a11-89f1-369daab15fc1.pdf"><span class="file-embed-button-text">Download</span></a></div></div><p></p><h4>Metrics</h4><div><hr></div><p>I like this part a lot. It&#8217;s a fun area and thinking about what these metrics are truly describing is an integral part of the process when it comes to building good relationships between assets:</p><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Test For White Noise</div><div class="file-embed-details-h2">32.4KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/55ff938a-6528-4084-9c61-f57555642966.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/55ff938a-6528-4084-9c61-f57555642966.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">White Noise Tests</div><div class="file-embed-details-h2">179KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/d38bcde5-8618-4e3e-bd8c-3bc0328a7858.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/d38bcde5-8618-4e3e-bd8c-3bc0328a7858.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Crossingstat</div><div class="file-embed-details-h2">349KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/e871c2fd-98f9-425c-bb84-1db1ecc92ac1.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/e871c2fd-98f9-425c-bb84-1db1ecc92ac1.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Introducing Hurst Exponent In Pair Trading</div><div class="file-embed-details-h2">591KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/543759d2-95d7-40e0-b86e-a10d9266f596.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/543759d2-95d7-40e0-b86e-a10d9266f596.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">2 Stage Hurst Fast</div><div class="file-embed-details-h2">480KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/6a3008e5-e319-424a-b231-23d53d7ddbfb.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/6a3008e5-e319-424a-b231-23d53d7ddbfb.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Persistencebaseddecomposition</div><div class="file-embed-details-h2">456KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/0e1fdba3-605e-4f27-aecb-59c90772795d.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/0e1fdba3-605e-4f27-aecb-59c90772795d.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Fasthurst</div><div class="file-embed-details-h2">596KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/6570c594-8b33-4673-b949-f490599b1ab5.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/6570c594-8b33-4673-b949-f490599b1ab5.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">A Fast Estimation Algorithm On The Hurst Parameter</div><div class="file-embed-details-h2">501KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/55c29806-9ab9-42bd-a9c2-1ea19f22d073.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/55c29806-9ab9-42bd-a9c2-1ea19f22d073.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Pairs Persistencedecomposition</div><div class="file-embed-details-h2">227KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/062cd560-2fae-442c-ad8a-1e3ca96abedc.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/062cd560-2fae-442c-ad8a-1e3ca96abedc.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">A Cooperative Dynamic Approach To Pairs Trading</div><div class="file-embed-details-h2">2.79MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/f46d0fdc-c74f-4baa-bbbe-e58a2cc2585f.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/f46d0fdc-c74f-4baa-bbbe-e58a2cc2585f.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Statarb Multiasset Using Tsa</div><div class="file-embed-details-h2">1.09MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/0a42381f-f032-4c2b-8e0f-78a5c15f465f.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/0a42381f-f032-4c2b-8e0f-78a5c15f465f.pdf"><span class="file-embed-button-text">Download</span></a></div></div><p></p><h4>Cointegration</h4><div><hr></div><p>This is the one everyone knows. There are some interesting approaches to it that have come out recently but I think they&#8217;re still too close to what is a dead trade. We can do well finding underdeveloped markets / fundamentally robust pairs and using these methods, but there&#8217;s a lot more thought that goes into it:</p><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Kalman Pairs Statarb</div><div class="file-embed-details-h2">441KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/5608c2a9-ae38-4c42-9896-9501e5cdc410.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/5608c2a9-ae38-4c42-9896-9501e5cdc410.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Cointegration And Subset Correlation Hedging</div><div class="file-embed-details-h2">929KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/44fbe0a7-770e-4500-95b4-0751d4f370f9.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/44fbe0a7-770e-4500-95b4-0751d4f370f9.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Ms&amp;e 448 Final Project Statistical Arbitrage</div><div class="file-embed-details-h2">945KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/1bf2dd4b-27b7-423f-b0cc-a036a78ca4ba.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/1bf2dd4b-27b7-423f-b0cc-a036a78ca4ba.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Cointegration Enhancedindextracking</div><div class="file-embed-details-h2">2.1MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/3616c2e4-c153-4ac8-8621-9f9247342931.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/3616c2e4-c153-4ac8-8621-9f9247342931.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Jse Partialcoint Statarb</div><div class="file-embed-details-h2">2.12MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/a6c1ce30-5d16-472a-862b-ee6b2193647c.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/a6c1ce30-5d16-472a-862b-ee6b2193647c.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Avellanedaleestatarb2008</div><div class="file-embed-details-h2">2.59MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/5c6ffadf-1a09-4f9b-9046-26d3cc2f07bc.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/5c6ffadf-1a09-4f9b-9046-26d3cc2f07bc.pdf"><span class="file-embed-button-text">Download</span></a></div></div><p></p><h4>Math Reading</h4><div><hr></div><p>You should probably get good at math if you want to be a quant, especially if you are interested in a model-focused area like pairs trading. Here&#8217;s some material to help you along:</p><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Highordercrossings Timeseries</div><div class="file-embed-details-h2">193KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/c325cdb0-126f-4362-b900-c3142b091873.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/c325cdb0-126f-4362-b900-c3142b091873.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Truncated Mathematics</div><div class="file-embed-details-h2">630KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/c746d7f3-e8fb-4901-a60e-8071d0bc525b.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/c746d7f3-e8fb-4901-a60e-8071d0bc525b.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Var Ma Process</div><div class="file-embed-details-h2">534KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/16ae4d96-9629-4b73-92f7-3774754c51f6.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/16ae4d96-9629-4b73-92f7-3774754c51f6.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Sgep Smooth</div><div class="file-embed-details-h2">458KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/97f4cc12-400d-40e5-8044-68ba87880a7a.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/97f4cc12-400d-40e5-8044-68ba87880a7a.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Generalized Eigen</div><div class="file-embed-details-h2">151KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/6540bd29-d6af-4178-b41e-0ac08efa306d.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/6540bd29-d6af-4178-b41e-0ac08efa306d.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">On The Simulation And Estimation Of The</div><div class="file-embed-details-h2">1.63MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/4b15af42-2edf-4cf9-adcb-b0b73060743d.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/4b15af42-2edf-4cf9-adcb-b0b73060743d.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Boxtiao Canonical Bio 77</div><div class="file-embed-details-h2">574KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/8f9a17f8-0008-4911-a3d6-6a1c425358b7.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/8f9a17f8-0008-4911-a3d6-6a1c425358b7.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Sparserecovery Conicprogramming</div><div class="file-embed-details-h2">152KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/3a39758f-46c0-4b79-b769-e39f59113fa1.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/3a39758f-46c0-4b79-b769-e39f59113fa1.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Eigenvalues And Gep</div><div class="file-embed-details-h2">151KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/d6c465ab-5c52-4869-87c4-d6fddc96594a.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/d6c465ab-5c52-4869-87c4-d6fddc96594a.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Nonsymmetric Sparse Matrix Factorizations</div><div class="file-embed-details-h2">3.03MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/9b01616f-af79-4644-83e2-4732987f5bbf.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/9b01616f-af79-4644-83e2-4732987f5bbf.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Sparsereducedrankregularization</div><div class="file-embed-details-h2">760KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/6b2cedd1-77f7-4237-8133-445a703ee6e9.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/6b2cedd1-77f7-4237-8133-445a703ee6e9.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Levelcrossing</div><div class="file-embed-details-h2">2.6MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/20a9508d-4faf-4eec-96c0-def925d75993.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/20a9508d-4faf-4eec-96c0-def925d75993.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Box Leung</div><div class="file-embed-details-h2">6.66MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/b57d06e6-224c-43a5-9d63-517c431b4dd1.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/b57d06e6-224c-43a5-9d63-517c431b4dd1.pdf"><span class="file-embed-button-text">Download</span></a></div></div><p></p><h4>HFT Pairs</h4><div><hr></div><p>There&#8217;s a bit of literature on pairs trading for high-frequencies, but with all things HFT, you need to learn from practice. The literature tends to be less relevant for HFT strategies owing to the very practical and market feedback-oriented development process behind them which academics/theory-loving individuals tend not to go for. Either way here are a few, but I do recommend reading some of my material on this which is a bit more practically focused (although it is still quite mid-frequency in its scope), and of course testing for yourself:</p><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Statarb Pairs Hft</div><div class="file-embed-details-h2">832KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/aa3e0252-e189-4db9-b949-22c16a11175a.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/aa3e0252-e189-4db9-b949-22c16a11175a.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Statarbstrats Hft</div><div class="file-embed-details-h2">658KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/05881335-1bd1-4ca7-b7fc-6bdd84a703c2.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/05881335-1bd1-4ca7-b7fc-6bdd84a703c2.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Pairs Trading Using Hft In Omx Baltic Market</div><div class="file-embed-details-h2">723KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/15d6e0eb-7c55-4a61-8999-f511159b782d.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/15d6e0eb-7c55-4a61-8999-f511159b782d.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Twostagecorr Coint Dynamic Hft Pairs</div><div class="file-embed-details-h2">924KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/52bfdabf-46ee-440c-b7f9-93998d95eb78.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/52bfdabf-46ee-440c-b7f9-93998d95eb78.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Intradaypairs Hft Oil</div><div class="file-embed-details-h2">622KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/d4742b56-14c3-4268-a6b1-b778998294e8.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/d4742b56-14c3-4268-a6b1-b778998294e8.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Statarb Hft Gunderson</div><div class="file-embed-details-h2">1.96MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/529c67f3-3cf8-46ba-abf3-5a87c0f57796.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/529c67f3-3cf8-46ba-abf3-5a87c0f57796.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Pairstrading Jumpdiffusion Hft</div><div class="file-embed-details-h2">888KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/0f7103fe-4361-4785-9cc5-8ffee6cd9c4b.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/0f7103fe-4361-4785-9cc5-8ffee6cd9c4b.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Ml Hft Pairs</div><div class="file-embed-details-h2">1.7MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/434c0782-8742-4a57-b969-7e06ec4354b1.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/434c0782-8742-4a57-b969-7e06ec4354b1.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Hft Copula Pairs</div><div class="file-embed-details-h2">1.38MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/b5cd3a47-8415-42ba-9a81-8fc8af174554.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/b5cd3a47-8415-42ba-9a81-8fc8af174554.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Statarb Lob Imbalance</div><div class="file-embed-details-h2">2.58MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/aad73e9c-1b21-4dea-b6e2-9a69228e755d.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/aad73e9c-1b21-4dea-b6e2-9a69228e755d.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Hft Pairs Micro Nanosecond</div><div class="file-embed-details-h2">891KB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/b6825d7e-1c1b-44d5-86df-a33441bdf3fb.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/b6825d7e-1c1b-44d5-86df-a33441bdf3fb.pdf"><span class="file-embed-button-text">Download</span></a></div></div><p></p><h4>Clustering and Pre-Selection</h4><div><hr></div><p>I never dove too much into this from a theory/models perspective because my approaches were usually based on fundamental similarities behind assets such as industries, but there is a machine learning side of things that is quite interesting and that I have explored a little:</p><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Multi Factor Statistical Arbitrage Model</div><div class="file-embed-details-h2">1.14MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/f353edcd-6d59-4d12-be00-494d9983b610.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/f353edcd-6d59-4d12-be00-494d9983b610.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Cluster Based Statistical Arbitrage Strategy</div><div class="file-embed-details-h2">1.88MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/1ebcae68-5461-407e-a1aa-781470fe0bb6.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/1ebcae68-5461-407e-a1aa-781470fe0bb6.pdf"><span class="file-embed-button-text">Download</span></a></div></div><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">Dataselectionpairsavoidoverfitting</div><div class="file-embed-details-h2">2.82MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.algos.org/api/v1/file/e65817a7-e6c1-4d36-abcf-07de9f3f4656.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.algos.org/api/v1/file/e65817a7-e6c1-4d36-abcf-07de9f3f4656.pdf"><span class="file-embed-button-text">Download</span></a></div></div><h4>Misc.</h4><div><hr></div><p>I don&#8217;t have more papers to share, but I do want to give a shout-out to financialnoob who has written a decent bit on pairs trading and shared a lot of code. I think it&#8217;s a great resource for those diving into the subject and covers most of the simpler methods that I perhaps have glazed over. </p><p>Simple methods do well and often are the most robust way to do pairs trading. Don&#8217;t write them off. I worked on pairs trading at a more model-focused time in my life and hence my thoughts and writings often flow into this area, but my current research represents more of a balance. </p><p>It isn&#8217;t very pairs trading oriented anymore, but I&#8217;ve had a few looks around in the years since pairs trading and have enjoyed the application of simpler models to dumber markets.</p><p>Both sides of the coin are fun and teach you a lot. </p><p>https://medium.com/@financialnoob</p><p>He&#8217;s also got a Github which saves me from writing code on these methods (mostly ones I haven&#8217;t covered yet anyway) and as a bonus it&#8217;s all free. Enjoy :)</p><p></p><h4>Notes from me</h4><div><hr></div><p>Please excuse any mislabelling of papers, I&#8217;ve put a lot of work in but as you can see there are a lot of them to go through, and as with all papers - I skim. Hopefully, my commentary has provided guidance and my articles that exist so far will provide more practical insights into this area of strategies. </p><p>On the point of skimming, do it. Have a skim and then come back to what you enjoy. There&#8217;s a lot to get through and most papers don&#8217;t require you to read the full thing to get the general idea. If you really like the idea then of course dive in and code it up / test it out - it&#8217;s a great way to learn, but do be diligent with your time. It&#8217;s not a great idea to just sit there and read them all day, in full - you&#8217;ll forget a lot of the parts anyway if you do that.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.algos.org/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">The Quant Stack 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>]]></content:encoded></item><item><title><![CDATA[Thinking about stationarity the right way]]></title><description><![CDATA[Some practical insights for pairs trading]]></description><link>https://www.algos.org/p/thinking-about-stationarity-the-right</link><guid isPermaLink="false">https://www.algos.org/p/thinking-about-stationarity-the-right</guid><dc:creator><![CDATA[Quant Arb]]></dc:creator><pubDate>Fri, 23 Jun 2023 05:49:52 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!6jBY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b28bd7d-57ca-4569-9dff-34012db68e12_903x362.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mA1_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcee0b273-d291-4182-9424-dbc1099caaa0_484x212.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mA1_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcee0b273-d291-4182-9424-dbc1099caaa0_484x212.png 424w, https://substackcdn.com/image/fetch/$s_!mA1_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcee0b273-d291-4182-9424-dbc1099caaa0_484x212.png 848w, https://substackcdn.com/image/fetch/$s_!mA1_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcee0b273-d291-4182-9424-dbc1099caaa0_484x212.png 1272w, https://substackcdn.com/image/fetch/$s_!mA1_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcee0b273-d291-4182-9424-dbc1099caaa0_484x212.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mA1_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcee0b273-d291-4182-9424-dbc1099caaa0_484x212.png" width="592" height="259.3057851239669" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cee0b273-d291-4182-9424-dbc1099caaa0_484x212.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:212,&quot;width&quot;:484,&quot;resizeWidth&quot;:592,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Augmented Dickey-Fuller (ADF) Test&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Augmented Dickey-Fuller (ADF) Test" title="Augmented Dickey-Fuller (ADF) Test" srcset="https://substackcdn.com/image/fetch/$s_!mA1_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcee0b273-d291-4182-9424-dbc1099caaa0_484x212.png 424w, https://substackcdn.com/image/fetch/$s_!mA1_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcee0b273-d291-4182-9424-dbc1099caaa0_484x212.png 848w, https://substackcdn.com/image/fetch/$s_!mA1_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcee0b273-d291-4182-9424-dbc1099caaa0_484x212.png 1272w, https://substackcdn.com/image/fetch/$s_!mA1_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcee0b273-d291-4182-9424-dbc1099caaa0_484x212.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><h4>Introduction</h4><div><hr></div>
      <p>
          <a href="https://www.algos.org/p/thinking-about-stationarity-the-right">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[A Real Pairs Trading Strategy]]></title><description><![CDATA[Breaking down a profitable strategy I built a couple years ago]]></description><link>https://www.algos.org/p/a-real-pairs-trading-strategy</link><guid isPermaLink="false">https://www.algos.org/p/a-real-pairs-trading-strategy</guid><dc:creator><![CDATA[Quant Arb]]></dc:creator><pubDate>Sun, 11 Jun 2023 05:35:16 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff09c99c9-f0bb-4eb1-bb7e-4580142721ab_958x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PJ4_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9c28606-6785-4142-8352-ab1f123d2461_1154x438.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PJ4_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9c28606-6785-4142-8352-ab1f123d2461_1154x438.png 424w, https://substackcdn.com/image/fetch/$s_!PJ4_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9c28606-6785-4142-8352-ab1f123d2461_1154x438.png 848w, https://substackcdn.com/image/fetch/$s_!PJ4_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9c28606-6785-4142-8352-ab1f123d2461_1154x438.png 1272w, https://substackcdn.com/image/fetch/$s_!PJ4_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9c28606-6785-4142-8352-ab1f123d2461_1154x438.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PJ4_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9c28606-6785-4142-8352-ab1f123d2461_1154x438.png" width="1154" height="438" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e9c28606-6785-4142-8352-ab1f123d2461_1154x438.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:438,&quot;width&quot;:1154,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:53210,&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;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!PJ4_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9c28606-6785-4142-8352-ab1f123d2461_1154x438.png 424w, https://substackcdn.com/image/fetch/$s_!PJ4_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9c28606-6785-4142-8352-ab1f123d2461_1154x438.png 848w, https://substackcdn.com/image/fetch/$s_!PJ4_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9c28606-6785-4142-8352-ab1f123d2461_1154x438.png 1272w, https://substackcdn.com/image/fetch/$s_!PJ4_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9c28606-6785-4142-8352-ab1f123d2461_1154x438.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><h4>Introduction</h4><div><hr></div><p>In this article, we will go into detail about an equities strategy I built in 2020. This was traded live for a few months and delivered 30% returns on a 2.7 Sharpe (over about 4 months) until I stopped trading equities (crypto is more exciting). </p><p>My journey into quant started with options and volatility trading (really early days). I quickly realized I knew nothing about volatility trading and instead fell in love with the field of pairs trading. This was a field I researched for a while and even wrote papers in. The strategy we discuss today trades a portfolio of equities. </p><p>There are a few optimizations which add to the performance that I&#8217;ve left out the exact details on, but for most of them, I still cover what they achieve so readers can come up with their own ways to benefit from the ideas behind them.</p><p></p><h4>General Strategy Overview</h4><div><hr></div><p>This strategy is built around multivariate pairs trading and uses the optimization approach to pairs trading. It is quite a complex strategy, but all of the alpha comes from simple and elegant ideas. This is the way to do it; the complexity of a strategy is usually inverse to alpha. You could do this very simply; it would just suck. Each idea that adds complexity has clear reasoning - we aren&#8217;t randomly slapping an LSTM on it or anything.</p><p>We generate a portfolio of assets (4-6) with some optimization objectives for the spread and portfolio characteristics. Reduce turnover with some simple methods. Repeat this step 10-30x to generate 10-30 portfolios. Use a validation technique to pick the best ones for robustness, then trade the top portfolios live.</p><p>Putting this into a list of steps:</p><ol><li><p>Identify the universe of assets to trade (liquid, has short margin, and maybe even some filters for characteristics like removing meme stonks).</p></li><li><p>Generate portfolios by optimizing for an ensemble of objectives.</p></li><li><p>Sit still for a short out-of-sample &#8220;validation&#8221; period where we do not trade.</p></li><li><p>Compare the in-sample portfolios vs. validation period portfolios and ensure we didn&#8217;t overfit (ex. - ultra mean-reverting now barely mean-reverting OR stationary portfolio now drifting off into space). </p></li><li><p>Trade the selected portfolios in a 3rd and final test set using a slightly modified Bollinger Bands implementation.</p></li><li><p>Continuously monitor for the decay of statistical properties and shut down decayed portfolios.</p></li></ol><p>We&#8217;ll walk through this list and the considerations in the following sections.</p><p></p><h4>Universe Selection (1)</h4><div><hr></div><p>This part starts with the basics - what assets are not going to cause issues. We want assets with a decent amount of liquidity and availability of short margin. That&#8217;s the first step, and it usually just means we trade only S&amp;P500 stocks because margin availability is like a $250,000 dataset. </p><p>After this, we run into an issue with universe size. 500 assets are far too many to optimize over because we&#8217;ll overfit, so we shrink it down. Our universe size is actually a parameter for the strategy and has a pretty big impact on results. This should be informed by the timeframe of mean-reversion we want to capture. </p><p>Longer-term pairs trading warrants a smaller universe as there is a higher risk of overfitting, and inversely shorter-term pairs trading lets us have larger universes as we look for more transitory relationships than robust ones. Hence we fit more.</p><p>My previous articles on pairs trading have explored this and used real data to show it happening in practice. Feel free to check them out.</p><p>As a related component to universe selection, we also need to think about the size of our train, validation, and test periods in terms of samples. I can give the same algorithm hourly data and daily data, and I&#8217;ll get different results even if the length of the train, validation, and test periods are the same in terms of time. Sampling less frequently removes noise, and as a rule of thumb, there is more noise per data point as we go down timeframes. </p><p>When we are doing short-term pairs trading, we need more samples due to the higher noise per sample. With long-term pairs trading, this just adds noise and confuses our optimization algorithm with relationships that are significant but transitory. With short-term pairs trading, we can just use validation to know when the portfolio has decayed and take advantage of these transitory relationships, whereas long-term pairs trading does not capture these relationships because they&#8217;re gone by the time we get to the test set. The data agrees with this observation of optimal sample sizes when you test it out - the more you do, the more intuition you build.</p><p>The universe can be randomly split into equal slices of a certain size, but there are smarter ways to do things. I won&#8217;t cover the exact details, but here are some pointers:</p><ol><li><p>Clustering algorithms (DBSCAN recommended) based on:</p><ol><li><p>Factor exposures</p></li><li><p>Fundamentals</p></li><li><p>Time series characteristics (Hurst, volatility, mkt cap adj. volume, etc.)</p></li></ol></li><li><p>Maximize similarity (correlation and the mix) as an objective using a greedy algorithm to shrink 500 &#8594; 50 (arbitrary example).</p></li><li><p>Group by industry</p></li><li><p>Top/bottom XX by some characteristic (use the metrics above in 1c).</p></li><li><p>Group by beta to things like political polls or exposure to macroeconomic variables (ex. CPI)</p></li></ol><p>Depending on the level of optimization done to create the universe, 20-70 is optimal for this strategy. 50-70 being no optimization (randomly split into buckets). 20-30 being a fair bit of optimization in our universe selection. Play around with it and see what feels right.</p><p>I&#8217;ve given a few ideas, and there is not a specific one that is the correct option. Test them, see what works, and ensemble the versions that work for maximum diversification points. </p><p></p><h4>Optimization Objectives (2a)</h4><div><hr></div><p>We have primary and secondary objectives. Our primary objectives capture what makes us money, and our secondary objectives capture what loses us money. </p><p>Mean-reversion makes us money. Simple as that. Here are our metrics:</p><ol><li><p>Hurst</p></li><li><p>Portmanteau</p></li><li><p>VAR(1) Predictability</p></li><li><p>Crossing Statistic</p></li><li><p>SNVR</p></li></ol>
      <p>
          <a href="https://www.algos.org/p/a-real-pairs-trading-strategy">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Greedy Method for SMRPs (PART 2)]]></title><description><![CDATA[Implementing the greedy method for SMRPs with 2 new metrics]]></description><link>https://www.algos.org/p/greedy-method-for-smrps-part-2</link><guid isPermaLink="false">https://www.algos.org/p/greedy-method-for-smrps-part-2</guid><dc:creator><![CDATA[Quant Arb]]></dc:creator><pubDate>Wed, 29 Mar 2023 00:38:58 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!g_B9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae307152-4356-4258-a1d9-56982a761691_911x481.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h4>Introduction</h4><div><hr></div><p>We recently explored the use of the Greedy algorithm for generating Sparse Mean Reverting Portfolios (SMRPs) using the Portmanteau criterion. In this article, we will expand a little on this method and look at 2 other metrics which take a slightly different perspective when optimizing. These two metrics are:</p><ul><li><p>Predictability (Box-Tiao Canonical Decomposition)</p></li><li><p>Crossing Statistic </p></li></ul><p>Code will be included so that you can test this out for yourself. I&#8217;ll also add some commentary on how these metrics can be useful when used together.</p><p></p>
      <p>
          <a href="https://www.algos.org/p/greedy-method-for-smrps-part-2">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Pairs Trading Framework & Process]]></title><description><![CDATA[A full guide on pairs trading and building mean-reverting portfolios]]></description><link>https://www.algos.org/p/pairs-trading-framework-and-process</link><guid isPermaLink="false">https://www.algos.org/p/pairs-trading-framework-and-process</guid><dc:creator><![CDATA[Quant Arb]]></dc:creator><pubDate>Thu, 23 Mar 2023 03:28:33 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3181420c-1609-4724-98aa-16e0368920f9_1076x449.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h4>Introduction</h4><div><hr></div><p>As many of you will have seen, recent articles have focused a fair bit on pairs trading methods. After finishing a 3 part series where we went from non-sparse mean-reverting portfolios up to sparse mean-reverting portfolios I thought it was about time to give a proper guide on all the different nuances of pairs trading. </p><p></p><p>In this article, we will take a different perspective than we normally chose, and cover pairs trading, specifically building mean-reverting portfolios, as a start-to-finish framework. Many statistical arbitrage managers will run these strategies alongside others, and this is by no means an exclusive area to specialize in. </p><p></p><p>DISCLAIMER: This is going to be quite, if not a lot, anecdotal. It is based on a lot of research into the space, and I even ended up writing a paper on some sparse eigenportfolio math during my adventures. I don&#8217;t often work with these strategies anymore since migrating from equities, but I hope to share the knowledge regardless.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.algos.org/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">Quant&#8217;s Substack 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><h4>Index</h4><div><hr></div><p>This is quite a long article as it is a full guide to pairs trading and all the lessons/anecdotes I&#8217;ve accumulated over the years. You&#8217;ll be happy to find that there is an index to help organize all of this content:</p><ol><li><p>Introduction</p></li><li><p>Defining Pairs Trading</p></li><li><p>Pairs Trading as an Optimization Problem</p></li><li><p>Robust or Non-Robust: A Temporal Question</p></li><li><p>The Parameters That Matter</p></li><li><p>How Data Parameters Drive Modelling Choices</p></li><li><p>Short-Term High-Turnover Pairs Trading</p></li><li><p>Long-Term Low-Turnover Pairs Trading</p></li><li><p>The Different Flavors of Mean Reversion</p></li><li><p>Optimization Metrics (Mean-Reversion)</p></li><li><p>Optimization Metrics (Alternative Objectives)</p></li><li><p>Methods for Optimization</p></li><li><p>Non-Optimization Focused Approaches</p></li><li><p>Conclusion</p></li></ol><p></p><h4>Defining Pairs Trading</h4><div><hr></div><p>I think most readers have a general idea of what pairs trading is, and if you don&#8217;t - Google exists, but I want to really dig into the question of what is pairs trading? </p><p>For many, it is simply trading the spread between two cointegrated assets, but this is no longer true or an effective definition. Modern pairs trading can involve a variety of assets, with a mix of long and short exposures. They don&#8217;t have to be cointegrated or stationary either. You can generally think of pairs trading as the art of generating, trading, and managing portfolios that exhibit both predictability and efficient tradeability. Predictability in this sense refers to the fact that our portfolios follow a (usually mean-reverting) pattern that is robust and stable. This is not to be confused with the VAR(1) (BTCD) approach where predictability means something different.</p><p>Where does pairs trading end? This isn&#8217;t an easy question either. If I take a KO - PEP spread and decide to only trade one leg, the one I expect to do the moving, am I still pairs trading? I could be capturing 90% of the variance of the equivalent (although hedged) pairs trade but would this still be a pairs trade? </p><p>In most cases, the scenario where only one asset will move occurs because one asset is driving all of the variance between the two of them. There is a leader and a lagger. This is a lead-lag trade, one that has many similarities to pairs trading, and with a lot of room to bridge ideas, but is definitely still its own distinct area.</p><p></p><h4>Pairs Trading as an Optimization Problem</h4><div><hr></div><p>Pairs trading in my view is best thought of as an optimization problem. We have 3 primary objectives we need to optimize for:</p><ol><li><p>Predictability (Well Behaved Mean-Reversion)</p></li><li><p>Trading Costs Relative to Profit (Liquidity, Variance, Notional vs. Net Ratio)</p></li><li><p>Stability of Statistical Properties (Stationarity - although often this is worth giving up to get a much better deal on parts 1 &amp; 2)</p></li></ol><p>You could very well sit down and create a metric for mean reversion then slap some assets into a neural network and shit out a mean-reverting portfolio. That doesn&#8217;t guarantee that your portfolio will be robust, it will likely be overfit in fact, and will decay completely in live testing. Often a healthy dose of heuristic methods and well-thought-out processes will provide the best results with our limited data.</p><p>We have already framed it as a problem like this in previous articles. Our SDP article optimized for mean-reversion using a VAR(1) framework (objective 1) and made trading efficient by inducing sparsity and variance constraints (objective 2). It was also convex, which means it had far less ability to overfit, helping us achieve objective 3. An earlier article took a more aggressive stance and used the portmanteau statistic to achieve objective 1, but only implemented some controls on the liquidity requirements of our input universe to help aid objective 2. It was definitely not the most robust technique, but as we will discuss later, robust != optimal for many cases.</p><p></p><h4>Robust or Non-Robust - A Temporal Question</h4><div><hr></div><p>In my view, it was never a question of how can we make our portfolio robust always. Unstable portfolios add cost, but you can still make money if the other objectives get optimized really well. Below is a portfolio that is constructed from two fractional Brownian motion processes. One has a Hurst exponent of 0.3, the other has a Hurst exponent of 0.9. What this means is that the 0.9 Hurst process is our drift (trend) which we do not want, and the 0.3 Hurst process is the mean-reversion (we want this). The trend can be thought of as noise that damages our PNL, but we can still adapt to it. The use of techniques like Bollinger Bands allow us to trade non-stationary spreads, with the error term from non-stationarity as a cost.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1afA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa42f2385-09fb-4ade-a351-b90206e58332_907x518.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1afA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa42f2385-09fb-4ade-a351-b90206e58332_907x518.png 424w, https://substackcdn.com/image/fetch/$s_!1afA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa42f2385-09fb-4ade-a351-b90206e58332_907x518.png 848w, https://substackcdn.com/image/fetch/$s_!1afA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa42f2385-09fb-4ade-a351-b90206e58332_907x518.png 1272w, https://substackcdn.com/image/fetch/$s_!1afA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa42f2385-09fb-4ade-a351-b90206e58332_907x518.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1afA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa42f2385-09fb-4ade-a351-b90206e58332_907x518.png" width="907" height="518" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a42f2385-09fb-4ade-a351-b90206e58332_907x518.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:518,&quot;width&quot;:907,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:51235,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!1afA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa42f2385-09fb-4ade-a351-b90206e58332_907x518.png 424w, https://substackcdn.com/image/fetch/$s_!1afA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa42f2385-09fb-4ade-a351-b90206e58332_907x518.png 848w, https://substackcdn.com/image/fetch/$s_!1afA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa42f2385-09fb-4ade-a351-b90206e58332_907x518.png 1272w, https://substackcdn.com/image/fetch/$s_!1afA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa42f2385-09fb-4ade-a351-b90206e58332_907x518.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 cause of loss for Bollinger Band based approaches is what I call lag error. I have covered lag error in a thread on my Twitter:</p><div class="twitter-embed" data-attrs="{&quot;url&quot;:&quot;https://twitter.com/quant_arb/status/1501910890916069382?s=20&quot;,&quot;full_text&quot;:&quot;Lag error:\n\nI&#8217;ve totally made up this word but there&#8217;s not word for the concept it captures and I&#8217;ve been using it for over a year regardless. \n\nIf you use bollinger bands to trade mean reverting portfolios your lag error is the loss of alpha from the deterministic component.&quot;,&quot;username&quot;:&quot;quant_arb&quot;,&quot;name&quot;:&quot;Stat Arb&quot;,&quot;profile_image_url&quot;:&quot;&quot;,&quot;date&quot;:&quot;Thu Mar 10 13:20:35 +0000 2022&quot;,&quot;photos&quot;:[],&quot;quoted_tweet&quot;:{},&quot;reply_count&quot;:0,&quot;retweet_count&quot;:3,&quot;like_count&quot;:42,&quot;impression_count&quot;:0,&quot;expanded_url&quot;:{},&quot;video_url&quot;:null,&quot;belowTheFold&quot;:true}" data-component-name="Twitter2ToDOM"></div><p>Moving back to the concept of robustness. We cannot have everything, and there is usually a question of what model is right for the job. If you are trading higher frequency timeframes, you need to optimize for trading costs, and you will likely trade short-lasting effects which will quickly disappear. This is fine. We already have a framework that is robust to instability. Instead of non-stationary behavior making it impossible to trade it just acts as a variable cost against our revenue from mean-reversion. More effective spread trading models and optimization for well-behaved mean-reversion lower this cost.</p><p>The reason I say this is a temporal problem is that as you increase your timeframe, you have less opportunity to diversify, both in the correlation of your spreads and the law of large numbers with trades. This is partially because correlations increase as the timeframe increases (so you have less ability to form multiple diversified pairs portfolios). The other issue is that you will make fewer trades so the law of large numbers applies less. Above both of these, the key reason why it makes sense to pick more flexible and less robust models for shorter timeframes is because the relationships are more complex and unstable on shorter timeframes. To detect these we use models which fit more but do not create as robust portfolios, in a lot of cases the extra mean reversion we gain outweighs the lag error introduced.</p><p></p><h4>The Parameters That Matter</h4><div><hr></div><p>I wouldn&#8217;t say any of these are necessarily parameters as you might normally think of them, but they are under your control. Here is a quick list of the data-related ones:</p><ol><li><p>Universe Size</p></li><li><p>Data Frequency</p></li><li><p>Training Period Length</p></li><li><p>Test Period Length</p></li><li><p>Validation Period Length / Use</p></li></ol><p>It is important to use the right data. How large should the starting universe you pick from be? Should we filter for liquidity to reduce turnover costs? What about the timeframe - there is a big difference between 5-minute bars and daily bars. You also get to play around with the length of your training, validation, and test sets. </p><p>The validation set is an optional extra set you add between the training and testing sets. You might generate 30 portfolios, then for a validation period you measure their ADFs, rank them on ADFs, take the top 3, and trade the top 3 in test. Here we are sacrificing the number of portfolios / &#8220;freshness&#8221; (much like an apple, portfolios decay quickly, especially when trained on short-term data) for hoped stability. </p><p>What about model-related choices we can control? Here&#8217;s a quick list:</p><ol><li><p>Portfolio Sparsity</p></li><li><p>Metrics / Combination To Fit The Task</p></li><li><p>Optimization Model</p></li></ol><p>There is definitely a &#8220;right&#8221; set of metrics to get a certain type of mean reversion. This is important and should come inside of the overall situation context. All of these questions are part of this context, but typically our first list is what drives the choices we make in our second list. </p><p>Portfolio sparsity isn&#8217;t something that greatly affects the mean-reversion of portfolios, a 4-asset portfolio might behave the same as a 6-asset portfolio, but in the long run, the extra cost to trade 2 more assets can add up. It is really a question of inducing sparsity, which is just a branch of the overall objective of reducing turnover costs, but at the cost of the mean-reversion or stability the portfolio exhibits. If assets do not meaningfully contribute to the portfolio there are methods like Truncation contribution to test whether they are noise and exclude them.</p><p></p><h4>How Data Parameters Drive Modelling Choices</h4><div><hr></div><p>The data parameters directly affect how you then model it. This is a pretty basic concept, but we will walk through the 3 different modeling choice subjects and how they are affected by different data. This all reverts to the different focuses you have with different types of pairs trading.</p><p>The next two sections will examine short-term high-turnover pairs trading and long-term low-turnover pairs trading to give insights about what are the right choices and what problems should you focus on solving based on your data/timeframe of effect.</p><p></p><h4>Short-Term High-Turnover Pairs Trading</h4><div><hr></div><p>With short-term high-turnover pairs trading:</p><ul><li><p>Transaction costs are important and thus we care a lot about:</p><ul><li><p>Spread</p></li><li><p>Exchange Fees</p></li><li><p>Sparsity (2 legs is easier to limit fill than 10)</p></li><li><p>Volatility (larger moves, easier to beat costs)</p></li><li><p>Notional vs. net exposure ratio (If I have to spend $1000 notional to buy a $100 net exposure portfolio that is effectively a 10x multiplier on trading costs as most of the exposure I buy cancels out). Called SNVR (standardized notional volume ratio when we adjust for volatility, otherwise it is just NVR).</p></li></ul></li><li><p>Mean reversion effects are far stronger.</p></li><li><p>Effects are generally less robust.</p></li><li><p>Fleeting / more complex relationships require more fitting.</p></li><li><p>More data to work with.</p></li><li><p>Less information per data point (this combines with the above point to create larger train/test datasets in terms of data points).</p></li><li><p>Low correlation between different pairs portfolios. </p></li><li><p>Higher Sharpe / reward &#8594; much harder. A high turnover means you are temporally diversified. If you make 1000s of trades they will average out and your risk will be lower, this is boosted by low correlations. This means the reward is larger compared to long-term methods, but that slight edge per trade is competitive.</p></li></ul><p>The implication of some of these is quite substantial. If you know that finding highly mean-reverting portfolios is easier, then you are fine paying some of that away as lag error and using bolling bands / dynamic mean based methods of capturing the mean-reversion. If your mean-reversion is weaker (like long term) you need to focus on robustness because you cannot afford to pay for the lag error of a non-robust portfolio.</p><p>There is huge importance in trading costs and optimizing that. How many elements should your portfolio contain? Can we use limit orders to execute? You might have 6 assets, but if 1 asset is 40% of the portfolio it is perhaps worthwhile trying to get that leg in as a limit order, but not always. </p><p>Think of short-term high-turnover pairs trading as the following equations:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OvPR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87765aff-e904-4455-8043-3b4c983e4f54_729x150.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OvPR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87765aff-e904-4455-8043-3b4c983e4f54_729x150.png 424w, https://substackcdn.com/image/fetch/$s_!OvPR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87765aff-e904-4455-8043-3b4c983e4f54_729x150.png 848w, https://substackcdn.com/image/fetch/$s_!OvPR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87765aff-e904-4455-8043-3b4c983e4f54_729x150.png 1272w, https://substackcdn.com/image/fetch/$s_!OvPR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87765aff-e904-4455-8043-3b4c983e4f54_729x150.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OvPR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87765aff-e904-4455-8043-3b4c983e4f54_729x150.png" width="729" height="150" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/87765aff-e904-4455-8043-3b4c983e4f54_729x150.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:150,&quot;width&quot;:729,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:13647,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!OvPR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87765aff-e904-4455-8043-3b4c983e4f54_729x150.png 424w, https://substackcdn.com/image/fetch/$s_!OvPR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87765aff-e904-4455-8043-3b4c983e4f54_729x150.png 848w, https://substackcdn.com/image/fetch/$s_!OvPR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87765aff-e904-4455-8043-3b4c983e4f54_729x150.png 1272w, https://substackcdn.com/image/fetch/$s_!OvPR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87765aff-e904-4455-8043-3b4c983e4f54_729x150.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The average move captured puts volatility, but also our ability to capture it (lag error) at the front of the equation. We then think of mean-reversion strength &amp; quality as the probability of this being in our favor and multiply as such. Trading costs are subtracted net of all this. </p><p></p><h4>Long-Term Low-Turnover Pairs Trading</h4><div><hr></div><p>With long-term low-turnover pairs trading:</p><ul><li><p>Low turnover means transaction costs matter far less</p></li><li><p>Mean reversion tends to be weaker, but more robust</p></li><li><p>Risk premium / generally easier to make money in</p></li><li><p>Fewer data points to work with so requires less fitting</p></li><li><p>Portfolios tend to be correlated / diversification is harder</p></li><li><p>News can affect prices more, creating tail risk</p></li></ul><p>As with longer-term strategies in general it is easier to make a little bit of money, but many many times harder to make a lot of money in a low-risk manner. The weaker mean-reversion strength also means that methods like stochastic control are not suitable to trade the spread as they will fail to fit properly. </p><p>It is important to understand the nature of these effects and that they are different when looking at the short-term and the long-term. The best way to think of it in my view is that with long-term effects you are focusing on collecting a small risk premium each time and not taking downside. For short-term pairs trading it is the other way around. Your default starting point is losing small amounts of money because of transaction costs. Once you cross that threshold of beating fees your profit rockets. </p><p>Longer-term strategies tend to have fewer data points to work with and there is less time for losses to average out, not to mention the fact that portfolios have higher correlations killing diversification. This all culminates to require the use of simpler models when generating long-term portfolios and focusing on how can we keep these portfolios stable. When each trade matters / has a larger impact on the final PNL you need to focus on improving quality since you cannot rely on quantity / averaging out.</p><p></p><h4>The Flavors of Mean Reversion </h4><div><hr></div><p>Ideal mean reversion should have minimal lag error. This means it should have one single frequency and stable properties. </p><p>What do we mean by frequency? This is where fractal methods like Hurst can come in handy. More intuitively, &#8220;how does price cluster around different price levels?&#8221;, and &#8220;how many levels are there?&#8221;. If our process has 3 states, up, down, and at mean if it is only able to be in one of those 3 states and the prices for those states are constant we get a portfolio like 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_!Asm1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7647960-322a-410b-9d3a-6da503cfe97a_1052x457.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Asm1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7647960-322a-410b-9d3a-6da503cfe97a_1052x457.png 424w, https://substackcdn.com/image/fetch/$s_!Asm1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7647960-322a-410b-9d3a-6da503cfe97a_1052x457.png 848w, https://substackcdn.com/image/fetch/$s_!Asm1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7647960-322a-410b-9d3a-6da503cfe97a_1052x457.png 1272w, https://substackcdn.com/image/fetch/$s_!Asm1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7647960-322a-410b-9d3a-6da503cfe97a_1052x457.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Asm1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7647960-322a-410b-9d3a-6da503cfe97a_1052x457.png" width="1052" height="457" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a7647960-322a-410b-9d3a-6da503cfe97a_1052x457.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:457,&quot;width&quot;:1052,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:18123,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!Asm1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7647960-322a-410b-9d3a-6da503cfe97a_1052x457.png 424w, https://substackcdn.com/image/fetch/$s_!Asm1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7647960-322a-410b-9d3a-6da503cfe97a_1052x457.png 848w, https://substackcdn.com/image/fetch/$s_!Asm1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7647960-322a-410b-9d3a-6da503cfe97a_1052x457.png 1272w, https://substackcdn.com/image/fetch/$s_!Asm1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7647960-322a-410b-9d3a-6da503cfe97a_1052x457.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 above chart clearly only has 3 prices it ever visits.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!G36L!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3181420c-1609-4724-98aa-16e0368920f9_1076x449.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!G36L!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3181420c-1609-4724-98aa-16e0368920f9_1076x449.png 424w, https://substackcdn.com/image/fetch/$s_!G36L!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3181420c-1609-4724-98aa-16e0368920f9_1076x449.png 848w, https://substackcdn.com/image/fetch/$s_!G36L!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3181420c-1609-4724-98aa-16e0368920f9_1076x449.png 1272w, https://substackcdn.com/image/fetch/$s_!G36L!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3181420c-1609-4724-98aa-16e0368920f9_1076x449.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!G36L!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3181420c-1609-4724-98aa-16e0368920f9_1076x449.png" width="1076" height="449" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3181420c-1609-4724-98aa-16e0368920f9_1076x449.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:449,&quot;width&quot;:1076,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19322,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!G36L!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3181420c-1609-4724-98aa-16e0368920f9_1076x449.png 424w, https://substackcdn.com/image/fetch/$s_!G36L!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3181420c-1609-4724-98aa-16e0368920f9_1076x449.png 848w, https://substackcdn.com/image/fetch/$s_!G36L!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3181420c-1609-4724-98aa-16e0368920f9_1076x449.png 1272w, https://substackcdn.com/image/fetch/$s_!G36L!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3181420c-1609-4724-98aa-16e0368920f9_1076x449.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>Since we have no lag error we can capture these moves really well. If the price is at our upper band we have close to 1 probability that the price will then go down. In normal settings, however, the probability curve does not look like this. </p><p>The different frequencies that mean reversion or generally cyclical behavior occur on primarily influence how we trade the spread. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HuVE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46f948d1-d3c4-4922-b509-fbff270fee6f_828x313.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HuVE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46f948d1-d3c4-4922-b509-fbff270fee6f_828x313.jpeg 424w, https://substackcdn.com/image/fetch/$s_!HuVE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46f948d1-d3c4-4922-b509-fbff270fee6f_828x313.jpeg 848w, https://substackcdn.com/image/fetch/$s_!HuVE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46f948d1-d3c4-4922-b509-fbff270fee6f_828x313.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!HuVE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46f948d1-d3c4-4922-b509-fbff270fee6f_828x313.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HuVE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46f948d1-d3c4-4922-b509-fbff270fee6f_828x313.jpeg" width="828" height="313" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/46f948d1-d3c4-4922-b509-fbff270fee6f_828x313.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:313,&quot;width&quot;:828,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Image&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="Image" title="Image" srcset="https://substackcdn.com/image/fetch/$s_!HuVE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46f948d1-d3c4-4922-b509-fbff270fee6f_828x313.jpeg 424w, https://substackcdn.com/image/fetch/$s_!HuVE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46f948d1-d3c4-4922-b509-fbff270fee6f_828x313.jpeg 848w, https://substackcdn.com/image/fetch/$s_!HuVE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46f948d1-d3c4-4922-b509-fbff270fee6f_828x313.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!HuVE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46f948d1-d3c4-4922-b509-fbff270fee6f_828x313.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This is an example of a mean-reverting process with 2 different frequencies. We either capture the short-period mean reversion or the longer-period mean reversion, but each will work against us. </p><p>If we capture the longer period we will just have all this extra mean-reversion add noise to our PNL curve. If we are capturing the short period, one of our bands will be more likely to get hit because of the longer period reversion and that will introduce a large degree of lag error. </p><p>This is not really an issue for longer-term pairs trading as portfolios tend to exhibit simpler mean-reversion. Whether this is a fundamental nature of mean-reversion on this timescale or a reflection of the fact that our models must be simpler I can&#8217;t say, but either argument would be valid. </p><p>For short-term pairs portfolios, there is definitely an issue with multi-fractal mean reversion. Models have far more data and tend to be able to fit more making this a common type of mean-reversion to encounter. </p><p>Mean reversion may also be thought of in the context of white noise or stationarity, but this is a topic with plenty of literature to dig through so I will leave this to the reader.</p><p>Finally, I will list some metrics to classify mean reversion:</p><ol><li><p>Half-Life (speed of mean-reversion) </p></li><li><p>Crossing Statistic (how many times it crosses the mean)</p></li><li><p>Volatility (self-explanatory)</p></li><li><p>Kurtosis (We want bounded mean-reversion, not infrequent mega deviations)</p></li><li><p>Quantile Ratios (Absolute the z-scores, then calculate quantiles, compare the ratio of different quantiles, maybe 95% vs. 99%, is the difference large, this acts as a more fine-tuned version of kurtosis when controlling tails)</p></li><li><p>Stationarity (non-stationary white noise is a whole different ballpark than standard ADF-created portfolios)</p></li><li><p>Drift Term (directly looking at drift / change in price instead of stationarity)</p></li><li><p>Information discreteness of smoothed process (after smoothing, i.e. removing the noise/ mean-reversion, what is the % of data points that had a positive % change vs % of data points with a negative % change? This tells us whether it is non-stationary with a constant smooth drift or if it is all over the place).</p></li></ol><p></p><h4>Optimization Metrics (Mean-Reversion)</h4><div><hr></div><p>We&#8217;ve already given some metrics which classify the behavior of mean-reversion and are some custom metrics I developed whilst working on pairs trading years ago, but here I&#8217;ll list through some metrics for mean-reversion that are stand-alone. The previous list was metrics that help you assess the quality of mean-reversion, but most of them still don&#8217;t optimize for mean-reversion directly, only the qualities we would want to see if we had mean-reversion. Hence, most of these optimizations are multi-objective.</p><p>This is by no means a complete list and should only serve as inspiration. The key is to focus on how these methods work and understand what we are actually capturing.</p><ol><li><p>ADF</p></li><li><p>KPSS</p></li><li><p>Portmanteau</p></li><li><p>Hurst</p></li><li><p>Crossing Statistic</p></li><li><p>AR-HMM (similar idea as BTCD, Levendovszky &amp; Sipos wrote the literature here)</p></li><li><p>Zivot Andrews</p></li><li><p>BTCD - Box Tiao Canonical Decomposition (also called Variance Ratio or VAR(1))</p></li><li><p>Kanaya, 2011</p></li><li><p>Delft et al, 2017</p></li><li><p>Basu et al, 2009</p></li><li><p>Delft and Eichler, 2018</p></li><li><p>Vogt &amp; Dette, 2015</p></li></ol><p>There is existing literature finding semi-definite relaxations for a lot of these metrics so that we can optimize for them in a non-sparse manner before using greedy search to make it sparse, but some of them do not have such relaxations published. One such example is the Hurst exponent, which is a shame because it performs so well once relaxed. Pick up a copy of Boyd&#8217;s Convex Optimization and work through it yourself, it isn&#8217;t too hard if you have the background down.</p><p>Mean reversion strength and robustness are often 2 different tests. In my experience, it is always the tests like Portmanteau which scarcely produce stationarity but also perform the best. You just need to control for stationarity/robustness of the portfolio after the fact in a validation set. </p><p>Here is an example with the use of a validation set:</p><p>Train 30 portfolios using portmanteau as your objective (train set is 2x as long as test), then for a period equal in length to our test set we wait and watch the portfolios, we then rank them all on their ADF scores or some stationarity metric, and then take the top 3. We run these 3 live in our test set.</p><p>Our validation set created a trade-off where we were able to reduce the chance of overfitting by having a period where portfolios could decay after being trained and then can be thrown out before actually trading them. We also improve stability by picking the most stationary portfolios. This comes at the cost of information decay. Instead of being run right after training, when the optimization is most relevant, we had to wait for the validation set meaning that some good portfolios potentially lost mean-reversion strength. For me, the validation set was a great choice in most cases that I worked on, but I would only use it for short-term pairs trading where mean-reversion comes first and stationarity comes second. Longer term you cannot afford to wait because this is a timespan of multiple months, you wouldn&#8217;t want to trade a portfolio trained over a year ago.</p><p></p><h4>Optimization Metrics (Alternative Objectives)</h4><div><hr></div><p>We have already listed quite a few alternative metrics under the area of quality of mean-reversion so the remaining metrics focus on transaction costs/practicality.</p><p>Our goal is to reduce the amount of notional needed to get a net exposure as this increases costs. If I need 10x net in terms of notional volume to capture a 10% move in the spread, I am effectively paying 10x fees. If I need 3x the net exposure in terms of notional then I have less than 1/3 the cost if I was to capture the same move.</p><p>I won&#8217;t go ahead and list them all as they are pretty self-explanatory, but you should focus on what drives costs. This should also be a part of the execution. If it is 1 asset long against 3 others short then you can probably execute that 1 asset as a limit order / using actual smart execution where you have some time to execute the order. If it was 3 vs 3 then you have executed 16.5% of the portfolio if you fill one, but if this is 3v1 and you execute the 1 then you have nailed 50% of the portfolio in one fill. If there are 4 orders you get quite a complicated problem of unhedged exposures whilst some legs have been filled. This is another complex problem to solve, one that is rewarded with alpha. </p><p>There is also a significant literature on optimization for leverage / budget constraints as well as other real-world constraints that users will deal with for optimizing a full suite of pairs trading portfolios. Literature on this is included at the end.</p><p></p><h4>Methods For Optimization</h4><div><hr></div><p>There are many methods to optimize your portfolio. I will list some of them, specifically the ones I have tended to look at, but will probably ignore others. Do your own research here, but note that the right model will not make you any alpha, but the wrong model will sure as shit prevent you from finding it.</p><ul><li><p>LASSO (brute force)</p></li><li><p>Simulated Annealing (Dual annealing is better)</p></li><li><p>Basinhopping (I prefer this to the one above / they are very similar)</p></li><li><p>Greedy </p></li><li><p>Truncation</p></li><li><p>SDP (Semi-Definite Programming)</p></li><li><p>Non-sparse solving as GEP (used in methods like Greedy / Truncation as a sub-problem)</p></li><li><p>Feed Forward Neural Networks (They don&#8217;t work, but I will give them the mention)</p></li><li><p>Cyclical Coordinate Descent</p></li><li><p>Other Brute Force-Based Approaches</p></li><li><p>DSPCA (SDP is an extension of this)</p></li><li><p>DC-PCA (difference of convex functions algorithm, DCA)</p></li></ul><p>Relevant literature can be found at the end.</p><p></p><h4>Non-Optimization Focused Approaches</h4><div><hr></div><p>We have tackled pairs trading within the framework of optimization, but there are other ways to think of it as well. I prefer thinking of it as a robust optimization challenge and have found a lot of success this way, but there are also approaches that model the relationships between assets instead of optimizing for a final goal.</p><p>The primary approach here is copulas, which can be extended into higher dimensions with vine copulas. This is an approach that performs well and should not be discounted, but it is not something we will dive too deep into.</p><p>There are also models which use graphs, but those lean more into the lead-lag literature where we model it as a network.</p><p>Optimization methods still play a key role in these as we need to identify our starting universe. This is often done by creating a portfolio using the greedy method and then fitting a copula / vine copula / whatever you want to model to the constituents.</p><p></p><h4>Additional Areas of Study</h4><div><hr></div><p>We have not covered the trading of the spread, universe selection, or regime shift models (the existing literature sucks, just ask yourself &#8220;is this portfolio different enough OOS compared to IS that I actually care.&#8221; If the mean reversion is slightly lower but it is still stable then it is fine, if the mean reversion is gone and it is unstable then it is useless. There is no need to use a fancy HMM model, a simple metric should serve as an easy proxy).</p><p>Universe selection is also an extensive topic and as we saw in the last articles it certainly plays a role in the final output. This can be done by grouping based on industry, or using a simple method to optimize for some metric (maybe average correlation between assets, can significantly speed up this process by taking the eigenportfolios and using the correlation vs the main eigenportfolios instead of pairwise, this reduces noise / overfitting and makes compute faster - I&#8217;d still use greedy alongside this though).</p><p>There are also machine learning-based methods to universe selection like clustering algorithms (HDBSCAN / DBSCAN is the go-to as K-means produces groups that tend to look like a Voronoi diagram), but at the end of the day the metrics you cluster by are still the most important part. </p><p></p><h4>Conclusion</h4><div><hr></div><p>I hope to end on the note that finding alpha is hard. I gave a list of custom metrics I developed over my time, but to find your own alpha you need to take the same route of understanding these effects and how they behave. How can I isolate effects that improve performance and then capture them without hurting other objectives? </p><p>We also didn&#8217;t dive much into the problem of trading spreads as this is a whole article on its own.</p><p>This should serve as a complete introduction to creating portfolios for pairs trading, I&#8217;ll leave it up to the reader to form their own ideas on how to then trade these portfolios as well as come up with novel modifications (coming from an area of understanding/observation of the effects) to find new alpha. </p><p>If you enjoyed the post consider subscribing! There are also a few articles I&#8217;ve previously written that take a more practical dive into different methods so feel free to check them out.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.algos.org/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">Quant&#8217;s Substack 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><h4>Literature</h4><div><hr></div><p>&#8220;Three l1 based nonconvex methods in constructing sparse mean reverting portfolios&#8221;</p><p>&#8220;Mean-Reverting Portfolio With Budget Constraint&#8221;</p><p>&#8220;Efficient computation of mean reverting portfolios using cyclical coordinate descent&#8221;</p><p>&#8220;A Novel Optimization Approach to Sparse Mean-Reverting Portfolios&#8221;</p><p>&#8220;Optimizing a portfolio of mean-reverting assets with transaction costs via a feedforward neural network&#8221;</p><p>&#8220;Constructing sparse and fast mean reverting portfolios&#8221;</p><p>&#8220;Optimizing Sparse Mean Reverting Portfolios with AR-HMMs in the Presence of Secondary Effects&#8221;</p><p>&#8220;Parallel Optimization of Sparse Portfolios with AR-HMMs&#8221;</p><p>&#8220;Optimal Mean-Reverting Portfolio With Leverage Constraint for Statistical Arbitrage in Finance&#8221;</p><p>&#8220;Sparse mean-reverting portfolios via penalized likelihood optimization&#8221;</p><p>&#8220;Sparse, mean reverting portfolio selection using simulated annealing&#8221;</p><p>&#8220;Developing a fully automated algo-trading system&#8221;</p><p>&#8220;Optimizing sparse mean reverting portfolios&#8221;</p><p>&#8220;A Penalty Decomposition Algorithm with Greedy Improvement for Mean-Reverting Portfolios with Sparsity and Volatility Constraints&#8221;</p><p>&#8220;A simplified approach to parameter estimation and selection of sparse, mean reverting portfolios&#8221;</p><p>&#8220;Mean-Reverting Portfolio Design via Majorization-Minimization Method&#8221;</p><p>&#8220;Identifying Small Mean Reverting Portfolios&#8221;</p><p>&#8220;POLYNOMIAL TIME HEURISTIC OPTIMIZATION METHODS APPLIED TO PROBLEMS IN COMPUTATIONAL FINANCE&#8221;</p><p>&#8220;Detection of mean-reverting phenomenon from American stocks with unsupervised techniques&#8221;</p><p>&#8220;Trading sparse, mean reverting portfolios using VAR(1) and LSTM prediction&#8221;</p><p>&#8220;Solving Mixed Integer Programs Using Neural Networks&#8221;</p><p>&#8220;Mean Reversion with a Variance Threshold&#8221;</p><p>&#8220;Mean-Reverting Portfolios Tradeoffs between Sparsity and Volatility&#8221;</p><p>&#8220;An Intelligent Model for Pairs Trading Using Genetic Algorithms&#8221;</p><p>&#8220;An Advanced Optimization Approach for Long-Short Pairs Trading Strategy Based on Correlation Coefficients and Bollinger Bands&#8221;</p><p>&#8220;Discovery of multi-spread portfolio strategies for weakly-cointegrated instruments using boosting-based optimization&#8221;</p><p>&#8220;Evolutionary multi-objective optimization for multivariate pairs trading&#8221;</p><p>&#8220;Multi-asset pair-trading strategy: A statistical learning approach&#8221;</p><p>&#8220;M of a kind: A Multivariate Approach at Pairs Trading&#8221;</p><p>&#8220;Statistical arbitrage in the US equities market&#8221;</p><p>&#8220;OPTIMAL PORTFOLIO DESIGN FOR STATISTICAL ARBITRAGE IN FINANCE&#8221;</p><p>&#8220;Multivariate Pair Trading by Volatility &amp; Model Adaption Trade-of&#8221;</p><p></p>]]></content:encoded></item><item><title><![CDATA[Greedy Method for SMRPs]]></title><description><![CDATA[Sparse Mean-Reverting Portfolios generated with the greedy method.]]></description><link>https://www.algos.org/p/greedy-method-for-smrps</link><guid isPermaLink="false">https://www.algos.org/p/greedy-method-for-smrps</guid><dc:creator><![CDATA[Quant Arb]]></dc:creator><pubDate>Mon, 20 Mar 2023 22:33:36 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/9ff4aed8-f760-4b69-ad38-4e14378a1d77_937x521.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Vkg5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F184dfa2e-bade-470e-ac66-7dd659ad2ba4_364x204.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Vkg5!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F184dfa2e-bade-470e-ac66-7dd659ad2ba4_364x204.gif 424w, https://substackcdn.com/image/fetch/$s_!Vkg5!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F184dfa2e-bade-470e-ac66-7dd659ad2ba4_364x204.gif 848w, https://substackcdn.com/image/fetch/$s_!Vkg5!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F184dfa2e-bade-470e-ac66-7dd659ad2ba4_364x204.gif 1272w, https://substackcdn.com/image/fetch/$s_!Vkg5!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F184dfa2e-bade-470e-ac66-7dd659ad2ba4_364x204.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Vkg5!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F184dfa2e-bade-470e-ac66-7dd659ad2ba4_364x204.gif" width="648" height="363.16483516483515" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/184dfa2e-bade-470e-ac66-7dd659ad2ba4_364x204.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:204,&quot;width&quot;:364,&quot;resizeWidth&quot;:648,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Laser Grid GIFs - Find &amp; Share on GIPHY&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Laser Grid GIFs - Find &amp; Share on GIPHY" title="Laser Grid GIFs - Find &amp; Share on GIPHY" srcset="https://substackcdn.com/image/fetch/$s_!Vkg5!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F184dfa2e-bade-470e-ac66-7dd659ad2ba4_364x204.gif 424w, https://substackcdn.com/image/fetch/$s_!Vkg5!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F184dfa2e-bade-470e-ac66-7dd659ad2ba4_364x204.gif 848w, https://substackcdn.com/image/fetch/$s_!Vkg5!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F184dfa2e-bade-470e-ac66-7dd659ad2ba4_364x204.gif 1272w, https://substackcdn.com/image/fetch/$s_!Vkg5!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F184dfa2e-bade-470e-ac66-7dd659ad2ba4_364x204.gif 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><h4>Introduction</h4>
      <p>
          <a href="https://www.algos.org/p/greedy-method-for-smrps">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Truncation Method for SMRPs]]></title><description><![CDATA[Sparse Mean-Reverting Portfolios generated with the truncation method.]]></description><link>https://www.algos.org/p/truncation-method-for-smrps</link><guid isPermaLink="false">https://www.algos.org/p/truncation-method-for-smrps</guid><dc:creator><![CDATA[Quant Arb]]></dc:creator><pubDate>Thu, 16 Mar 2023 02:40:10 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a754691-3b6c-4f2c-9d0a-d6d71f583723_989x472.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h4>Introduction</h4><div><hr></div><p>We will be building off the previous article on non-sparse synthetic portfolios and look at the truncation method for generating sparse mean reverting portfolios. This is part of a 3 article series where we start with a non-sparse method and then climb into some heuristic approaches to sparsity. Our first heuristic approach is the truncation method. This is quite an easy method to understand so this should be a comfortable introduction; I&#8217;ll also be including code so that readers can follow along themselves.</p><p>As with before, we will be using a pre-defined set of stocks in the S&amp;P500 that are all in the same industry. Keeping the data the same should help for easier comparison.</p><p></p><h4>Data</h4><div><hr></div><p>Since the data is the exact same data as the previous article, with the exact same train and test periods, there is no need to explain it again. Readers are free to reference back to that for more information on how the data is organised. </p><p></p><h4>Methodology</h4><div><hr></div><p>The Truncation method is probably the simplest of all.  To start, we calculate the non-sparse solution with all the tickers as we did in the previous article. Then we normalise our weights (for the minimum eigenvalue weights) by the price of each asset. Take the absolute value, rank them largest to smallest, adjust them so that they total to 1 (thus, our weights are the % contribution to the notional volume needed to trade this portfolio), then select our top x tickers by contribution.</p><p>We can then retrain on this new, truncated, set of assets or we can skip this step and leave the weights unchanged (using the real weights of course, not the adjusted &amp; absoluted wieghts as those only represent each asset&#8217;s contribution). </p><p>For our example, we will take the top 5 assets by contribution. We end up only discarding about 5-10% of the notional volume, but remove more than half the assets. This lets us achieve a relatively sparse portfolio, and we will see that the portfolio that wasn&#8217;t retrained is stronger OOS. Less is more in many cases, and reducing the amount of fitting we perform is a great way to ensure robust portfolios. When the discarded % is this low we are able to do this, but only because these components are noise that have no effect on our OOS portfolio. </p><p>The simplicity of this method makes it easy to understand / implement. Our next article will cover the greedy method which is a little bit more work, but is a far better method. </p><p>Truncation is super fast to compute, making it the fastest way to build sparse mean-reverting portfolios. This is ideal for working with large datasets, but otherwise greedy is superior, something we will show in the next article for this series.</p><p></p><h4>Implementation (CODE)</h4><div><hr></div><p>I am starting off from the same place as before (reference previous article) with the exact same data, exact same weights, and exact same non-sparse portfolio.</p><pre><code>eigvals, wgts = portmanteau_gep(df_train, 10)</code></pre><p>This is the same method we coded up last article, and when we plotted our minimum eigenvalue portfolio we returned 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_!KqHH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21a7d329-332d-4ea5-a9b1-166c9692ec4d_970x483.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!KqHH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21a7d329-332d-4ea5-a9b1-166c9692ec4d_970x483.png 424w, https://substackcdn.com/image/fetch/$s_!KqHH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21a7d329-332d-4ea5-a9b1-166c9692ec4d_970x483.png 848w, https://substackcdn.com/image/fetch/$s_!KqHH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21a7d329-332d-4ea5-a9b1-166c9692ec4d_970x483.png 1272w, https://substackcdn.com/image/fetch/$s_!KqHH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21a7d329-332d-4ea5-a9b1-166c9692ec4d_970x483.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!KqHH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21a7d329-332d-4ea5-a9b1-166c9692ec4d_970x483.png" width="970" height="483" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/21a7d329-332d-4ea5-a9b1-166c9692ec4d_970x483.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:483,&quot;width&quot;:970,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:65806,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!KqHH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21a7d329-332d-4ea5-a9b1-166c9692ec4d_970x483.png 424w, https://substackcdn.com/image/fetch/$s_!KqHH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21a7d329-332d-4ea5-a9b1-166c9692ec4d_970x483.png 848w, https://substackcdn.com/image/fetch/$s_!KqHH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21a7d329-332d-4ea5-a9b1-166c9692ec4d_970x483.png 1272w, https://substackcdn.com/image/fetch/$s_!KqHH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21a7d329-332d-4ea5-a9b1-166c9692ec4d_970x483.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 start by creating our adjustment factor, we then use this to form our contribution list as explained in the methodology. </p><p>The reason we multiply by adjustment factor divided by itself (basically all ones) is to take our weights from a numpy array with no tickers attached to a pandas array where the index is our ticker names. They are aligned in the same order so this is fine. Doing this lets us select the unadjusted weights by ticker which is easier. My approach is a very dirty way to do it, but hey it works. I also have infrequently used this model in my research due to the superiority of the greedy method (hence the dirty code), but insights about how non-sparse methods can overfit weights are revealed a lot more intuitively in our results so well worth learning.</p><p>Finally, normalize the contribution list so that all values total 1 (thus representing the % of notional volume each ticker contributes). </p><pre><code># Take mean of each asset, then divide by average price to normalize values.
adjustment_factor = df_train.mean() / df_train.mean().mean()

# Divide our weights by our adjustment factor, absolute them, then sort.
contribution_list = abs(wgts[0] / adjustment_factor)
contribution_list = contribution_list.sort_values(ascending=False);

# putting our weights into pandas with tickers attached (dirty af)
ticker_weights = wgts[0] * (adjustment_factor / adjustment_factor)

# Normalizing so all total to 1
contribution_list /= contribution_list.sum()</code></pre><p>Below is our contribution list, we take the top 5, which means we are only losing about 10% of the notional volume, contributions which are effectively 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_!v-6H!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F152e50d9-ceb2-4778-9c6c-c2014a085c74_271x268.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!v-6H!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F152e50d9-ceb2-4778-9c6c-c2014a085c74_271x268.png 424w, https://substackcdn.com/image/fetch/$s_!v-6H!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F152e50d9-ceb2-4778-9c6c-c2014a085c74_271x268.png 848w, https://substackcdn.com/image/fetch/$s_!v-6H!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F152e50d9-ceb2-4778-9c6c-c2014a085c74_271x268.png 1272w, https://substackcdn.com/image/fetch/$s_!v-6H!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F152e50d9-ceb2-4778-9c6c-c2014a085c74_271x268.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!v-6H!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F152e50d9-ceb2-4778-9c6c-c2014a085c74_271x268.png" width="271" height="268" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/152e50d9-ceb2-4778-9c6c-c2014a085c74_271x268.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:268,&quot;width&quot;:271,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:9072,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!v-6H!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F152e50d9-ceb2-4778-9c6c-c2014a085c74_271x268.png 424w, https://substackcdn.com/image/fetch/$s_!v-6H!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F152e50d9-ceb2-4778-9c6c-c2014a085c74_271x268.png 848w, https://substackcdn.com/image/fetch/$s_!v-6H!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F152e50d9-ceb2-4778-9c6c-c2014a085c74_271x268.png 1272w, https://substackcdn.com/image/fetch/$s_!v-6H!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F152e50d9-ceb2-4778-9c6c-c2014a085c74_271x268.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>sparse_tickers = contribution_list[:5].index.tolist()

sparse_weights = ticker_weights.loc[sparse_tickers].values.tolist()</code></pre><p>We take the top 5 tickers to get our sparse tickers, then we use the ticker weights (our actual weights which haven&#8217;t been changed short of the redundant transform - multiplying by 1 - we did to add tickers as the index). </p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cRgb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86ee697e-e3d2-4870-ac3c-3dcba646ed06_136x122.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cRgb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86ee697e-e3d2-4870-ac3c-3dcba646ed06_136x122.png 424w, https://substackcdn.com/image/fetch/$s_!cRgb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86ee697e-e3d2-4870-ac3c-3dcba646ed06_136x122.png 848w, https://substackcdn.com/image/fetch/$s_!cRgb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86ee697e-e3d2-4870-ac3c-3dcba646ed06_136x122.png 1272w, https://substackcdn.com/image/fetch/$s_!cRgb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86ee697e-e3d2-4870-ac3c-3dcba646ed06_136x122.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cRgb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86ee697e-e3d2-4870-ac3c-3dcba646ed06_136x122.png" width="136" height="122" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/86ee697e-e3d2-4870-ac3c-3dcba646ed06_136x122.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:122,&quot;width&quot;:136,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1551,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!cRgb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86ee697e-e3d2-4870-ac3c-3dcba646ed06_136x122.png 424w, https://substackcdn.com/image/fetch/$s_!cRgb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86ee697e-e3d2-4870-ac3c-3dcba646ed06_136x122.png 848w, https://substackcdn.com/image/fetch/$s_!cRgb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86ee697e-e3d2-4870-ac3c-3dcba646ed06_136x122.png 1272w, https://substackcdn.com/image/fetch/$s_!cRgb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86ee697e-e3d2-4870-ac3c-3dcba646ed06_136x122.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The above list is our final set of tickers, our sparse tickers. Plotting the portfolio (using the original wieghts) we get the below results out of sample (we have been using df_train so far, this chart is df_test).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-HDY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a754691-3b6c-4f2c-9d0a-d6d71f583723_989x472.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-HDY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a754691-3b6c-4f2c-9d0a-d6d71f583723_989x472.png 424w, https://substackcdn.com/image/fetch/$s_!-HDY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a754691-3b6c-4f2c-9d0a-d6d71f583723_989x472.png 848w, https://substackcdn.com/image/fetch/$s_!-HDY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a754691-3b6c-4f2c-9d0a-d6d71f583723_989x472.png 1272w, https://substackcdn.com/image/fetch/$s_!-HDY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a754691-3b6c-4f2c-9d0a-d6d71f583723_989x472.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-HDY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a754691-3b6c-4f2c-9d0a-d6d71f583723_989x472.png" width="989" height="472" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2a754691-3b6c-4f2c-9d0a-d6d71f583723_989x472.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:472,&quot;width&quot;:989,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:74399,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!-HDY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a754691-3b6c-4f2c-9d0a-d6d71f583723_989x472.png 424w, https://substackcdn.com/image/fetch/$s_!-HDY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a754691-3b6c-4f2c-9d0a-d6d71f583723_989x472.png 848w, https://substackcdn.com/image/fetch/$s_!-HDY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a754691-3b6c-4f2c-9d0a-d6d71f583723_989x472.png 1272w, https://substackcdn.com/image/fetch/$s_!-HDY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a754691-3b6c-4f2c-9d0a-d6d71f583723_989x472.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 above porfolio is actually more robust than the prior portfolio because we have removed the useless assets. As shown below when we take the remaining assets and use them instead, they create a drift term which actually hurts our results:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!R18o!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41c86167-4016-4f0c-994e-d082e0eb3c52_945x471.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!R18o!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41c86167-4016-4f0c-994e-d082e0eb3c52_945x471.png 424w, https://substackcdn.com/image/fetch/$s_!R18o!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41c86167-4016-4f0c-994e-d082e0eb3c52_945x471.png 848w, https://substackcdn.com/image/fetch/$s_!R18o!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41c86167-4016-4f0c-994e-d082e0eb3c52_945x471.png 1272w, https://substackcdn.com/image/fetch/$s_!R18o!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41c86167-4016-4f0c-994e-d082e0eb3c52_945x471.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!R18o!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41c86167-4016-4f0c-994e-d082e0eb3c52_945x471.png" width="945" height="471" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/41c86167-4016-4f0c-994e-d082e0eb3c52_945x471.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:471,&quot;width&quot;:945,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:60771,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!R18o!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41c86167-4016-4f0c-994e-d082e0eb3c52_945x471.png 424w, https://substackcdn.com/image/fetch/$s_!R18o!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41c86167-4016-4f0c-994e-d082e0eb3c52_945x471.png 848w, https://substackcdn.com/image/fetch/$s_!R18o!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41c86167-4016-4f0c-994e-d082e0eb3c52_945x471.png 1272w, https://substackcdn.com/image/fetch/$s_!R18o!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41c86167-4016-4f0c-994e-d082e0eb3c52_945x471.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>Some mean reversion, but mostly drift. This is likely why our sparse portfolio appears much more stationary out of sample than our non-sparse portfolio. </p><p>Looking at our retrained portfolio we quickly re-run the code, as shown below:</p><pre><code>eigvals, wgts = portmanteau_gep(df_train[sparse_tickers], 10)</code></pre><p>and then we plot our new portfolio and achieve this porfolio out of sample:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nA5K!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F613af519-353d-4b40-a549-3945769944d2_934x472.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nA5K!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F613af519-353d-4b40-a549-3945769944d2_934x472.png 424w, https://substackcdn.com/image/fetch/$s_!nA5K!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F613af519-353d-4b40-a549-3945769944d2_934x472.png 848w, https://substackcdn.com/image/fetch/$s_!nA5K!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F613af519-353d-4b40-a549-3945769944d2_934x472.png 1272w, https://substackcdn.com/image/fetch/$s_!nA5K!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F613af519-353d-4b40-a549-3945769944d2_934x472.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nA5K!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F613af519-353d-4b40-a549-3945769944d2_934x472.png" width="934" height="472" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/613af519-353d-4b40-a549-3945769944d2_934x472.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:472,&quot;width&quot;:934,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:60635,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!nA5K!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F613af519-353d-4b40-a549-3945769944d2_934x472.png 424w, https://substackcdn.com/image/fetch/$s_!nA5K!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F613af519-353d-4b40-a549-3945769944d2_934x472.png 848w, https://substackcdn.com/image/fetch/$s_!nA5K!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F613af519-353d-4b40-a549-3945769944d2_934x472.png 1272w, https://substackcdn.com/image/fetch/$s_!nA5K!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F613af519-353d-4b40-a549-3945769944d2_934x472.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 portfolio in-sample:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!X28z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F608c2298-847a-413d-8ac5-7bcde8d75892_965x475.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!X28z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F608c2298-847a-413d-8ac5-7bcde8d75892_965x475.png 424w, https://substackcdn.com/image/fetch/$s_!X28z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F608c2298-847a-413d-8ac5-7bcde8d75892_965x475.png 848w, https://substackcdn.com/image/fetch/$s_!X28z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F608c2298-847a-413d-8ac5-7bcde8d75892_965x475.png 1272w, https://substackcdn.com/image/fetch/$s_!X28z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F608c2298-847a-413d-8ac5-7bcde8d75892_965x475.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!X28z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F608c2298-847a-413d-8ac5-7bcde8d75892_965x475.png" width="965" height="475" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/608c2298-847a-413d-8ac5-7bcde8d75892_965x475.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:475,&quot;width&quot;:965,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:77741,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!X28z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F608c2298-847a-413d-8ac5-7bcde8d75892_965x475.png 424w, https://substackcdn.com/image/fetch/$s_!X28z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F608c2298-847a-413d-8ac5-7bcde8d75892_965x475.png 848w, https://substackcdn.com/image/fetch/$s_!X28z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F608c2298-847a-413d-8ac5-7bcde8d75892_965x475.png 1272w, https://substackcdn.com/image/fetch/$s_!X28z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F608c2298-847a-413d-8ac5-7bcde8d75892_965x475.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 only have one example here, and the jury is out on whether retraining is a good idea, it probably is in my view, but we ran into the same issue that we previously were trying to avoid where a large majority of the weights are basically noise because the non-sparse method finds a weight for every asset in the portfolio, overfitting some when they should just be 0. This results in a few being very small weights which barely contribute to the portfolio, but help overfit towards our objective of minimising portmanteau (only in-sample, out of sample this overfitting comes to life and they actually hurt more than they help as we saw).</p><p></p><h4>Conclusion</h4><div><hr></div><p>We looked at a very simple method for making portfolios more robust and reducing turnover. We also showed the ugly side of non-sparse portfolios where the majority of the weights are overfit noise which do not contribute significantly to the final portfolio. This is a fantastic example of how quick and dirty methods can vastly improve performance by avoiding unneccessary fitting. </p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Non-Sparse Synthetic Portfolios]]></title><description><![CDATA[Implementing synthetic portfolios with non-sparse methods]]></description><link>https://www.algos.org/p/non-sparse-synthetic-portfolios</link><guid isPermaLink="false">https://www.algos.org/p/non-sparse-synthetic-portfolios</guid><dc:creator><![CDATA[Quant Arb]]></dc:creator><pubDate>Wed, 08 Mar 2023 03:21:12 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!zccM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab951e4d-5b86-4311-9bf3-ffda95f07390_912x466.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h4>Introduction</h4><div><hr></div><p>Building on previous articles in the area of synthetic portfolios, we will explore a convex method for building synthetic portfolios without introducing constraints like sparsity. In future research, we will look at 2 heuristic approaches that allow us to build on these methods and introduce sparsity constraints. In this article, we once again look at the portmanteau criterion as our chosen method for generating non-sparse synthetic portfolios. I won&#8217;t dive too much into the theory here since you can read up on that yourself (I&#8217;ll butcher it anyways), but I will walk through a code implementation of this. We do not produce any backtests or strategies here, but we do present a tool every quant should have. </p><p></p><h4>Data</h4><div><hr></div><p>We would have a pretty hard time trying to form a robust portfolio using a large number of portfolio constituents. There is a much larger probability of overfitting, and in other cases, this can be impractical for computing reasons. The GEP (generalized eigenvalue problem) framework used to solve this optimization is highly compute efficient but the downside is that it cannot produce a sparse output. </p><p>Our universe consists of S&amp;P500 stocks in the form of daily close prices for each asset. We ensure that our universe is part of the S&amp;P500 for 3 main reasons:</p><ul><li><p>Greater ability to trade portfolios in size due to better book depth.</p></li><li><p>We don&#8217;t need short-margin availability datasets as margin is probably available.</p></li><li><p>Fake mean-reversion from the bid/ask bounce is less pronounced because of tighter spreads.</p></li></ul><p>Starting with the first point, we need to ensure that our portfolios will be able to absorb some decent size without creating a large impact. This is important for many traders as something you can only put $10,000 behind but makes 60% a year is probably not even worth coding up despite the great APR.</p><p>The next two concerns are designed to avoid situations where our backtests aren&#8217;t realistic for live trading. This is either from assets being unavailable to short or from mistaking the price bouncing between the bid and ask as actual mean reversion. Most bars use the last trade to form the close. If this trade is a buy and in the next candle it is a sell we will see the price change by the size of the bid/ask spread. The actual fair value could have remained unchanged during this period. </p><p>To form our portfolios we should select the optimal assets ahead of time. Otherwise, we will not be likely to generate a robust portfolio. In our case, we use the below list of tickers in the electrical utility category. This is an area that can be expanded upon greatly by looking at other categories/themes or even by applying clustering algorithms to form your portfolios.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wL6p!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F925054ca-a190-41b1-a5da-3d4d27af2677_769x59.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wL6p!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F925054ca-a190-41b1-a5da-3d4d27af2677_769x59.png 424w, https://substackcdn.com/image/fetch/$s_!wL6p!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F925054ca-a190-41b1-a5da-3d4d27af2677_769x59.png 848w, https://substackcdn.com/image/fetch/$s_!wL6p!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F925054ca-a190-41b1-a5da-3d4d27af2677_769x59.png 1272w, https://substackcdn.com/image/fetch/$s_!wL6p!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F925054ca-a190-41b1-a5da-3d4d27af2677_769x59.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wL6p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F925054ca-a190-41b1-a5da-3d4d27af2677_769x59.png" width="769" height="59" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/925054ca-a190-41b1-a5da-3d4d27af2677_769x59.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:59,&quot;width&quot;:769,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:5056,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!wL6p!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F925054ca-a190-41b1-a5da-3d4d27af2677_769x59.png 424w, https://substackcdn.com/image/fetch/$s_!wL6p!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F925054ca-a190-41b1-a5da-3d4d27af2677_769x59.png 848w, https://substackcdn.com/image/fetch/$s_!wL6p!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F925054ca-a190-41b1-a5da-3d4d27af2677_769x59.png 1272w, https://substackcdn.com/image/fetch/$s_!wL6p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F925054ca-a190-41b1-a5da-3d4d27af2677_769x59.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p> </p><h4>Minimizing Portmanteau Statistic as a GEP</h4><div><hr></div><p>Formulating our optimization as a generalized eigenvalue problem (GEP), we can greatly reduce the computational complexity and quickly find an optimal solution. If this sounds a bit too complicated you&#8217;ll be happy to hear we are basically using PCA. </p><p>For background reading, this is one of the best tutorials on the topic:</p><p>https://arxiv.org/pdf/1903.11240.pdf</p><p>We will be using the portmanteau statistic (more info in the link below) which we have covered in previous articles. This tests for white noise using autocorrelation. As a result of this, you have to specify the number of lags, in our case, we will use 10, but it is generally recommended to go lower for mean-reversion (what we optimize for here), and higher for momentum. </p><p>https://en.wikipedia.org/wiki/Ljung%E2%80%93Box_test</p><p>We will need to solve the problem:</p><p>Modify w (our matrix of weights for each asset) to minimize the portmanteau statistic with lag p. M represents the autocovariance matrix of lag i. </p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NK07!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb558ccf1-f622-43e2-b659-d6b6e756e20a_464x119.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NK07!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb558ccf1-f622-43e2-b659-d6b6e756e20a_464x119.png 424w, https://substackcdn.com/image/fetch/$s_!NK07!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb558ccf1-f622-43e2-b659-d6b6e756e20a_464x119.png 848w, https://substackcdn.com/image/fetch/$s_!NK07!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb558ccf1-f622-43e2-b659-d6b6e756e20a_464x119.png 1272w, https://substackcdn.com/image/fetch/$s_!NK07!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb558ccf1-f622-43e2-b659-d6b6e756e20a_464x119.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NK07!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb558ccf1-f622-43e2-b659-d6b6e756e20a_464x119.png" width="464" height="119" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b558ccf1-f622-43e2-b659-d6b6e756e20a_464x119.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:119,&quot;width&quot;:464,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:16619,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!NK07!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb558ccf1-f622-43e2-b659-d6b6e756e20a_464x119.png 424w, https://substackcdn.com/image/fetch/$s_!NK07!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb558ccf1-f622-43e2-b659-d6b6e756e20a_464x119.png 848w, https://substackcdn.com/image/fetch/$s_!NK07!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb558ccf1-f622-43e2-b659-d6b6e756e20a_464x119.png 1272w, https://substackcdn.com/image/fetch/$s_!NK07!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb558ccf1-f622-43e2-b659-d6b6e756e20a_464x119.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>We know p ahead of time and it is a parameter we define ourselves, this is the lag parameter that was mentioned before.</p><p></p><h4>Implementation (Optimization)</h4><div><hr></div><p>The first function we need to define is one that produces our autocovariance matrix. This is done below:</p><pre><code>def autocov_matrix_calc(arr, p):
    m = arr.shape[0]
    arr_demeaned = arr - np.nanmean(arr, axis=0)
    return 1 / (m - p - 1) * arr_demeaned[p:].T @ arr_demeaned[:m - p]; </code></pre><p>Next, we rearrange our optimization problem to produce a matrix we can find the eigenvalues/vectors of:</p><pre><code>import pandas as pd;
import numpy as np;
from scipy.linalg import sqrtm;

def portmanteau_gep(df, lags):    
    df_normalized = df - df.mean(0);
    rho = df_normalized.cov().values
    rho_inv_sqrt = np.linalg.inv(sqrtm(rho))
    
    pmt_matrix = 0;
    for i in range(1, lags):
        autocov = autocov_matrix_calc(df.values, i)
        pmt_matrix += np.square(rho_inv_sqrt @ autocov @ rho_inv_sqrt)
    pmt_matrix /= lags;

    eigenvalues, eigenvectors = np.linalg.eig(pmt_matrix)
    asc = np.argsort(eigenvalues)
    eigenvalues, eigenvectors = eigenvalues[asc], eigenvectors[:, asc]

    wgts = rho_inv_sqrt @ eigenvectors

    return np.real(eigenvalues), np.real(wgts)</code></pre><p>The above code goes through the entire optimization logic and is all that you need to test out this model for yourself. We start by de-meaning our data. Then, we take the covariance matrix denoted as rho. After taking the inverse square root of this we can now use it to build our matrix.</p><p>This matrix is denoted as &#8220;pmt_matrix&#8221; and is produced by dot multiplying the inverse square root of our covariance matrix (twice) against the autocovariance matrix and then squaring it. We do this for each lag below our lag parameter.</p><p>After that, we divide by the number of lags so that it is an average, not a sum, and then our matrix is finished. The hard part is over now; we can simply take the eigenvalues and eigenvectors of our matrix and we are almost finished.</p><p>Finally, we sort our eigenvalues and eigenvectors. Our smallest eigenvalue's corresponding eigenvector can be dot multiplied with the inverse square root of our covariance matrix &#8220;rho_inv_sqrt&#8221; to give us the weights that minimize our portmanteau statistic. This is the weights for our mean-reverting portfolio. We can do the opposite of this to get a momentum portfolio, although, in my experience momentum portfolios are best formed using other methods and approaches not covered in this article. </p><p></p><h4>Implementation (Generating Portfolios)</h4><div><hr></div><p>Applying this method using a lag parameter of 10 to our training dataset spanning 2017-01-01 to 2018-06-01 we produce this portfolio out of sample:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zccM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab951e4d-5b86-4311-9bf3-ffda95f07390_912x466.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zccM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab951e4d-5b86-4311-9bf3-ffda95f07390_912x466.png 424w, https://substackcdn.com/image/fetch/$s_!zccM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab951e4d-5b86-4311-9bf3-ffda95f07390_912x466.png 848w, https://substackcdn.com/image/fetch/$s_!zccM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab951e4d-5b86-4311-9bf3-ffda95f07390_912x466.png 1272w, https://substackcdn.com/image/fetch/$s_!zccM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab951e4d-5b86-4311-9bf3-ffda95f07390_912x466.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zccM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab951e4d-5b86-4311-9bf3-ffda95f07390_912x466.png" width="912" height="466" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ab951e4d-5b86-4311-9bf3-ffda95f07390_912x466.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:466,&quot;width&quot;:912,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:65091,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!zccM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab951e4d-5b86-4311-9bf3-ffda95f07390_912x466.png 424w, https://substackcdn.com/image/fetch/$s_!zccM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab951e4d-5b86-4311-9bf3-ffda95f07390_912x466.png 848w, https://substackcdn.com/image/fetch/$s_!zccM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab951e4d-5b86-4311-9bf3-ffda95f07390_912x466.png 1272w, https://substackcdn.com/image/fetch/$s_!zccM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab951e4d-5b86-4311-9bf3-ffda95f07390_912x466.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 above portfolio exhibits high degrees of mean-reversion but has a hard time with stationarity. This metric is best used for short-term mean-reversion strategies so daily data isn&#8217;t the most optimal way to use this. </p><p>The (not shown) momentum portfolio (maximum eigenvalue) is quite mean-reverting since we used a short lag and portmanteau is best used for mean-reversion.</p><p></p><h4>Conclusion</h4><div><hr></div><p>The main objective for this article was to present GEPs as a foundation for future articles. In the future, we will look at the truncation and greedy methods for adapting this method to sparse portfolios using heuristics that save on compute.  </p><p>We&#8217;ve also managed to present a method for determining the optimal portfolio given a pre-selected group of assets. This is useful for strategies that work by finding groups of assets that are similar. We can use industry categories or more statistical approaches involving clustering or plain simple top z assets with the largest/smallest metric x. Hopefully, this article is useful for readers in search of a new tool they can use when developing strategies in this area.</p><p></p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Semi-Definite Programming For SMRPs]]></title><description><![CDATA[Using SDP to create sparse mean-reverting portfolios (SMRPs) with variance constraints]]></description><link>https://www.algos.org/p/semi-definite-programming-for-mrps</link><guid isPermaLink="false">https://www.algos.org/p/semi-definite-programming-for-mrps</guid><dc:creator><![CDATA[Quant Arb]]></dc:creator><pubDate>Mon, 27 Feb 2023 03:19:20 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F000a102a-3f87-41c9-923c-75112579db93_910x473.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h4>Introduction</h4><div><hr></div><p>In the previous research article, we explored the use of Monte-Carlo Minimization (MCM) as a non-convex method for finding mean-reverting portfolios. Here we will use Semi-Definite Programming (SDP) to form mean-reverting portfolios with 2 major constraints. These are variance and sparsity. </p><p>SDP is a convex method which makes it a lot more robust compared to MCM. This means that it is far better suited to longer-term pairs trading portfolios as these prioritize forming robust portfolios whereas shorter-term portfolios are best built using models that can find more complex, but also shorter-lasting relationships.</p><p>We were able to produce a strategy with significant alpha in equities markets. Avid readers are welcome to solve the optimal spread trading problem in other ways and form their own strategies after building on this work. </p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.algos.org/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">Quant&#8217;s Substack 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>Teasing results, we were able to generate significant alpha OOS using a robust methodology that makes overfitting far harder. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0Cfi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15190508-ed53-4f12-babf-2137cf1096b7_943x510.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0Cfi!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15190508-ed53-4f12-babf-2137cf1096b7_943x510.png 424w, https://substackcdn.com/image/fetch/$s_!0Cfi!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15190508-ed53-4f12-babf-2137cf1096b7_943x510.png 848w, https://substackcdn.com/image/fetch/$s_!0Cfi!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15190508-ed53-4f12-babf-2137cf1096b7_943x510.png 1272w, https://substackcdn.com/image/fetch/$s_!0Cfi!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15190508-ed53-4f12-babf-2137cf1096b7_943x510.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0Cfi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15190508-ed53-4f12-babf-2137cf1096b7_943x510.png" width="943" height="510" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/15190508-ed53-4f12-babf-2137cf1096b7_943x510.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:510,&quot;width&quot;:943,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:40094,&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;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!0Cfi!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15190508-ed53-4f12-babf-2137cf1096b7_943x510.png 424w, https://substackcdn.com/image/fetch/$s_!0Cfi!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15190508-ed53-4f12-babf-2137cf1096b7_943x510.png 848w, https://substackcdn.com/image/fetch/$s_!0Cfi!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15190508-ed53-4f12-babf-2137cf1096b7_943x510.png 1272w, https://substackcdn.com/image/fetch/$s_!0Cfi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15190508-ed53-4f12-babf-2137cf1096b7_943x510.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></p><h4>The Models </h4><div><hr></div><p>In addition to SDP, we will also be making use of Sparse Principal Component Analysis (SPCA) to enforce sparsity within our weight vector. Sparsity in this case means reducing the number of assets in our portfolio.  We also want to add a minimum variance constraint to ensure that our portfolio is volatile enough to beat fees. To trade the spread we will use a set of Bollinger Bands. This is a very simple approach as our main focus is on portfolio generation methods.</p><p></p><h4>The Data</h4><div><hr></div><p>For this analysis, we shall use data from 2017-01-01 to 2018-01-01 for our training dataset, and 2018-01-01 to 2018-06-01 for our OOS dataset. This is equities data which comes from 50 randomly sampled S&amp;P500 constituents. </p><p></p><h4>Pre-Processing</h4><div><hr></div><p>We start by taking our data and arranging it into an array of column vectors containing daily close prices for our assets. Below is what our training (top image) and testing (bottom image) datasets look like:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!B475!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe20d1351-4c96-4084-b3cb-8325f85907d3_1255x646.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!B475!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe20d1351-4c96-4084-b3cb-8325f85907d3_1255x646.png 424w, https://substackcdn.com/image/fetch/$s_!B475!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe20d1351-4c96-4084-b3cb-8325f85907d3_1255x646.png 848w, https://substackcdn.com/image/fetch/$s_!B475!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe20d1351-4c96-4084-b3cb-8325f85907d3_1255x646.png 1272w, https://substackcdn.com/image/fetch/$s_!B475!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe20d1351-4c96-4084-b3cb-8325f85907d3_1255x646.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!B475!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe20d1351-4c96-4084-b3cb-8325f85907d3_1255x646.png" width="1255" height="646" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e20d1351-4c96-4084-b3cb-8325f85907d3_1255x646.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:646,&quot;width&quot;:1255,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:78982,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!B475!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe20d1351-4c96-4084-b3cb-8325f85907d3_1255x646.png 424w, https://substackcdn.com/image/fetch/$s_!B475!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe20d1351-4c96-4084-b3cb-8325f85907d3_1255x646.png 848w, https://substackcdn.com/image/fetch/$s_!B475!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe20d1351-4c96-4084-b3cb-8325f85907d3_1255x646.png 1272w, https://substackcdn.com/image/fetch/$s_!B475!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe20d1351-4c96-4084-b3cb-8325f85907d3_1255x646.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_!lt3s!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f6e342c-9464-412a-9f49-91c74d716a36_1248x645.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lt3s!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f6e342c-9464-412a-9f49-91c74d716a36_1248x645.png 424w, https://substackcdn.com/image/fetch/$s_!lt3s!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f6e342c-9464-412a-9f49-91c74d716a36_1248x645.png 848w, https://substackcdn.com/image/fetch/$s_!lt3s!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f6e342c-9464-412a-9f49-91c74d716a36_1248x645.png 1272w, https://substackcdn.com/image/fetch/$s_!lt3s!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f6e342c-9464-412a-9f49-91c74d716a36_1248x645.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lt3s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f6e342c-9464-412a-9f49-91c74d716a36_1248x645.png" width="1248" height="645" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2f6e342c-9464-412a-9f49-91c74d716a36_1248x645.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:645,&quot;width&quot;:1248,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:79089,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!lt3s!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f6e342c-9464-412a-9f49-91c74d716a36_1248x645.png 424w, https://substackcdn.com/image/fetch/$s_!lt3s!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f6e342c-9464-412a-9f49-91c74d716a36_1248x645.png 848w, https://substackcdn.com/image/fetch/$s_!lt3s!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f6e342c-9464-412a-9f49-91c74d716a36_1248x645.png 1272w, https://substackcdn.com/image/fetch/$s_!lt3s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f6e342c-9464-412a-9f49-91c74d716a36_1248x645.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 then proceed to normalize our data. We first subtract the mean of each column, then we divide each column by the standard deviation of that column. We then get this Numpy array (for our training dataset)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3dlD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7042cf25-75e8-43bb-9165-13f01de21964_686x292.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3dlD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7042cf25-75e8-43bb-9165-13f01de21964_686x292.png 424w, https://substackcdn.com/image/fetch/$s_!3dlD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7042cf25-75e8-43bb-9165-13f01de21964_686x292.png 848w, https://substackcdn.com/image/fetch/$s_!3dlD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7042cf25-75e8-43bb-9165-13f01de21964_686x292.png 1272w, https://substackcdn.com/image/fetch/$s_!3dlD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7042cf25-75e8-43bb-9165-13f01de21964_686x292.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3dlD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7042cf25-75e8-43bb-9165-13f01de21964_686x292.png" width="686" height="292" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7042cf25-75e8-43bb-9165-13f01de21964_686x292.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:292,&quot;width&quot;:686,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:27112,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!3dlD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7042cf25-75e8-43bb-9165-13f01de21964_686x292.png 424w, https://substackcdn.com/image/fetch/$s_!3dlD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7042cf25-75e8-43bb-9165-13f01de21964_686x292.png 848w, https://substackcdn.com/image/fetch/$s_!3dlD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7042cf25-75e8-43bb-9165-13f01de21964_686x292.png 1272w, https://substackcdn.com/image/fetch/$s_!3dlD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7042cf25-75e8-43bb-9165-13f01de21964_686x292.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h4>VAR(1) Non-Sparse Optimization</h4><div><hr></div><p>We will give a quick example of how to optimize for a non-sparse portfolio using VAR(1) predictability as our optimization objective. There will also be no attempt to optimize for a minimum variance here. </p><p>We start by taking the autocovariance matrix of our normalized data using a lag of 0 and doing this again with a lag of 1. I&#8217;m sure some readers will have figured this out, but using a lag of 0 is just a normal covariance matrix. </p><p>We are effectively solving for the matrix x which minimizes our variance ratio, this is expressed as the below problem:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xuFY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F891109f8-c090-468f-9e3c-6b5e6639662b_218x97.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xuFY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F891109f8-c090-468f-9e3c-6b5e6639662b_218x97.png 424w, https://substackcdn.com/image/fetch/$s_!xuFY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F891109f8-c090-468f-9e3c-6b5e6639662b_218x97.png 848w, https://substackcdn.com/image/fetch/$s_!xuFY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F891109f8-c090-468f-9e3c-6b5e6639662b_218x97.png 1272w, https://substackcdn.com/image/fetch/$s_!xuFY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F891109f8-c090-468f-9e3c-6b5e6639662b_218x97.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xuFY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F891109f8-c090-468f-9e3c-6b5e6639662b_218x97.png" width="218" height="97" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/891109f8-c090-468f-9e3c-6b5e6639662b_218x97.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:97,&quot;width&quot;:218,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:3881,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!xuFY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F891109f8-c090-468f-9e3c-6b5e6639662b_218x97.png 424w, https://substackcdn.com/image/fetch/$s_!xuFY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F891109f8-c090-468f-9e3c-6b5e6639662b_218x97.png 848w, https://substackcdn.com/image/fetch/$s_!xuFY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F891109f8-c090-468f-9e3c-6b5e6639662b_218x97.png 1272w, https://substackcdn.com/image/fetch/$s_!xuFY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F891109f8-c090-468f-9e3c-6b5e6639662b_218x97.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>We know that minimizing this variance ratio is the same as finding the minimum generalized eigenvalue &#120582; in the equation:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fhhj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1afe7173-00ca-48f0-8693-4db383a23f8f_274x80.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fhhj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1afe7173-00ca-48f0-8693-4db383a23f8f_274x80.png 424w, https://substackcdn.com/image/fetch/$s_!fhhj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1afe7173-00ca-48f0-8693-4db383a23f8f_274x80.png 848w, https://substackcdn.com/image/fetch/$s_!fhhj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1afe7173-00ca-48f0-8693-4db383a23f8f_274x80.png 1272w, https://substackcdn.com/image/fetch/$s_!fhhj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1afe7173-00ca-48f0-8693-4db383a23f8f_274x80.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fhhj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1afe7173-00ca-48f0-8693-4db383a23f8f_274x80.png" width="274" height="80" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1afe7173-00ca-48f0-8693-4db383a23f8f_274x80.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:80,&quot;width&quot;:274,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:4174,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!fhhj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1afe7173-00ca-48f0-8693-4db383a23f8f_274x80.png 424w, https://substackcdn.com/image/fetch/$s_!fhhj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1afe7173-00ca-48f0-8693-4db383a23f8f_274x80.png 848w, https://substackcdn.com/image/fetch/$s_!fhhj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1afe7173-00ca-48f0-8693-4db383a23f8f_274x80.png 1272w, https://substackcdn.com/image/fetch/$s_!fhhj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1afe7173-00ca-48f0-8693-4db383a23f8f_274x80.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The portfolio that thus minimizes the variance ratio &#119907;(&#119909;) is given by:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iJW8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5961d8c5-bff7-4f95-aca5-b121155d8d92_194x60.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iJW8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5961d8c5-bff7-4f95-aca5-b121155d8d92_194x60.png 424w, https://substackcdn.com/image/fetch/$s_!iJW8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5961d8c5-bff7-4f95-aca5-b121155d8d92_194x60.png 848w, https://substackcdn.com/image/fetch/$s_!iJW8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5961d8c5-bff7-4f95-aca5-b121155d8d92_194x60.png 1272w, https://substackcdn.com/image/fetch/$s_!iJW8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5961d8c5-bff7-4f95-aca5-b121155d8d92_194x60.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iJW8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5961d8c5-bff7-4f95-aca5-b121155d8d92_194x60.png" width="194" height="60" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5961d8c5-bff7-4f95-aca5-b121155d8d92_194x60.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:60,&quot;width&quot;:194,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1928,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!iJW8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5961d8c5-bff7-4f95-aca5-b121155d8d92_194x60.png 424w, https://substackcdn.com/image/fetch/$s_!iJW8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5961d8c5-bff7-4f95-aca5-b121155d8d92_194x60.png 848w, https://substackcdn.com/image/fetch/$s_!iJW8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5961d8c5-bff7-4f95-aca5-b121155d8d92_194x60.png 1272w, https://substackcdn.com/image/fetch/$s_!iJW8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5961d8c5-bff7-4f95-aca5-b121155d8d92_194x60.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Where &#119911; is the eigenvector that corresponds to the minimum eigenvalue of the matrix denoted:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!507z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d92aeed-354a-429d-9fcf-99870281f7cd_218x85.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!507z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d92aeed-354a-429d-9fcf-99870281f7cd_218x85.png 424w, https://substackcdn.com/image/fetch/$s_!507z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d92aeed-354a-429d-9fcf-99870281f7cd_218x85.png 848w, https://substackcdn.com/image/fetch/$s_!507z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d92aeed-354a-429d-9fcf-99870281f7cd_218x85.png 1272w, https://substackcdn.com/image/fetch/$s_!507z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d92aeed-354a-429d-9fcf-99870281f7cd_218x85.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!507z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d92aeed-354a-429d-9fcf-99870281f7cd_218x85.png" width="218" height="85" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2d92aeed-354a-429d-9fcf-99870281f7cd_218x85.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:85,&quot;width&quot;:218,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2432,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!507z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d92aeed-354a-429d-9fcf-99870281f7cd_218x85.png 424w, https://substackcdn.com/image/fetch/$s_!507z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d92aeed-354a-429d-9fcf-99870281f7cd_218x85.png 848w, https://substackcdn.com/image/fetch/$s_!507z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d92aeed-354a-429d-9fcf-99870281f7cd_218x85.png 1272w, https://substackcdn.com/image/fetch/$s_!507z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d92aeed-354a-429d-9fcf-99870281f7cd_218x85.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Rho is our covariance matrix, and A is the coefficients of our vector autoregressive model. </p><p>Expressing this as code we perform the below series of operations. cov_matrix is our covariance matrix (autocovariance matrix with lag 0) and autocov_matrix is our autocovariance matrix with lag 1.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DP9z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46672a64-483e-4ab6-ab76-a7e6b621705b_1226x102.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DP9z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46672a64-483e-4ab6-ab76-a7e6b621705b_1226x102.png 424w, https://substackcdn.com/image/fetch/$s_!DP9z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46672a64-483e-4ab6-ab76-a7e6b621705b_1226x102.png 848w, https://substackcdn.com/image/fetch/$s_!DP9z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46672a64-483e-4ab6-ab76-a7e6b621705b_1226x102.png 1272w, https://substackcdn.com/image/fetch/$s_!DP9z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46672a64-483e-4ab6-ab76-a7e6b621705b_1226x102.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DP9z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46672a64-483e-4ab6-ab76-a7e6b621705b_1226x102.png" width="1226" height="102" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/46672a64-483e-4ab6-ab76-a7e6b621705b_1226x102.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:102,&quot;width&quot;:1226,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:12309,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!DP9z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46672a64-483e-4ab6-ab76-a7e6b621705b_1226x102.png 424w, https://substackcdn.com/image/fetch/$s_!DP9z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46672a64-483e-4ab6-ab76-a7e6b621705b_1226x102.png 848w, https://substackcdn.com/image/fetch/$s_!DP9z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46672a64-483e-4ab6-ab76-a7e6b621705b_1226x102.png 1272w, https://substackcdn.com/image/fetch/$s_!DP9z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F46672a64-483e-4ab6-ab76-a7e6b621705b_1226x102.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>We then take the eigenvalues of this matrix and then grab the eigenvector (our portfolio weights) corresponding to the minimum eigenvalue.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PSPK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc961945f-f89b-4939-bf17-ccf3ab781ce5_589x80.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PSPK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc961945f-f89b-4939-bf17-ccf3ab781ce5_589x80.png 424w, https://substackcdn.com/image/fetch/$s_!PSPK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc961945f-f89b-4939-bf17-ccf3ab781ce5_589x80.png 848w, https://substackcdn.com/image/fetch/$s_!PSPK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc961945f-f89b-4939-bf17-ccf3ab781ce5_589x80.png 1272w, https://substackcdn.com/image/fetch/$s_!PSPK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc961945f-f89b-4939-bf17-ccf3ab781ce5_589x80.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PSPK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc961945f-f89b-4939-bf17-ccf3ab781ce5_589x80.png" width="589" height="80" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c961945f-f89b-4939-bf17-ccf3ab781ce5_589x80.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:80,&quot;width&quot;:589,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:6625,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!PSPK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc961945f-f89b-4939-bf17-ccf3ab781ce5_589x80.png 424w, https://substackcdn.com/image/fetch/$s_!PSPK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc961945f-f89b-4939-bf17-ccf3ab781ce5_589x80.png 848w, https://substackcdn.com/image/fetch/$s_!PSPK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc961945f-f89b-4939-bf17-ccf3ab781ce5_589x80.png 1272w, https://substackcdn.com/image/fetch/$s_!PSPK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc961945f-f89b-4939-bf17-ccf3ab781ce5_589x80.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Our eigenvalues look like 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_!nQWx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d61030e-e558-4d35-9868-6bc28ab5e01c_745x267.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nQWx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d61030e-e558-4d35-9868-6bc28ab5e01c_745x267.png 424w, https://substackcdn.com/image/fetch/$s_!nQWx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d61030e-e558-4d35-9868-6bc28ab5e01c_745x267.png 848w, https://substackcdn.com/image/fetch/$s_!nQWx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d61030e-e558-4d35-9868-6bc28ab5e01c_745x267.png 1272w, https://substackcdn.com/image/fetch/$s_!nQWx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d61030e-e558-4d35-9868-6bc28ab5e01c_745x267.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nQWx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d61030e-e558-4d35-9868-6bc28ab5e01c_745x267.png" width="745" height="267" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3d61030e-e558-4d35-9868-6bc28ab5e01c_745x267.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:267,&quot;width&quot;:745,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:34551,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!nQWx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d61030e-e558-4d35-9868-6bc28ab5e01c_745x267.png 424w, https://substackcdn.com/image/fetch/$s_!nQWx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d61030e-e558-4d35-9868-6bc28ab5e01c_745x267.png 848w, https://substackcdn.com/image/fetch/$s_!nQWx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d61030e-e558-4d35-9868-6bc28ab5e01c_745x267.png 1272w, https://substackcdn.com/image/fetch/$s_!nQWx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d61030e-e558-4d35-9868-6bc28ab5e01c_745x267.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>Taking the dot product of our previously mentioned normalized training dataset with our minimum_eigen variable (the weights) we get the portfolio below:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VRay!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9601692-c1f5-431b-83e7-3a709bc9e5cc_920x522.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VRay!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9601692-c1f5-431b-83e7-3a709bc9e5cc_920x522.png 424w, https://substackcdn.com/image/fetch/$s_!VRay!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9601692-c1f5-431b-83e7-3a709bc9e5cc_920x522.png 848w, https://substackcdn.com/image/fetch/$s_!VRay!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9601692-c1f5-431b-83e7-3a709bc9e5cc_920x522.png 1272w, https://substackcdn.com/image/fetch/$s_!VRay!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9601692-c1f5-431b-83e7-3a709bc9e5cc_920x522.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VRay!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9601692-c1f5-431b-83e7-3a709bc9e5cc_920x522.png" width="920" height="522" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a9601692-c1f5-431b-83e7-3a709bc9e5cc_920x522.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:522,&quot;width&quot;:920,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:54697,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!VRay!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9601692-c1f5-431b-83e7-3a709bc9e5cc_920x522.png 424w, https://substackcdn.com/image/fetch/$s_!VRay!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9601692-c1f5-431b-83e7-3a709bc9e5cc_920x522.png 848w, https://substackcdn.com/image/fetch/$s_!VRay!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9601692-c1f5-431b-83e7-3a709bc9e5cc_920x522.png 1272w, https://substackcdn.com/image/fetch/$s_!VRay!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9601692-c1f5-431b-83e7-3a709bc9e5cc_920x522.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h4>Semi-Definite Programming &amp; SPCA</h4><div><hr></div><p>Now that we have generated our non-sparse portfolio without minimum variance constraints we will now create a portfolio that is both sparse and meets minimum variance constraints using Semi-Definite Programming and SPCA. </p><p>Giving a glimpse into our optimization problem:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Qg7v!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1ea9a2e-d6fc-4915-bee6-67a8211a6355_1239x57.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Qg7v!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1ea9a2e-d6fc-4915-bee6-67a8211a6355_1239x57.png 424w, https://substackcdn.com/image/fetch/$s_!Qg7v!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1ea9a2e-d6fc-4915-bee6-67a8211a6355_1239x57.png 848w, https://substackcdn.com/image/fetch/$s_!Qg7v!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1ea9a2e-d6fc-4915-bee6-67a8211a6355_1239x57.png 1272w, https://substackcdn.com/image/fetch/$s_!Qg7v!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1ea9a2e-d6fc-4915-bee6-67a8211a6355_1239x57.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Qg7v!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1ea9a2e-d6fc-4915-bee6-67a8211a6355_1239x57.png" width="1239" height="57" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a1ea9a2e-d6fc-4915-bee6-67a8211a6355_1239x57.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:57,&quot;width&quot;:1239,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:12455,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!Qg7v!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1ea9a2e-d6fc-4915-bee6-67a8211a6355_1239x57.png 424w, https://substackcdn.com/image/fetch/$s_!Qg7v!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1ea9a2e-d6fc-4915-bee6-67a8211a6355_1239x57.png 848w, https://substackcdn.com/image/fetch/$s_!Qg7v!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1ea9a2e-d6fc-4915-bee6-67a8211a6355_1239x57.png 1272w, https://substackcdn.com/image/fetch/$s_!Qg7v!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1ea9a2e-d6fc-4915-bee6-67a8211a6355_1239x57.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>This is all done using CVXPY which is quite an easy task so I won&#8217;t walk through this part too much. We use a matrix norm penalty which is equivalent to the alpha parameter of our SPCA to induce sparsity. </p><p>We get the target selection of eigenvectors given below from solving with SDP:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ydkn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F111d237b-5c6f-4f5e-a7fb-c0a2bd65c74e_630x291.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ydkn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F111d237b-5c6f-4f5e-a7fb-c0a2bd65c74e_630x291.png 424w, https://substackcdn.com/image/fetch/$s_!ydkn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F111d237b-5c6f-4f5e-a7fb-c0a2bd65c74e_630x291.png 848w, https://substackcdn.com/image/fetch/$s_!ydkn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F111d237b-5c6f-4f5e-a7fb-c0a2bd65c74e_630x291.png 1272w, https://substackcdn.com/image/fetch/$s_!ydkn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F111d237b-5c6f-4f5e-a7fb-c0a2bd65c74e_630x291.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ydkn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F111d237b-5c6f-4f5e-a7fb-c0a2bd65c74e_630x291.png" width="630" height="291" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/111d237b-5c6f-4f5e-a7fb-c0a2bd65c74e_630x291.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:291,&quot;width&quot;:630,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:31639,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!ydkn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F111d237b-5c6f-4f5e-a7fb-c0a2bd65c74e_630x291.png 424w, https://substackcdn.com/image/fetch/$s_!ydkn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F111d237b-5c6f-4f5e-a7fb-c0a2bd65c74e_630x291.png 848w, https://substackcdn.com/image/fetch/$s_!ydkn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F111d237b-5c6f-4f5e-a7fb-c0a2bd65c74e_630x291.png 1272w, https://substackcdn.com/image/fetch/$s_!ydkn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F111d237b-5c6f-4f5e-a7fb-c0a2bd65c74e_630x291.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>After we apply SPCA we get:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rKoo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ddc18bd-6f43-4eb2-b10e-222006e8e21f_680x227.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rKoo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ddc18bd-6f43-4eb2-b10e-222006e8e21f_680x227.png 424w, https://substackcdn.com/image/fetch/$s_!rKoo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ddc18bd-6f43-4eb2-b10e-222006e8e21f_680x227.png 848w, https://substackcdn.com/image/fetch/$s_!rKoo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ddc18bd-6f43-4eb2-b10e-222006e8e21f_680x227.png 1272w, https://substackcdn.com/image/fetch/$s_!rKoo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ddc18bd-6f43-4eb2-b10e-222006e8e21f_680x227.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rKoo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ddc18bd-6f43-4eb2-b10e-222006e8e21f_680x227.png" width="680" height="227" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9ddc18bd-6f43-4eb2-b10e-222006e8e21f_680x227.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:227,&quot;width&quot;:680,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:13814,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!rKoo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ddc18bd-6f43-4eb2-b10e-222006e8e21f_680x227.png 424w, https://substackcdn.com/image/fetch/$s_!rKoo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ddc18bd-6f43-4eb2-b10e-222006e8e21f_680x227.png 848w, https://substackcdn.com/image/fetch/$s_!rKoo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ddc18bd-6f43-4eb2-b10e-222006e8e21f_680x227.png 1272w, https://substackcdn.com/image/fetch/$s_!rKoo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ddc18bd-6f43-4eb2-b10e-222006e8e21f_680x227.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>This array (which is our portfolio weights) can be used to generate the below 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_!C_6R!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848228a7-b96f-49a3-99c5-8a99991c078e_918x517.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!C_6R!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848228a7-b96f-49a3-99c5-8a99991c078e_918x517.png 424w, https://substackcdn.com/image/fetch/$s_!C_6R!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848228a7-b96f-49a3-99c5-8a99991c078e_918x517.png 848w, https://substackcdn.com/image/fetch/$s_!C_6R!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848228a7-b96f-49a3-99c5-8a99991c078e_918x517.png 1272w, https://substackcdn.com/image/fetch/$s_!C_6R!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848228a7-b96f-49a3-99c5-8a99991c078e_918x517.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!C_6R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848228a7-b96f-49a3-99c5-8a99991c078e_918x517.png" width="918" height="517" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/848228a7-b96f-49a3-99c5-8a99991c078e_918x517.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:517,&quot;width&quot;:918,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:51765,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!C_6R!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848228a7-b96f-49a3-99c5-8a99991c078e_918x517.png 424w, https://substackcdn.com/image/fetch/$s_!C_6R!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848228a7-b96f-49a3-99c5-8a99991c078e_918x517.png 848w, https://substackcdn.com/image/fetch/$s_!C_6R!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848228a7-b96f-49a3-99c5-8a99991c078e_918x517.png 1272w, https://substackcdn.com/image/fetch/$s_!C_6R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F848228a7-b96f-49a3-99c5-8a99991c078e_918x517.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>Applying these weights to our out of sample dataset we get:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!TlYX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F284425f8-7a22-4434-9eb4-45376a2a77f6_971x517.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!TlYX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F284425f8-7a22-4434-9eb4-45376a2a77f6_971x517.png 424w, https://substackcdn.com/image/fetch/$s_!TlYX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F284425f8-7a22-4434-9eb4-45376a2a77f6_971x517.png 848w, https://substackcdn.com/image/fetch/$s_!TlYX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F284425f8-7a22-4434-9eb4-45376a2a77f6_971x517.png 1272w, https://substackcdn.com/image/fetch/$s_!TlYX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F284425f8-7a22-4434-9eb4-45376a2a77f6_971x517.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!TlYX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F284425f8-7a22-4434-9eb4-45376a2a77f6_971x517.png" width="971" height="517" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/284425f8-7a22-4434-9eb4-45376a2a77f6_971x517.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:517,&quot;width&quot;:971,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:58454,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!TlYX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F284425f8-7a22-4434-9eb4-45376a2a77f6_971x517.png 424w, https://substackcdn.com/image/fetch/$s_!TlYX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F284425f8-7a22-4434-9eb4-45376a2a77f6_971x517.png 848w, https://substackcdn.com/image/fetch/$s_!TlYX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F284425f8-7a22-4434-9eb4-45376a2a77f6_971x517.png 1272w, https://substackcdn.com/image/fetch/$s_!TlYX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F284425f8-7a22-4434-9eb4-45376a2a77f6_971x517.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h4>Trading The Spread</h4><div><hr></div><p>We will be applying a simple 20-period moving average as our rolling mean, with bands that are +/- 2SD (computed as a 20-period rolling standard deviation). This is just Bollinger Bands for the degens out there. It is far from the optimal way to do it, but trading the spread is not the focus of this article.</p><p>Doing this, our in-sample and OOS portfolios look like 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_!41U7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F000a102a-3f87-41c9-923c-75112579db93_910x473.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!41U7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F000a102a-3f87-41c9-923c-75112579db93_910x473.png 424w, https://substackcdn.com/image/fetch/$s_!41U7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F000a102a-3f87-41c9-923c-75112579db93_910x473.png 848w, https://substackcdn.com/image/fetch/$s_!41U7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F000a102a-3f87-41c9-923c-75112579db93_910x473.png 1272w, https://substackcdn.com/image/fetch/$s_!41U7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F000a102a-3f87-41c9-923c-75112579db93_910x473.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!41U7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F000a102a-3f87-41c9-923c-75112579db93_910x473.png" width="910" height="473" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/000a102a-3f87-41c9-923c-75112579db93_910x473.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:473,&quot;width&quot;:910,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:100512,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!41U7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F000a102a-3f87-41c9-923c-75112579db93_910x473.png 424w, https://substackcdn.com/image/fetch/$s_!41U7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F000a102a-3f87-41c9-923c-75112579db93_910x473.png 848w, https://substackcdn.com/image/fetch/$s_!41U7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F000a102a-3f87-41c9-923c-75112579db93_910x473.png 1272w, https://substackcdn.com/image/fetch/$s_!41U7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F000a102a-3f87-41c9-923c-75112579db93_910x473.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_!q_Q2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde7a45a5-a75b-4825-add0-ff12e8503b4a_931x490.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!q_Q2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde7a45a5-a75b-4825-add0-ff12e8503b4a_931x490.png 424w, https://substackcdn.com/image/fetch/$s_!q_Q2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde7a45a5-a75b-4825-add0-ff12e8503b4a_931x490.png 848w, https://substackcdn.com/image/fetch/$s_!q_Q2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde7a45a5-a75b-4825-add0-ff12e8503b4a_931x490.png 1272w, https://substackcdn.com/image/fetch/$s_!q_Q2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde7a45a5-a75b-4825-add0-ff12e8503b4a_931x490.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!q_Q2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde7a45a5-a75b-4825-add0-ff12e8503b4a_931x490.png" width="931" height="490" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/de7a45a5-a75b-4825-add0-ff12e8503b4a_931x490.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:490,&quot;width&quot;:931,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:96276,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!q_Q2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde7a45a5-a75b-4825-add0-ff12e8503b4a_931x490.png 424w, https://substackcdn.com/image/fetch/$s_!q_Q2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde7a45a5-a75b-4825-add0-ff12e8503b4a_931x490.png 848w, https://substackcdn.com/image/fetch/$s_!q_Q2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde7a45a5-a75b-4825-add0-ff12e8503b4a_931x490.png 1272w, https://substackcdn.com/image/fetch/$s_!q_Q2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde7a45a5-a75b-4825-add0-ff12e8503b4a_931x490.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h4>Results</h4><div><hr></div><p>Trading these thresholds by getting short the spread if it is above the upper band, then exiting at the mean, AND getting long the spread if it is below the lower band, then exiting at the mean results in the below performance:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!E7Hc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498f049e-3eec-4f97-819d-a2cc8fa16c59_924x517.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!E7Hc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498f049e-3eec-4f97-819d-a2cc8fa16c59_924x517.png 424w, https://substackcdn.com/image/fetch/$s_!E7Hc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498f049e-3eec-4f97-819d-a2cc8fa16c59_924x517.png 848w, https://substackcdn.com/image/fetch/$s_!E7Hc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498f049e-3eec-4f97-819d-a2cc8fa16c59_924x517.png 1272w, https://substackcdn.com/image/fetch/$s_!E7Hc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498f049e-3eec-4f97-819d-a2cc8fa16c59_924x517.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!E7Hc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498f049e-3eec-4f97-819d-a2cc8fa16c59_924x517.png" width="924" height="517" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/498f049e-3eec-4f97-819d-a2cc8fa16c59_924x517.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:517,&quot;width&quot;:924,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:43819,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!E7Hc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498f049e-3eec-4f97-819d-a2cc8fa16c59_924x517.png 424w, https://substackcdn.com/image/fetch/$s_!E7Hc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498f049e-3eec-4f97-819d-a2cc8fa16c59_924x517.png 848w, https://substackcdn.com/image/fetch/$s_!E7Hc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498f049e-3eec-4f97-819d-a2cc8fa16c59_924x517.png 1272w, https://substackcdn.com/image/fetch/$s_!E7Hc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498f049e-3eec-4f97-819d-a2cc8fa16c59_924x517.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_!WuHw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8af4871-cf65-49ca-8a15-93edf997ee0a_927x521.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WuHw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8af4871-cf65-49ca-8a15-93edf997ee0a_927x521.png 424w, https://substackcdn.com/image/fetch/$s_!WuHw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8af4871-cf65-49ca-8a15-93edf997ee0a_927x521.png 848w, https://substackcdn.com/image/fetch/$s_!WuHw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8af4871-cf65-49ca-8a15-93edf997ee0a_927x521.png 1272w, https://substackcdn.com/image/fetch/$s_!WuHw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8af4871-cf65-49ca-8a15-93edf997ee0a_927x521.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WuHw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8af4871-cf65-49ca-8a15-93edf997ee0a_927x521.png" width="927" height="521" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e8af4871-cf65-49ca-8a15-93edf997ee0a_927x521.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:521,&quot;width&quot;:927,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:40167,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!WuHw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8af4871-cf65-49ca-8a15-93edf997ee0a_927x521.png 424w, https://substackcdn.com/image/fetch/$s_!WuHw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8af4871-cf65-49ca-8a15-93edf997ee0a_927x521.png 848w, https://substackcdn.com/image/fetch/$s_!WuHw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8af4871-cf65-49ca-8a15-93edf997ee0a_927x521.png 1272w, https://substackcdn.com/image/fetch/$s_!WuHw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8af4871-cf65-49ca-8a15-93edf997ee0a_927x521.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h4>Conclusion</h4><div><hr></div><p>We were able to show that there is significant alpha in pairs trading still, but this does not come from outdated methods static thresholds, and ADF. We can further improve this performance by creating additional optimization metrics which can improve the volatility, trading costs, and mean-reversion characteristics of our portfolio.</p><p>Eager users may also want to explore my other articles on portfolio generation for pairs trading and may attempt to build on this using methods like pattern matching and stochastic control for more optimal pairs trading (these methods are only optimal for higher resolution data, they are too much / will suck for a longer-term portfolio like the one shown).</p><p>If you want further reading on this topic I&#8217;ve added some papers below.</p><p></p><h4>Papers</h4><div><hr></div><p><em>BOX, G. E., and G. C. TIAO. &#8220;A Canonical Analysis of Multiple Time Series.&#8221; Biometrika, vol. 64, no. 2, 1977, pp. 355&#8211;365., https://doi.org/10.1093/biomet/64.2.355. </em></p><p></p><p><em>D'Aspremont, Alexandre. &#8220;Identifying Small Mean-Reverting Portfolios.&#8221; Quantitative Finance, vol. 11, no. 3, 2011, pp. 351&#8211;364., https://doi.org/10.1080/14697688.2010.481634. </em></p><p></p><p><em>Deadman, Edvin, et al. &#8220;Blocked Schur Algorithms for Computing the Matrix Square Root.&#8221; Applied Parallel and Scientific Computing, 2013, pp. 171&#8211;182., https://doi.org/10.1007/978-3-642-36803-5_12. </em></p><p></p><p><em>Fogarasi, Norbert, and Janos Levendovszky. &#8220;Sparse, Mean Reverting Portfolio Selection Using Simulated Annealing.&#8221; Algorithmic Finance, vol. 2, no. 3-4, 2013, pp. 197&#8211;211., https://doi.org/10.3233/af-13026. </em></p><p></p><p><em>G&#246;nc&#252;, Ahmet, and Erdin&#231; Aky&#305;ld&#305;r&#305;m. &#8220;Statistical Arbitrage with Pairs Trading.&#8221; International Review of Finance, vol. 16, no. 2, 2016, pp. 307&#8211;319., https://doi.org/10.1111/irfi.12074.</em></p>]]></content:encoded></item><item><title><![CDATA[Monte-Carlo Minimization for Synthetic Portfolios]]></title><description><![CDATA[Forming synthetic mean-reverting portfolios (MRPs) using Monte-Carlo Minimization (MCM)]]></description><link>https://www.algos.org/p/monte-carlo-minimization-for-synthetic</link><guid isPermaLink="false">https://www.algos.org/p/monte-carlo-minimization-for-synthetic</guid><dc:creator><![CDATA[Quant Arb]]></dc:creator><pubDate>Fri, 10 Feb 2023 07:19:41 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F475d1e3b-a1da-4026-a956-3f6918049585_1040x437.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h4>Introduction</h4><div><hr></div><p>Monte-Carlo Minimization (MCM), also known as Basinhopping is a popular non-convex optimization algorithm for global optimization. It is derived from the chemical physics literature and is accompanied by Dual-Annealing as its primary alternative.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.algos.org/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">Quant&#8217;s Substack 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>Today we will apply it to digital asset markets to form synthetic mean-reverting portfolios by optimizing for multiple different mean-reversion tests. This article merely is meant to provide a methodology for generating these portfolios and we will not explore the optimal trading problem needed to form a full strategy. There are also many backtesting caveats that are beyond the scope of this article that would need to be explored separately first.</p><p></p><h4>Data</h4><div><hr></div><p>We use these below assets in our analysis, but this is entirely an arbitrary selection. This research blog will likely explore universe selection methods in future articles. Research relating to optimization and mean-reverting portfolios will be explored in a mix of both free and paid articles, alternating each time.</p><p>The table below gives an overview of the dates used. There hasn&#8217;t been much of a significant change in the effectiveness of this technique, so we can use older data. This was also influenced by this dataset being the first one I found on my computer.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Abuo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe1b3a68-dc62-4ab7-aaf2-8897dc7869c9_895x482.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Abuo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe1b3a68-dc62-4ab7-aaf2-8897dc7869c9_895x482.png 424w, https://substackcdn.com/image/fetch/$s_!Abuo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe1b3a68-dc62-4ab7-aaf2-8897dc7869c9_895x482.png 848w, https://substackcdn.com/image/fetch/$s_!Abuo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe1b3a68-dc62-4ab7-aaf2-8897dc7869c9_895x482.png 1272w, https://substackcdn.com/image/fetch/$s_!Abuo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe1b3a68-dc62-4ab7-aaf2-8897dc7869c9_895x482.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Abuo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe1b3a68-dc62-4ab7-aaf2-8897dc7869c9_895x482.png" width="895" height="482" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fe1b3a68-dc62-4ab7-aaf2-8897dc7869c9_895x482.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:482,&quot;width&quot;:895,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:49720,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!Abuo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe1b3a68-dc62-4ab7-aaf2-8897dc7869c9_895x482.png 424w, https://substackcdn.com/image/fetch/$s_!Abuo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe1b3a68-dc62-4ab7-aaf2-8897dc7869c9_895x482.png 848w, https://substackcdn.com/image/fetch/$s_!Abuo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe1b3a68-dc62-4ab7-aaf2-8897dc7869c9_895x482.png 1272w, https://substackcdn.com/image/fetch/$s_!Abuo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe1b3a68-dc62-4ab7-aaf2-8897dc7869c9_895x482.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>These are close prices arranged as a matrix which is usually required for such optimization problems, especially the more complicated convex methods we will explore in later articles.</p><p></p><h4>Normalization</h4><div><hr></div><p>In the interest of avoiding as much look-ahead bias as possible, we standardize our training and test sets individually. </p><p>This is the below-standardized training set:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FmDL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c00b748-1dd7-4f59-8865-924ed45339b7_902x484.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FmDL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c00b748-1dd7-4f59-8865-924ed45339b7_902x484.png 424w, https://substackcdn.com/image/fetch/$s_!FmDL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c00b748-1dd7-4f59-8865-924ed45339b7_902x484.png 848w, https://substackcdn.com/image/fetch/$s_!FmDL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c00b748-1dd7-4f59-8865-924ed45339b7_902x484.png 1272w, https://substackcdn.com/image/fetch/$s_!FmDL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c00b748-1dd7-4f59-8865-924ed45339b7_902x484.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FmDL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c00b748-1dd7-4f59-8865-924ed45339b7_902x484.png" width="902" height="484" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5c00b748-1dd7-4f59-8865-924ed45339b7_902x484.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:484,&quot;width&quot;:902,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:53143,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!FmDL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c00b748-1dd7-4f59-8865-924ed45339b7_902x484.png 424w, https://substackcdn.com/image/fetch/$s_!FmDL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c00b748-1dd7-4f59-8865-924ed45339b7_902x484.png 848w, https://substackcdn.com/image/fetch/$s_!FmDL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c00b748-1dd7-4f59-8865-924ed45339b7_902x484.png 1272w, https://substackcdn.com/image/fetch/$s_!FmDL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c00b748-1dd7-4f59-8865-924ed45339b7_902x484.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>For clarity, we are using the below formula where x is our asset close prices, mu is the mean of our prices, and sigma is the standard deviation of our prices. For shorter-term synthetic portfolios standardization is ideal, but for longer-term portfolios, it can make our portfolios less robust as volatility changes over time. </p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Wpdj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a33d45d-b70d-4cca-b7db-2a3dbf37de19_458x116.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Wpdj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a33d45d-b70d-4cca-b7db-2a3dbf37de19_458x116.png 424w, https://substackcdn.com/image/fetch/$s_!Wpdj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a33d45d-b70d-4cca-b7db-2a3dbf37de19_458x116.png 848w, https://substackcdn.com/image/fetch/$s_!Wpdj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a33d45d-b70d-4cca-b7db-2a3dbf37de19_458x116.png 1272w, https://substackcdn.com/image/fetch/$s_!Wpdj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a33d45d-b70d-4cca-b7db-2a3dbf37de19_458x116.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Wpdj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a33d45d-b70d-4cca-b7db-2a3dbf37de19_458x116.png" width="458" height="116" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9a33d45d-b70d-4cca-b7db-2a3dbf37de19_458x116.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:116,&quot;width&quot;:458,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2076,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!Wpdj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a33d45d-b70d-4cca-b7db-2a3dbf37de19_458x116.png 424w, https://substackcdn.com/image/fetch/$s_!Wpdj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a33d45d-b70d-4cca-b7db-2a3dbf37de19_458x116.png 848w, https://substackcdn.com/image/fetch/$s_!Wpdj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a33d45d-b70d-4cca-b7db-2a3dbf37de19_458x116.png 1272w, https://substackcdn.com/image/fetch/$s_!Wpdj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a33d45d-b70d-4cca-b7db-2a3dbf37de19_458x116.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>We also show our testing dataset that has been standardized here.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xMY4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6f1ee5a-fa18-4dbc-833d-b29bcfec5bc0_883x485.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xMY4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6f1ee5a-fa18-4dbc-833d-b29bcfec5bc0_883x485.png 424w, https://substackcdn.com/image/fetch/$s_!xMY4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6f1ee5a-fa18-4dbc-833d-b29bcfec5bc0_883x485.png 848w, https://substackcdn.com/image/fetch/$s_!xMY4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6f1ee5a-fa18-4dbc-833d-b29bcfec5bc0_883x485.png 1272w, https://substackcdn.com/image/fetch/$s_!xMY4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6f1ee5a-fa18-4dbc-833d-b29bcfec5bc0_883x485.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xMY4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6f1ee5a-fa18-4dbc-833d-b29bcfec5bc0_883x485.png" width="883" height="485" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b6f1ee5a-fa18-4dbc-833d-b29bcfec5bc0_883x485.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:485,&quot;width&quot;:883,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:53445,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!xMY4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6f1ee5a-fa18-4dbc-833d-b29bcfec5bc0_883x485.png 424w, https://substackcdn.com/image/fetch/$s_!xMY4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6f1ee5a-fa18-4dbc-833d-b29bcfec5bc0_883x485.png 848w, https://substackcdn.com/image/fetch/$s_!xMY4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6f1ee5a-fa18-4dbc-833d-b29bcfec5bc0_883x485.png 1272w, https://substackcdn.com/image/fetch/$s_!xMY4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6f1ee5a-fa18-4dbc-833d-b29bcfec5bc0_883x485.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p></p><h4>Objective Function</h4><div><hr></div><p>We will be optimizing for mean-reversion using the portmanteau statistic which is used to test for the presence of white noise in time series.</p><p>It is formulated below:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SMW5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F237b87bc-d743-4c45-af1e-bc3497e28692_763x185.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SMW5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F237b87bc-d743-4c45-af1e-bc3497e28692_763x185.png 424w, https://substackcdn.com/image/fetch/$s_!SMW5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F237b87bc-d743-4c45-af1e-bc3497e28692_763x185.png 848w, https://substackcdn.com/image/fetch/$s_!SMW5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F237b87bc-d743-4c45-af1e-bc3497e28692_763x185.png 1272w, https://substackcdn.com/image/fetch/$s_!SMW5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F237b87bc-d743-4c45-af1e-bc3497e28692_763x185.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SMW5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F237b87bc-d743-4c45-af1e-bc3497e28692_763x185.png" width="763" height="185" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/237b87bc-d743-4c45-af1e-bc3497e28692_763x185.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:185,&quot;width&quot;:763,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:17159,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!SMW5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F237b87bc-d743-4c45-af1e-bc3497e28692_763x185.png 424w, https://substackcdn.com/image/fetch/$s_!SMW5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F237b87bc-d743-4c45-af1e-bc3497e28692_763x185.png 848w, https://substackcdn.com/image/fetch/$s_!SMW5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F237b87bc-d743-4c45-af1e-bc3497e28692_763x185.png 1272w, https://substackcdn.com/image/fetch/$s_!SMW5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F237b87bc-d743-4c45-af1e-bc3497e28692_763x185.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>As some readers may notice, we are using the 1978 Box-Leung formulation of the statistic and not the original 1970 Box-Pierce formulation shown below:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iazc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe83c5d96-4da5-4dfe-88f8-498cb6ede4d4_327x171.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iazc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe83c5d96-4da5-4dfe-88f8-498cb6ede4d4_327x171.png 424w, https://substackcdn.com/image/fetch/$s_!iazc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe83c5d96-4da5-4dfe-88f8-498cb6ede4d4_327x171.png 848w, https://substackcdn.com/image/fetch/$s_!iazc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe83c5d96-4da5-4dfe-88f8-498cb6ede4d4_327x171.png 1272w, https://substackcdn.com/image/fetch/$s_!iazc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe83c5d96-4da5-4dfe-88f8-498cb6ede4d4_327x171.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iazc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe83c5d96-4da5-4dfe-88f8-498cb6ede4d4_327x171.png" width="327" height="171" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e83c5d96-4da5-4dfe-88f8-498cb6ede4d4_327x171.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:171,&quot;width&quot;:327,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:10279,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!iazc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe83c5d96-4da5-4dfe-88f8-498cb6ede4d4_327x171.png 424w, https://substackcdn.com/image/fetch/$s_!iazc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe83c5d96-4da5-4dfe-88f8-498cb6ede4d4_327x171.png 848w, https://substackcdn.com/image/fetch/$s_!iazc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe83c5d96-4da5-4dfe-88f8-498cb6ede4d4_327x171.png 1272w, https://substackcdn.com/image/fetch/$s_!iazc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe83c5d96-4da5-4dfe-88f8-498cb6ede4d4_327x171.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>For further improvements, the additional options of the Hosking portmanteau test formulation (1980) or the Li and Mcleod formulation (1981) could be used.</p><p>Hosking:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aTUE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39f78bb4-6eb2-4560-9ddb-0a0d6a1aba45_661x152.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aTUE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39f78bb4-6eb2-4560-9ddb-0a0d6a1aba45_661x152.png 424w, https://substackcdn.com/image/fetch/$s_!aTUE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39f78bb4-6eb2-4560-9ddb-0a0d6a1aba45_661x152.png 848w, https://substackcdn.com/image/fetch/$s_!aTUE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39f78bb4-6eb2-4560-9ddb-0a0d6a1aba45_661x152.png 1272w, https://substackcdn.com/image/fetch/$s_!aTUE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39f78bb4-6eb2-4560-9ddb-0a0d6a1aba45_661x152.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aTUE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39f78bb4-6eb2-4560-9ddb-0a0d6a1aba45_661x152.png" width="661" height="152" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/39f78bb4-6eb2-4560-9ddb-0a0d6a1aba45_661x152.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:152,&quot;width&quot;:661,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:17687,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!aTUE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39f78bb4-6eb2-4560-9ddb-0a0d6a1aba45_661x152.png 424w, https://substackcdn.com/image/fetch/$s_!aTUE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39f78bb4-6eb2-4560-9ddb-0a0d6a1aba45_661x152.png 848w, https://substackcdn.com/image/fetch/$s_!aTUE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39f78bb4-6eb2-4560-9ddb-0a0d6a1aba45_661x152.png 1272w, https://substackcdn.com/image/fetch/$s_!aTUE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39f78bb4-6eb2-4560-9ddb-0a0d6a1aba45_661x152.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Li and Mcleod:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Jy1E!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1be4b19c-e4d1-4854-a5c2-7b53d70f0775_644x122.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Jy1E!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1be4b19c-e4d1-4854-a5c2-7b53d70f0775_644x122.png 424w, https://substackcdn.com/image/fetch/$s_!Jy1E!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1be4b19c-e4d1-4854-a5c2-7b53d70f0775_644x122.png 848w, https://substackcdn.com/image/fetch/$s_!Jy1E!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1be4b19c-e4d1-4854-a5c2-7b53d70f0775_644x122.png 1272w, https://substackcdn.com/image/fetch/$s_!Jy1E!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1be4b19c-e4d1-4854-a5c2-7b53d70f0775_644x122.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Jy1E!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1be4b19c-e4d1-4854-a5c2-7b53d70f0775_644x122.png" width="644" height="122" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1be4b19c-e4d1-4854-a5c2-7b53d70f0775_644x122.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:122,&quot;width&quot;:644,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:18898,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!Jy1E!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1be4b19c-e4d1-4854-a5c2-7b53d70f0775_644x122.png 424w, https://substackcdn.com/image/fetch/$s_!Jy1E!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1be4b19c-e4d1-4854-a5c2-7b53d70f0775_644x122.png 848w, https://substackcdn.com/image/fetch/$s_!Jy1E!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1be4b19c-e4d1-4854-a5c2-7b53d70f0775_644x122.png 1272w, https://substackcdn.com/image/fetch/$s_!Jy1E!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1be4b19c-e4d1-4854-a5c2-7b53d70f0775_644x122.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The final two I suggested are not appropriate for this use case because of their increased complexity. One of the primary reasons that the Portmanteau statistic was chosen was because it is efficient to compute when compared to statistics like Augmented Dickey-Fuller. Despite its computational efficiency, it is still vastly superior to ADF when used for lower timeframes.</p><p></p><h4>Portfolio Optimization</h4><div><hr></div><p>We use the SciPy Optimize library which includes both Monte-Carlo Minimization (named as Basinhopping in the library) and Dual-Annealing. There is already some literature on the use of Simulated Annealing for the formation of mean-reverting portfolios, but since its release, Dual-Annealing has proven a much more effective and popular solution. Overall, it is regarded that Monte-Carlo Minimization is more effective than Dual-Annealing in chemical physics, but it is yet to be determined whether this is the case for financial markets.</p><p>Using the library with custom-defined optimization metrics we get the following results:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PL4T!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F475d1e3b-a1da-4026-a956-3f6918049585_1040x437.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PL4T!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F475d1e3b-a1da-4026-a956-3f6918049585_1040x437.png 424w, https://substackcdn.com/image/fetch/$s_!PL4T!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F475d1e3b-a1da-4026-a956-3f6918049585_1040x437.png 848w, https://substackcdn.com/image/fetch/$s_!PL4T!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F475d1e3b-a1da-4026-a956-3f6918049585_1040x437.png 1272w, https://substackcdn.com/image/fetch/$s_!PL4T!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F475d1e3b-a1da-4026-a956-3f6918049585_1040x437.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PL4T!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F475d1e3b-a1da-4026-a956-3f6918049585_1040x437.png" width="1040" height="437" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/475d1e3b-a1da-4026-a956-3f6918049585_1040x437.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:437,&quot;width&quot;:1040,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:39950,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!PL4T!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F475d1e3b-a1da-4026-a956-3f6918049585_1040x437.png 424w, https://substackcdn.com/image/fetch/$s_!PL4T!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F475d1e3b-a1da-4026-a956-3f6918049585_1040x437.png 848w, https://substackcdn.com/image/fetch/$s_!PL4T!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F475d1e3b-a1da-4026-a956-3f6918049585_1040x437.png 1272w, https://substackcdn.com/image/fetch/$s_!PL4T!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F475d1e3b-a1da-4026-a956-3f6918049585_1040x437.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 then generate this mean-reverting portfolio. The training set is shown in blue with the out-of-sample data shown in red. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!L1II!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa101a004-2495-4f1d-97a1-2821d2aeae01_1241x440.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!L1II!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa101a004-2495-4f1d-97a1-2821d2aeae01_1241x440.png 424w, https://substackcdn.com/image/fetch/$s_!L1II!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa101a004-2495-4f1d-97a1-2821d2aeae01_1241x440.png 848w, https://substackcdn.com/image/fetch/$s_!L1II!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa101a004-2495-4f1d-97a1-2821d2aeae01_1241x440.png 1272w, https://substackcdn.com/image/fetch/$s_!L1II!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa101a004-2495-4f1d-97a1-2821d2aeae01_1241x440.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!L1II!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa101a004-2495-4f1d-97a1-2821d2aeae01_1241x440.png" width="1241" height="440" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a101a004-2495-4f1d-97a1-2821d2aeae01_1241x440.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:440,&quot;width&quot;:1241,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:101021,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!L1II!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa101a004-2495-4f1d-97a1-2821d2aeae01_1241x440.png 424w, https://substackcdn.com/image/fetch/$s_!L1II!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa101a004-2495-4f1d-97a1-2821d2aeae01_1241x440.png 848w, https://substackcdn.com/image/fetch/$s_!L1II!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa101a004-2495-4f1d-97a1-2821d2aeae01_1241x440.png 1272w, https://substackcdn.com/image/fetch/$s_!L1II!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa101a004-2495-4f1d-97a1-2821d2aeae01_1241x440.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>Taking another arbitrary data window, but here halving the size of the train and test sets respectively we were able to achieve similar mean-reversion.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HNl2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf3fe947-0024-4837-a751-f7d711c05160_1232x434.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HNl2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf3fe947-0024-4837-a751-f7d711c05160_1232x434.png 424w, https://substackcdn.com/image/fetch/$s_!HNl2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf3fe947-0024-4837-a751-f7d711c05160_1232x434.png 848w, https://substackcdn.com/image/fetch/$s_!HNl2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf3fe947-0024-4837-a751-f7d711c05160_1232x434.png 1272w, https://substackcdn.com/image/fetch/$s_!HNl2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf3fe947-0024-4837-a751-f7d711c05160_1232x434.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HNl2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf3fe947-0024-4837-a751-f7d711c05160_1232x434.png" width="1232" height="434" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/af3fe947-0024-4837-a751-f7d711c05160_1232x434.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:434,&quot;width&quot;:1232,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:98011,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&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="" srcset="https://substackcdn.com/image/fetch/$s_!HNl2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf3fe947-0024-4837-a751-f7d711c05160_1232x434.png 424w, https://substackcdn.com/image/fetch/$s_!HNl2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf3fe947-0024-4837-a751-f7d711c05160_1232x434.png 848w, https://substackcdn.com/image/fetch/$s_!HNl2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf3fe947-0024-4837-a751-f7d711c05160_1232x434.png 1272w, https://substackcdn.com/image/fetch/$s_!HNl2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf3fe947-0024-4837-a751-f7d711c05160_1232x434.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h4>Final Remarks</h4><div><hr></div><p>We find in our analysis that whilst our portfolios do tend to decay out of sample they remain highly mean-reverting. This is a trend that was found consistently with other non-convex optimization approaches I have used before to do this. This effect typically only occurs for shorter timeframes. Usually, you get a total decay when you do not use ultra-robust methods for creating mean-reverting portfolios over longer timeframes. This method is likely one of if not the least robust of them all. </p><p>It is however a novel application of a very underrated algorithm to financial markets and we were able to generate highly mean-reverting portfolios both in and out of sample despite seeing some decay. The dynamics of short-term pairs trading are very different from longer-term pairs trading portfolios that the literature focuses on, and for shorter-term pairs trading portfolios stationarity / robustness is less of a concern as we quickly generate new portfolios, capturing temporally local effects.</p><p>It is important to note that as a result of using assets that are not top 15 liquid coins, there will be lower capacity in this strategy. We also have to trade many assets which further increases the costs of trading large sizes. This is likely only appropriate for smaller capital bases. The volatility and increased mean-reversion exhibited by medium-sized coins are ideal for our research. You may also maximize the objective to try and form index portfolios for different areas such as DeFi tokens etc, this is best done with PCA-based methods which we will explore in one of the next articles!</p><p>Eager readers may want to continue experimenting with this research topic and finding ways to trade these mean-reverting portfolios optimally and cost-effectively.</p><p></p><p><strong>If you enjoyed reading this, then feel free to subscribe. The next article will be paid as I alternate between a paid and unpaid article each time. </strong></p><p></p><h4>Further Reading</h4><div><hr></div><p>Below are a few key papers and some general reading material related to the methods used in this research article.</p><p>https://www.sciencedirect.com/science/article/abs/pii/S0009261404016082</p><p>https://pubs.acs.org/doi/abs/10.1021/jp970984n</p><p>https://en.wikipedia.org/wiki/Simulated_annealing</p><p>https://www.pnas.org/doi/10.1073/pnas.84.19.6611</p><p>https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.basinhopping.html#scipy.optimize.basinhopping</p><p>https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.dual_annealing.html#scipy.optimize.dual_annealing</p><p>https://en.wikipedia.org/wiki/Portmanteau_test</p><p>https://apps.dtic.mil/sti/pdfs/ADA049397.pdf</p><p> </p>]]></content:encoded></item></channel></rss>