<?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[MacroQuant Insights: Quantitative Edge]]></title><description><![CDATA[This section dives deep into quantitative strategies designed for real-world application. From backtested models to data-driven insights, you'll discover tools and techniques that can transform your approach to portfolio management and investment decisions.]]></description><link>https://www.macroquant.org/s/quantitative-edge</link><image><url>https://substackcdn.com/image/fetch/$s_!sthT!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ef475e3-5e3c-4bdb-98fe-58cc92477301_155x155.png</url><title>MacroQuant Insights: Quantitative Edge</title><link>https://www.macroquant.org/s/quantitative-edge</link></image><generator>Substack</generator><lastBuildDate>Sat, 09 May 2026 05:30:59 GMT</lastBuildDate><atom:link href="https://www.macroquant.org/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Mateo]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[macroquantinsights@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[macroquantinsights@substack.com]]></itunes:email><itunes:name><![CDATA[Mateo]]></itunes:name></itunes:owner><itunes:author><![CDATA[Mateo]]></itunes:author><googleplay:owner><![CDATA[macroquantinsights@substack.com]]></googleplay:owner><googleplay:email><![CDATA[macroquantinsights@substack.com]]></googleplay:email><googleplay:author><![CDATA[Mateo]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[A deep dive into Atlanta Fed GDPNow]]></title><description><![CDATA[Is the US going into a recession?]]></description><link>https://www.macroquant.org/p/a-deep-dive-into-atlanta-fed-gdpnow</link><guid isPermaLink="false">https://www.macroquant.org/p/a-deep-dive-into-atlanta-fed-gdpnow</guid><dc:creator><![CDATA[Mateo]]></dc:creator><pubDate>Wed, 12 Mar 2025 15:07:07 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!_tUO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12c2d5f2-a471-4595-80b2-6ce4fd27f983_650x530.gif" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The Atlanta Fed's GDPNow is a real-time forecasting tool that estimates GDP growth based on the latest economic data releases. Currently, it's projecting negative growth for Q1 2025, with its standard model showing -1.6% as of early March. This negative reading has sparked concerns about whether the US economy is heading toward a recession. However, looking beneath the surface reveals a more complex picture.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_tUO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12c2d5f2-a471-4595-80b2-6ce4fd27f983_650x530.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_tUO!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12c2d5f2-a471-4595-80b2-6ce4fd27f983_650x530.gif 424w, https://substackcdn.com/image/fetch/$s_!_tUO!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12c2d5f2-a471-4595-80b2-6ce4fd27f983_650x530.gif 848w, https://substackcdn.com/image/fetch/$s_!_tUO!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12c2d5f2-a471-4595-80b2-6ce4fd27f983_650x530.gif 1272w, https://substackcdn.com/image/fetch/$s_!_tUO!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12c2d5f2-a471-4595-80b2-6ce4fd27f983_650x530.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_tUO!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12c2d5f2-a471-4595-80b2-6ce4fd27f983_650x530.gif" width="650" height="530" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/12c2d5f2-a471-4595-80b2-6ce4fd27f983_650x530.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:530,&quot;width&quot;:650,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&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="" title="" srcset="https://substackcdn.com/image/fetch/$s_!_tUO!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12c2d5f2-a471-4595-80b2-6ce4fd27f983_650x530.gif 424w, https://substackcdn.com/image/fetch/$s_!_tUO!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12c2d5f2-a471-4595-80b2-6ce4fd27f983_650x530.gif 848w, https://substackcdn.com/image/fetch/$s_!_tUO!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12c2d5f2-a471-4595-80b2-6ce4fd27f983_650x530.gif 1272w, https://substackcdn.com/image/fetch/$s_!_tUO!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12c2d5f2-a471-4595-80b2-6ce4fd27f983_650x530.gif 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><h3>Why the economy isn't as bad as GDPNow suggests</h3><ul><li><p>The sharp decline in GDPNow's Q1 2025 forecast was largely driven by January's widening trade deficit&#8212;but there's a crucial detail here. Approximately 60% of this deficit expansion came from an extraordinary surge in nonmonetary gold imports, which jumped from $13.2 billion in December to $32.6 billion in January.</p></li><li><p>This gold import spike appears to be directly related to President Trump's threatened tariffs on Europe. As detailed in recent reporting, gold prices have been driven to record highs, creating a significant price gap between the New York and London markets. Gold is currently worth substantially more in Manhattan than in London, prompting major banks like JPMorgan and HSBC to transport physical gold bars across the Atlantic on commercial flights.</p></li><li><p>Think of this as a temporary distortion rather than an economic fundamental. While technically these gold imports reduce GDP (since imports subtract from GDP calculation), they don't signal broader economic weakness or reduced consumer spending. Recognizing this anomaly, the Atlanta Fed has begun publishing both standard and "gold-adjusted" forecasts, with the latter showing significantly less negative growth.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GBEj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58e5210b-d11f-49a2-aa4c-0b5a68a61a65_1090x676.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GBEj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58e5210b-d11f-49a2-aa4c-0b5a68a61a65_1090x676.png 424w, https://substackcdn.com/image/fetch/$s_!GBEj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58e5210b-d11f-49a2-aa4c-0b5a68a61a65_1090x676.png 848w, https://substackcdn.com/image/fetch/$s_!GBEj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58e5210b-d11f-49a2-aa4c-0b5a68a61a65_1090x676.png 1272w, https://substackcdn.com/image/fetch/$s_!GBEj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58e5210b-d11f-49a2-aa4c-0b5a68a61a65_1090x676.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GBEj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58e5210b-d11f-49a2-aa4c-0b5a68a61a65_1090x676.png" width="1090" height="676" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/58e5210b-d11f-49a2-aa4c-0b5a68a61a65_1090x676.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:676,&quot;width&quot;:1090,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&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_!GBEj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58e5210b-d11f-49a2-aa4c-0b5a68a61a65_1090x676.png 424w, https://substackcdn.com/image/fetch/$s_!GBEj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58e5210b-d11f-49a2-aa4c-0b5a68a61a65_1090x676.png 848w, https://substackcdn.com/image/fetch/$s_!GBEj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58e5210b-d11f-49a2-aa4c-0b5a68a61a65_1090x676.png 1272w, https://substackcdn.com/image/fetch/$s_!GBEj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58e5210b-d11f-49a2-aa4c-0b5a68a61a65_1090x676.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>When to trust GDPNow vs. economist consensus</h3><p>Given that we're still in early March, it's worth noting that we're not yet in the period when GDPNow typically provides its most reliable signals. GDPNow's accuracy follows a predictable pattern that affects when you should pay attention to it:</p><p><strong>Early in the quarter</strong>: GDPNow exhibits larger errors and significant volatility. This is like trying to predict the final score of a basketball game in the first quarter&#8212;theoretically possible but highly unreliable. During this period, consensus forecasts from economists often provide more balanced projections.</p><p><strong>When the quarter ends, about a month before the GDP release</strong>: This is where GDPNow really shines. Research shows that GDPNow often outperforms consensus forecasts during this period. Since the BEA publishes its first GDP estimate about four weeks after the quarter ends, GDPNow becomes most accurate around the end of the measured quarter, giving us valuable insights before the official numbers are released.</p><h3>Bottom Line</h3><p>So, is the US heading into a recession? The headline GDPNow number suggests caution, but the details tell a different story. The negative forecast is substantially driven by a specific, temporary phenomenon in gold imports rather than broad-based economic deterioration.</p><p>Looking at the numbers more carefully, removing gold from imports and exports leads to an increase in GDPNow's topline growth forecast from -1.6 percent to a positive 0.4 percent growth. While 0.4 percent isn't particularly robust, timing matters tremendously. We're still relatively early in Q1 2025, so the current reading should be viewed as preliminary. As we move closer to April's GDP release date, GDPNow's accuracy will likely improve, giving us a clearer picture of the economy's direction.</p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.macroquant.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">Thanks for reading MacroQuant Insights! Subscribe for free to receive new posts and support my work.</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><p><em>The content provided on MacroQuant Insights is for informational and educational purposes only and does not constitute financial advice. While every effort is made to ensure accuracy and reliability, all data, analysis, and opinions are based on sources believed to be trustworthy but are not guaranteed for completeness or timeliness. The views expressed are solely those of the author and do not reflect endorsements or recommendations for any specific investment, strategy, or action.</em></p><p><em>Investing involves inherent risks, including the potential loss of principal. Past performance is not indicative of future results. We strongly encourage readers to conduct their own research and consult with a qualified financial advisor or professional before making any financial decisions. MacroQuant Insights and its contributors disclaim all liability for investment decisions based on the information provided and make no warranties regarding the content&#8217;s accuracy or reliability.</em></p><p><em>Remember, all investments carry risks, and it is essential to understand these risks fully before acting on any information presented. Users are responsible for their own investment decisions. MacroQuant Insights assumes no responsibility for any outcomes resulting from the use of this information. Content is subject to change without notice.</em></p>]]></content:encoded></item><item><title><![CDATA[Python Meets the Fed]]></title><description><![CDATA[The Ultimate Guide to FredAPI]]></description><link>https://www.macroquant.org/p/python-meets-the-fed</link><guid isPermaLink="false">https://www.macroquant.org/p/python-meets-the-fed</guid><dc:creator><![CDATA[Mateo]]></dc:creator><pubDate>Tue, 10 Sep 2024 12:30:52 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/5ca8ddaa-3292-43d4-b128-2ea28916c87a_921x597.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Did you ever wonder how to easily get free economic data into Python? Look no further &#8211; FredAPI is here to revolutionize your quantitative and macroeconomic analysis. In the fast-paced world of financial modeling and economic forecasting, having access to reliable, up-to-date data is not just an advantage &#8211; it's a necessity. FredAPI serves as your direct line to the Federal Reserve Economic Data (FRED), a treasure trove of over 816,000 US and international time series from 108 sources.</p><p>As quantitative analysts and economists, we often find ourselves juggling multiple data sources, wrestling with inconsistent formats, and spending precious time on data cleaning rather than analysis. FredAPI eliminates these pain points by providing a streamlined, Pythonic interface to access a vast array of economic indicators. Whether you're building predictive models, back-testing trading strategies, or conducting in-depth economic research, FredAPI empowers you to focus on what truly matters &#8211; deriving insights from the data. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!buuj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1d8892c-2106-48df-ade9-c754bfded7c5_1328x824.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!buuj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1d8892c-2106-48df-ade9-c754bfded7c5_1328x824.png 424w, https://substackcdn.com/image/fetch/$s_!buuj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1d8892c-2106-48df-ade9-c754bfded7c5_1328x824.png 848w, https://substackcdn.com/image/fetch/$s_!buuj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1d8892c-2106-48df-ade9-c754bfded7c5_1328x824.png 1272w, https://substackcdn.com/image/fetch/$s_!buuj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1d8892c-2106-48df-ade9-c754bfded7c5_1328x824.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!buuj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1d8892c-2106-48df-ade9-c754bfded7c5_1328x824.png" width="1328" height="824" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c1d8892c-2106-48df-ade9-c754bfded7c5_1328x824.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:824,&quot;width&quot;:1328,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:149778,&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_!buuj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1d8892c-2106-48df-ade9-c754bfded7c5_1328x824.png 424w, https://substackcdn.com/image/fetch/$s_!buuj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1d8892c-2106-48df-ade9-c754bfded7c5_1328x824.png 848w, https://substackcdn.com/image/fetch/$s_!buuj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1d8892c-2106-48df-ade9-c754bfded7c5_1328x824.png 1272w, https://substackcdn.com/image/fetch/$s_!buuj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1d8892c-2106-48df-ade9-c754bfded7c5_1328x824.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>Source: <a href="https://fred.stlouisfed.org/series/GDP">https://fred.stlouisfed.org/series/GDP</a></p><p>In this comprehensive guide, we'll explore how FredAPI can supercharge your quantitative toolkit. From basic data retrieval to creating complex, multi-variable dashboards, you'll learn how to leverage this powerful library to its fullest potential. By the end of this journey, you'll be equipped to effortlessly integrate real-time economic data into your Python workflows, giving you a competitive edge in the world of quantitative finance and macroeconomic analysis. So, are you ready to unlock the full potential of economic data in your Python projects? Let's dive in!</p><div><hr></div><h2>Initial Setup: Installing and Configuring FredAPI</h2><p>Before we begin our data exploration, let's set up our environment. First, install FredAPI:</p><pre><code>pip install fredapi</code></pre><p>Once installed, import the library and configure your API key:</p><pre><code>import fredapi as fa
fred = fa.Fred(api_key='your_api_key_here')</code></pre><p>Replace 'your_api_key_here' with your actual API key from the FRED website. This key is your access point to a vast repository of economic data, so ensure it's kept secure.</p><div><hr></div><h2>Basic Data Retrieval: Fetching Unemployment Data</h2><p>Let's start with a fundamental economic indicator: the unemployment rate. This metric is crucial for assessing overall economic health and is often a key input for macroeconomic models.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SW-d!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff92b340d-6c4a-4c01-93a8-d5f2862a6639_261x176.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SW-d!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff92b340d-6c4a-4c01-93a8-d5f2862a6639_261x176.png 424w, https://substackcdn.com/image/fetch/$s_!SW-d!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff92b340d-6c4a-4c01-93a8-d5f2862a6639_261x176.png 848w, https://substackcdn.com/image/fetch/$s_!SW-d!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff92b340d-6c4a-4c01-93a8-d5f2862a6639_261x176.png 1272w, https://substackcdn.com/image/fetch/$s_!SW-d!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff92b340d-6c4a-4c01-93a8-d5f2862a6639_261x176.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SW-d!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff92b340d-6c4a-4c01-93a8-d5f2862a6639_261x176.png" width="261" height="176" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f92b340d-6c4a-4c01-93a8-d5f2862a6639_261x176.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:176,&quot;width&quot;:261,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:13864,&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_!SW-d!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff92b340d-6c4a-4c01-93a8-d5f2862a6639_261x176.png 424w, https://substackcdn.com/image/fetch/$s_!SW-d!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff92b340d-6c4a-4c01-93a8-d5f2862a6639_261x176.png 848w, https://substackcdn.com/image/fetch/$s_!SW-d!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff92b340d-6c4a-4c01-93a8-d5f2862a6639_261x176.png 1272w, https://substackcdn.com/image/fetch/$s_!SW-d!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff92b340d-6c4a-4c01-93a8-d5f2862a6639_261x176.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>To retrieve this data, we use the <code>fred.get_series()</code> function, the primary method for data extraction in FredAPI. This function requires a 'series_id' as its main argument. You can find these series IDs on the FRED website or by using FredAPI's search functionality.</p><pre><code>import pandas as pd

unemployment = fred.get_series('UNRATE')

pd.DataFrame(unemployment, columns=['Unemployment_Rate']).tail() </code></pre><p>By default, this retrieves the entire available history of the unemployment rate. Having this long-term perspective can be invaluable for many analyses, allowing you to identify trends and cycles over extended periods.</p><div><hr></div><h2>Specifying Date Ranges: Analyzing Production Data</h2><p>Often, your analysis may focus on a specific time period. For instance, if we're examining the production performance since the 2008 financial crisis, we can use the Industrial Production Index and specify a date range:</p><pre><code>import matplotlib.pyplot as plt

industrial_production = fred.get_series('indpro', 
                                    observation_start='2008-01-01', 
                                    observation_end='2023-12-31')

industrial_production.plot(figsize=(12, 6))
plt.title('Industrial Production Index (2008-2023)')
plt.ylabel('Index')
plt.grid(True)
plt.show()</code></pre><p>The <code>observation_start</code> and <code>observation_end</code> parameters allow us to focus on specific periods. This functionality is particularly useful when studying the effects of certain events or policies, or when you want to exclude unusual periods that might skew your analysis.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Wv-L!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79368ed4-bfff-44de-bf8d-a6806a4a3684_1024x524.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Wv-L!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79368ed4-bfff-44de-bf8d-a6806a4a3684_1024x524.png 424w, https://substackcdn.com/image/fetch/$s_!Wv-L!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79368ed4-bfff-44de-bf8d-a6806a4a3684_1024x524.png 848w, https://substackcdn.com/image/fetch/$s_!Wv-L!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79368ed4-bfff-44de-bf8d-a6806a4a3684_1024x524.png 1272w, https://substackcdn.com/image/fetch/$s_!Wv-L!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79368ed4-bfff-44de-bf8d-a6806a4a3684_1024x524.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Wv-L!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79368ed4-bfff-44de-bf8d-a6806a4a3684_1024x524.png" width="1024" height="524" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/79368ed4-bfff-44de-bf8d-a6806a4a3684_1024x524.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:524,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:69775,&quot;alt&quot;:null,&quot;title&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_!Wv-L!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79368ed4-bfff-44de-bf8d-a6806a4a3684_1024x524.png 424w, https://substackcdn.com/image/fetch/$s_!Wv-L!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79368ed4-bfff-44de-bf8d-a6806a4a3684_1024x524.png 848w, https://substackcdn.com/image/fetch/$s_!Wv-L!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79368ed4-bfff-44de-bf8d-a6806a4a3684_1024x524.png 1272w, https://substackcdn.com/image/fetch/$s_!Wv-L!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79368ed4-bfff-44de-bf8d-a6806a4a3684_1024x524.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h2>Adjusting Data Frequency: Examining the Federal Funds Rate</h2><p>Different analyses require different data granularities. Let's examine the Federal Funds Rate, a key monetary policy tool, and demonstrate how to adjust its frequency:</p><pre><code>fed_rate_monthly = fred.get_series('FEDFUNDS', frequency='m')
fed_rate_quarterly = fred.get_series('FEDFUNDS', frequency='q')
fed_rate_annual = fred.get_series('FEDFUNDS', frequency='a')

fig, (ax1, ax2, ax3) = plt.subplots(3, 1, figsize=(12, 15))
fed_rate_monthly['2020':].plot(ax=ax1, title='Monthly Fed Funds Rate')
fed_rate_quarterly['2020':].plot(ax=ax2, title='Quarterly Fed Funds Rate')
fed_rate_annual['2000':].plot(ax=ax3, title='Annual Fed Funds Rate')
plt.tight_layout()
plt.show()</code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3Pcn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aed2031-0f78-4e6a-91d3-e8ea65ec864b_1190x1489.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3Pcn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aed2031-0f78-4e6a-91d3-e8ea65ec864b_1190x1489.png 424w, https://substackcdn.com/image/fetch/$s_!3Pcn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aed2031-0f78-4e6a-91d3-e8ea65ec864b_1190x1489.png 848w, https://substackcdn.com/image/fetch/$s_!3Pcn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aed2031-0f78-4e6a-91d3-e8ea65ec864b_1190x1489.png 1272w, https://substackcdn.com/image/fetch/$s_!3Pcn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aed2031-0f78-4e6a-91d3-e8ea65ec864b_1190x1489.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3Pcn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aed2031-0f78-4e6a-91d3-e8ea65ec864b_1190x1489.png" width="1190" height="1489" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0aed2031-0f78-4e6a-91d3-e8ea65ec864b_1190x1489.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1489,&quot;width&quot;:1190,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&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="" srcset="https://substackcdn.com/image/fetch/$s_!3Pcn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aed2031-0f78-4e6a-91d3-e8ea65ec864b_1190x1489.png 424w, https://substackcdn.com/image/fetch/$s_!3Pcn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aed2031-0f78-4e6a-91d3-e8ea65ec864b_1190x1489.png 848w, https://substackcdn.com/image/fetch/$s_!3Pcn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aed2031-0f78-4e6a-91d3-e8ea65ec864b_1190x1489.png 1272w, https://substackcdn.com/image/fetch/$s_!3Pcn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aed2031-0f78-4e6a-91d3-e8ea65ec864b_1190x1489.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 <code>frequency</code> parameter allows you to specify the time scale of your data. Use 'd' for daily, 'w' for weekly, 'm' for monthly, 'q' for quarterly, or 'a' for annual data. This flexibility is crucial because different economic indicators have different natural frequencies, and your models might require specific time scales.</p><p>For instance, if you're building a model to predict quarterly GDP growth, you might want to align all your input variables to a quarterly frequency. Conversely, for long-term trend analysis, annual data might suffice and could smooth out short-term fluctuations.</p><div><hr></div><h2>Data Transformations: Analyzing CPI Data</h2><p>In many cases, we need to view data from different perspectives. The Consumer Price Index (CPI) serves as an excellent example. We might need to analyze its absolute level, its percentage change, or its change from a year ago. FredAPI's <code>units</code> parameter facilitates these transformations:</p><pre><code>cpi_level = fred.get_series('CPIAUCSL', units='lin')  # Linear (level)
cpi_pct_change = fred.get_series('CPIAUCSL', units='pch')  # Percent change
cpi_chg_year_ago = fred.get_series('CPIAUCSL', units='ch1')  # Change from year ago

fig, (ax1, ax2, ax3) = plt.subplots(3, 1, figsize=(12, 15))
cpi_level['2020':].plot(ax=ax1, title='CPI Level')
cpi_pct_change['2020':].plot(ax=ax2, title='CPI Percent Change')
cpi_chg_year_ago['2020':].plot(ax=ax3, title='CPI Change from Year Ago')
plt.tight_layout()
plt.show()</code></pre><p>The <code>units</code> parameter offers various transformation options:</p><ul><li><p>'lin': Linear (no transformation)</p></li><li><p>'chg': Change</p></li><li><p>'ch1': Change from a year ago</p></li><li><p>'pch': Percent change</p></li><li><p>'pc1': Percent change from a year ago</p></li><li><p>'pca': Compounded annual rate of change</p></li><li><p>'cch': Continuously compounded rate of change</p></li><li><p>'cca': Continuously compounded annual rate of change</p></li><li><p>'log': Natural log</p></li></ul><p>These transformations are essential for various analyses. For example, when examining inflation, economists often focus on year-over-year percent changes rather than absolute levels.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!eD3p!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd872f43-c6d7-4c79-b66c-fb20fa9f24f5_1189x1489.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!eD3p!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd872f43-c6d7-4c79-b66c-fb20fa9f24f5_1189x1489.png 424w, https://substackcdn.com/image/fetch/$s_!eD3p!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd872f43-c6d7-4c79-b66c-fb20fa9f24f5_1189x1489.png 848w, https://substackcdn.com/image/fetch/$s_!eD3p!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd872f43-c6d7-4c79-b66c-fb20fa9f24f5_1189x1489.png 1272w, https://substackcdn.com/image/fetch/$s_!eD3p!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd872f43-c6d7-4c79-b66c-fb20fa9f24f5_1189x1489.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!eD3p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd872f43-c6d7-4c79-b66c-fb20fa9f24f5_1189x1489.png" width="1189" height="1489" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bd872f43-c6d7-4c79-b66c-fb20fa9f24f5_1189x1489.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1489,&quot;width&quot;:1189,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&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="" srcset="https://substackcdn.com/image/fetch/$s_!eD3p!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd872f43-c6d7-4c79-b66c-fb20fa9f24f5_1189x1489.png 424w, https://substackcdn.com/image/fetch/$s_!eD3p!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd872f43-c6d7-4c79-b66c-fb20fa9f24f5_1189x1489.png 848w, https://substackcdn.com/image/fetch/$s_!eD3p!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd872f43-c6d7-4c79-b66c-fb20fa9f24f5_1189x1489.png 1272w, https://substackcdn.com/image/fetch/$s_!eD3p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd872f43-c6d7-4c79-b66c-fb20fa9f24f5_1189x1489.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h2>Comprehensive Analysis: Creating a MacroQuant Dashboard</h2><p>Now that we've explored various aspects of FredAPI, let's integrate our knowledge to create a comprehensive macroeconomic dashboard:</p><pre><code>import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt

def fetch_macro_data(start_date='2000-01-01'):
    return pd.DataFrame({
        'Unemployment': fred.get_series('UNRATE', observation_start=start_date, frequency='q'),
        'Industrial Production': fred.get_series('indpro', observation_start=start_date, frequency='q'),
        'Fed Funds Rate': fred.get_series('FEDFUNDS', observation_start=start_date, frequency='q'),
        'CPI': fred.get_series('CPIAUCSL', observation_start=start_date, frequency='q', units='pch'),
        'GDP Growth': fred.get_series('GDP', observation_start=start_date, frequency='q', units='pch'),
        'Yield Curve': fred.get_series('T10Y2Y', observation_start=start_date, frequency='q'),
    })

macro_data = fetch_macro_data()

# Set up the matplotlib figure
fig, axes = plt.subplots(3, 2, figsize=(20, 20))
fig.suptitle('MacroQuant Economic Dashboard', fontsize=16)

# Plot each indicator
for (col, ax) in zip(macro_data.columns, axes.flatten()):
    sns.lineplot(data=macro_data, x=macro_data.index, y=col, ax=ax)
    ax.set_title(col)
    ax.grid(True)

# Adjust layout and display
plt.tight_layout()
plt.show()</code></pre><p>This dashboard consolidates several key economic indicators, each retrieved and transformed according to our specific requirements. We're using quarterly data for consistency, but you could easily adjust this based on your analysis needs.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iw-K!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a7dd35d-b568-45e3-837b-5a025293d7a5_1989x1965.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iw-K!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a7dd35d-b568-45e3-837b-5a025293d7a5_1989x1965.png 424w, https://substackcdn.com/image/fetch/$s_!iw-K!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a7dd35d-b568-45e3-837b-5a025293d7a5_1989x1965.png 848w, https://substackcdn.com/image/fetch/$s_!iw-K!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a7dd35d-b568-45e3-837b-5a025293d7a5_1989x1965.png 1272w, https://substackcdn.com/image/fetch/$s_!iw-K!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a7dd35d-b568-45e3-837b-5a025293d7a5_1989x1965.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iw-K!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a7dd35d-b568-45e3-837b-5a025293d7a5_1989x1965.png" width="1456" height="1438" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0a7dd35d-b568-45e3-837b-5a025293d7a5_1989x1965.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1438,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&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="" srcset="https://substackcdn.com/image/fetch/$s_!iw-K!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a7dd35d-b568-45e3-837b-5a025293d7a5_1989x1965.png 424w, https://substackcdn.com/image/fetch/$s_!iw-K!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a7dd35d-b568-45e3-837b-5a025293d7a5_1989x1965.png 848w, https://substackcdn.com/image/fetch/$s_!iw-K!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a7dd35d-b568-45e3-837b-5a025293d7a5_1989x1965.png 1272w, https://substackcdn.com/image/fetch/$s_!iw-K!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a7dd35d-b568-45e3-837b-5a025293d7a5_1989x1965.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># Print correlation matrix
sns.heatmap(macro_data.corr(), annot=True, cmap='coolwarm')
plt.title('Correlation Matrix of Economic Indicators')
plt.show()</code></pre><p>The correlation heatmap provides a quick visualization of relationships between different economic variables, which can be an excellent starting point for developing hypotheses or identifying potential leading indicators for your models.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8Rk4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15dba8d3-7fe1-43ce-aba9-eca30496f770_643x549.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8Rk4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15dba8d3-7fe1-43ce-aba9-eca30496f770_643x549.png 424w, https://substackcdn.com/image/fetch/$s_!8Rk4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15dba8d3-7fe1-43ce-aba9-eca30496f770_643x549.png 848w, https://substackcdn.com/image/fetch/$s_!8Rk4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15dba8d3-7fe1-43ce-aba9-eca30496f770_643x549.png 1272w, https://substackcdn.com/image/fetch/$s_!8Rk4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15dba8d3-7fe1-43ce-aba9-eca30496f770_643x549.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8Rk4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15dba8d3-7fe1-43ce-aba9-eca30496f770_643x549.png" width="643" height="549" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/15dba8d3-7fe1-43ce-aba9-eca30496f770_643x549.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:549,&quot;width&quot;:643,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&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="" title="" srcset="https://substackcdn.com/image/fetch/$s_!8Rk4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15dba8d3-7fe1-43ce-aba9-eca30496f770_643x549.png 424w, https://substackcdn.com/image/fetch/$s_!8Rk4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15dba8d3-7fe1-43ce-aba9-eca30496f770_643x549.png 848w, https://substackcdn.com/image/fetch/$s_!8Rk4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15dba8d3-7fe1-43ce-aba9-eca30496f770_643x549.png 1272w, https://substackcdn.com/image/fetch/$s_!8Rk4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15dba8d3-7fe1-43ce-aba9-eca30496f770_643x549.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Conclusion</h2><p>FredAPI is a powerful tool for quantitative researchers and macroeconomic analysts. Its seamless Python integration allows for easy incorporation of a wide range of economic data into your analytical workflows. From basic data retrieval to building comprehensive dashboards, FredAPI provides the tools you need to enhance your macroquant models with robust, up-to-date economic indicators.</p><p>At MacroQuant Insights, we're committed to equipping you with cutting-edge tools for portfolio construction and macroeconomic analysis. FredAPI is an essential addition to your quantitative toolkit, enabling you to stay current with economic trends and make data-driven decisions.</p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.macroquant.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">Thanks for reading MacroQuant Insights! Subscribe for free to receive new posts and support my work.</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><h3><strong>Disclaimer:</strong></h3><p><em>The content provided on MacroQuant Insights is for informational and educational purposes only and should not be construed as financial advice. While we strive to provide accurate and timely information, all data and analysis are based on sources believed to be reliable but are not guaranteed for accuracy, reliability, or completeness. The opinions expressed are solely those of the author and do not constitute endorsements or recommendations for any specific investment strategy, security, or action.</em></p><p><em>Investing involves risk, including the potential loss of principal. Past performance is not indicative of future results. Always conduct your own research and consult with a qualified financial advisor or other professional before making any investment decisions. MacroQuant Insights and its contributors disclaim all liability for any investment decisions made based on the information provided, and no warranty is made as to the accuracy or completeness of the information presented.</em></p><p><em>Remember, all investments carry risks, and it is important to fully understand these risks before acting on any information presented on this blog. Users are solely responsible for their own investment decisions. MacroQuant Insights is not responsible for any outcomes resulting from the use of this information, and all content is subject to change without notice.</em></p><p></p>]]></content:encoded></item><item><title><![CDATA[Tactical Asset Allocation with Macroeconomic Factors]]></title><description><![CDATA[Part 2 - Implementing the Investment Clock with Python]]></description><link>https://www.macroquant.org/p/tactical-asset-allocation-with-macroeconomic</link><guid isPermaLink="false">https://www.macroquant.org/p/tactical-asset-allocation-with-macroeconomic</guid><dc:creator><![CDATA[Mateo]]></dc:creator><pubDate>Mon, 19 Aug 2024 23:17:38 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%2F75e1dc45-9d8b-4bb7-b783-6f7f2ed6ad8f_728x485.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3><strong>Introduction: Bridging Theory and Practice</strong></h3><p>Hey there, MacroQuant investors! &#128075; Welcome back to our deep dive into tactical asset allocation (TAA).</p><p>In Part 1, we explored the theory and frameworks that underpin this powerful investment strategy, focusing on how macroeconomic factors like growth and inflation can guide our decisions. Now, it's time to roll up our sleeves and get into the practical side of things.</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;8471b179-dca1-4563-bbb9-bda091314128&quot;,&quot;caption&quot;:&quot;Introduction: The Power and Flexibility of Tactical Asset Allocation&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Tactical Asset Allocation with Macroeconomic Factors&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:46377252,&quot;name&quot;:&quot;Mateo&quot;,&quot;bio&quot;:&quot;Driving investment success through strategic portfolio construction&quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5119d71d-af78-4d2e-96f4-7aed283f40ce_800x800.png&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2024-08-06T12:02:22.668Z&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%2Fa40c2e70-8f46-4831-a6e0-9d37d35f8f7d_700x503.jpeg&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.macroquant.org/p/tactical-asset-allocation-growth-inflation&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:147349013,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:0,&quot;comment_count&quot;:0,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;MacroQuant Insights&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%2F5ef475e3-5e3c-4bdb-98fe-58cc92477301_155x155.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>In this article, we're going to walk through the implementation of the Investment Clock model using Python. The Investment Clock, popularized by Merrill Lynch's Global Asset Allocation team, is a dynamic tool that visualizes the economic cycle as a 12-hour clock. This powerful framework integrates key macroeconomic variables&#8212;specifically, the output gap and inflation&#8212;to help investors anticipate market conditions and make informed tactical decisions. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!B99W!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64c3182-180a-4fb5-8e53-8116e7b298a2_700x655.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!B99W!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64c3182-180a-4fb5-8e53-8116e7b298a2_700x655.webp 424w, https://substackcdn.com/image/fetch/$s_!B99W!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64c3182-180a-4fb5-8e53-8116e7b298a2_700x655.webp 848w, https://substackcdn.com/image/fetch/$s_!B99W!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64c3182-180a-4fb5-8e53-8116e7b298a2_700x655.webp 1272w, https://substackcdn.com/image/fetch/$s_!B99W!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64c3182-180a-4fb5-8e53-8116e7b298a2_700x655.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!B99W!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64c3182-180a-4fb5-8e53-8116e7b298a2_700x655.webp" width="700" height="655" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c64c3182-180a-4fb5-8e53-8116e7b298a2_700x655.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:655,&quot;width&quot;:700,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:47346,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&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_!B99W!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64c3182-180a-4fb5-8e53-8116e7b298a2_700x655.webp 424w, https://substackcdn.com/image/fetch/$s_!B99W!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64c3182-180a-4fb5-8e53-8116e7b298a2_700x655.webp 848w, https://substackcdn.com/image/fetch/$s_!B99W!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64c3182-180a-4fb5-8e53-8116e7b298a2_700x655.webp 1272w, https://substackcdn.com/image/fetch/$s_!B99W!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc64c3182-180a-4fb5-8e53-8116e7b298a2_700x655.webp 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><strong>Why Macro Variables Matter in Market Analysis </strong>&#128269;</h4><p>Macroeconomic variables are the vital signs of the economy, directly influencing market behavior &#8211; especially for equities and bonds. These variables form the foundation upon which market dynamics are built.</p><p>Economic growth, measured by GDP, impacts corporate revenues and earnings, which in turn affect stock valuations. Meanwhile, inflation influences interest rates, directly impacting bond yields and prices.</p><div><hr></div><h3><strong>Chapter 1: Defining Our Key Variables  &#128202;</strong></h3><p>Before we can build our Investment Clock, we need to get familiar with the two macroeconomic variables that drive it: the output gap and inflation.</p><h4><strong>1. Output Gap: The Pulse of Economic Activity</strong></h4><p>To implement our Investment Clock model, we first need to understand and calculate the output gap. The output gap is a crucial economic indicator that measures the difference between actual GDP and potential GDP.</p><p>We use the output gap rather than GDP because it provides a relative measure of economic activity, showing us where the economy stands compared to its full potential.</p><p>For our analysis, we've downloaded the output gap data directly from FRED (Federal Reserve Economic Data), provided by the St. Louis Fed. </p><p>The specific series we're using is calculated as:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\text{Output Gap (%)} = \\left(\\frac{\\text{Actual GDP} - \\text{Potential GDP}}{\\text{Potential GDP}}\\right) \\times 100&quot;,&quot;id&quot;:&quot;BZDXHCFUBW&quot;}" data-component-name="LatexBlockToDOM"></div><p>This gives us a percentage measure of how far the economy is operating above or below its potential.</p><p>Once we have this data, we want to identify periods of economic expansion and contraction. To do this, we'll use Python's SciPy library to find the peaks and troughs in our output gap data. Here's how we can implement this:</p><pre><code>from scipy.signal import find_peaks

def find_major_peaks_and_troughs(data, prominence_pct=10, distance=12):
    # Remove NaN values
    clean_data = data.dropna()
    
    # Calculate the prominence as a percentage of the data range
    data_range = clean_data.max() - clean_data.min()
    prominence = prominence_pct / 100 * data_range
    
    # Find peaks
    peaks, _ = find_peaks(clean_data, prominence=prominence, distance=distance)
    
    # Find troughs (by inverting the data)
    troughs, _ = find_peaks(-clean_data, prominence=prominence, distance=distance)
    
    return clean_data.index[peaks], clean_data.index[troughs]

# Find major peaks and troughs for Output Gap data
output_gap_peaks, output_gap_troughs = find_major_peaks_and_troughs(output_gap_data, prominence_pct=20, distance=24)</code></pre><p>This function uses SciPy's <strong>find_peaks </strong>to identify significant peaks and troughs in our output gap data. We set a prominence percentage to ensure we're catching major turns in the economic cycle, and a minimum distance between peaks to avoid picking up on minor fluctuations.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!prYD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F607c640e-85ca-4620-ab5a-ff870b6d8373_996x598.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!prYD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F607c640e-85ca-4620-ab5a-ff870b6d8373_996x598.png 424w, https://substackcdn.com/image/fetch/$s_!prYD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F607c640e-85ca-4620-ab5a-ff870b6d8373_996x598.png 848w, https://substackcdn.com/image/fetch/$s_!prYD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F607c640e-85ca-4620-ab5a-ff870b6d8373_996x598.png 1272w, https://substackcdn.com/image/fetch/$s_!prYD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F607c640e-85ca-4620-ab5a-ff870b6d8373_996x598.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!prYD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F607c640e-85ca-4620-ab5a-ff870b6d8373_996x598.png" width="996" height="598" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/607c640e-85ca-4620-ab5a-ff870b6d8373_996x598.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:598,&quot;width&quot;:996,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:74469,&quot;alt&quot;:null,&quot;title&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_!prYD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F607c640e-85ca-4620-ab5a-ff870b6d8373_996x598.png 424w, https://substackcdn.com/image/fetch/$s_!prYD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F607c640e-85ca-4620-ab5a-ff870b6d8373_996x598.png 848w, https://substackcdn.com/image/fetch/$s_!prYD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F607c640e-85ca-4620-ab5a-ff870b6d8373_996x598.png 1272w, https://substackcdn.com/image/fetch/$s_!prYD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F607c640e-85ca-4620-ab5a-ff870b6d8373_996x598.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>By identifying these peaks and troughs, we can determine when the economy is expanding (moving from a trough to a peak) or contracting (moving from a peak to a trough). This information is crucial for our Investment Clock model, as different assets tend to perform better during different phases of the economic cycle.</p><h4><strong>2. Inflation: Tracking Price Dynamics</strong></h4><p>The second key variable in our Investment Clock model is inflation. We'll focus on the Consumer Price Index (CPI) year-over-year change, as this is the metric targeted by the Federal Reserve in its monetary policy decisions. The investment clock is designed to incorporate policy changes, making this measure particularly relevant.</p><p>The year-over-year percentage change in the Consumer Price Index (CPI) is a common way to track inflation. In Python, this can be done using the formula:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\text{Inflation (%)} = \\left(\\frac{\\text{CPI}_{\\text{current}} - \\text{CPI}_{\\text{previous year}}}{\\text{CPI}_{\\text{previous year}}}\\right) \\times 100&quot;,&quot;id&quot;:&quot;IHHKDBNYUD&quot;}" data-component-name="LatexBlockToDOM"></div><p>Here's how we processed the data:</p><pre><code># Calculate year-over-year CPI change
cpi_df['CPI_YoY'] = cpi_df['CPI'].pct_change(periods=12) * 100

# Find major peaks and troughs for CPI data
cpi_peaks, cpi_troughs = find_major_peaks_and_troughs(cpi_df['CPI_YoY'], prominence_pct=10, distance=12)</code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ttZx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfb8d56d-7259-441a-8be7-ab0aba36b92b_997x600.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ttZx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfb8d56d-7259-441a-8be7-ab0aba36b92b_997x600.png 424w, https://substackcdn.com/image/fetch/$s_!ttZx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfb8d56d-7259-441a-8be7-ab0aba36b92b_997x600.png 848w, https://substackcdn.com/image/fetch/$s_!ttZx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfb8d56d-7259-441a-8be7-ab0aba36b92b_997x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ttZx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfb8d56d-7259-441a-8be7-ab0aba36b92b_997x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ttZx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfb8d56d-7259-441a-8be7-ab0aba36b92b_997x600.png" width="997" height="600" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cfb8d56d-7259-441a-8be7-ab0aba36b92b_997x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:997,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:72739,&quot;alt&quot;:null,&quot;title&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_!ttZx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfb8d56d-7259-441a-8be7-ab0aba36b92b_997x600.png 424w, https://substackcdn.com/image/fetch/$s_!ttZx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfb8d56d-7259-441a-8be7-ab0aba36b92b_997x600.png 848w, https://substackcdn.com/image/fetch/$s_!ttZx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfb8d56d-7259-441a-8be7-ab0aba36b92b_997x600.png 1272w, https://substackcdn.com/image/fetch/$s_!ttZx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfb8d56d-7259-441a-8be7-ab0aba36b92b_997x600.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>By calculating these two variables, we can start to understand where we are in the economic cycle.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NUdN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09787551-8654-4209-84dc-02580e524d6f_800x697.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NUdN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09787551-8654-4209-84dc-02580e524d6f_800x697.png 424w, https://substackcdn.com/image/fetch/$s_!NUdN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09787551-8654-4209-84dc-02580e524d6f_800x697.png 848w, https://substackcdn.com/image/fetch/$s_!NUdN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09787551-8654-4209-84dc-02580e524d6f_800x697.png 1272w, https://substackcdn.com/image/fetch/$s_!NUdN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09787551-8654-4209-84dc-02580e524d6f_800x697.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NUdN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09787551-8654-4209-84dc-02580e524d6f_800x697.png" width="800" height="697" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/09787551-8654-4209-84dc-02580e524d6f_800x697.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:697,&quot;width&quot;:800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:47447,&quot;alt&quot;:null,&quot;title&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_!NUdN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09787551-8654-4209-84dc-02580e524d6f_800x697.png 424w, https://substackcdn.com/image/fetch/$s_!NUdN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09787551-8654-4209-84dc-02580e524d6f_800x697.png 848w, https://substackcdn.com/image/fetch/$s_!NUdN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09787551-8654-4209-84dc-02580e524d6f_800x697.png 1272w, https://substackcdn.com/image/fetch/$s_!NUdN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F09787551-8654-4209-84dc-02580e524d6f_800x697.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h3><strong>Chapter 2: Combining Variables to Create Regimes &#128260;</strong></h3><p>Now that we have our key variables - the output gap and inflation - the next step is to combine them to define economic regimes. These regimes are the building blocks of the Investment Clock and will guide our tactical asset allocation decisions.</p><p><strong>Creating the Regimes</strong></p><p>We'll classify the economy into four distinct regimes based on the relationship between the output gap and inflation. Our approach involves identifying periods of high and low growth and inflation based on the peaks and troughs we found earlier. </p><p>Here's how we implement this in Python:</p><pre><code>def classify_trend(date, peaks, troughs):
    """Classify if we're in a high or low period based on peaks and troughs"""
    turning_points = sorted(list(peaks) + list(troughs))
    
    if date &lt;= turning_points[0]:
        return 'low' if turning_points[0] in peaks else 'high'
    
    for i in range(len(turning_points) - 1):
        if turning_points[i] &lt;= date &lt; turning_points[i+1]:
            return 'high' if turning_points[i] in troughs else 'low'
    
    return 'high' if turning_points[-1] in troughs else 'low'

# Create a date range covering both series
start_date = min(cpi_data.index.min(), output_gap_data.index.min())
end_date = max(cpi_data.index.max(), output_gap_data.index.max())
date_range = pd.date_range(start=start_date, end=end_date, freq='ME')

# Create the dataframe
df = pd.DataFrame(index=date_range)

# Classify growth and inflation for each date
df['growth'] = df.index.map(lambda date: classify_trend(date, output_gap_peaks, output_gap_troughs))
df['inflation'] = df.index.map(lambda date: classify_trend(date, cpi_peaks, cpi_troughs))

# Define the regime mapping
regime_map = {
    ('low', 'low'): 'Reflation',
    ('high', 'low'): 'Recovery',
    ('high', 'high'): 'Overheat',
    ('low', 'high'): 'Stagflation'
}

# Assign regimes
df['regime'] = df.apply(lambda row: regime_map[(row['growth'], row['inflation'])], axis=1)</code></pre><p>Let's break down this approach:</p><ol><li><p>We define a <strong>classify_trend</strong> function that determines whether we're in a high or low period for a given variable (output gap or inflation) based on its peaks and troughs.</p></li><li><p>We create a date range that covers our entire dataset.</p></li><li><p>For each date, we classify the growth (output gap) and inflation as either 'high' or 'low'.</p></li><li><p>We define a regime mapping that combines the growth and inflation states into four distinct regimes:</p><ul><li><p><strong>Recovery (High Growth, Low Inflation):</strong> This phase is characterized by strong economic growth with minimal inflationary pressure. </p></li><li><p><strong>Overheat (High Growth, High Inflation):</strong> In this phase, the economy is growing rapidly, and inflation is picking up. </p></li><li><p><strong>Stagflation (Low Growth, High Inflation):</strong> This is a challenging environment where economic growth is weak, but inflation remains high. </p></li><li><p><strong>Reflation (Low Growth, Low Inflation):</strong> In this phase, both growth and inflation are subdued. </p></li></ul></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AxmI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69eec95b-8bdd-4fce-890d-6c572c771c90_994x491.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AxmI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69eec95b-8bdd-4fce-890d-6c572c771c90_994x491.png 424w, https://substackcdn.com/image/fetch/$s_!AxmI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69eec95b-8bdd-4fce-890d-6c572c771c90_994x491.png 848w, https://substackcdn.com/image/fetch/$s_!AxmI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69eec95b-8bdd-4fce-890d-6c572c771c90_994x491.png 1272w, https://substackcdn.com/image/fetch/$s_!AxmI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69eec95b-8bdd-4fce-890d-6c572c771c90_994x491.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AxmI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69eec95b-8bdd-4fce-890d-6c572c771c90_994x491.png" width="994" height="491" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/69eec95b-8bdd-4fce-890d-6c572c771c90_994x491.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:491,&quot;width&quot;:994,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:67030,&quot;alt&quot;:null,&quot;title&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_!AxmI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69eec95b-8bdd-4fce-890d-6c572c771c90_994x491.png 424w, https://substackcdn.com/image/fetch/$s_!AxmI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69eec95b-8bdd-4fce-890d-6c572c771c90_994x491.png 848w, https://substackcdn.com/image/fetch/$s_!AxmI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69eec95b-8bdd-4fce-890d-6c572c771c90_994x491.png 1272w, https://substackcdn.com/image/fetch/$s_!AxmI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69eec95b-8bdd-4fce-890d-6c572c771c90_994x491.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This approach allows us to create a time series of economic regimes, providing a clear picture of how the economy has moved through different phases over time.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uwE5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5f82c42-1d08-48dc-95c3-2309a60d2cb3_1406x1006.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uwE5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5f82c42-1d08-48dc-95c3-2309a60d2cb3_1406x1006.png 424w, https://substackcdn.com/image/fetch/$s_!uwE5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5f82c42-1d08-48dc-95c3-2309a60d2cb3_1406x1006.png 848w, https://substackcdn.com/image/fetch/$s_!uwE5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5f82c42-1d08-48dc-95c3-2309a60d2cb3_1406x1006.png 1272w, https://substackcdn.com/image/fetch/$s_!uwE5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5f82c42-1d08-48dc-95c3-2309a60d2cb3_1406x1006.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uwE5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5f82c42-1d08-48dc-95c3-2309a60d2cb3_1406x1006.png" width="1406" height="1006" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f5f82c42-1d08-48dc-95c3-2309a60d2cb3_1406x1006.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1006,&quot;width&quot;:1406,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:176392,&quot;alt&quot;:null,&quot;title&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_!uwE5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5f82c42-1d08-48dc-95c3-2309a60d2cb3_1406x1006.png 424w, https://substackcdn.com/image/fetch/$s_!uwE5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5f82c42-1d08-48dc-95c3-2309a60d2cb3_1406x1006.png 848w, https://substackcdn.com/image/fetch/$s_!uwE5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5f82c42-1d08-48dc-95c3-2309a60d2cb3_1406x1006.png 1272w, https://substackcdn.com/image/fetch/$s_!uwE5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5f82c42-1d08-48dc-95c3-2309a60d2cb3_1406x1006.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h3><strong>Chapter 3: Measuring Returns in Each Regime &#128176;</strong></h3><p>With our economic regimes defined, the next crucial step is to analyze how different asset classes perform in each environment. This analysis serves two primary purposes: it helps validate our Investment Clock model and provides valuable insights for refining our tactical asset allocation strategy.</p><p><strong>Methodology</strong></p><p>To conduct this analysis, we'll calculate the average annual real returns for major asset classes within each regime. We'll be using real returns (returns adjusted for inflation) in our analysis, as we are comparing performance across different inflationary environments.</p><p>Here's the Python code we use to calculate and visualize these returns:</p><pre><code>import plotly.graph_objects as go

def plot_regime_returns(data, assets=['stocks', 'bonds']):
    # Function to calculate annualized return
    def annualize(returns):
        return (1 + returns.mean()) ** 12 - 1
    
    # Calculate annualized real returns for each regime
    regime_returns = data.groupby('regime').agg({f'{asset}_r': annualize for asset in assets})
    regime_returns.columns = assets  # Simplify column names
    regime_returns = regime_returns.reset_index()
    
    # Plot the data
    fig = go.Figure()
    for asset in assets:
        fig.add_trace(
            go.Bar(
                x=regime_returns['regime'],
                y=regime_returns[asset],
                name=asset.capitalize(),
                text=regime_returns[asset].apply(lambda x: f'{x:.1%}'),  # Format as percentage
                textposition='auto'
            )
        )
    
    # Basic layout settings
    fig.update_layout(
        title="Average Annual Real Returns by Regime",
        xaxis_title="Regime",
        yaxis_title="Average Annual Real Return",
        barmode='group'
    )
    
    # Show the plot
    fig.show()

# Example usage:
# Assuming 'data' is your DataFrame with columns 'regime', 'stocks_r', 'bonds_r', etc.
# plot_regime_returns(data, assets=['stocks', 'bonds'])</code></pre><p>This code calculates the annualized real returns for each asset class within each regime and creates a bar chart to visualize the 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_!VfH_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e1dc45-9d8b-4bb7-b783-6f7f2ed6ad8f_728x485.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VfH_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e1dc45-9d8b-4bb7-b783-6f7f2ed6ad8f_728x485.png 424w, https://substackcdn.com/image/fetch/$s_!VfH_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e1dc45-9d8b-4bb7-b783-6f7f2ed6ad8f_728x485.png 848w, https://substackcdn.com/image/fetch/$s_!VfH_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e1dc45-9d8b-4bb7-b783-6f7f2ed6ad8f_728x485.png 1272w, https://substackcdn.com/image/fetch/$s_!VfH_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e1dc45-9d8b-4bb7-b783-6f7f2ed6ad8f_728x485.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VfH_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e1dc45-9d8b-4bb7-b783-6f7f2ed6ad8f_728x485.png" width="728" height="485" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/75e1dc45-9d8b-4bb7-b783-6f7f2ed6ad8f_728x485.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:485,&quot;width&quot;:728,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:40456,&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_!VfH_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e1dc45-9d8b-4bb7-b783-6f7f2ed6ad8f_728x485.png 424w, https://substackcdn.com/image/fetch/$s_!VfH_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e1dc45-9d8b-4bb7-b783-6f7f2ed6ad8f_728x485.png 848w, https://substackcdn.com/image/fetch/$s_!VfH_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e1dc45-9d8b-4bb7-b783-6f7f2ed6ad8f_728x485.png 1272w, https://substackcdn.com/image/fetch/$s_!VfH_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e1dc45-9d8b-4bb7-b783-6f7f2ed6ad8f_728x485.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><strong>Results and Analysis</strong></p><p>Let's examine the average annual real returns for stocks and bonds across the four regimes:</p><ol><li><p><strong>Recovery (High Growth, Low Inflation)</strong>:</p><ul><li><p>Stocks: 16.1%</p></li><li><p>Bonds: 4.5%</p></li></ul><p>In this phase, stocks significantly outperform bonds. This aligns with economic theory, as companies benefit from strong growth and low inflation, leading to higher profits and stock prices.</p></li><li><p><strong>Overheat (High Growth, High Inflation)</strong>:</p><ul><li><p>Stocks: 6.9%</p></li><li><p>Bonds: -0.9%</p></li></ul><p>Both assets show lower returns compared to the Recovery phase. Stocks still perform positively, likely due to strong nominal growth, while bonds suffer due to rising inflation.</p></li><li><p><strong>Stagflation (Low Growth, High Inflation)</strong>:</p><ul><li><p>Stocks: -7.7%</p></li><li><p>Bonds: -1.5%</p></li></ul><p>This is the most challenging environment for both stocks and bonds. High inflation erodes returns, while low growth impacts corporate profits.</p></li><li><p><strong>Reflation (Low Growth, Low Inflation)</strong>:</p><ul><li><p>Stocks: 2.2%</p></li><li><p>Bonds: 9.1%</p></li></ul><p>In this phase, bonds outperform stocks. Low inflation benefits bond returns, while low growth hampers stock performance.</p></li></ol><p>These results largely confirm the intuition behind the Investment Clock model. They also align closely with the findings from the Merrill Lynch report, which shows similar patterns of asset performance across regimes.</p><div><hr></div><h4><strong>Chapter 4: Using the Investment Clock and Conclusion </strong>&#128368;&#65039;</h4><p>Now that we've done the heavy lifting, it's time to bring it all together and apply the Investment Clock model in a real-world context. But first, an important clarification:</p><blockquote><p><strong>What this Model Shows</strong></p><p>This Investment Clock model is not a real-time, quantitative trading rule. Rather, it's a framework that suggests how a correct macro view could pay off in a particular way. It's a powerful justification for economics teams and macro strategies in asset management.</p></blockquote><h4><strong>Applying the Investment Clock</strong></h4><p>The Investment Clock visualizes the economy as a clock face, with each quadrant representing one of the regimes we've defined. By tracking current economic data, we can position our portfolios to potentially benefit from the expected phase of the cycle.</p><p>In practice, this means:</p><ol><li><p><strong>Identifying the Current Phase:</strong> We need to develop a systematic way of determining where we are in the cycle. This involves looking at recent economic data. For example:</p><ul><li><p>Use a proxy for real GDP growth, such as the ISM survey.</p></li><li><p>Look at the CPI to gauge inflation relative to a moving average.</p></li><li><p>Combine these to decide if we're in Recovery, Overheat, Stagflation, or Reflation.</p></li></ul></li><li><p><strong>Forecasting the Next Phase:</strong> Economists are generally concerned with forecasting the future level of a range of economic indicators. For our purposes, we're more interested in the future direction of the output gap and inflation.</p></li><li><p><strong>Adjusting Your Portfolio:</strong> Based on the current regime and our forecast, we can tilt the portfolio towards asset classes that historically performed well in that environment.</p></li></ol><h4><strong>Conclusion: A Framework for Tactical Decisions</strong></h4><p>The Investment Clock is a powerful tool for making informed tactical asset allocation decisions. By combining the output gap and inflation to define economic regimes, we can anticipate potential market shifts and position our portfolio accordingly.</p><blockquote><p><strong>Remember, this model provides a framework, not a crystal ball. It should complement, not replace, fundamental analysis and risk management practices.</strong></p></blockquote><p>The key to successful tactical asset allocation is not just understanding the theory but also being able to implement it effectively. With the Python code and methodology we've covered in this post, you're now equipped to bring this strategy to life in your own investment process.</p><p>As always, investing is both an art and a science. Stay curious, keep learning, and don't be afraid to adapt as new insights and data become available. The economy and markets are complex systems, and our understanding of them continues to evolve.</p><p>Happy investing, and see you in the next post!</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.macroquant.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">Thanks for reading MacroQuant Insights! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h3>Sources:</h3><ul><li><p>The Investment Clock - Merril Lynch</p></li><li><p>FRED Economic Data - St. Louis Fed</p></li><li><p>Stocks, Bonds, Bills, and Inflation (SBBI) Data</p></li></ul><h3><strong>Disclaimer:</strong></h3><p><em>The content provided on MacroQuant Insights is for informational and educational purposes only and should not be construed as financial advice. While we strive to provide accurate and timely information, all data and analysis are based on sources believed to be reliable but are not guaranteed for accuracy, reliability, or completeness. The opinions expressed are solely those of the author and do not constitute endorsements or recommendations for any specific investment strategy, security, or action. </em></p><p><em>Investing involves risk, including the potential loss of principal. Past performance is not indicative of future results. Always conduct your own research and consult with a qualified financial advisor or other professional before making any investment decisions. MacroQuant Insights and its contributors disclaim all liability for any investment decisions made based on the information provided, and no warranty is made as to the accuracy or completeness of the information presented. </em></p><p><em>Remember, all investments carry risks, and it is important to fully understand these risks before acting on any information presented on this blog. Users are solely responsible for their own investment decisions. MacroQuant Insights is not responsible for any outcomes resulting from the use of this information, and all content is subject to change without notice.</em></p>]]></content:encoded></item><item><title><![CDATA[Tactical Asset Allocation with Macroeconomic Factors]]></title><description><![CDATA[Part 1 - Theory and Frameworks]]></description><link>https://www.macroquant.org/p/tactical-asset-allocation-growth-inflation</link><guid isPermaLink="false">https://www.macroquant.org/p/tactical-asset-allocation-growth-inflation</guid><dc:creator><![CDATA[Mateo]]></dc:creator><pubDate>Tue, 06 Aug 2024 12:02:22 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%2Fa40c2e70-8f46-4831-a6e0-9d37d35f8f7d_700x503.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Introduction: The Power and Flexibility of Tactical Asset Allocation</h2><p>Hey there, MacroQuant investors! &#128075; Welcome to the first part of our deep dive into tactical asset allocation (TAA). In this article, we're laying the groundwork by exploring the theory and frameworks behind this powerful investment strategy. Don't worry, we'll get our hands dirty with practical implementation in Part 2, but for now, let's build a solid understanding of the concepts.</p><p>First things first: asset allocation is a big deal. How big? <em><strong>Well, studies have shown that it can explain anywhere from 40% to 90% of the variation in portfolio returns over time. &#129327; </strong></em>That's right &#8211; the way you divide your investments across different asset classes can be more important than picking individual stocks or timing the market. </p><p>Now, when we talk about asset allocation, we're actually talking about two different approaches:</p><ol><li><p><strong>Strategic Asset Allocation (SAA): </strong>This is your long-term game plan. It's based on your goals, risk tolerance, and long-term market expectations. Think of it as setting your course for a long journey.</p></li><li><p><strong>Tactical Asset Allocation (TAA):</strong> This is where things get exciting. TAA is all about making short-term adjustments to your portfolio based on current market conditions. It's like adjusting your sails as the wind changes.</p></li></ol><p>In today's market, with monetary policies shifting and economic cycles evolving, the flexibility that TAA offers is more valuable than ever. It allows us to respond to changes in the market environment, potentially adding value to our portfolios beyond what our long-term strategy alone might achieve.</p><p>But here's the million-dollar question: How do we make these tactical decisions? What guides us in adjusting our portfolios as market conditions change?</p><p>This is where our focus on macroeconomic factors &#8211; specifically, growth and inflation &#8211; comes into play. These two economic heavyweights have been shaping market dynamics since the dawn of modern finance, and they're at the heart of some of the most influential TAA models developed by investment giants like Bridgewater Associates and Merrill Lynch.</p><p>In this article, we're going to explore how we can use growth and inflation as guiding principles for tactical asset allocation. </p><h2>Understanding the Growth-Inflation Matrix</h2><p>Picture this: a simple grid with growth on one axis and inflation on the other. This, my friends, is the Growth-Inflation Matrix, and it's about to become your new best friend in the world of investing.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gE1O!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa40c2e70-8f46-4831-a6e0-9d37d35f8f7d_700x503.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gE1O!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa40c2e70-8f46-4831-a6e0-9d37d35f8f7d_700x503.jpeg 424w, https://substackcdn.com/image/fetch/$s_!gE1O!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa40c2e70-8f46-4831-a6e0-9d37d35f8f7d_700x503.jpeg 848w, https://substackcdn.com/image/fetch/$s_!gE1O!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa40c2e70-8f46-4831-a6e0-9d37d35f8f7d_700x503.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!gE1O!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa40c2e70-8f46-4831-a6e0-9d37d35f8f7d_700x503.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gE1O!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa40c2e70-8f46-4831-a6e0-9d37d35f8f7d_700x503.jpeg" width="700" height="503" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a40c2e70-8f46-4831-a6e0-9d37d35f8f7d_700x503.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:503,&quot;width&quot;:700,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&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="" title="" srcset="https://substackcdn.com/image/fetch/$s_!gE1O!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa40c2e70-8f46-4831-a6e0-9d37d35f8f7d_700x503.jpeg 424w, https://substackcdn.com/image/fetch/$s_!gE1O!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa40c2e70-8f46-4831-a6e0-9d37d35f8f7d_700x503.jpeg 848w, https://substackcdn.com/image/fetch/$s_!gE1O!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa40c2e70-8f46-4831-a6e0-9d37d35f8f7d_700x503.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!gE1O!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa40c2e70-8f46-4831-a6e0-9d37d35f8f7d_700x503.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 matrix gives us four distinct economic scenarios:</p><ol><li><p>Rising Growth, Falling Inflation: We call this the "Recovery" phase. It's like springtime for the economy.</p></li><li><p>Rising Growth, Rising Inflation: Welcome to "Overheat". The economy's running hot!</p></li><li><p>Falling Growth, Rising Inflation: Say hello to everyone's least favorite guest, "Stagflation".</p></li><li><p>Falling Growth, Falling Inflation: This is "Deflation", and it's as challenging as it sounds.</p></li></ol><p>Now, here's where it gets interesting. Each of these scenarios tends to favor different types of investments:</p><ul><li><p>In <strong>Recovery &#127793;</strong>, stocks often shine, especially those in cyclical and growth sectors.</p></li><li><p>During <strong>Overheat &#128293;</strong>, commodities and inflation-protected securities typically take the lead.</p></li><li><p>In <strong>Stagflation &#128531;</strong>, cash and inflation-hedged assets often outperform.</p></li><li><p>In <strong>Deflation &#10052;&#65039;</strong>, long-duration bonds usually steal the show.</p></li></ul><p>Understanding this matrix isn't just an academic exercise. It's a practical tool that can help you tilt your portfolio towards assets that are likely to perform well in the current or expected economic environment. </p><h3>The Investment Clock: A Dynamic View of the Economic Cycle</h3><p>Now, let's look at a model that's tailor-made for tactical thinking: the Investment Clock. This clever tool, popularized Merrill Lynch, visualizes the economy as a clock face. Each position on the clock corresponds to a different phase of the economic cycle.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lXeH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c37cc93-2b43-45b5-ab65-107288b205a9_700x655.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lXeH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c37cc93-2b43-45b5-ab65-107288b205a9_700x655.jpeg 424w, https://substackcdn.com/image/fetch/$s_!lXeH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c37cc93-2b43-45b5-ab65-107288b205a9_700x655.jpeg 848w, https://substackcdn.com/image/fetch/$s_!lXeH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c37cc93-2b43-45b5-ab65-107288b205a9_700x655.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!lXeH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c37cc93-2b43-45b5-ab65-107288b205a9_700x655.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lXeH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c37cc93-2b43-45b5-ab65-107288b205a9_700x655.jpeg" width="700" height="655" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8c37cc93-2b43-45b5-ab65-107288b205a9_700x655.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:655,&quot;width&quot;:700,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&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="" title="" srcset="https://substackcdn.com/image/fetch/$s_!lXeH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c37cc93-2b43-45b5-ab65-107288b205a9_700x655.jpeg 424w, https://substackcdn.com/image/fetch/$s_!lXeH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c37cc93-2b43-45b5-ab65-107288b205a9_700x655.jpeg 848w, https://substackcdn.com/image/fetch/$s_!lXeH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c37cc93-2b43-45b5-ab65-107288b205a9_700x655.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!lXeH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c37cc93-2b43-45b5-ab65-107288b205a9_700x655.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>Here's how Merrill Lynch breaks it down:</p><ul><li><p><strong>Recovery:</strong> Growth is up, inflation is down. Stocks are the star performers here.</p></li><li><p><strong>Overheat:</strong> Both growth and inflation are rising. Commodities tend to shine in this phase.</p></li><li><p><strong>Stagflation:</strong> Growth is falling, but inflation is rising. Cash often outperforms here.</p></li><li><p><strong>Deflation:</strong> Both growth and inflation are falling. Bonds typically take the lead.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-qOv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c7d6fe7-9de8-4529-a2da-b2dac202dc7f_700x218.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-qOv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c7d6fe7-9de8-4529-a2da-b2dac202dc7f_700x218.jpeg 424w, https://substackcdn.com/image/fetch/$s_!-qOv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c7d6fe7-9de8-4529-a2da-b2dac202dc7f_700x218.jpeg 848w, https://substackcdn.com/image/fetch/$s_!-qOv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c7d6fe7-9de8-4529-a2da-b2dac202dc7f_700x218.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!-qOv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c7d6fe7-9de8-4529-a2da-b2dac202dc7f_700x218.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-qOv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c7d6fe7-9de8-4529-a2da-b2dac202dc7f_700x218.jpeg" width="700" height="218" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2c7d6fe7-9de8-4529-a2da-b2dac202dc7f_700x218.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:218,&quot;width&quot;:700,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&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="" title="" srcset="https://substackcdn.com/image/fetch/$s_!-qOv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c7d6fe7-9de8-4529-a2da-b2dac202dc7f_700x218.jpeg 424w, https://substackcdn.com/image/fetch/$s_!-qOv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c7d6fe7-9de8-4529-a2da-b2dac202dc7f_700x218.jpeg 848w, https://substackcdn.com/image/fetch/$s_!-qOv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c7d6fe7-9de8-4529-a2da-b2dac202dc7f_700x218.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!-qOv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c7d6fe7-9de8-4529-a2da-b2dac202dc7f_700x218.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>This model offers some key insights:</p><ol><li><p><strong>Cyclicality &#128260;:</strong> Asset performance tends to follow a predictable pattern that aligns with the economic cycle.</p></li><li><p><strong>Sector Rotation &#128256;</strong>: Different sectors of the stock market tend to outperform at different points in the cycle. For instance, defensive sectors might lead during the "Deflation" phase, while cyclical sectors often shine in the "Recovery" phase.</p></li><li><p><strong>Duration Management &#9203;</strong>: The model suggests adjusting your portfolio's interest rate sensitivity based on the inflation outlook. When inflation is falling, longer-duration assets (like long-term bonds) tend to perform better.</p></li><li><p><strong>Tactical Opportunities &#127919;</strong>: The clock can help you spot potential tactical moves. For example, as the economy shifts from "Recovery" to "Overheat", you might consider reducing your stock exposure and increasing your allocation to commodities.</p></li></ol><p>By understanding where we are in this cycle, we can make more informed decisions about how to tilt our portfolios.</p><h2>Conclusion: Setting the Stage for Practical Application</h2><p>So, what have we learned? Tactical asset allocation based on macroeconomic factors  it's a powerful tool for navigating market cycles. By understanding the Growth-Inflation Matrix and leveraging the Investment Clock model, we've laid the foundation for building portfolios that are better equipped to handle whatever the economy throws at us.</p><p>But let's be real: there's no crystal ball in investing. Economic conditions can be messy and unpredictable, and transitions between regimes aren't always as clean as these models suggest. That's why it's crucial to use these frameworks as guides, not gospel, and always keep a close eye on risk management.</p><p>In Part 2 of this series, we'll roll up our sleeves and dive into the practical aspects of implementing these strategies. We'll explore how to assess the current economic environment, translate our analysis into portfolio decisions, and monitor the effectiveness of our tactical moves.</p><p>Remember, investing is a journey, not a destination. Stay curious, keep learning, and don't be afraid to adjust your approach as you gain new insights. Happy Investing! </p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.macroquant.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">Thanks for reading MacroQuant Insights! Subscribe for free to receive new posts and support my work.</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><h3>Sources:</h3><p><a href="https://blogs.cfainstitute.org/investor/2022/02/10/tactical-asset-allocation-the-flexibility-advantage/">Tactical Asset Allocation: The Flexibility Advantage</a> - CFA Institute </p><p><a href="https://www.bridgewater.com/research-and-insights/the-all-weather-story">The All Weather Story</a> - Bridgewater</p><p><a href="https://medium.com/@richardhwlin/how-does-investment-clock-work-c7d8fbbeb7bd">How Does Investment Clock Work?</a> - Richard L </p><p>The Investment Clock - Merril Lynch</p><h3><strong>Disclaimer:</strong></h3><p><em>The content provided on MacroQuant Insights is for informational and educational purposes only and should not be construed as financial advice. While we strive to provide accurate and timely information, all data and analysis are based on sources believed to be reliable but are not guaranteed for accuracy or completeness. The opinions expressed here are solely those of the author and do not constitute recommendations for any specific investment strategy or security.</em></p><p><em>Investing involves risk, including the potential loss of principal. Past performance is not indicative of future results. Always conduct your own research and consult with a qualified financial advisor or other professional before making any investment decisions. MacroQuant Insights and its contributors are not responsible for any investment decisions made based on the information provided.</em></p><p><em>Remember, all investments carry risks, and it is important to fully understand these risks before acting on any information presented on this blog.</em></p>]]></content:encoded></item><item><title><![CDATA[Economic Puzzle Pieces From Sahm Rule to Investor Strategies]]></title><description><![CDATA[As we approach the release of new unemployment figures this Friday, economists are closely watching various indicators of economic health.]]></description><link>https://www.macroquant.org/p/economic-puzzle-pieces-from-sahm</link><guid isPermaLink="false">https://www.macroquant.org/p/economic-puzzle-pieces-from-sahm</guid><dc:creator><![CDATA[Mateo]]></dc:creator><pubDate>Mon, 29 Jul 2024 00:14:22 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%2F4dc81767-7db8-4190-a691-120f63609763_860x610.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>As we approach the release of new unemployment figures this Friday, economists are closely watching various indicators of economic health. The latest Wall Street Journal survey of economists suggests a relatively low risk of recession, with the average probability of a recession in the next 12 months estimated at only 28% as of July 2024. However, an intriguing question arises: Could the Sahm Rule, a reliable recession indicator, be on the verge of triggering and potentially surprise economic analysts?</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ev5y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bbe9722-369c-4339-9b15-ef7a4c5aec46_662x510.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ev5y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bbe9722-369c-4339-9b15-ef7a4c5aec46_662x510.png 424w, https://substackcdn.com/image/fetch/$s_!Ev5y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bbe9722-369c-4339-9b15-ef7a4c5aec46_662x510.png 848w, https://substackcdn.com/image/fetch/$s_!Ev5y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bbe9722-369c-4339-9b15-ef7a4c5aec46_662x510.png 1272w, https://substackcdn.com/image/fetch/$s_!Ev5y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bbe9722-369c-4339-9b15-ef7a4c5aec46_662x510.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ev5y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bbe9722-369c-4339-9b15-ef7a4c5aec46_662x510.png" width="662" height="510" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1bbe9722-369c-4339-9b15-ef7a4c5aec46_662x510.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:510,&quot;width&quot;:662,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Screenshot 2024-07-28 at 9.37.33&#8239;AM.png&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="Screenshot 2024-07-28 at 9.37.33&#8239;AM.png" title="Screenshot 2024-07-28 at 9.37.33&#8239;AM.png" srcset="https://substackcdn.com/image/fetch/$s_!Ev5y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bbe9722-369c-4339-9b15-ef7a4c5aec46_662x510.png 424w, https://substackcdn.com/image/fetch/$s_!Ev5y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bbe9722-369c-4339-9b15-ef7a4c5aec46_662x510.png 848w, https://substackcdn.com/image/fetch/$s_!Ev5y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bbe9722-369c-4339-9b15-ef7a4c5aec46_662x510.png 1272w, https://substackcdn.com/image/fetch/$s_!Ev5y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bbe9722-369c-4339-9b15-ef7a4c5aec46_662x510.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>The latest data shows the Sahm Rule Recession Indicator at 0.43, just shy of the 0.50 threshold that would signal a recession. This proximity to the trigger point raises the possibility of a disconnect between economist predictions and what this particular indicator might soon reveal. In this post, we'll explore the original Sahm Rule, its Canadian adaptation, and how investors might approach their strategies during periods of economic uncertainty, especially when different economic signals appear to be in tension.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!L5ed!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a104d63-3230-4285-b6ca-9fccd99cd34c_762x426.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!L5ed!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a104d63-3230-4285-b6ca-9fccd99cd34c_762x426.jpeg 424w, https://substackcdn.com/image/fetch/$s_!L5ed!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a104d63-3230-4285-b6ca-9fccd99cd34c_762x426.jpeg 848w, https://substackcdn.com/image/fetch/$s_!L5ed!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a104d63-3230-4285-b6ca-9fccd99cd34c_762x426.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!L5ed!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a104d63-3230-4285-b6ca-9fccd99cd34c_762x426.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!L5ed!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a104d63-3230-4285-b6ca-9fccd99cd34c_762x426.jpeg" width="762" height="426" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3a104d63-3230-4285-b6ca-9fccd99cd34c_762x426.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:426,&quot;width&quot;:762,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;url.jpg&quot;,&quot;title&quot;:&quot;url.jpg&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="url.jpg" title="url.jpg" srcset="https://substackcdn.com/image/fetch/$s_!L5ed!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a104d63-3230-4285-b6ca-9fccd99cd34c_762x426.jpeg 424w, https://substackcdn.com/image/fetch/$s_!L5ed!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a104d63-3230-4285-b6ca-9fccd99cd34c_762x426.jpeg 848w, https://substackcdn.com/image/fetch/$s_!L5ed!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a104d63-3230-4285-b6ca-9fccd99cd34c_762x426.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!L5ed!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a104d63-3230-4285-b6ca-9fccd99cd34c_762x426.jpeg 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>The Original Sahm Rule: A Recession's Early Warning System</strong></h2><p>Developed by economist Claudia Sahm in 2019, the Sahm Rule is a reliable indicator for identifying the start of a recession. It states that when the three-month moving average of the national unemployment rate rises by 0.50 percentage points or more relative to its low during the previous 12 months, the economy has entered or is about to enter a recession.</p><p>This rule has accurately signaled the onset of every recession since the 1970s, providing policymakers and economists with a valuable tool for early detection of economic downturns. As we await the latest unemployment figures, many will be watching to see if the Sahm Rule is triggered, potentially signaling the start of a new recessionary period in the US.</p><p>The latest data from June 2024 shows the Sahm Rule Recession Indicator at 0.43, just below the 0.50 threshold that would signal a recession. This suggests we're in a period of economic uncertainty, but not yet in recession territory according to this metric.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!12HZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30939f57-5442-467e-b8e9-36101309a8d1_723x492.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!12HZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30939f57-5442-467e-b8e9-36101309a8d1_723x492.png 424w, https://substackcdn.com/image/fetch/$s_!12HZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30939f57-5442-467e-b8e9-36101309a8d1_723x492.png 848w, https://substackcdn.com/image/fetch/$s_!12HZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30939f57-5442-467e-b8e9-36101309a8d1_723x492.png 1272w, https://substackcdn.com/image/fetch/$s_!12HZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30939f57-5442-467e-b8e9-36101309a8d1_723x492.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!12HZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30939f57-5442-467e-b8e9-36101309a8d1_723x492.png" width="723" height="492" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/30939f57-5442-467e-b8e9-36101309a8d1_723x492.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:492,&quot;width&quot;:723,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Screenshot 2024-07-28 at 9.40.40&#8239;AM.png&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Screenshot 2024-07-28 at 9.40.40&#8239;AM.png" title="Screenshot 2024-07-28 at 9.40.40&#8239;AM.png" srcset="https://substackcdn.com/image/fetch/$s_!12HZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30939f57-5442-467e-b8e9-36101309a8d1_723x492.png 424w, https://substackcdn.com/image/fetch/$s_!12HZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30939f57-5442-467e-b8e9-36101309a8d1_723x492.png 848w, https://substackcdn.com/image/fetch/$s_!12HZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30939f57-5442-467e-b8e9-36101309a8d1_723x492.png 1272w, https://substackcdn.com/image/fetch/$s_!12HZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30939f57-5442-467e-b8e9-36101309a8d1_723x492.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>The Canadian Sahm Rule: Innovation Across Borders</strong></h2><p>The Sahm Rule has been adapted for use in Canada, showcasing how economic indicators can be tailored to different national contexts while maintaining their core predictive power. Economic research suggests that a slightly higher trigger of 0.6 percentage points works better for Canada, compared to the 0.5 percentage point threshold used in the United States.</p><p>The Canadian Sahm Rule follows the same principle as its U.S. counterpart: It calculates a three-month average of the Canadian monthly unemployment rate to smooth out short-term fluctuations. This average is then compared with its lowest point over the prior 12 months. When the difference exceeds the 0.6 percentage point threshold, it signals that Canada may be entering a recession.</p><p>Interestingly, recent economic data indicates that the Canadian Sahm Rule has just been triggered, suggesting that Canada might currently be in a recession. This development has caught the attention of economists and policymakers, as it contrasts with some other economic indicators that have not yet signaled a downturn.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!m2Ry!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4dc81767-7db8-4190-a691-120f63609763_860x610.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!m2Ry!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4dc81767-7db8-4190-a691-120f63609763_860x610.png 424w, https://substackcdn.com/image/fetch/$s_!m2Ry!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4dc81767-7db8-4190-a691-120f63609763_860x610.png 848w, https://substackcdn.com/image/fetch/$s_!m2Ry!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4dc81767-7db8-4190-a691-120f63609763_860x610.png 1272w, https://substackcdn.com/image/fetch/$s_!m2Ry!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4dc81767-7db8-4190-a691-120f63609763_860x610.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!m2Ry!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4dc81767-7db8-4190-a691-120f63609763_860x610.png" width="860" height="610" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4dc81767-7db8-4190-a691-120f63609763_860x610.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:610,&quot;width&quot;:860,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:62782,&quot;alt&quot;:null,&quot;title&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_!m2Ry!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4dc81767-7db8-4190-a691-120f63609763_860x610.png 424w, https://substackcdn.com/image/fetch/$s_!m2Ry!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4dc81767-7db8-4190-a691-120f63609763_860x610.png 848w, https://substackcdn.com/image/fetch/$s_!m2Ry!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4dc81767-7db8-4190-a691-120f63609763_860x610.png 1272w, https://substackcdn.com/image/fetch/$s_!m2Ry!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4dc81767-7db8-4190-a691-120f63609763_860x610.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>It's worth noting that while the Sahm Rule has proven to be a reliable indicator in both the U.S. and Canada, it's not infallible. In Canada, there's only one recorded "false positive" outside of a recession since the 1970s, occurring in the mid-1990s. This high degree of accuracy, combined with its simplicity and timeliness, makes the Canadian Sahm Rule a valuable tool for economic forecasting and policy planning.</p><h2><strong>Investing During Recessions: Steady Course or Strategic Shift?</strong></h2><p>As recession indicators like the Sahm Rule gain attention, many investors wonder if they should adjust their strategies. However, recent discussions in financial circles, including on the Rational Reminder podcast, highlight that the relationship between economic data and stock returns is often messier than most people realize, both in Canada and the United States.</p><p>Historical data shows that of the seven economic recessions in Canada since 1957, four actually saw positive stock returns during the recession period. In the US, a similar pattern emerges, with some recessions coinciding with positive stock market performance. This counterintuitive result occurs because stock markets in both countries price assets based on future expectations, while economic data is backward-looking.</p><p>Moreover, even if one could predict recession dates accurately in either country, this information might not translate into profitable trading strategies. Research examining US data has found no evidence that yield curve inversions, which are good predictors of economic activity, can help investors avoid poor stock returns.</p><p>Importantly for long-term investors in both Canada and the US, three-year and five-year returns following economic peaks have historically been meaningfully positive. This suggests that even if markets decline during a recession, they tend to recover relatively quickly in both countries.</p><p>The key takeaway for investors on both sides of the border is that bad economic conditions don't necessarily mean they should change course with their investments. When we hear news about either country entering a recession, it doesn't automatically imply that we should make our portfolios more conservative or move to cash. The complex, adaptive nature of markets in both nations means that widely known information is already reflected in current prices, making it extremely challenging to outperform through market timing based on economic indicators.</p><h2><strong>Conclusion</strong></h2><p>As we await the latest unemployment figures and watch for any triggering of the Sahm Rule, it's crucial to remember that economic indicators, while valuable, don't always translate directly into investment strategies. Whether we're looking at the original Sahm Rule, its Canadian adaptation, or considering our investment approach, the key is to maintain a long-term perspective. Economic cycles come and go, but a well-diversified, consistently maintained investment strategy has historically been the most reliable path to long-term financial success.</p><h2>Sources:</h2><ol><li><p>Federal Reserve Economic Data (FRED) - Sahm Rule Recession Indicator - <a href="https://fred.stlouisfed.org/series/SAHMREALTIME">https://fred.stlouisfed.org/series/SAHMREALTIME</a></p></li><li><p>Wall Street Journal Economic Forecasting Survey - <a href="https://www.wsj.com/economy/economists-say-inflation-would-be-worse-under-trump-than-biden-263bc900?mod=article_inline">https://www.wsj.com/economy/economists-say-inflation-would-be-worse-under-trump-than-biden-263bc900?mod=article_inline</a></p></li><li><p>Claudia Sahm's original research on the Sahm Rule - <a href="https://www.hamiltonproject.org/assets/files/Sahm_web_20190506.pdf">https://www.hamiltonproject.org/assets/files/Sahm_web_20190506.pdf</a></p></li><li><p>Claudia Sahm - O Canada!</p><div class="embedded-post-wrap" data-attrs="{&quot;id&quot;:40456288,&quot;url&quot;:&quot;https://stayathomemacro.substack.com/p/o-canada&quot;,&quot;publication_id&quot;:280281,&quot;publication_name&quot;:&quot;Stay-At-Home Macro (SAHM)&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0593a51-c407-42bc-91ba-bbfec8310c64_278x278.png&quot;,&quot;title&quot;:&quot;O Canada! &quot;,&quot;truncated_body_text&quot;:&quot;On Monday, the Conservative Party of Canada released its election platform, &#8220;Canada&#8217;s Recovery Plan.&#8221; Within the 160-page document, is a proposal to reform Employment Insurance (EI), which is Canada&#8217;s program for the unemployed. \&quot;Protecting Canadian Workers During Recessions Canada&#8217;s Conservatives understand how a recession can be devastating for Canad&#8230;&quot;,&quot;date&quot;:&quot;2021-08-25T12:36:39.459Z&quot;,&quot;like_count&quot;:13,&quot;comment_count&quot;:5,&quot;bylines&quot;:[{&quot;id&quot;:4650173,&quot;name&quot;:&quot;Claudia Sahm&quot;,&quot;handle&quot;:&quot;stayathomemacro&quot;,&quot;previous_name&quot;:null,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fe97d36a-3361-4fa9-8d48-251ffa4dc05d_96x96.jpeg&quot;,&quot;bio&quot;:&quot;Founder of Sahm Consulting, former Federal Reserve and White House economist.&quot;,&quot;profile_set_up_at&quot;:&quot;2021-08-14T22:55:46.820Z&quot;,&quot;publicationUsers&quot;:[{&quot;id&quot;:251285,&quot;user_id&quot;:4650173,&quot;publication_id&quot;:280281,&quot;role&quot;:&quot;admin&quot;,&quot;public&quot;:true,&quot;is_primary&quot;:false,&quot;publication&quot;:{&quot;id&quot;:280281,&quot;name&quot;:&quot;Stay-At-Home Macro (SAHM)&quot;,&quot;subdomain&quot;:&quot;stayathomemacro&quot;,&quot;custom_domain&quot;:null,&quot;custom_domain_optional&quot;:false,&quot;hero_text&quot;:&quot;My goal is to make economic policy and macroeconomics better.&quot;,&quot;logo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/a0593a51-c407-42bc-91ba-bbfec8310c64_278x278.png&quot;,&quot;author_id&quot;:4650173,&quot;theme_var_background_pop&quot;:&quot;#786CFF&quot;,&quot;created_at&quot;:&quot;2021-02-06T22:25:11.638Z&quot;,&quot;rss_website_url&quot;:null,&quot;email_from_name&quot;:&quot;Claudia Sahm from Stay-At-Home Macro (SAHM)&quot;,&quot;copyright&quot;:&quot;Claudia Sahm&quot;,&quot;founding_plan_name&quot;:&quot;Extra Special Supporter&quot;,&quot;community_enabled&quot;:true,&quot;invite_only&quot;:false,&quot;payments_state&quot;:&quot;enabled&quot;,&quot;language&quot;:null,&quot;explicit&quot;:false,&quot;is_personal_mode&quot;:false}}],&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;utm_campaign&quot;:null,&quot;belowTheFold&quot;:true,&quot;type&quot;:&quot;newsletter&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="EmbeddedPostToDOM"><a class="embedded-post" native="true" href="https://stayathomemacro.substack.com/p/o-canada?utm_source=substack&amp;utm_campaign=post_embed&amp;utm_medium=web"><div class="embedded-post-header"><img class="embedded-post-publication-logo" src="https://substackcdn.com/image/fetch/$s_!qaf_!,w_56,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0593a51-c407-42bc-91ba-bbfec8310c64_278x278.png" loading="lazy"><span class="embedded-post-publication-name">Stay-At-Home Macro (SAHM)</span></div><div class="embedded-post-title-wrapper"><div class="embedded-post-title">O Canada! </div></div><div class="embedded-post-body">On Monday, the Conservative Party of Canada released its election platform, &#8220;Canada&#8217;s Recovery Plan.&#8221; Within the 160-page document, is a proposal to reform Employment Insurance (EI), which is Canada&#8217;s program for the unemployed. "Protecting Canadian Workers During Recessions Canada&#8217;s Conservatives understand how a recession can be devastating for Canad&#8230;</div><div class="embedded-post-cta-wrapper"><span class="embedded-post-cta">Read more</span></div><div class="embedded-post-meta">5 years ago &#183; 13 likes &#183; 5 comments &#183; Claudia Sahm</div></a></div></li><li><p>Rational Reminder, Episode 279 - <a href="https://rationalreminder.ca/podcast/279">https://rationalreminder.ca/podcast/279</a></p></li></ol><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.macroquant.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">Thanks for reading MacroQuant Insights! Subscribe for free to receive new posts and support my work.</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></channel></rss>