<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[The Fractal]]></title><description><![CDATA[Writing about how data & tech professionals become storytellers, leaders, and changemakers.

Be Brilliant. Be Heard.
]]></description><link>https://www.thefractal.co</link><image><url>https://substackcdn.com/image/fetch/$s_!8Fo7!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdee94698-7fc3-41c3-a2cc-15f3b9499eb0_256x256.png</url><title>The Fractal</title><link>https://www.thefractal.co</link></image><generator>Substack</generator><lastBuildDate>Sat, 25 Apr 2026 13:13:52 GMT</lastBuildDate><atom:link href="https://www.thefractal.co/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Vijay Reddiar]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[thefractal@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[thefractal@substack.com]]></itunes:email><itunes:name><![CDATA[Vijay Reddiar]]></itunes:name></itunes:owner><itunes:author><![CDATA[Vijay Reddiar]]></itunes:author><googleplay:owner><![CDATA[thefractal@substack.com]]></googleplay:owner><googleplay:email><![CDATA[thefractal@substack.com]]></googleplay:email><googleplay:author><![CDATA[Vijay Reddiar]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Range Is The New Black - Part V (The Grand Finale)]]></title><description><![CDATA[Why Developing Range Is the Most Important Thing You Can Do for Managing and Developing Your Career]]></description><link>https://www.thefractal.co/p/range-is-the-new-black-part-v-the</link><guid isPermaLink="false">https://www.thefractal.co/p/range-is-the-new-black-part-v-the</guid><dc:creator><![CDATA[Vijay Reddiar]]></dc:creator><pubDate>Sat, 14 Feb 2026 12:30:22 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!nrK8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0573d5b0-e14f-4b49-bbeb-95c42cb7a5e6_1600x896.heic" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nrK8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0573d5b0-e14f-4b49-bbeb-95c42cb7a5e6_1600x896.heic" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nrK8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0573d5b0-e14f-4b49-bbeb-95c42cb7a5e6_1600x896.heic 424w, https://substackcdn.com/image/fetch/$s_!nrK8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0573d5b0-e14f-4b49-bbeb-95c42cb7a5e6_1600x896.heic 848w, https://substackcdn.com/image/fetch/$s_!nrK8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0573d5b0-e14f-4b49-bbeb-95c42cb7a5e6_1600x896.heic 1272w, https://substackcdn.com/image/fetch/$s_!nrK8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0573d5b0-e14f-4b49-bbeb-95c42cb7a5e6_1600x896.heic 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nrK8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0573d5b0-e14f-4b49-bbeb-95c42cb7a5e6_1600x896.heic" width="1456" height="815" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0573d5b0-e14f-4b49-bbeb-95c42cb7a5e6_1600x896.heic&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:815,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:86610,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/heic&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.thefractal.co/i/186452946?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0573d5b0-e14f-4b49-bbeb-95c42cb7a5e6_1600x896.heic&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!nrK8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0573d5b0-e14f-4b49-bbeb-95c42cb7a5e6_1600x896.heic 424w, https://substackcdn.com/image/fetch/$s_!nrK8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0573d5b0-e14f-4b49-bbeb-95c42cb7a5e6_1600x896.heic 848w, https://substackcdn.com/image/fetch/$s_!nrK8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0573d5b0-e14f-4b49-bbeb-95c42cb7a5e6_1600x896.heic 1272w, https://substackcdn.com/image/fetch/$s_!nrK8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0573d5b0-e14f-4b49-bbeb-95c42cb7a5e6_1600x896.heic 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>This is the last piece of  the 5-part series on <em>Range Is The New Black</em>. Previously published posts are linked at the bottom. Ok, Onward.</p><p>This closing chapter is also perhaps the most liberating one of all.</p><p>If you&#8217;ve followed the arc of this series so far, you will see that the interpretation of the  final chapter of Range as it applies to career development doesn&#8217;t just reinforce the previous ideas. <strong>It reframes the very </strong><em><strong>goal</strong></em><strong> of a career.</strong> Not as a linear climb from novice to expert, but as an evolving, curious journey led  by a mindset that evolution is essential for growth.</p><p>An evolutionary mindset perhaps never more important than it is now, as human brilliance is squarely staring at machine brilliance and what it is becoming capable of doing.</p><h2><strong>Chapter 12: Deliberate Amateurs</strong></h2><p>David introduces us to the concept of the <strong>deliberate amateur</strong>.  Someone who, even after achieving deep expertise, deliberately chooses to approach problems as if they&#8217;re new again. Not because they don&#8217;t know better, but because they <strong>do</strong>.</p><p>They know that fresh thinking comes not from mastery alone, but from resisting the rigidity that mastery can create.</p><p>To illustrate this, David brings us the story of <strong>Frances Hesselbein</strong>, who took over the Girl Scouts of the USA in the 1970s. She had no formal management training. No MBA. No pedigree in organizational transformation.</p><p>Yet she modernized the Girl Scouts into one of the most respected leadership development organizations in the country.</p><p>Her secret? She didn&#8217;t try to be the smartest person in the room. She asked good questions. She ignored &#8220;best practices.&#8221; She trusted her outsider status to rethink what leadership could look like.</p><p>In fact, her amateurism wasn&#8217;t a weakness. It was her <strong>superpower</strong>.</p><div><hr></div><h3><strong>What This Means for Data &amp; Tech Professionals in 2026</strong></h3><p>In a world where AI can learn the rules of any domain quickly, the <em>last</em> thing you want to become is a rule-bound expert who forgets how to ask &#8220;why.&#8221;</p><p>Here&#8217;s the paradox: the deeper you go into your technical craft, the more likely you are to become rigid in your mental models.  And the more dangerous that rigidity is likely to become in an environment shaped by exponential change.</p><p>That&#8217;s why some of the best leaders in tech deliberately cultivate an <strong>amateur mindset</strong>, even when they&#8217;re operating at the top of their game.</p><p>They are, for the purpose of illustration:</p><ul><li><p>The Head of Engineering who regularly joins onboarding sessions for junior engineers to hear how beginners think. </p></li><li><p>The  Senior Staff Data Scientist who picks up visual design to better communicate model insights.</p></li><li><p>The Principal Architect who shadows product managers, not to advise but to listen and relearn user needs.</p></li></ul><p>These professionals aren&#8217;t becoming less expert. They&#8217;re choosing <strong>range over rigidity</strong>. They&#8217;re choosing <strong>curiosity over correctness</strong>.  </p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.thefractal.co/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 The Fractal! 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><strong>The Power of Not Knowing (On Purpose)</strong></h3><p>In the AI era, where much of the &#8220;doing&#8221; is being automated, the real leverage comes from thinking differently i.e., combining, questioning, reframing, reimagining.</p><p>That doesn&#8217;t happen when you&#8217;re always the expert in the room. It happens when you choose to occasionally become <strong>the beginner again</strong>.</p><p>David shows how deliberate amateurs across fields from Nobel-winning scientists to elite artists  stay relevant by refusing to box themselves into a single identity. They wander. They tinker. They play.</p><p>And that&#8217;s not a detour. That&#8217;s the fodder for innovation.</p><p></p><div><hr></div><h3><strong>Practical Strategy: Become a Career Amateur (Deliberately)</strong></h3><ol><li><p><strong>Carve out &#8220;amateur hours&#8221;</strong></p><p>Block time each week for exploration outside your core domain. Study fields adjacent to your own. Pick up an unrelated skill, not for career gain, but for mental flexibility.</p></li><li><p><strong>Join teams where you&#8217;re not the expert</strong></p><p>Deliberately embed yourself in projects where others know more. Watch how you learn. Observe your own biases. That&#8217;s where you&#8217;ll grow.</p></li><li><p><strong>Ask &#8220;why&#8221; like a beginner</strong></p><p>In meetings, practice asking &#8220;why are we doing it this way?&#8221; Not to challenge, but to uncover assumptions. Often, you&#8217;ll surface outdated thinking others missed.</p></li><li><p><strong>Write and teach across disciplines</strong></p><p>Explaining a technical concept to non-technical peers forces you to see it with new eyes. It&#8217;s a powerful way to stay mentally limber.</p></li><li><p><strong>Normalize saying &#8220;I don&#8217;t know&#8221;</strong></p><p>Especially in leadership roles, this is powerful. It gives your team permission to explore, learn, and challenge assumptions, which is exactly what you want in an AI-enabled environment.</p></li></ol><div><hr></div><h3><strong>Bottom Line: Expertise Is a Starting Point. Not a Destination.</strong></h3><p>The deliberate amateur doesn&#8217;t reject mastery. They <strong>build on it</strong>, but refuse to let it become a cage. They use their range  across roles, industries, and ways of thinking to stay creative, connected, and adaptable.</p><p>And in the modern tech world, that&#8217;s what leadership looks like.</p><p>The ability to learn publicly. To think laterally. To ask &#8220;what if?&#8221; long after others have stopped.</p><div><hr></div><h2><strong>Conclusion: Why Range Is the New Black</strong></h2><p>We opened this series with a bold claim: that in a world reshaped by AI, automation, and complexity, <em>range</em>,  not narrow specialization is becoming the most important advantage a professional can build.</p><p>And now, having walked through the book <em>Range</em>, it&#8217;s clear: range isn&#8217;t just a philosophy. It&#8217;s a playbook.</p><p>Across every chapter, one truth keeps repeating: the most resilient, creative, and influential professionals are those who refuse to be defined by a single skillset or a static path.</p><p>They sample broadly.</p><p>They adapt relentlessly.</p><p>They question the rules.</p><p>They think like outsiders.</p><p>They update like foxes.</p><p>They drop tools when needed.</p><p>They lead like deliberate amateurs.</p><p>Whether you&#8217;re a senior engineer wondering how to stay relevant, a data professional hoping to step into strategic influence, or a team leader stepping into leading an area of large-scale transformation programs, <strong>range is no longer optional</strong>. It&#8217;s the new foundation of career durability and exponential growth.  </p><p>So don&#8217;t chase the narrowest lane. Build your bridge wide. Cultivate your curiosity. Own your unexpected combinations. The future belongs to those who can flex.</p><div><hr></div><p><em>Range is the new black. And, this series is your career development playbook.</em></p><div><hr></div><p>Thanks for being part of this journey. If you found this series valuable, share it with someone who will appreciate this perspective and needs to hear the most. The next chapter of <em><strong>your</strong></em> <em><strong>own</strong></em> <em><strong>range</strong></em> might be closer than you think.</p><p>To your success,</p><p>Vijay</p><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://www.thefractal.co/p/range-is-the-new-black-part-v-the?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption">Thanks for reading The Fractal! This post is public so feel free to share it.</p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.thefractal.co/p/range-is-the-new-black-part-v-the?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.thefractal.co/p/range-is-the-new-black-part-v-the?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><p>PS. If you missed the previous posts, start from <a href="https://www.thefractal.co/p/range-is-the-new-black?r=e8d53">here</a>.</p>]]></content:encoded></item><item><title><![CDATA[Range Is The New Black - Part IV]]></title><description><![CDATA[Why Developing Range Is the Most Important Thing You Can Do for Managing and Developing Your Career]]></description><link>https://www.thefractal.co/p/range-is-the-new-black-part-iv</link><guid isPermaLink="false">https://www.thefractal.co/p/range-is-the-new-black-part-iv</guid><pubDate>Thu, 12 Feb 2026 13:37:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!JeU-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b87a2d0-4542-404a-be70-3a251fe03e49_1600x896.heic" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JeU-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b87a2d0-4542-404a-be70-3a251fe03e49_1600x896.heic" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JeU-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b87a2d0-4542-404a-be70-3a251fe03e49_1600x896.heic 424w, https://substackcdn.com/image/fetch/$s_!JeU-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b87a2d0-4542-404a-be70-3a251fe03e49_1600x896.heic 848w, https://substackcdn.com/image/fetch/$s_!JeU-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b87a2d0-4542-404a-be70-3a251fe03e49_1600x896.heic 1272w, https://substackcdn.com/image/fetch/$s_!JeU-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b87a2d0-4542-404a-be70-3a251fe03e49_1600x896.heic 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JeU-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b87a2d0-4542-404a-be70-3a251fe03e49_1600x896.heic" width="1456" height="815" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3b87a2d0-4542-404a-be70-3a251fe03e49_1600x896.heic&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:815,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:78931,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/heic&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.thefractal.co/i/186450926?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b87a2d0-4542-404a-be70-3a251fe03e49_1600x896.heic&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!JeU-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b87a2d0-4542-404a-be70-3a251fe03e49_1600x896.heic 424w, https://substackcdn.com/image/fetch/$s_!JeU-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b87a2d0-4542-404a-be70-3a251fe03e49_1600x896.heic 848w, https://substackcdn.com/image/fetch/$s_!JeU-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b87a2d0-4542-404a-be70-3a251fe03e49_1600x896.heic 1272w, https://substackcdn.com/image/fetch/$s_!JeU-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b87a2d0-4542-404a-be70-3a251fe03e49_1600x896.heic 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>This next topic brings us to one of the most disruptive and empowering ideas in <em>Range</em>. The idea that sometimes, <strong>not being &#8220;qualified&#8221; is your biggest advantage</strong>. Especially when you&#8217;re solving a problem no one else has cracked  or stepping into a space no one expects you to lead.</p><div><hr></div><h2><strong>Chapter 8: The Outsider Advantage</strong></h2><p>David introduces us to a surprising insight drawn from science competitions like the <em>InnoCentive</em> challenge. In these competitions, organizations post difficult R&amp;D problems to a global network, inviting anyone,  not just internal experts to propose a solution.</p><p>You&#8217;d expect that the most &#8220;qualified&#8221; participants would dominate. The people with deep experience in the exact domain of the problem. But that&#8217;s not what happens.</p><p>In fact, the data show that solutions are most often found by people who are <em>outside the domain entirely</em>, but <strong>close enough</strong> to understand the problem, and different enough to see it with fresh eyes.</p><p>For example, a concrete durability problem posed by a construction company was solved by a chemist. A molecular biology question was answered by someone in computer graphics.</p><p>David calls this &#8220;cognitive lateral thinking.&#8221; It&#8217;s what happens when people carry mental models from one domain into another and see things the insiders miss.</p><div><hr></div><h3><strong>Why This Is Vital for Tech Professionals</strong></h3><p>Let&#8217;s now apply this to tech careers, especially in AI-heavy or innovation-driven environments.</p><p>Many technical professionals carry deep expertise in a specific stack, system, or architecture. They&#8217;ve been trained to solve problems with best practices. But in rapidly changing contexts new product categories, cross-functional initiatives, novel AI use cases <strong>best practices don&#8217;t exist yet</strong>.</p><p>The insiders often apply what they already know. But what if the problem requires a completely different frame?</p><p>That&#8217;s where the outsider shines.</p><p>If you&#8217;re a software engineer who understands organizational psychology, you might design more human-centered AI products.</p><p>If you&#8217;re a data analyst who dabbles in regulatory law, you might see compliance risks before legal does.</p><p>If you&#8217;re a systems architect who studies storytelling, you might communicate infrastructure tradeoffs in a way that influences executives. My last job in tech was that of a systems architect in 2007, way before I l had the opportunity to learn storytelling through a series of other roles I took on after that.</p><p>Developing such lateral skills aren&#8217;t &#8220;side hobbies.&#8221; They&#8217;re strategic advantages. They are the source of your range.</p><div><hr></div><h3><strong>When Not Knowing the Rules Is Exactly the Point</strong></h3><p>David explains that many breakthroughs happen when people don&#8217;t know what they&#8217;re <em>not</em> supposed to try.</p><p>He gives the example of Gunpei Yokoi, the inventor behind Nintendo&#8217;s Game Boy. Yokoi wasn&#8217;t the most advanced engineer. In fact, he worked with &#8220;lateral technology&#8221; that was not only mature but also used inexpensive components. His genius wasn&#8217;t in bleeding-edge tech, but in recombining old parts in new ways.</p><p>That&#8217;s how he helped turn Nintendo from a playing card company into a global gaming empire.</p><p>He didn&#8217;t break the rules. He just never learned the ones that kept others stuck.</p><div><hr></div><h3><strong>In the Age of AI, Every Domain Is a Mashup</strong></h3><p>Modern tech work doesn&#8217;t live inside neat categories anymore.</p><ul><li><p>DevOps is blending with security.</p></li><li><p>ML is merging with design. </p></li><li><p>Product thinking now includes ethics, trust, and regulatory nuance.</p></li><li><p>Engineering leaders are expected to understand GTM strategy, pricing, and user behavior.</p></li></ul><p>That means <strong>being an outsider in one part of the conversation is inevitable</strong>. The question is whether you use that as a constraint or a superpower.</p><p>If you&#8217;ve ever felt like the odd one in the room  too business-oriented for engineering, too technical for marketing, too strategic for ops, then congratulations! That&#8217;s your edge.</p><div><hr></div><h3><strong>Practical Strategy: Turn Outsiderness Into Leverage</strong></h3><ol><li><p><strong>Own your interdisciplinary background</strong></p><p>If you came from a non-traditional path say, economics before engineering, or graphic design before data highlight that. It gives you pattern recognition others don&#8217;t have.</p></li><li><p><strong>Volunteer for ambiguous, cross-functional projects</strong></p><p>These are often the ones insiders avoid. But they&#8217;re ripe for outsiders to see solutions no one else does. Bring your outside lens to the table.</p></li><li><p><strong>Study problems in unrelated domains</strong></p><p>Find challenges your team is facing and study how other industries solve them. You&#8217;ll start to build a library of metaphors, models, and mechanisms that apply across contexts.</p></li><li><p><strong>Don&#8217;t wait for permission</strong></p><p>Outsiders don&#8217;t always get invited into core decisions. Sometimes you have to show up with a solution first. If you see a blind spot, raise it. If you have an unconventional proposal, pitch it. Respectfully challenge the assumption that &#8220;we&#8217;ve always done it this way.&#8221;</p></li></ol><div><hr></div><h3><strong>Bottom Line: Your Range is your invitation to </strong><em><strong>what&#8217;s next</strong></em></h3><p>The next opportunity in your career may not come from what you&#8217;ve mastered. It may come from where your strange combination of skills lets you see something others missed.</p><p>Being the outsider doesn&#8217;t mean you don&#8217;t belong. It means you see the game from a new angle.</p><p>In a world shaped by rapid change, the outsider is often the innovator. And the person with range is the one who gets to rewrite the rules.</p><p>In the next chapter, we&#8217;ll go deeper into how seemingly &#8220;outdated&#8221; tools and experiences can lead to radical innovation when recontextualized creatively.</p><p>This chapter takes a curious but powerful turn. David  introduces a concept that might sound counterintuitive in a world obsessed with cutting-edge tech and constant upskilling. He argues that <strong>old technology, when repurposed laterally, can fuel breakthrough innovation</strong>.</p><p>It&#8217;s not just about chasing what&#8217;s new. It&#8217;s about seeing <strong>what&#8217;s useful</strong>, even if the world has already moved on.</p><p>And for tech professionals navigating the AI age, this chapter has profound implications.</p><div><hr></div><h2><strong>Chapter 9: Lateral Thinking With Withered Technology</strong></h2><p>The phrase   &#8220;lateral thinking with withered technology&#8221; comes from <strong>Gunpei Yokoi</strong>, the legendary Nintendo engineer we touched on in the last chapter.</p><p>Yokoi didn&#8217;t try to build the most powerful hardware. Instead, he embraced <strong>outdated components</strong>, combined them in unconventional ways, and created iconic products like the Game Boy. While his competitors chased graphics and processing speed, he used cheap, well-understood parts to make games that were simple, fun, and durable.</p><p>The Game Boy went on to become a massive global success. Not despite the outdated tech but because of it.</p><p>Yokoi&#8217;s philosophy was this: when technology matures and stabilizes, it becomes affordable, predictable, and easier to adapt creatively. You can recombine it in new contexts without the risks of bleeding-edge fragility.</p><p>That&#8217;s lateral thinking. And it works because innovation isn&#8217;t always about pushing forward. Sometimes, it&#8217;s about looking sideways.</p><div><hr></div><h3><strong>Powering Real World Generative AI Architecture:  By Being Boring And Brilliant At The Same Time</strong></h3><p>In tech careers, it&#8217;s easy to become obsessed with &#8220;what&#8217;s next.&#8221; The newest AI model. The latest framework. The next &#8220;latest&#8221;.</p><p>But David&#8217;s message, through Yokoi&#8217;s story, is simple. <strong>You don&#8217;t always need to chase the frontier. You can innovate by recombining what already works.</strong></p><p>Imagine you&#8217;re a senior backend engineer watching your team run out of creative energy.  Why?</p><p>Everyone around you is chasing the &#8220;bleeding edge&#8221;: Rust microservices, WASM at the edge, and complex event-driven architectures. On paper, it&#8217;s a masterpiece. In practice, the <strong>cognitive load</strong> is crushing the team. New hires spend weeks just trying to trace a single request through the &#8220;event-driven mess,&#8221; and the product team hasn&#8217;t shipped a meaningful feature in months.</p><p>While they hunt for the next shiny framework, you&#8217;re looking at your &#8220;dated&#8221; toolkit: <strong>Postgres, Redis, and a battle-tested Monolith.</strong></p><p>You realize that creativity isn&#8217;t about using the newest tool; it&#8217;s about the <strong>creative recombination</strong> of proven ones. You propose something that sounds almost heretical in a hype-driven office: an internal MVP engine built on a &#8220;Boring Technology&#8221; stack.</p><p>You don&#8217;t need a specialized vector database for the new AI feature you know <strong>Postgres</strong> can handle it with an extension. You don&#8217;t need a complex distributed cache for the prototype <strong>Redis</strong> is already sitting there, ready to go.</p><h3>The Breakthrough</h3><p>While the rest of the org is fighting &#8220;unknown unknowns&#8221; in their experimental stack, your &#8220;boring&#8221; engine is live in forty-eight hours.</p><p>You haven&#8217;t just built a prototype; you&#8217;ve achieved <strong>Operational Maturity</strong> overnight. Because you chose a stack where you already know where the &#8220;landmines&#8221; are buried, you can focus 100% of your creativity on the <strong>user experience </strong>rather than the infrastructure.</p><p>Suddenly, your &#8220;outdated&#8221; skills are the company&#8217;s greatest accelerator. You didn&#8217;t win by being the fastest coder; you won by knowing that <strong>simplicity is the ultimate sophisticated recombination.</strong> You saved the company&#8217;s innovation tokens for the product, not the plumbing.</p><div><hr></div><h3><strong>Old Tech + New Context = Strategic Leverage</strong></h3><p>Lateral thinking with withered technology isn&#8217;t about nostalgia. It&#8217;s about <strong>transference</strong>.</p><p>You&#8217;re using experience with known tools to solve <strong>new</strong> problems in <strong>unfamiliar</strong> domains.</p><p>And this is where range comes in.</p><ul><li><p>The frontend developer who knows psychology can build interfaces that anticipate user confusion.</p></li><li><p>The data engineer who&#8217;s worked in fintech and education can see patterns that a specialist can&#8217;t.</p></li><li><p>The cloud architect who understands physical logistics can design better infrastructure for distributed systems.</p></li></ul><p>You don&#8217;t need the newest thing. You need the <strong>right combination</strong> of old and new as well as the imagination to apply it laterally.</p><div><hr></div><h3><strong>AI is Built on This Philosophy</strong></h3><p>Ironically, the entire AI boom is proof of this principle.</p><p>The underlying architecture of transformers, which powers GPT and other LLMs, wasn&#8217;t invented last year. It came from a 2017 Google paper called &#8220;Attention Is All You Need.&#8221; And that paper built on decades of earlier work in NLP, probability theory, and gradient descent. If you are interested in this paper, you can find it here on <a href="https://arxiv.org/abs/1706.03762">Arxiv</a>.</p><p>The magic wasn&#8217;t in brand new ideas. It was in recombining known components at the right time, with the right compute infrastructure.</p><p>In other words, AI itself is lateral thinking with withered technology.</p><p>So if you&#8217;re worried that your skills are getting &#8220;stale,&#8221; ask yourself instead, <em>Where can these tools shine next?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.thefractal.co/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.thefractal.co/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><h3><strong>Practical Strategy: Don&#8217;t Discard, Reframe</strong></h3><ol><li><p><strong>Inventory your &#8220;stale&#8221; strengths</strong></p><p>Make a list of tools, skills, and mental models you&#8217;ve mastered that the market thinks are &#8220;old.&#8221; For each, ask: &#8220;Where might this be useful in a new context?&#8221; You might be surprised how many doors open when you change the setting.</p></li><li><p><strong>Recombine before you reinvent</strong></p><p>When solving a new problem, start by asking: &#8220;What have I used before that might apply here differently?&#8221; Don&#8217;t reach for new tools by default. Reach for new angles first.</p></li><li><p><strong>Teach incoming staff the value of the &#8216;old ways&#8217;</strong></p><p>Junior engineers might dismiss technologies you know inside out. Show them how reliability, simplicity, and cost-effectiveness still win in many settings. That turns your knowledge into mentorship  and range into leadership.</p></li><li><p><strong>Use constraints as a creativity engine</strong></p><p>Don&#8217;t wait for unlimited resources. Challenge yourself to solve problems using &#8220;low-power&#8221; tech. Old methods. Limited compute. That&#8217;s how lateral creativity forms.</p></li></ol><div><hr></div><h3><strong>Bottom Line: The Past Is a Source of Innovation</strong></h3><p>You don&#8217;t need to abandon everything you&#8217;ve learned to stay relevant. In fact, the most future-proof professionals aren&#8217;t the ones constantly chasing new tools. They&#8217;re the ones who can <strong>see possibility where others see obsolescence</strong>.</p><p>Old skills. Legacy systems. Mature tools. These are not liabilities. In the hands of someone with range, they&#8217;re ingredients for strategic breakthroughs.</p><p>In the next section, we&#8217;ll look at an interesting and somewhat contrarian idea &#8220;<strong>Fooled by Expertise&#8221;</strong>, where David shows how even the most experienced professionals can be led astray by overconfidence, and why humility is a key part of building effective leadership in a complex world. </p><p>This section discussed one of the most cautionary and relevant chapters for anyone navigating complex systems, especially in tech.</p><p>This is where David  pulls back the curtain on one of the biggest risks in modern careers: <strong>overconfidence born from deep expertise</strong>. And in a world where decisions must be made across messy, unpredictable, AI-transformed environments, this blind spot can cost more than credibility. It can cost outcomes, influence, and the chance to lead. </p><div><hr></div><h2><strong>Chapter 10: Fooled by Expertise</strong></h2><p>This chapter opens with a stark and troubling study: <strong>Philip Tetlock&#8217;s famous 20-year forecasting experiment</strong>. Tetlock collected predictions from hundreds of political and economic experts, asking them to forecast real-world outcomes including wars, elections, market crashes.</p><p>The results were damning.</p><p>The most famous experts, the ones with the highest credentials and deepest specialization performed no better than random chance. Some were <strong>worse</strong>. Why? Because the more deeply they specialized, the more confident and committed they became to their own frameworks. They filtered out conflicting data. They ignored ambiguity. They rationalized poor outcomes.</p><p>The conclusion? In complex, fast-changing environments, <strong>narrow expertise isn&#8217;t enough</strong>. Worse, it can actively mislead.</p><p>And here&#8217;s the kicker: the most accurate forecasters weren&#8217;t the specialists. They were the <strong>generalists</strong>, the <strong>&#8220;foxes&#8221;</strong> (as Tetlock called them). These were the people who knew a little about a lot and were constantly updating their models, cross-checking their biases, and staying curious.</p><div><hr></div><h3><strong>Where do you see this?</strong></h3><p>Let&#8217;s put this in the context of a senior engineer or data leader in 2026.</p><p>You&#8217;ve spent the last decade mastering a domain &#8212; backend infrastructure, enterprise data architecture, ML deployment. You&#8217;ve earned your place as the go-to expert.</p><p>But now AI models are becoming black-box co-workers. Regulation is accelerating. Security threats are escalating. User behavior continues to shift faster than ever. Consider this: People don&#8217;t &#8220;Google&#8221; for information anymore, they &#8220;ChatGPT&#8221; or &#8220;Gemini&#8221; etc for answers. Subtle but highly nuanced behavior disrupting the whole ecosystem and business models build on Search Engine Optimization. Bringing us back to you as the data leader  or the senior engineer we started to talk about,  your leadership is suddenly expected to extend beyond your area of technical comfort. And why is it that you are expected to do that? Because emerging technologies create emerging landscapes and emerging multi-domain problems that hardly anyone is an expert to solve for.</p><p>In this moment though, <strong>overconfidence can become a career-limiting condition</strong>.</p><ul><li><p>You insist a new system can&#8217;t scale, because it doesn&#8217;t follow traditional sharding best practices.</p></li><li><p>You dismiss an AI product idea because it doesn&#8217;t fit your model of &#8220;real ML.&#8221;</p></li><li><p>You push back on design trade-offs because they conflict with your engineering instincts, not because you&#8217;ve tested outcomes.</p></li></ul><p>And slowly, you become <em>less effective</em>, not more. Because your deep domain expertise starts blinding you to a changing landscape.</p><div><hr></div><h3><strong>The AI Age Demands Humble Leaders</strong></h3><p>This is one of the central arguments David makes. In wicked environments where rules change, data is incomplete, and feedback is delayed the best decision-makers are <strong>humble, adaptable, and multidisciplinary</strong>.</p><p>In other words, they have <strong>range</strong>.</p><p>They are not the loudest voice in the room. They&#8217;re the ones asking questions. Testing assumptions. Borrowing models from other fields. Updating their priors based on new evidence.</p><p>In Tetlock&#8217;s research, these &#8220;foxes&#8221; were:</p><ul><li><p>More likely to acknowledge uncertainty.</p></li><li><p>More open to input from outside their domain.</p></li><li><p>More likely to change their mind.</p></li><li><p>More accurate over time.</p></li></ul><p>If you want to lead in AI, where no one can be an expert in everything, <strong>this mindset is non-negotiable</strong>.</p><div><hr></div><h3><strong>Real-World Parallel: The 2008 Financial Crisis</strong></h3><p>David ties the lesson of expert overconfidence to the 2008 crash. Many of the so-called smartest financial minds  PhDs, Nobel laureates, quants  were completely blindsided by systemic risk. Their models, which had worked in predictable environments, failed in reality. </p><p>During my days at B-school, I recall being in a  class in 2009 at NYU Stern where I was sitting next to a classmate who had previously graduate  from MIT with a degree in engineering. She worked as quant at a leading rating agency in the city. She validated this exact point for me we were hearing in the media - &#8220;No industry insider seemed to  have seen this coming&#8221;.  This whole crisis seemed closer to home for us given its recency,  its continuing fall out, and more so because  we were in a classroom about two  miles from the epicenter of this meltdown. (Map below).</p><p>But who saw the crisis coming? Often, it was outsiders journalists, generalist investors, or people who cross-referenced multiple fields. People who saw the <em>connections</em> others missed. People who questioned the sacred models.</p><p>The analogy to AI-driven tech is clear. Many of the best decisions won&#8217;t come from specialists. They&#8217;ll come from people who know <strong>just enough</strong> across multiple domains to spot the disconnects.</p><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xzJi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f5f9deb-e63b-4ef2-9d90-28b1948406f9_1428x860.heic" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xzJi!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f5f9deb-e63b-4ef2-9d90-28b1948406f9_1428x860.heic 424w, https://substackcdn.com/image/fetch/$s_!xzJi!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f5f9deb-e63b-4ef2-9d90-28b1948406f9_1428x860.heic 848w, https://substackcdn.com/image/fetch/$s_!xzJi!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f5f9deb-e63b-4ef2-9d90-28b1948406f9_1428x860.heic 1272w, https://substackcdn.com/image/fetch/$s_!xzJi!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f5f9deb-e63b-4ef2-9d90-28b1948406f9_1428x860.heic 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xzJi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f5f9deb-e63b-4ef2-9d90-28b1948406f9_1428x860.heic" width="1428" height="860" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2f5f9deb-e63b-4ef2-9d90-28b1948406f9_1428x860.heic&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:860,&quot;width&quot;:1428,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:276120,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/heic&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.thefractal.co/i/186450926?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f5f9deb-e63b-4ef2-9d90-28b1948406f9_1428x860.heic&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!xzJi!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f5f9deb-e63b-4ef2-9d90-28b1948406f9_1428x860.heic 424w, https://substackcdn.com/image/fetch/$s_!xzJi!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f5f9deb-e63b-4ef2-9d90-28b1948406f9_1428x860.heic 848w, https://substackcdn.com/image/fetch/$s_!xzJi!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f5f9deb-e63b-4ef2-9d90-28b1948406f9_1428x860.heic 1272w, https://substackcdn.com/image/fetch/$s_!xzJi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f5f9deb-e63b-4ef2-9d90-28b1948406f9_1428x860.heic 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The two mile walk from NYU to Wall Street</figcaption></figure></div><p></p><div><hr></div><h3><strong>Practical Strategy: Adopt a Fox Mindset</strong></h3><ol><li><p><strong>Regularly update your frameworks</strong></p><p>Don&#8217;t cling to the same decision-making playbook forever. Create a habit of reevaluating your assumptions quarterly. Ask, &#8220;What has changed in the environment that should change how I think?&#8221;</p></li><li><p><strong>Invite contradiction</strong></p><p>Seek out voices that disagree with you including other teams, backgrounds, or functions. Encourage dissent in your meetings. This doesn&#8217;t weaken your authority. It strengthens your decisions.</p></li><li><p><strong>Cultivate humility</strong></p><p>Get comfortable saying &#8220;I don&#8217;t know yet.&#8221; It&#8217;s not weakness. It signals intelligence in complex environments. Model this for your teams.</p></li><li><p><strong>Study other disciplines</strong></p><p>Learn how strategists, product designers, psychologists, and historians think. You&#8217;ll start seeing failure patterns and solution patterns your peers overlook.</p></li><li><p><strong>Test small, iterate fast</strong></p><p>Avoid placing big bets based solely on confidence. Set up small experiments that generate real data. That&#8217;s how foxes build confidence not from belief, but from feedback.</p></li></ol><div><hr></div><h3><strong>Bottom Line: Don&#8217;t Let Your Strength Become Your Limitation</strong></h3><p>In a world where AI is changing the rules faster than we can codify them, being &#8220;the expert&#8221; is less valuable than being <strong>the adaptable thinker</strong>.</p><p>Yes, your experience matters. But your <strong>range</strong>: your ability to integrate diverse models, admit uncertainty, and adjust will determine how far you go.</p><p>The best leaders in the AI era won&#8217;t be the most confident. They&#8217;ll be the most curious.</p><p>In the next section the cautionary tone develops into signaling of danger which in my opinion is highly relevant for tech professionals as well.  David explores why professionals often fail when they refuse to let go of legacy ways of thinking  and how this affects real-time decision-making under stress.</p><p>If the last chapter warned us about the dangers of overconfidence, this one delivers the natural follow-up: <strong>What happens when we cling to the tools, methods, and models we know even when the world changes around us?</strong></p><p>David  makes a compelling case that failing to drop familiar tools isn&#8217;t just inefficient can be deadly. For tech professionals navigating rapid change, that&#8217;s not a metaphor. That&#8217;s a roadmap for irrelevance, unless we develop the muscle to adapt.</p><div><hr></div><h2><strong>Chapter 11: Learning to Drop Your Familiar Tools</strong></h2><p>David draws from a tragic and powerful example: <strong>firefighting disasters</strong>, specifically the 1949 Mann Gulch fire that killed 13 elite smokejumpers. The men who died weren&#8217;t untrained or underqualified. In fact, they were some of the best in the business.</p><p>So what happened?</p><p>When the fire turned unexpectedly, they were instructed to drop their tools and run uphill. But many couldn&#8217;t do it. They clung to their heavy equipment including shovels, saws, packs. These tools that had become symbols of identity and control. Tools that made them feel like professionals.</p><p>They slowed them down. And they died.</p><p>In later incidents, it happened again. Highly trained responders failed to abandon familiar tools, even in life-threatening scenarios. Why? Because tools aren&#8217;t just objects. They&#8217;re <em>extensions of self</em>. Dropping them felt like dropping identity.</p><p>The result? Inflexibility in the face of change. Tragedy in the face of speed.</p><div><hr></div><h3><strong>What This Means for Tech Professionals</strong></h3><p>In tech, our tools are usually digital. But our emotional attachment to them is just as real.</p><ul><li><p>The framework you&#8217;ve used for years.</p></li><li><p>The data model you built from scratch.</p></li><li><p>The codebase you&#8217;ve maintained like a second brain.</p></li><li><p>The process you refined and defended over time.</p></li></ul><p>These aren&#8217;t just tools. They&#8217;re symbols of mastery. Of credibility. Of who we are as professionals.</p><p>Which is exactly why they&#8217;re so hard to let go of&#8212;especially when the terrain shifts. Especially when AI changes the very assumptions those tools were built on.</p><div><hr></div><h3><strong>Dropping Familiar Tools in the AI Era</strong></h3><p>Let&#8217;s make this painfully real.</p><p>Imagine you&#8217;re a seasoned DevOps engineer. You&#8217;ve spent a decade hand writing  YAML files., meticulously hand-crafting CI/CD pipelines and mastering the  art of containerization with Kubernetes. You were the &#8220;gatekeeper of production.&#8221;</p><p>Then, the <strong>Abstraction Wave</strong> hits. Enter Vercel.</p><p>New AI-native deployment platforms emerge that don&#8217;t just assist you they <strong>commoditize</strong> your core tasks. They handle auto-scaling, blue-green deployments, and secret management with a single prompt. 80% of your &#8220;hard-earned&#8221; expertise is suddenly a background process.</p><h3>The Pivot</h3><p>You face the classic &#8220;Engineer&#8217;s Dilemma&#8221;: do you fight the tool by pointing out its edge-case failures, or do you treat the tool as a new <strong>primitive</strong>?</p><p>You choose to evolve. You stop being the &#8220;plumber&#8221; fixing individual leaks and become the <strong>Architect of Velocity</strong>. You realize that while the AI can deploy the code, it doesn&#8217;t understand <strong>System Resilience</strong>, <strong>Compliance</strong>, or <strong>Cost-Efficiency</strong>.You can resist it, dismiss it, argue its limitations. Or you can learn the new system, <strong>drop some of your old tools</strong>, and evolve into a new kind of builder: someone who enables velocity through orchestration, abstraction, and systems thinking.</p><p>Now multiply that across roles:</p><ul><li><p>The data scientist who lets go of manual feature engineering in favor of AutoML, and pivots toward interpreting models in business context.</p></li><li><p>The engineer who drops custom microservice sprawl and embraces platform thinking, improving performance by simplifying instead of scaling.</p></li><li><p>The PM who gives up a strict agile cadence in favor of continuous experimentation based on AI feedback loops.</p></li></ul><p>In all of these examples, professionals grow <strong>not by clinging</strong>, but by <em>releasing</em>.</p><div><hr></div><h3><strong>This Isn&#8217;t About Abandonment. It&#8217;s About Reframing.</strong></h3><p>Dropping familiar tools doesn&#8217;t mean throwing away your value. It means <strong>updating how your value gets expressed</strong>.</p><p>It&#8217;s the database wizard who becomes the real-time observability expert.</p><p>The cloud infrastructure builder who becomes the systems reliability strategist.</p><p>The brilliant coder who becomes a tech translator for the C-suite.</p><p>You&#8217;re not starting over. You&#8217;re moving up.</p><div><hr></div><h3><strong>Practical Strategy:  Build Your Adaptation Reflex</strong></h3><ol><li><p><strong>Inventory your identity tools</strong></p><p>Ask: &#8220;Which tools, methods, or models do I deeply associate with my professional identity?&#8221; These are the hardest to drop. And the most important to question.</p></li><li><p><strong>Run &#8220;no tool&#8221; challenges</strong></p><p>Once a quarter, try solving a common problem <em>without</em> your go-to tool. Force a constraint. It&#8217;ll surface blind spots and make space for lateral solutions.</p></li><li><p><strong>Welcome junior insight</strong></p><p>Junior team members often adopt new tools faster because they&#8217;re less invested in legacy ones. Learn from their freshness. It&#8217;s not just naivety, it&#8217;s agility.</p></li><li><p><strong>Decouple ego from method</strong></p><p>Your value isn&#8217;t tied to any one tool. It&#8217;s tied to your ability to solve real problems. Focus your pride there.</p></li><li><p><strong>Create exit strategies for old methods</strong></p><p>Build a habit of retiring tools, not just accumulating them. What do you no longer need to carry? What&#8217;s slowing you down?</p></li></ol><div><hr></div><h3><strong>Bottom Line: Adaptation Is a Leadership Skill</strong></h3><p>In high-velocity environments, those who succeed aren&#8217;t the ones who hold the tightest grip. They&#8217;re the ones who can let go when the moment demands it.</p><p>In firefighting, that reflex saves lives. In tech, it saves careers.</p><p>Range is what helps you build that reflex. Because when you&#8217;ve experimented across domains, roles, and perspectives, you&#8217;re less attached to any single tool. You trust your ability to adapt, not your ability to defend.</p><p>And that&#8217;s what future-ready professionals do. They don&#8217;t define themselves by their tools. They define themselves by the problems they&#8217;re ready to solve.</p><p>In the final section named <strong>Deliberate Amateurs</strong>, we explore how embracing the amateur mindset: curious, flexible, unburdened by expert baggage can make you not just more innovative, but more influential. </p><p></p><div><hr></div><p>If this helped you reframe your thinking about your career development please consider sharing with others. (And, feel free to post it to your LinkedIn network).</p><p>More content like this in the future. Stay tuned.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.thefractal.co/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.thefractal.co/subscribe?"><span>Subscribe now</span></a></p><p></p><p>If you missed the previous posts. They can be found here:</p><p>Part I is <a href="https://www.thefractal.co/p/range-is-the-new-black">here</a>.</p><p>Part II is <a href="https://www.thefractal.co/p/range-is-the-new-black-part-2">here</a>.</p><p>Part III is <a href="https://www.thefractal.co/p/range-is-the-new-black-part-iii">here</a>.</p>]]></content:encoded></item><item><title><![CDATA[Range Is The New Black - Part III ]]></title><description><![CDATA[Why Developing Range Is the Most Important Thing You Can Do for Managing and Developing Your Career]]></description><link>https://www.thefractal.co/p/range-is-the-new-black-part-iii</link><guid isPermaLink="false">https://www.thefractal.co/p/range-is-the-new-black-part-iii</guid><dc:creator><![CDATA[Vijay Reddiar]]></dc:creator><pubDate>Wed, 11 Feb 2026 13:39:30 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!z3fJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68d4b2cc-d1ba-43cc-911e-503551d36fb8_1600x896.heic" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!z3fJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68d4b2cc-d1ba-43cc-911e-503551d36fb8_1600x896.heic" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!z3fJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68d4b2cc-d1ba-43cc-911e-503551d36fb8_1600x896.heic 424w, https://substackcdn.com/image/fetch/$s_!z3fJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68d4b2cc-d1ba-43cc-911e-503551d36fb8_1600x896.heic 848w, https://substackcdn.com/image/fetch/$s_!z3fJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68d4b2cc-d1ba-43cc-911e-503551d36fb8_1600x896.heic 1272w, https://substackcdn.com/image/fetch/$s_!z3fJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68d4b2cc-d1ba-43cc-911e-503551d36fb8_1600x896.heic 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!z3fJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68d4b2cc-d1ba-43cc-911e-503551d36fb8_1600x896.heic" width="1456" height="815" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/68d4b2cc-d1ba-43cc-911e-503551d36fb8_1600x896.heic&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:815,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:78582,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/heic&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.thefractal.co/i/186406567?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68d4b2cc-d1ba-43cc-911e-503551d36fb8_1600x896.heic&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!z3fJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68d4b2cc-d1ba-43cc-911e-503551d36fb8_1600x896.heic 424w, https://substackcdn.com/image/fetch/$s_!z3fJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68d4b2cc-d1ba-43cc-911e-503551d36fb8_1600x896.heic 848w, https://substackcdn.com/image/fetch/$s_!z3fJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68d4b2cc-d1ba-43cc-911e-503551d36fb8_1600x896.heic 1272w, https://substackcdn.com/image/fetch/$s_!z3fJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68d4b2cc-d1ba-43cc-911e-503551d36fb8_1600x896.heic 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>If you missed the previous opening posts on this topic:</p><p>Part I is <a href="https://www.thefractal.co/p/range-is-the-new-black">here</a>.</p><p>Part II is <a href="https://www.thefractal.co/p/range-is-the-new-black-part-2">here</a>.</p><p>Continuing&#8230; </p><h2><strong>Chapter 4 &#8212; Learning, Fast and Slow</strong></h2><p>In this chapter, David dismantles another sacred cow of conventional career advice: the idea that <strong>fast learning is always better learning</strong>.</p><p>In schools, bootcamps, and even professional development programs, we&#8217;re conditioned to seek <em>efficiency</em>. The faster you acquire a skill, the smarter you must be. The more fluently you can recall, repeat, and replicate,  the more advanced you&#8217;re perceived to be.</p><p>But as David shows, there&#8217;s a massive difference between <strong>fluency in the moment</strong> and <strong>flexibility over time</strong>. And surprisingly, it&#8217;s the <em>struggler</em>, not the natural, who often comes out ahead.</p><div><hr></div><h3><strong>The Interleaving Study: Slow Learners, Fast Results</strong></h3><p>David cites a fascinating experiment with two groups of students learning to identify types of paintings. One group studied paintings by artist A, then artist B, then C.  All in &#8220;blocked&#8221; sessions. The second group studied the same paintings, but mixed them up.  This is a technique called <strong>interleaving</strong>.</p><p>The results were revealing.</p><p>During training, the blocked group outperformed the interleaved group by a significant margin. They &#8220;learned faster.&#8221; But when tested later,  when the task required <em>transferring</em> knowledge,  the interleaved group crushed it.</p><p>Why? Because the struggle of interleaving, of comparing, contrasting, and making distinctions created deeper encoding. It felt harder,  but it worked better.</p><p>David&#8217;s conclusion? <em>&#8220;Desirable difficulty&#8221;  the kind that makes learning slower  actually leads to more robust performance when it matters most.</em></p><div><hr></div><h3><strong>Where This Shows Up in Tech Careers</strong></h3><p>Let&#8217;s translate that to your career.</p><p>The professional equivalent of blocked learning is what most engineers and analysts do early in their roles: focus on one problem domain, one language, one layer of the tech stack. The work becomes fluent. You can solve things quickly, almost without thinking.</p><p>It <em>feels</em> like mastery.</p><p>But then something changes:  business priorities shifts, your tools evolve, or as we are learning AI is about to automate part of your workflow, if not already. Suddenly, you&#8217;re asked to solve a new kind of problem: unfamiliar data, undefined metrics,  a new &#8216;wicked environment&#8217; requiring tradeoffs to be made for design and build that will change business outcomes.</p><p>So what happens to the people who struggled more in the early days who rotated through different tools, took on seemingly weird projects no one was willing to touch, or had to explain their work to non-technical audiences? They  are the ones primed to make  confident decisions in ambiguity. Because they <em>learned how to learn</em>.</p><p>The speed of your early fluency is <strong>not</strong> the same as your readiness for complexity.</p><div><hr></div><h3><strong>AI Makes This Even More Critical</strong></h3><p>Let&#8217;s put this in the context of AI.</p><p>AI accelerates <strong>syntactic fluency</strong>. It helps you autocomplete code, translate frameworks, even write documentation. This is the kind of speed that flatters the fast learner.</p><p>But AI can&#8217;t do:</p><ul><li><p>Model-to-business mapping</p></li><li><p>Organizational prioritization</p></li><li><p>Systems thinking across departments</p></li><li><p>Reconciliation and resolution between independently developed roadmap and architecture</p></li><li><p>Human intuition in unknown domains</p></li></ul><p>That&#8217;s where the interleavers, i.e. the slow, struggling learners  win.</p><p>Because they weren&#8217;t just memorizing patterns. They were building mental models that not only become adaptable to breaking down  complexity but scales with it.</p><div><hr></div><h3><strong>Why This Matters in a Wicked World</strong></h3><p>Wicked environments don&#8217;t reward people who are masters of tools. They reward people who can <strong>transfer principles</strong> from one domain to another.</p><p>When the problem is fuzzy, the systems have shaky foundation, you have multiple conflicting priorities - you need more than fluent system builders. You need flexible thinkers.</p><p>So if you&#8217;ve felt like your learning journey has been messy and if you&#8217;ve had to figure things out slowly, through failure, across different stacks or domains, then, that wasn&#8217;t wasted time. That was your real edge being built.</p><div><hr></div><h3><strong>Practical Strategy:  How to Train Like a Generalist</strong></h3><ol><li><p><strong>Practice &#8220;interleaved&#8221; learning in your career</strong></p><p>Don&#8217;t optimize for staying in one domain just because it&#8217;s comfortable. Mix projects. Pair with someone in a different role. Explain your work to people outside your team. Each friction point builds cognitive flexibility.</p></li><li><p><strong>Do things the hard way (on purpose)</strong></p><p>Every once in a while, write code without your favorite helper tools. Build a model from scratch without AutoML. Recreate a report without a template. Struggle intentionally. That&#8217;s where the learning lives.</p></li><li><p><strong>Debrief your decisions, not just your results</strong></p><p>The fast learner just celebrates that something worked. The flexible learner asks: <em>&#8220;Why did that work? Would it work here again? What was different?&#8221;</em> That reflection is what trains adaptive judgment.</p></li><li><p><strong>Teach what you learn</strong></p><p>Teaching forces you to translate deep understanding into clear explanations. That process slows down learning  and makes it permanent.</p></li></ol><div><hr></div><h3><strong>Bottom Line: Fast is Fragile. Flexible is Forever.</strong></h3><p>In a world where machines will outperform humans in speed, efficiency, and recall our real advantage isn&#8217;t fluency. It&#8217;s <strong>range-informed flexibility</strong>.</p><p>The best careers aren&#8217;t built by those who sprinted to early mastery. They&#8217;re built by those who got their hands dirty across contexts and turned struggle into strength.</p><div><hr></div><h2><strong>Chapter 5: Thinking Outside Experience</strong></h2><p>This is the chapter where David starts to seriously dismantle the idea that expertise comes only from repetition inside a single domain. In fact, he flips that logic completely. Instead of asking, &#8220;How deep is your experience?&#8221;, he suggests we ask a more powerful question. &#8220;Can you think beyond your experience?&#8221;</p><p>That&#8217;s a different kind of intelligence. And it&#8217;s exactly the kind that becomes invaluable in tech careers navigating wicked, unpredictable change.</p><div><hr></div><h3><strong>The Firefighter Analogy That Fell Apart</strong></h3><p>David opens this chapter by revisiting a famous concept from psychology. It&#8217;s the idea that experts can make incredibly fast decisions because they have built up thousands of stored patterns in their brain. The classic example is the firefighter who senses that a building is about to collapse, even though no visible clues are present. It&#8217;s intuition, born from experience.</p><p>This is the gold standard in many fields. In fact, we tend to revere that kind of &#8220;instinctive expertise&#8221; in senior engineers, senior staff-level ICs, and technical architects. We assume that the more time someone has spent in a specific domain, the more likely they are to know what to do when a crisis hits.</p><p>But David then asks a harder question. What happens when the environment changes? What if you&#8217;re suddenly facing a different kind of fire?</p><p>He brings up the case of the Columbia space shuttle disaster. In this case, the engineers with the most NASA experience were the ones who insisted everything was fine. They had seen foam strikes before, and nothing catastrophic had ever happened. So they treated this one like all the others.</p><p>Except, this time, the foam strike did cause fatal damage. And the people who had the hardest time seeing the risk were the ones with the most direct experience. Their deep familiarity blinded them to a new kind of danger.</p><div><hr></div><h3><strong>Experience Can Be a Liability in Machine Learning Too</strong></h3><p>If you&#8217;ve spent years mastering classical machine learning, you&#8217;ve likely developed a strong intuition for how to clean data, engineer features, tune hyperparameters, and validate models through careful experimentation. You&#8217;ve earned your credibility by building robust, explainable, well-evaluated systems  often for narrow business use cases.</p><p>Sine the advent of LLMs, the terrain has shifted.</p><p>Use cases now require building and  deploying LLMs and working with foundation models. You&#8217;re no longer training models from scratch:  you&#8217;re prompting them, fine-tuning them, or chaining their outputs.  Feature importance is not a topic of discussion anymore in this context. There is no hyper parameter tuning. You are designing and experimenting with prompts.  Evaluation is no longer a simple confusion matrix as you would use in a classification problem, it&#8217;s about user behavior, evaluating open-ended quality metrics on user expectations and experience, as well as controlling and evaluating for all the risks a LLM poses.</p><p>Your traditional ML instincts  grounded in structured model development process (CRISP-DM / SEMMA), precision, and explainability appears to be &#8220;different worldly&#8221; for a data scientist. You may try to slow things down, asking questions about where do we reintroduce classical rigor, or question whether this is &#8220;real&#8221; machine learning.</p><p>But that instinct, however valid in the past, might be holding you back now.</p><p>Because <strong>generative AI is a different paradigm</strong>, not just a new toolkit. And applying your hard-earned ML patterns to it without updating your lens can lead to misalignment.</p><p>This is how experience even deep technical experience  becomes a liability.</p><p>Not because it&#8217;s wrong, but because it&#8217;s <em>out of context</em> for classically trained statisticians, ML engineers or  data scientists.</p><div><hr></div><h3><strong>So Where Do the Best Ideas Actually Come From?</strong></h3><p>In the book, David gives the example of scientists who made breakthroughs <em>outside</em> their primary domains. He cites a study that showed researchers who solved complex innovation problems were more likely to do so when their domain expertise was only loosely related to the problem.</p><p>They weren&#8217;t so close that they relied on familiar patterns. But they weren&#8217;t so far that they couldn&#8217;t grasp the problem at all.</p><p>That sweet spot, known as <strong>far transfer</strong>, is where innovation lives.</p><p>In practical terms, that means the best solutions to your hardest problems might come from someone who doesn&#8217;t &#8220;specialize&#8221; in that exact space. They might work in design. In ops. In legal. Or they might be you, if you&#8217;ve taken time to build perspective across disciplines.</p><div><hr></div><h3><strong>Why This Matters in an AI World</strong></h3><p>As AI starts to become embedded in every workflow, the boundaries between disciplines is likely to dissolve or at least introduce a AI-Human integrated layer..</p><p>An engineer today might need to understand not just how models work, but how people trust them. A product manager  might need to reason about ethics, safety, infrastructure cost. A technical lead might need to navigate product strategy, user privacy, and regulatory compliance. Consider this: the job title of &#8220;AI Engineer&#8221; was practically non-existent prior to advent of LLMs becoming mainstream.</p><p>In other words, you don&#8217;t just need more experience. You need <em>the right kind</em> of experience. That means varied, cross-disciplinary, and intentionally adjacent.</p><p>And it also means you need to practice thinking outside of it. Not just &#8220;What do I know that applies here?&#8221;, but &#8220;What is just outside my experience that could inform this?&#8221;</p><p>That&#8217;s what makes a strategist. That&#8217;s what makes someone future-proof.</p><div><hr></div><h3><strong>Practical Strategy:  Train for Far Transfer</strong></h3><ol><li><p><strong>Read outside your domain</strong></p><p>If you&#8217;re a data person, read product design case studies. If you&#8217;re in backend engineering, explore behavioral psychology. The more frameworks you can draw from, the more novel connections you can make.</p></li><li><p><strong>Run solution sprints with outsiders</strong></p><p>Bring in someone from an unrelated team when solving a tough problem. Not for execution help, but to ask questions that break your usual framing.</p></li><li><p><strong>Challenge your mental models</strong></p><p>Ask yourself, &#8220;If I had to explain this to someone in marketing, how would I do it?&#8221; This forces you to abstract your knowledge and look for new metaphors.</p></li><li><p><strong>Adopt a second lens</strong></p><p>Pick a second professional identity to cultivate. Are you an engineer who also studies business models? A data analyst who reads philosophy? That second lens gives you clarity no specialist can replicate. Personally, I have spent a good part of a decade adopting a second lens myself. It definitely continues to serve me well.</p></li></ol><div><hr></div><h3><strong>Bottom Line: Mastery Is a Ceiling. Range Is a Bridge.</strong></h3><p>In a world where everything is changing  from how we build systems to how we trust machines, the person who can think outside their experience will always have an edge over the one who only deepened theirs.</p><p>The next leap in your career won&#8217;t come from going deeper. It&#8217;ll come from seeing <strong>sideways</strong>, connecting dots no one else noticed, and pulling in lessons from other domains.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.thefractal.co/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 The Fractal! 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><div><hr></div><h2><strong>Chapter 6: The Trouble With Too Much Grit</strong></h2><p>We&#8217;ve been taught that grit is a defining trait of success. It&#8217;s the quality behind &#8220;winners never quit and quitters never win.&#8221; It&#8217;s the force that powers you through  code reviews, late-night incident responses (yes, I also had a job two decades ago that involved both of these type of roles), years of climbing the technical ranks.</p><p>But David asks a more uncomfortable question: <em>What if grit keeps you stuck?</em></p><p>In this chapter, David makes an important pivot. He challenges not just how we learn, but how we persist. While grit, the celebrated ability to push through challenges and &#8216;never quit&#8217; has become a professional virtue in popular self development literature, David offers a counter point of view that talks about  the dark side of sticking to a path too long, especially when the world around you is shifting.</p><div><hr></div><h3><strong>The Escalation of Commitment</strong></h3><p>David shares the story of elite students who enter prestigious career tracks such as  pre-med, law, finance  and feel pressure to persist, even when it becomes obvious the path no longer fits them. These individuals aren&#8217;t failing. In fact, they&#8217;re often succeeding on paper. But they&#8217;re also stuck in what psychologists call the <strong>escalation of commitment</strong>. It is a tendency to continue investing in a decision because of the time and effort already sunk into it.</p><p>It&#8217;s not just that they fear quitting. It&#8217;s that they&#8217;ve spent so long building an identity around being gritty, that switching feels like personal failure. How many people do you know professionally who seems like this persona? Anyone?</p><p>David shows that many of the most innovative thinkers and leaders aren&#8217;t the grittiest in the traditional sense. They&#8217;re the ones who know when to walk away from the wrong path, even if it means disappointing others or starting over.</p><p>In other words, it&#8217;s not just perseverance that matters. It&#8217;s <strong>strategic quitting</strong>. (I also did this in 2007 - I wrote about this in part 1 <a href="https://www.thefractal.co/p/range-is-the-new-black">here</a> if you missed it)</p><div><hr></div><h3><strong>Why AI Changes the Risk Equation</strong></h3><p>In an AI-transformed future, domain development lifespan will shrink.</p><ul><li><p>Tools that once took years to learn can now be semi-automated.</p></li><li><p>Categories of technical work are being co-piloted by &#8230; you guessed it copilot .. no pun intended (Github etc). Let&#8217;s not yet go to the topic of vibe coding. I have a point of view on that I will cover in future posts.</p></li><li><p>What was once construed a &#8220;career moat&#8221; is  now a white space for a bright eyed AI startup founder.</p></li></ul><p>If you define grit as loyalty to a specific technical skill, you&#8217;re building permanence on sand.</p><p>Instead, your resilience needs to come from <strong>range</strong>: the ability to move, adapt, reframe, and re-engage in new contexts without fear of leaving your sunk costs behind.</p><div><hr></div><h3><strong>Real-World Parallel: Andre Agassi vs. Roger Federer</strong></h3><p>Though discussed earlier, this is where the Federer analogy from Chapter 1 deepens. Federer didn&#8217;t lock himself into tennis at age four. He tried basketball, handball, soccer. He switched late and dominated.</p><p>Contrast that with the professional identity crisis Andre Agassi describes in his memoir <em>Open</em>, where early over-specialization left him burned out, struggling, and without a sense of self outside of the sport.</p><p>In tech, this happens all the time. People specialize so early and so deeply that when change comes  and it always does  they have no transferable story, no adjacent skills, and no appetite to start over.</p><div><hr></div><h3><strong>Practical Strategy:  Redefining Grit in a Dynamic World</strong></h3><ol><li><p><strong>Run periodic &#8220;career audits&#8221;</strong></p><p>Ask yourself: &#8220;If I were starting from scratch today, would I still choose this path?&#8221; If the answer is no, don&#8217;t ignore it. You don&#8217;t need to quit tomorrow, but start sampling immediately.</p></li><li><p><strong>De-risk switching by diversifying</strong></p><p>Explore adjacent domains before you need them. Take on stretch projects. Join cross-functional initiatives. Build the escape ramps <em>before</em> the current lane closes.</p></li><li><p><strong>Change your identity from &#8216;expert&#8217; to &#8216;explorer&#8217;</strong></p><p>When people ask what you do, don&#8217;t box yourself into a title. Frame yourself as someone who solves complex problems across contexts. This creates space to evolve without shame. My personal philosophy on this is &#8220;Titles don&#8217;t define who you are&#8221;. Because that is very self-limiting.</p></li><li><p><strong>Measure progress by range, not just role</strong></p><p>Promotions are one form of progress. But so is the ability to navigate uncertainty, influence across domains, and pivot with confidence. Track <em>that</em> as your growth metric.</p></li></ol><div><hr></div><h3><strong>Bottom Line: Smart Quitters Win</strong></h3><p>The most resilient tech professionals won&#8217;t be the ones who went the deepest. They&#8217;ll be the ones who knew when depth became a dead end, and had the courage to move laterally or even diagonally to stay relevant.</p><p>Letting go of a skill, title, or path doesn&#8217;t mean you gave up. It means you saw the future coming  and moved.</p><div><hr></div><h2><strong>Chapter 7: Flirting With Your Possible Selves</strong></h2><p>In this chapter, David introduces the concept of <strong>&#8220;possible selves&#8221;</strong>, a term from psychologist Hazel Markus. It describes the mental versions of ourselves we carry in our heads.  The different careers, different lives, or different roles we could become. These are often undefined, rough sketches, not clear goals. But they serve a crucial purpose. They help us try, test, and refine who we really are.</p><p>David argues that success doesn&#8217;t come from identifying your &#8220;passion&#8221; early and chasing it relentlessly. Instead, it comes from <strong>actively testing</strong> different versions of yourself, seeing what fits, and letting experience inform identity, not the other way around.</p><p>He draws on the story of <strong>Frances Hesselbein</strong>, a woman who didn&#8217;t step into a leadership role until her 50s. She tried on multiple professional identities across her life: teacher, volunteer, community member, before eventually becoming CEO of the Girl Scouts and one of the most influential voices in leadership. Hesselbein didn&#8217;t plan her way into greatness. She <em>sampled</em> her way there.</p><div><hr></div><h3><strong>Why This Matters in Tech</strong></h3><p>In tech, we are obsessed with clarity. Job ladders. Career paths. Titles. Promotions. Specializations. But clarity can easily harden into rigidity. And before long, the question &#8220;What do you do?&#8221; becomes a cage, not a launchpad.  Again, self-limiting.</p><p>Here&#8217;s how it often plays out:</p><p>Say, you start as a marketing analyst. You build performant dashboards, analyze  experimentation results, apply attribution models, know marketing KPIs inside out. You get known for it  and rewarded for it. You become &#8220;the marketing analytics person.&#8221;  Then someone asks,  &#8220;Have you ever thought about moving into marketing strategy because you understand marketing so well&#8221; Or &#8220;You have a knack for storytelling,  why not join marketing comms&#8221;</p><p>You respond, &#8220;That&#8217;s not really my thing.&#8221;  But &#8230; how do you know?</p><p>That&#8217;s the point of trying on <em>possible selves</em>.</p><p>You don&#8217;t know which version of your career might fit or where your hidden strengths lie until you give yourself permission to test the edges.</p><p>This isn&#8217;t about abandoning your data skills.</p><p>It&#8217;s about using them as a foundation to explore what else you might be good at that is in the next adjacent space.</p><p>Because in a world where AI can  generate queries and run analyses, it&#8217;s not just about who&#8217;s the best analyst, it&#8217;s about who has the <strong>range</strong> to connect data to influence, decisions, and strategy.</p><p>And you can&#8217;t build that kind of range if you never leave the role you&#8217;ve been told you&#8217;re good at.</p><div><hr></div><h3><strong>The Professional Power of Trying Things On</strong></h3><p>David&#8217;s research shows that people who explore broadly, who take detours, pivots, lateral moves, or even temporary regressions are more likely to land in careers that match both their strengths and their values.</p><p>Why? Because your sense of identity <strong>emerges from action</strong>, not introspection.</p><p>Trying out new domains, functions, or roles gives you feedback loops you can&#8217;t get from thinking alone. It tells you how your skills translate. It reveals what kind of work energizes you. It shows you which environments reward your instincts.</p><p>And in a world being reshaped by AI, this becomes your survival tool.</p><div><hr></div><h3><strong>What It Looks Like in a Tech Career</strong></h3><p>Let&#8217;s say you&#8217;re a data scientist with solid modeling skills. But you&#8217;re curious about product strategy. You&#8217;ve never done it. You&#8217;re not sure if it&#8217;s for you. But part of you wonders, &#8220;Could I be good at that?&#8221;</p><p>You don&#8217;t need to quit your job or get an MBA.</p><p>You could:</p><ul><li><p>Sit in on product roadmap meetings.</p></li><li><p>Shadow a PM for two sprints.</p></li><li><p>Take on a project where you translate data insights into feature prioritization.</p></li><li><p>Run a small experiment where you pitch a data-driven initiative to a cross-functional team.</p></li></ul><p>In doing that, you <em>try on</em> a possible self. i.e. the new strategic PM, the hybrid lead, the internal consultant. You don&#8217;t have to marry that identity. But you get to ask, &#8220;Does this feel like me?&#8221;</p><p>Multiply that process over years, and you&#8217;ll have a wide portfolio of tested identities. Which means when the time comes to pivot  either because of interest or disruption you&#8217;ll know <em>exactly where you fit next</em>.</p><div><hr></div><h3><strong>In an AI-Transformed World, Optionality Is Everything</strong></h3><p>As AI does more of the repeatable tasks in technical roles, affording yourselves the optionality to move between value-creating roles  becomes the real &#8220;career&#8221; moat.</p><p>The engineer who can hold  product conversations.</p><p>The analyst who can evolve into an  leader.</p><p>The technical IC who can step into strategy without losing credibility.</p><p>These are not linear transitions. They&#8217;re the result of <em>possibility sampling</em>  of having tested multiple selves in lower-stakes settings, so you&#8217;re ready when opportunity arrives.</p><div><hr></div><h3><strong>Practical Strategy:  Expand Your Range of Selves</strong></h3><ol><li><p><strong>Run career &#8220;micro-experiments&#8221;</strong></p><p>Choose one identity you&#8217;re curious about (e.g. technical pre-sales, solution architect, team lead). Set a 90-day goal to explore it lightly. Shadow someone. Take on a side project. Reflect on how it feels.</p></li><li><p><strong>Track energy, not just skill</strong></p><p>When you try new things, don&#8217;t just assess whether you&#8217;re good at them. Ask: <em>Did this energize me?</em> The best roles lie at the intersection of ability and alignment.</p></li><li><p><strong>Decouple identity from title</strong></p><p>Don&#8217;t limit your professional identity to your job description. Try introducing yourself in broader terms. For example, &#8220;I help organizations turn messy data into clear decisions.&#8221; That gives you flexibility to try new expressions of the same value.</p></li><li><p><strong>Stay open to unlikely paths</strong></p><p>Frances Hesselbein didn&#8217;t plan to lead a major organization. Her leadership identity emerged from service. Your best opportunities may not come from plans. They may come from patterns that only make sense in retrospect.</p></li></ol><div><hr></div><h3><strong>Bottom Line: Test, Don&#8217;t Assume</strong></h3><p>The most successful and adaptive tech professionals aren&#8217;t the ones who picked the perfect ladder. They&#8217;re the ones who explored enough paths to build a multidimensional map of themselves.</p><p>If you feel unclear about where your career is going, that&#8217;s not failure. That&#8217;s signal. It means you&#8217;re still exploring, still testing, still building range.</p><div><hr></div><p>The next big idea covered in the book is based on <strong>The Outsider Advantage</strong>, where we&#8217;ll explore how people from outside a domain often make the biggest breakthroughs, and why that matters when you&#8217;re thinking about your next professional leap.</p><p>Until next time</p><p>Vijay</p><div><hr></div><p>If this helped you reframe your thinking about your career development please consider sharing with others. (And, feel free to post it to your LinkedIn network).</p><p>More content like this in the future. Stay tuned.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.thefractal.co/?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share The Fractal&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.thefractal.co/?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share The Fractal</span></a></p><p></p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.thefractal.co/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 The Fractal! 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><item><title><![CDATA[Range Is The New Black - Part II]]></title><description><![CDATA[Why Developing Range Is the Most Important Thing You Can Do for Managing and Developing Your Career]]></description><link>https://www.thefractal.co/p/range-is-the-new-black-part-2</link><guid isPermaLink="false">https://www.thefractal.co/p/range-is-the-new-black-part-2</guid><dc:creator><![CDATA[Vijay Reddiar]]></dc:creator><pubDate>Tue, 10 Feb 2026 05:09:31 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!UxpJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72f72fc3-478c-44ff-b892-9c3375e8f156_1600x896.heic" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!UxpJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72f72fc3-478c-44ff-b892-9c3375e8f156_1600x896.heic" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!UxpJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72f72fc3-478c-44ff-b892-9c3375e8f156_1600x896.heic 424w, https://substackcdn.com/image/fetch/$s_!UxpJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72f72fc3-478c-44ff-b892-9c3375e8f156_1600x896.heic 848w, https://substackcdn.com/image/fetch/$s_!UxpJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72f72fc3-478c-44ff-b892-9c3375e8f156_1600x896.heic 1272w, https://substackcdn.com/image/fetch/$s_!UxpJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72f72fc3-478c-44ff-b892-9c3375e8f156_1600x896.heic 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!UxpJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72f72fc3-478c-44ff-b892-9c3375e8f156_1600x896.heic" width="1456" height="815" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/72f72fc3-478c-44ff-b892-9c3375e8f156_1600x896.heic&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:815,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:78623,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/heic&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.thefractal.co/i/186269979?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72f72fc3-478c-44ff-b892-9c3375e8f156_1600x896.heic&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!UxpJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72f72fc3-478c-44ff-b892-9c3375e8f156_1600x896.heic 424w, https://substackcdn.com/image/fetch/$s_!UxpJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72f72fc3-478c-44ff-b892-9c3375e8f156_1600x896.heic 848w, https://substackcdn.com/image/fetch/$s_!UxpJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72f72fc3-478c-44ff-b892-9c3375e8f156_1600x896.heic 1272w, https://substackcdn.com/image/fetch/$s_!UxpJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72f72fc3-478c-44ff-b892-9c3375e8f156_1600x896.heic 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>If you missed the first part of this - please go back <a href="https://www.thefractal.co/p/range-is-the-new-black">here</a> so you have the full context of what this is about, and then come back to this article.</p><div><hr></div><h2><strong>Chapter 1: The Cult of the Head Start</strong></h2><p>In almost every industry, we reward people who specialize early. If someone &#8220;knew they wanted to be a doctor since age 8&#8221; or &#8220;wrote their first line of code at 10,&#8221; we treat it as a badge of honor. In tech, it&#8217;s no different. The faster you declare your domain the more credibility you&#8217;re often given. It&#8217;s the gospel of the head start: pick a lane early, go deep in that area, and enjoy the benefits of becoming invaluable specialist.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.thefractal.co/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 The Fractal! 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>But what if that advice, while occasionally true, is often dangerously incomplete? Especially now.</p><p>David opens <em>Range</em> by challenging this cultural narrative head-on. He does it not by critiquing it theoretically, but by showing us two real-world cases: Tiger Woods and Roger Federer. These aren&#8217;t just sports stories, they&#8217;re opposing archetypes of how excellence can emerge.</p><h3><strong>Tiger vs. Federer: Two Paths to Greatness</strong></h3><p>Tiger Woods is the canonical example of early specialization. At just seven months old, he mimicked his father&#8217;s golf swing. By two, he was on national TV. By three, he was shooting under par. His life was golf and nothing else. This is the prototypical tech professionals we&#8217;ve come to admire and ask others to emulate.</p><p>Roger Federer, on the other hand, couldn&#8217;t have had a more different trajectory. As a kid, he played soccer, basketball, skateboarding, wrestling, skiing and yes, some tennis. His parents encouraged sampling, not specialization. He didn&#8217;t take tennis seriously until his mid-teens. No intensive coaching. No travel circuit. No deep athletic seasoning. Just wide play. And yet, Federer would go on to become one of the greatest tennis players of all time.</p><p>These two athletes both reached the pinnacle of their fields, but through radically different developmental paths.</p><p>And this is where David makes his key point: while Tiger&#8217;s path works in a<strong> &#8220;kind&#8221; environment</strong>, Federer&#8217;s path is better suited to a &#8220;<strong>wicked</strong>&#8221; <strong>environment</strong>.</p><div><hr></div><h3><strong>Kind vs. Wicked Environments: What&#8217;s the Difference?</strong></h3><p>A &#8220;kind&#8221; learning environment is predictable, rules-based, and has near-immediate feedback. Think of golf, chess, classical music.  Any field where repetition leads directly to mastery. You swing, you miss, you adjust. It&#8217;s a quick feedback loop. Specialization here is rewarded early and often.</p><p>But  most things in life including most careers, especially in tech do not operate this way.</p><p>A &#8220;wicked&#8221; environment is one where the rules aren&#8217;t clear, the feedback is slow or inaccurate, and the situation evolves constantly. Think of entrepreneurship, product management, leading engineering teams, navigating cross-functional influencing where the success signals are noisy and messy.</p><p>In these environments, the habits and instincts you build from early specialization can actually work against you because the patterns don&#8217;t repeat predictably.</p><p>That&#8217;s where generalists like Federer have the edge: they learn to improvise, adapt, and <em>reason through ambiguity</em>. They learn how to learn, not just how to execute a playbook. Their edge isn&#8217;t technical precision, it&#8217;s strategic fluency. You learn to not only embrace ambiguity, but anticipate ambiguity. Those are the norms of a <em>wicked environment</em>. </p><div><hr></div><h3><strong>What This Means for Tech Careers</strong></h3><p>Let&#8217;s talk about &#8220;Tiger Path&#8221; professionals in tech. You know the ones. They picked a specialty early, let&#8217;s say  Ops/Engineering. They became the go-to infra person, solved every scaling problem, fine-tuned the performance of workloads.  </p><p>Early on, this pays off.  They are indispensable.</p><p>But then, the context shifts.</p><p>Suddenly, the team needs someone to decide whether to refactor the architecture to support a new business unit. Or whether to sunset a platform and migrate to cloud-native tooling. Or how to frame the value of the team&#8217;s work to leadership. The environment becomes <em>wicked</em>. The problem space is no longer technical, it&#8217;s systemic, strategic, and cross-functional.</p><p>And here&#8217;s the hard truth: if you&#8217;ve only lived inside the &#8220;kind&#8221; world of technical execution, your instincts may not translate. In fact, they might actively limit you.</p><p>Now imagine someone on a &#8220;Federer Path.&#8221; Early in their career, they bounced between frontend, data modeling, and dev tooling. They explored product conversations, joined a sprint with the sales enablement team, worked on both successful and failed launches. Their path looked non-linear. Maybe even slower. But it built one thing early: <strong>range</strong>.</p><p>And once the environment turns wicked, <em>range becomes leverage</em>.</p><div><hr></div><h3><strong>Why This Matters Now in the AI Era</strong></h3><p>AI is systematically absorbing many of the kind-environment tasks in tech: writing boilerplate code, debugging syntax errors, generating SQL queries, even suggesting infrastructure diagrams. It rewards those with execution depth but commodifies that depth quickly.</p><p>The last thing you want is to be narrowly specialized in a task AI can now do faster than you.</p><p>But wicked problems? The fuzzy, strategic, human ones? Those still require range: how to negotiate tradeoffs, assess risk, integrate product-market context, and work across disciplines.</p><p>We&#8217;re moving from a world where being a &#8220;Tiger&#8221; gave you a ten-year head start to one where being a &#8220;Federer&#8221; makes you <em>future-proof</em>.</p><div><hr></div><h3><strong>Practical Strategy: What You Can Do</strong></h3><ol><li><p><strong>Audit your &#8220;environment&#8221;:</strong></p><p>Are most of your problems kind (repetitive, with clear feedback) or wicked (ambiguous, cross-functional, change management)? If the latter, are you equipped with enough range to navigate them?</p></li><li><p><strong>Shift from efficiency to flexibility:</strong></p><p>Don&#8217;t optimize for faster delivery. Optimize for broader <em>understanding</em>. Take on projects with uncertain outcomes. Volunteer to work on initiatives outside your core stack.</p></li><li><p><strong>Delay final specialization:</strong></p><p>Just because you&#8217;re successful in your niche now doesn&#8217;t mean you&#8217;ve found your long-term &#8220;fit.&#8221; Allow yourself a career sampling period, no matter how many years of experience are behind you. Think about the active years of experience in front of you where you can make meaningful contribution.</p></li></ol><div><hr></div><p><strong>Bottom line:</strong> Early specialization makes you faster.</p><p>Range makes you adaptable.</p><p>And in a world that&#8217;s changing faster than your domain can keep up, adaptability always wins.</p><h2><strong>Chapter 2:  How the Wicked World Was Made</strong></h2><p>In Chapter 2, David dives deeper into the distinction between &#8220;kind&#8221; and &#8220;wicked&#8221; learning environments. It&#8217;s the concept introduced in Chapter 1 but now rigorously defined. And he starts by examining one of the most high-stakes, feedback-critical professions out there: <strong>medicine</strong>.</p><p>The setup is simple: how do people learn to make decisions? What makes someone an expert? And what happens when the <em>environment</em> they&#8217;re operating in doesn&#8217;t give them the kind of feedback needed to learn from their experience?</p><p>The implications, as we&#8217;ll see, go far beyond medicine. It directly impacts how you, as a tech professional, navigate your career in an AI-dominated future.</p><div><hr></div><h3><strong>The Cardiac Diagnosis Story: When Experience Doesn&#8217;t Help</strong></h3><p>One of the most memorable studies David explores involves emergency room physicians diagnosing chest pain.</p><p>The researchers discovered something strange: experienced ER doctors often performed <em>worse</em> than novices when it came to accurately diagnosing heart attacks. Their error rates were higher, even though they had years of practice. Why?</p><p>Because they were relying on instinct built in a <strong>wicked learning environment</strong> &#8212; one where feedback is slow, incomplete, and ambiguous.</p><p>When patients came in with chest pain and were misdiagnosed, but then went to another hospital or died later at home, the original doctor often <em>never knew</em>. The learning loop was broken. And over time, the wrong mental models solidified.</p><p>Contrast that with a <strong>kind learning environment</strong>, like chess or firefighting. You make a move, the result is immediate, and the pattern reinforces or corrects your instincts quickly. These are domains where experience reliably builds expertise.</p><p>But medicine &#8212; like much of modern life &#8212; is different. It&#8217;s complex. Multivariable. Pattern-defying. That&#8217;s wickedness in action.</p><div><hr></div><h3><strong>Wickedness in Tech: You&#8217;re Swimming in It</strong></h3><p>Now let&#8217;s bring this home.</p><p>You might think, &#8220;Well, I&#8217;m not diagnosing heart attacks. I&#8217;m building systems.&#8221; But think more carefully about how <em>you</em> develop judgment at work.</p><p>Let&#8217;s say you advocate for redesigning a system to support a growing customer segment. It requires capital. You are in a capital constrained environment. No investments occur. No redesign or re-engineering takes place.  The highly anticipated customer segment growth does not come to last, because the systems were never scaled to meet the levels of satisfaction through the customer experience delivered based on legacy implementation. A year later, customer churn spikes in that segment, but no one traces it back to that architectural tradeoff.   If you are not in a double digit growth industry (Silicon Valley I am not looking at you), then this will sound familiar.</p><p>These are <strong>wicked feedback loops</strong>. Outcomes are decoupled from decisions. Signals are distorted or delayed. You might be right and still look wrong. Or wrong and still look like a star.</p><p>And the biggest trap? <strong>You start believing your own faulty patterns.</strong></p><p>Like those ER physicians, you begin to trust gut feel that&#8217;s been trained in a messy, ambiguous environment. You overfit to patterns that don&#8217;t generalize. You optimize for what gets rewarded <em>locally</em>, not what&#8217;s right <em>systemically</em>.</p><div><hr></div><h3><strong>AI Makes the Environment Even More Wicked</strong></h3><p>Here&#8217;s where it gets even more interesting and relevant to your career.</p><p>AI is removing kind-environment tasks at scale. Repetitive queries, straightforward scripts, basic code translation many of these are now accelerated or being worked on to be replaced. That means what remains on your plate is <em>disproportionately wicked</em>.</p><p>You are no longer going to be being asked to &#8220;code the thing.&#8221; You are going to be asked to:</p><ul><li><p>Decide <em>which</em> thing is worth coding</p></li><li><p>Translate ambiguous business goals into system architecture</p></li><li><p>Influence a cross-functional group with competing priorities</p></li><li><p>Make calls under uncertainty, where tradeoffs are murky and outcomes are months away</p></li></ul><p>This is wicked territory. And if you&#8217;re used to feedback-rich, rule-based environments, this new terrain can feel disorienting.</p><p>But it&#8217;s also where the <em>opportunity</em> lies, because most of us are still trying to operate like it&#8217;s a kind environment.  Which means those who ask the question &#8220;Ok, what do I need to prepare myself to be ready for a wicked environment&#8221; will develop an edge.</p><div><hr></div><h3><strong>Why Range Helps You Navigate Wickedness</strong></h3><p>This is where David&#8217;s thesis and your career strategy  start to converge quite powerfully.</p><p>In wicked environments, what works isn&#8217;t deep repetition. It&#8217;s <strong>broad pattern recognition.</strong></p><p>The doctors who performed best at diagnosing cardiac events? They didn&#8217;t have more years of ER experience. They had exposure to <em>multiple domains</em> of medicine. They had developed conceptual models, not rote responses.</p><p>In your career, that means the more domains you&#8217;ve touched  product, ops, sales support, finance ops, systems design, market / social research, organizational design (to name a few), the better you&#8217;ll perform when the rules are unclear and feedback is messy.</p><p>You&#8217;ll see analogies others miss. You&#8217;ll avoid overfitting to short-term patterns. You&#8217;ll frame decisions in ways that account for ambiguity, not in spite of it.</p><div><hr></div><h3><strong>Practical Strategy:  Building a Wicked-Proof Career</strong></h3><ol><li><p><strong>Shift from solution muscle to sensing muscle</strong></p><p>Stop  asking, &#8220;What&#8217;s the best tool for this problem?&#8221; Start asking, &#8220;How is this problem evolving, and who else is affected by it?&#8221; </p></li><li><p><strong>Create your own feedback loops</strong></p><p>Don&#8217;t wait for outcomes to validate your decisions. Build a practice of <strong>retrospective inference</strong>: six months after a project, ask, &#8220;What did I believe? What happened? What does that teach me?&#8221;</p></li><li><p><strong>Learn across functions, not just within your stack</strong></p><p>Read about decision-making. Study organizational behavior. Understand how incentives shape architecture choices. Range lives in the overlaps.</p></li><li><p><strong>Say yes to ambiguous projects</strong></p><p>Join the working group with unclear outcomes. Take the product strategy sprint with no defined metrics. Build the muscle of navigating fog. That&#8217;s where range thrives.</p></li></ol><div><hr></div><p><strong>Bottom line:</strong></p><p>Kind environments reward mastery. Wicked environments reward <strong>metacognition</strong>. It is  the ability to think about how you&#8217;re thinking.</p><p>As AI clears out kind problems, your real value lies in how well you navigate the rest. And that means becoming the kind of person who doesn&#8217;t just <em>solve problems</em>, but reframes them entirely.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.thefractal.co/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 The Fractal! 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><div><hr></div><h2><strong>Chapter 3: When Less of the Same Is More</strong></h2><p>After laying the groundwork for how wicked environments require a different kind of thinking, David now turns to a question that challenges one of the most accepted beliefs in professional development: <em>Does early, narrow focus actually help you succeed faster?</em></p><p>The answer, it turns out, is not only <em>no</em>,  but in many fields, the opposite is true.</p><p>This chapter is where David begins to dismantle the myth that linear paths and early clarity about your goals are the fastest (or even most efficient) ways to succeed. In fact, he introduces one of the most powerful career levers most professionals overlook: <strong>sampling</strong>.</p><div><hr></div><h3><strong>The Army Officer Study: Fast Doesn&#8217;t Mean Forward</strong></h3><p>One of the more unexpected stories David shares is a large-scale study on U.S. Army officers. The study followed their career trajectories and evaluated their performance across time.</p><p>It found that officers who <em>sampled</em> more assignments early in their careers &#8212; rotating through different posts, roles, and units were initially <strong>slower</strong> to advance. They didn&#8217;t shoot up the ranks like their peers who stuck to one track.</p><p>But here&#8217;s what happened later: the samplers <em>surpassed</em> their more narrowly focused peers. They led more effectively, scored higher on assessments of judgment and strategic decision-making, and ultimately rose to more senior ranks.</p><p>Early specialists got the head start. But generalists won the race.</p><p>Why? Because by moving through different roles, the samplers developed <strong>transferable skills</strong>, pattern recognition, and a wider lens for assessing problems. When the complexity of leadership kicked in, they had the range to handle it. Their early &#8220;slowness&#8221; was an investment in long-term versatility.</p><div><hr></div><h3><strong>What Tech Professionals Get Wrong About Sampling</strong></h3><p>Let&#8217;s translate this to a tech career.</p><p>Early-career developers, analysts, or engineers are often told: &#8220;Pick your specialization fast. Go deep. Own a vertical. Make yourself indispensable.&#8221;</p><p>That sounds great until the context changes. Which it always does.</p><div><hr></div><h3><strong>And Then Came AI&#8230;</strong></h3><p>Here&#8217;s where it gets critical in today&#8217;s landscape.</p><p>AI is reducing the value of ultra-specialized execution. Writing optimized code, querying large datasets, even deploying infrastructure much of that is  now being co-piloted, if not outright replaced, by a machine. </p><p>But what AI can&#8217;t do  at least not yet  is <strong>bridge disciplines</strong>. It can&#8217;t integrate product context with data limitations and engineering tradeoffs. It can&#8217;t negotiate incentives between teams. It can&#8217;t hold a mental model that spans five loosely coupled systems and predict where the next problem will appear.</p><p>That kind of thinking requires <strong>range</strong>.</p><p>And range comes from sampling.</p><div><hr></div><h3><strong>A gig is not forever, so why not adopt a &#8220;I am going to sample this job&#8221; </strong></h3><p>Let&#8217;s acknowledge something. Sampling doesn&#8217;t always feel strategic while you&#8217;re doing it.  Just know that hiring managers don&#8217;t think anyone they hire are  going to stick with the job you take forever. Sooner or later high performers seek the next challenge.  Be deliberate about it. And if you so feel, share it. And, of course, there is always a right way to frame it.</p><p>Taking a lateral move from ML to DevOps, or rotating into a data governance project, or shadowing a product manager for a quarter, none of those feel like the &#8220;next big thing.&#8221; Especially when others in your peer network seem to be making vertical ascension in their careers within their specialization.</p><p>You worry: Am I falling behind? Am I diluting my expertise?</p><p>But if David&#8217;s research shows anything, it&#8217;s this: <strong>non-linear progress is not a weakness.</strong> It&#8217;s exactly what builds the judgment needed in wicked environments.</p><p>And in AI-driven tech, where everything is fluid, <em>judgment</em> beats optimization every time.</p><div><hr></div><h3><strong>Practical Strategy: Designing Your Sampling Phase</strong></h3><ol><li><p><strong>Map the adjacency graph</strong></p><p>If your core skill is backend engineering, what&#8217;s one adjacent domain that&#8217;s tightly coupled but not your core? API design? Frontend integration? Dev tooling? Sampling doesn&#8217;t mean abandoning, it means <em>expanding</em>.</p></li><li><p><strong>Declare a &#8220;range window&#8221;</strong></p><p>Set a 6&#8211;12 month intentional sampling period. Don&#8217;t drift. Pick areas to explore (e.g. &#8220;I want to understand business metrics and product prioritization&#8221;) and look for projects that expose you to those skills.</p></li><li><p><strong>Use side bets wisely</strong></p><p>Sampling doesn&#8217;t have to happen only within your full-time role. Contribute to internal tools, mentor outside your domain, build a tool that solves a non-engineering problem. These side bets become strategic range builders.</p></li><li><p><strong>Reframe your story</strong></p><p>When asked about your career trajectory, don&#8217;t apologize for variety. Position it as <strong>strategic versatility</strong>. Say: &#8220;I intentionally explored multiple domains early to better navigate ambiguity and make higher-leverage decisions.&#8221; Why? Because ultimately you own your career.  There is agency in choosing what you want to do with your career, so why not be intentional about it. And also own what story you want to tell. </p></li></ol><div><hr></div><h3><strong>Final Thought: You&#8217;re Not Late, You&#8217;re Building Optionality</strong></h3><p>In tech, we treat the person who climbed the ladder fastest as the gold standard.</p><p>But as David shows through military officers, scientists, athletes, and musicians, the people who climb the highest often didn&#8217;t start on the ladder at all. They wandered, explored, cross-trained and then took off with more force and better direction than anyone else.</p><p>If your path looks messy, non-linear, or a little slow, that might be the best indicator of future readiness in a world where AI will remove the straight lined paths.</p><div><hr></div><p>In next part  of this series we&#8217;ll begin looking at the next big idea Epstein provides:</p><p><strong>Learning, Fast and Slow</strong>, where we&#8217;ll look at why the people who seem to struggle more during learning often outperform in the long term and how embracing inefficient learning can give you the edge in a fast-moving industry.</p><p>Until next time,</p><p>Vijay</p><div><hr></div><p>If this helped you reframe your thinking about your career development please consider sharing with others. (And, feel free to post it to your LinkedIn network). More content like this in the future. Stay tuned.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.thefractal.co/?utm_source=substack&amp;utm_medium=email&amp;utm_content=share&amp;action=share&quot;,&quot;text&quot;:&quot;Share The Fractal&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.thefractal.co/?utm_source=substack&amp;utm_medium=email&amp;utm_content=share&amp;action=share"><span>Share The Fractal</span></a></p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.thefractal.co/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 The Fractal! 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><item><title><![CDATA[Range Is The New Black]]></title><description><![CDATA[Why Developing Range Is the Most Important Thing You Can Do for Managing and Developing Your Career]]></description><link>https://www.thefractal.co/p/range-is-the-new-black</link><guid isPermaLink="false">https://www.thefractal.co/p/range-is-the-new-black</guid><dc:creator><![CDATA[Vijay Reddiar]]></dc:creator><pubDate>Thu, 23 Oct 2025 00:30:19 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!S9zf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fc6512f-b077-46bf-b2a0-39ecac37b251_1600x896.heic" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!S9zf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fc6512f-b077-46bf-b2a0-39ecac37b251_1600x896.heic" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!S9zf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fc6512f-b077-46bf-b2a0-39ecac37b251_1600x896.heic 424w, https://substackcdn.com/image/fetch/$s_!S9zf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fc6512f-b077-46bf-b2a0-39ecac37b251_1600x896.heic 848w, https://substackcdn.com/image/fetch/$s_!S9zf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fc6512f-b077-46bf-b2a0-39ecac37b251_1600x896.heic 1272w, https://substackcdn.com/image/fetch/$s_!S9zf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fc6512f-b077-46bf-b2a0-39ecac37b251_1600x896.heic 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!S9zf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fc6512f-b077-46bf-b2a0-39ecac37b251_1600x896.heic" width="1456" height="815" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7fc6512f-b077-46bf-b2a0-39ecac37b251_1600x896.heic&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:815,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:75300,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/heic&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.thefractal.co/i/176457433?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fc6512f-b077-46bf-b2a0-39ecac37b251_1600x896.heic&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!S9zf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fc6512f-b077-46bf-b2a0-39ecac37b251_1600x896.heic 424w, https://substackcdn.com/image/fetch/$s_!S9zf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fc6512f-b077-46bf-b2a0-39ecac37b251_1600x896.heic 848w, https://substackcdn.com/image/fetch/$s_!S9zf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fc6512f-b077-46bf-b2a0-39ecac37b251_1600x896.heic 1272w, https://substackcdn.com/image/fetch/$s_!S9zf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fc6512f-b077-46bf-b2a0-39ecac37b251_1600x896.heic 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p> It was winter of 2007. At that point, I had spent almost a decade of my career   building and designing tech and data on open source technologies. I decided to take  a bold and partly seemingly foolish 180 degree turn into a business role as a finance analyst with the &#8216;feeling&#8217; that it was the right thing to do as a next step in my career, even if it came at the expense of  giving up a promising career growth in tech.  I worked at one of the largest global companies in the world at their HQ at that time. With a highly supportive management sponsoring my career pursuit, we concluded this transition from tech to finance would be a great next step. It took me from being a desk-bound architect who only ever was among deep tech audience to working with execs who ran P&amp;Ls - something I was not exactly prepared for.</p><p>Day 1  on a new job typically brings excitement and a spring in ones&#8217;s step, that unfortunately was not quite how it went down for me. My first meeting of my first day was an &#8216;financial operating review&#8217;. On the slide projected on the conference room screen was a deck full of numbers with bare minimum commentary. I was surrounded by finance undergraduates, with most of my colleagues about 5 to 10 years younger than me (some right out of college). Everyone felt poised, calm, confident and provided their &#8216;insights&#8217; - none of which made any sense to me.  Thirty minutes into the meeting, I started developing an uneasy feeling, starting with the thought that I was in the wrong room. Those thoughts started to become heavier with the weight of discomfort, and a terrible achy feeling that I just made a seriously wrong career move. After all, it was becoming clear that   I was the least qualified person on that team, because I had no background in finance. I had never taken an accounting class ever ( a pre-requisite to even have that job). Granted, I was getting into B-school that spring, but my accounting and finance classes were not until 6 months in the fall.  I was formally an engineering undergraduate  and really was a tech-bro.</p><p>The next few days I continued to churn  through buyer&#8217;s remorse. I stayed put. I told myself, &#8216;I am going to give it a year&#8217;. Like anything else, the initial shock of &#8216;I made a mistake&#8217; came to pass as I started to become resourceful and began learning on the job as well as building my network of experts I could go to when I needed help. </p><p>The first year in that job was possibly the lowest &#8216;productive&#8217; year of my career if productivity was to me measured both in some sense of &#8216;throughput&#8217; for my employer and personal sense of accomplishment - something you could be proud to claim.  I couldn&#8217;t escape the feeling that I had  hit a new trough. </p><p>Many years later I moved onto to do other functional and analytical roles after  &#8220;grinding&#8221; it out and learning everything I possibly could in that job including corporate financial planning, corporate  strategy, investment analysis, expense modeling, financial modeling, and, a solid understanding of accounting (I&#8217;d be remiss if  don&#8217;t include accounting standards), as well as the essence of  being able to understand and learning to articulate &#8216;what is the story here&#8217; to communicate with senior executives whose P&amp;Ls I was responsible to manage.</p><p>Fast forward more than a decade and a half now, I can unequivocally say that was the most transformative career switch  I ever made. The first principles of critical thinking, analytical skills, story telling all came out of that job which has continued to manifest in many of my roles after that point on  and allowed me to grow professionally.</p><div><hr></div><p>This personal journey, which seemed like a career-threatening mistake at first, turned out to be a masterclass in what author David Epstein would later articulate in his groundbreaking book &#8220;Range: Why Generalists Triumph in a Specialized World.&#8221; Published in 2019, this book arrived at a crucial moment when  tech industry is at the epicenter  of an AI led transformations across industries  that&#8217;s reshaping how we think about  jobs, expertise, careers, and professional growth among other things.</p><p>If there is one book I can recommend anyone serious about developing their abilities and career and that of their teams, it is this book. Be forewarned the some of the ideas challenge conventional wisdom we have all come to accept, and might lead you with what I like to call '&#8220;brain-breaking moments&#8221;</p><p>In an era where your favorite AI tool can write complex code, the conventional wisdom of becoming a narrow specialist starts to seem increasingly precarious. The tech industry&#8217;s long-standing mantra of &#8220;go deep, not broad&#8221; is being challenged not just by AI&#8217;s capabilities, but by the very nature of innovation and problem-solving in our complex world. Don&#8217;t believe me? Try vibe-coding and see how quickly you can get your first MVP off the ground.</p><p>Epstein&#8217;s work shatters the popular &#8220;10,000-hour rule&#8221; now entrenched in popular contemporary professional development literature. It challenges our deeply held beliefs about early specialization and expertise. Through compelling research and fascinating stories - from Roger Federer&#8217;s late specialization in tennis to Nintendo&#8217;s journey from a playing card company to a gaming giant - the book reveals how individuals with broad experiences and diverse skill sets often outperform deep specialists, especially in fields characterized by rapid change and uncertainty. Not quite what we have known to believe.</p><p>For tech professionals, this message couldn&#8217;t be more timely. As AI continues to automate routine technical tasks and reshape traditional roles, the ability to adapt, connect disparate ideas, and see the bigger picture becomes increasingly valuable. The future belongs not to those who can write the most efficient algorithm, but to those who can understand the human context, spot unconventional opportunities, and navigate complex systems thinking.</p><p>What makes &#8220;Range&#8221; particularly relevant for today&#8217;s tech professionals is its challenge to the traditional career ladder. In an industry where the pressure to specialize early and deeply is intense, Epstein&#8217;s research shows that late specialization and diverse experiences can lead to more innovative thinking and better problem-solving abilities. This isn&#8217;t just about career survival in the AI era; it&#8217;s about thriving through intellectual agility and adaptability.</p><p>As we dive deeper into  &#8220;Range,&#8221; I&#8217;ll demonstrate how its principles can be applied specifically to tech careers in an AI-transformed world. We&#8217;ll examine why some of the most successful tech leaders aren&#8217;t pure technologists but rather individuals who&#8217;ve cultivated broad perspectives and diverse skill sets. More importantly, we&#8217;ll discuss practical strategies for expanding your own range while leveraging your existing technical expertise.</p><p>Whether you&#8217;re a data scientist feeling boxed in by your specialization, a software engineer wondering about your role in an AI-driven future, or a tech leader looking to build more adaptable teams, this journey through &#8220;Range&#8221; will challenge your assumptions and open new possibilities for growth.</p><p>Get ready for some (again) brain-breaking moments as we challenge conventional wisdom and explore why range isn&#8217;t just a nice-to-have anymore - it&#8217;s the new black in professional success.  You don&#8217;t want to miss this series. Go ahead and subscribe. More coming soon.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.thefractal.co/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.thefractal.co/subscribe?"><span>Subscribe now</span></a></p><p>Until next time,</p><p>Vijay</p><p>PS. If you missed the cultural reference to the title. See OITNB here: <a href="https://en.wikipedia.org/wiki/Orange_Is_the_New_Black">Orange is the new black</a></p><p>PPS. If you really liked this, please consider sharing with a friend you think might find this of value. I would really appreciate that!</p><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://www.thefractal.co/p/range-is-the-new-black?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption">Thanks for reading The Fractal! This post is public so feel free to share it.</p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.thefractal.co/p/range-is-the-new-black?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.thefractal.co/p/range-is-the-new-black?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><p></p><div><hr></div><p></p>]]></content:encoded></item><item><title><![CDATA[Why Technical Brilliance and Strategic Influence Rarely Coexist]]></title><description><![CDATA[What keeps exceptional technical minds from shaping strategy &#8212; and how they can evolve without losing their edge.]]></description><link>https://www.thefractal.co/p/why-technical-brilliance-and-strategic</link><guid isPermaLink="false">https://www.thefractal.co/p/why-technical-brilliance-and-strategic</guid><dc:creator><![CDATA[Vijay Reddiar]]></dc:creator><pubDate>Tue, 14 Oct 2025 01:01:31 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!8Fo7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdee94698-7fc3-41c3-a2cc-15f3b9499eb0_256x256.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A while ago I wrote a post about analytical thinking linked <a href="https://www.thefractal.co/p/the-one-skill-you-need-to-develop">here</a>. I had many people reach out to me to tell me how they thought about analytical thinking. One thing became very clear was that there is a recognition that <em>analytical thinking</em> is a multi-dimensional convergence of skills that combines different competencies to optimize the most efficacious answer to the most consequential problem.</p><p>Today, I want to make a case why influencing might be one of the most valued but least understood and appreciated skills among many of the brilliant tech professionals,  including those in my own field of data science and more broadly data &amp; analytics. Every aspect of what I share below broadly also applies to technology oriented fields. </p><p></p><p>There&#8217;s a quiet frustration that ripples through many senior technical professionals &#8212; engineers, data scientists, architects, and technical leads who have mastered the craft of precision but find themselves unheard in the rooms where direction is set. How do I know it? I have personally lived it!</p><p>Their ideas are solid, their logical considerations airtight, yet their influence seems to fade when conversations shift from design artifacts to business outcomes.</p><p>It&#8217;s not because they lack ability. In fact, they often hold <em>more</em> technical clarity than anyone else in the room. But their brilliance can feel wasted on executives who don&#8217;t fully grasp algorithmic sophistication or appreciate the intricacies of for example a topic on &#8220;system design&#8221;.</p><p>The problem isn&#8217;t their expertise &#8212; it&#8217;s the <strong>translation gap</strong> between technical depth and strategic understanding. It&#8217;s the old adage.  They&#8217;re speaking &#8220;<em>Latin</em>&#8221; to an audience that needs &#8220;<em>English.</em>&#8221;</p><p>This article explores why that gap exists, why it persists even among the most gifted professionals, and what it takes to evolve from a technical authority into a strategic influencer  without diluting technical integrity.</p><p>In the sections follow I will introduce the multiple dimensions that explains the gap as well as what I think are the 8 mental architectures understanding which  can help forge a path forward.</p><h2><strong>The Hidden Paradox of Technical Mastery</strong></h2><p>For many senior technical professionals, excellence has always been a matter of precision including getting the details right, identifying edge cases others overlook, building solutions that stand up to complexity, and work under any circumstances. </p><p>That same instinct for perfection, however, often becomes the invisible barrier to influence.</p><p>Early in a career, mastery earns credibility. The person who can debug the impossible issue, optimize the slowest query, or architect a highly performant and scalable system becomes indispensable. But as responsibility scales, influence no longer depends solely on technical correctness,  it hinges on <em>strategic clarity</em>.</p><p>The irony is that the very habits that fuel technical mastery including deep focus, analytical rigor, a love for complexity can make it harder to connect with audiences who value brevity, clarity, and decision speed.</p><p>Executives, after all, don&#8217;t reward intellectual elegance; they reward <em>business alignment</em>.</p><p>To them, the conversation isn&#8217;t about architecture patterns &#8212; it&#8217;s about <strong>risk, timing, and impact</strong>.</p><p>The engineer who wants to discuss trade-offs in depth might unintentionally appear indecisive to a leader who simply needs to know whether the project will ship on time.</p><p>This isn&#8217;t a failure of intelligence. It&#8217;s a <em>mismatch of context.</em></p><p>Technical professionals are trained to optimize for truth and precision. Executives optimize for clarity and direction.</p><p>When these value systems collide, even the most brilliant individual contributors can feel sidelined. Not because they&#8217;re wrong, but because they&#8217;re <em>not being heard</em>. </p><h2><strong>The Mental Architecture of the Brilliant but Stuck</strong></h2><p>When analyzing why so many exceptional technical minds struggle to expand their influence, a pattern begins to emerge:  a shared &#8220;mental architecture&#8221; shaped by habits that once drove success but now limit visibility.</p><p>Below are eight recurring dimensions of that architecture. None of them reflect a lack of intelligence or ambition; instead, they reveal how excellence in one domain can unintentionally create blind spots in another.</p><h3><strong>1. The Pursuit of Perfection</strong></h3><p>Perfectionism often disguises itself as professionalism.</p><p>For the technical expert, &#8220;good enough&#8221; can feel like moral compromise. They equate high standards with identity. Because, precision is who they are.</p><p>But in strategic environments, perfectionism often manifests as paralysis. Projects stall while the technically-minded person refines, polishes, double-checks, and triple-checks.</p><p>Meanwhile, those who can tolerate ambiguity move ideas forward  and are perceived as more effective.</p><p>The challenge isn&#8217;t about lowering standards; it&#8217;s about reframing excellence from <strong>flawlessness</strong> to <strong>effectiveness</strong>.</p><h3><strong>2. The Executive Translation Gap</strong></h3><p>Ask a technical leader a question like, &#8220;When will this be ready?&#8221; and the instinctive response might begin with context: the architecture, dependencies, possible bottlenecks.</p><p>By the time they reach the actual answer, the executive has mentally moved on.</p><p>This isn&#8217;t a communication failure,  it&#8217;s a <em>framing mismatch</em>.</p><p>Executives operate in compressed timeframes. They want the answer first, the rationale later.</p><p>Those who can distill complex work into clear, outcome-oriented language are not oversimplifying &#8212; they&#8217;re <em>building bridges of understanding</em>.</p><h3><strong>3.Blind Spots in Organizational Dynamics</strong></h3><p>Many technically brilliant people assume organizations operate as meritocracies that excellence speaks for itself. Most organizations are.  But in reality, there is a less understood dynamic. It is flow of  influence  through human networks, not just performance metrics.</p><p>Ignoring how decisions actually move through an organization such as  who influences whom, how priorities get shaped often leads to brilliant ideas dying quietly in the middle layers.</p><p>Strategic influence requires not only insight but <strong>navigation</strong>: understanding alliances, timing, and informal decision channels that rarely appear on an org chart.</p><h3><strong>4. Reluctance to Take Initiative</strong></h3><p>In highly technical environments, structure and clarity are virtues. Requirements, specifications, and defined roles ensure stability.</p><p>But at senior levels, waiting for permission before acting can be mistaken for hesitation. Some of the most capable engineers hold back brilliant ideas until they&#8217;re formally invited to lead them. They want certainty, clear scope, and alignment before moving.</p><p>Yet influence often grows from <strong>creating clarity</strong>, not waiting for it. </p><p>Strategic leaders shape direction by defining opportunities others haven&#8217;t yet articulated.</p><p>They don&#8217;t discard rigor; they pair it with courage to move even when the path isn&#8217;t fully marked.</p><h3><strong>5. Limited Cross-Functional Reach</strong></h3><p>Many technical professionals feel most at home among peers who share their vocabulary and logic. Conversations outside the technical circle can feel inefficient or superficial.</p><p>However, leadership visibility expands through <em>connection</em>, not just competence.</p><p>When relationships remain confined to technical peers, the person&#8217;s impact remains similarly contained.</p><p>Strategic influence, by contrast, requires relationships with business counterparts such as operations, marketing, finance, and product &#8212; not for the  sake of checking the box on &#8216;are you being collaborative?&#8217;, but to understand the business holistically.</p><p>Those who cultivate cross-functional rapport start hearing early signals about market shifts, customer needs, and organizational priorities.</p><p>They stop being seen as &#8220;the technical expert in the corner&#8221; and start being viewed as &#8220;the person who understands how technology drives the business.&#8221;</p><h3><strong>6. Invisible Excellence</strong></h3><p>Another subtle barrier: the assumption that great work naturally gets noticed.</p><p>Many technical minds view packaging, presentation, or storytelling as distractions from &#8220;real&#8221; work.</p><p>Yet the corporate world runs on what I like to call <em>narrative visibility.</em></p><p>When achievements are not communicated in a way executives can grasp, they remain invisible, no matter how impactful they are in code or data.</p><p>Framing technical outcomes in terms of customer impact, cost savings, or risk mitigation isn&#8217;t embellishment &#8212; it&#8217;s translation.</p><p>It ensures that the organization recognizes the <em>strategic value</em> embedded in technical accomplishments.</p><h3><strong>7. Disconnection from Market Context</strong></h3><p>It&#8217;s easy to get absorbed in optimizing internal systems and technology deliverables, but without a clear sense of the market landscape &#8212; competitors, customers, revenue models &#8212; technical decisions risk becoming detached from strategic priorities.</p><p>Understanding business strategy isn&#8217;t about abandoning engineering purity; it&#8217;s about designing with <em>contextual intelligence.</em></p><p>When technical professionals understand where the company is trying to go, they can proactively align architectures, data models, or algorithms with that trajectory.</p><p>Strategic influence grows when technical decisions reflect awareness of business constraints and opportunities.</p><h3><strong>8. Mixed Leadership Signals</strong></h3><p>Even at senior levels, many technical experts unconsciously send signals that anchor them as deep specialists rather than organizational leaders.</p><p>They dive into technical minutiae during executive discussions, optimize for precision over persuasion, and often speak in frameworks rather than outcomes.</p><p>Strategic leaders, by contrast, send a different signal: confidence in ambiguity, focus on direction, and fluency in organizational language.</p><p>This doesn&#8217;t mean abandoning one&#8217;s craft &#8212; it means widening the aperture through which expertise is expressed.</p><p>Influence is as much about <em>how thinking is perceived</em> as it is about <em>what thinking produces.</em></p><p></p><h2><strong>Why Executives See the World Differently</strong></h2><p>Executives operate in a different mental environment. Their bandwidth is stretched across dozens of priorities &#8212; customers, investors, markets, competitors, talent, and timelines.</p><p>While technical professionals often look inward (to systems, processes, and precision), executives look outward &#8212; to risk, reputation, and results.</p><p>They interpret information through the lens of decision velocity: <em>What does this mean for our objectives, and what should we do next?</em></p><p>This perspective isn&#8217;t better or worse &#8212; just different.</p><p>Technical experts who understand this distinction begin to see that communication with executives isn&#8217;t about simplifying ideas; it&#8217;s about <strong>framing insights within the decision horizon</strong> of leadership.</p><p>For example, when discussing a new data-infrastructure upgrade, the executive mind seeks to know:</p><ul><li><p><em>What business pain does this solve?</em></p></li><li><p><em>What risk does it reduce or opportunity does it enable?</em></p></li><li><p><em>How does it align with our timing and budget reality?</em></p></li></ul><p>Once those anchors are clear, details find their place naturally.</p><p>Strategic influence begins when the conversation shifts from <em>how the system works</em> to <em>why the system matters</em>.</p><p></p><h2><strong>The Cost of Staying in Translation Mode</strong></h2><p>Remaining trapped between technical depth and organizational influence carries emotional and career costs.</p><p>Many senior engineers and data professionals experience a quiet sense of stagnation &#8212; the feeling of being indispensable yet peripheral.</p><p>Their work powers key decisions, yet they&#8217;re rarely part of the decision-making itself.</p><p>They see less technically skilled peers shaping direction simply because those peers can speak the language of outcomes.</p><p>Over time, this creates fatigue &#8212; a subtle disillusionment that technical merit alone should be enough.</p><p>But influence is not a reward for brilliance; it&#8217;s a by-product of <em>relevance.</em></p><p>When ideas don&#8217;t travel upward, potential impact stays localized.</p><p>Bridging that gap requires intentional evolution &#8212; not in skillset, but in mindset.</p><p></p><h2><strong>Bridging the Divide: From Expert to Strategic Partner</strong></h2><p>Bridging the space between technical depth and organizational strategy is less about abandoning expertise and more about <strong>expanding perspective</strong>.</p><p>It&#8217;s a deliberate evolution &#8212; from contributor to translator, from problem-solver to sense-maker.</p><p>This transition usually begins with three intertwined shifts.</p><h3><strong>1. From Precision to Perception</strong></h3><p>Precision builds systems; perception builds alignment.</p><p>The technically minded professional knows how things <em>should</em> work.</p><p>The strategically minded leader also senses <em>what the organization is ready to hear</em>.</p><p>Strategic perception means reading the room &#8212; noticing who needs confidence, who needs clarity, and when to stop explaining because the decision is already emotionally made.</p><p>Influence grows not from winning every argument but from understanding which ones actually shape momentum.</p><h3><strong>2. From Output to Outcome</strong></h3><p>At advanced stages of technical careers, success is no longer measured by <em>how much</em> is built but by <em>what it enables</em>.</p><p>The most respected strategic leaders speak the language of outcomes: customer retention, revenue protection, cost avoidance, market resilience.</p><p>They reframe metrics from &#8220;system uptime&#8221; to &#8220;business continuity,&#8221; from &#8220;algorithm accuracy&#8221; to &#8220;decision quality.&#8221;</p><p>When technical work is expressed through outcomes, it gains executive gravity.</p><h3><strong>3. From Isolation to Integration</strong></h3><p>Strategic influence comes from building connective tissue across the enterprise.</p><p>When technologists learn to integrate their work with marketing narratives, finance models, or customer journeys, they become translators of value.</p><p>Their ideas stop being &#8220;engineering initiatives&#8221; and start being &#8220;organizational levers.&#8221;</p><p>The result isn&#8217;t dilution &#8212; it&#8217;s amplification.</p><p>The same technical brilliance, viewed through a strategic lens, becomes exponentially more influential.</p><h2><strong>Building Influence Without Losing Technical Integrity</strong></h2><p>A common fear among deep technical professionals is that becoming more strategic will somehow make them <em>less technical</em> &#8212; that communicating simply or talking about business value equates to &#8220;dumbing down.&#8221;</p><p>In reality, it&#8217;s the opposite.</p><p>Strategic communicators <strong>elevate</strong> their technical work by revealing its meaning to those who fund, prioritize, and scale it.</p><p>They don&#8217;t abandon depth; they decide <em>how much</em> of that depth each audience actually needs.</p><p>Some practical ways this shows up:</p><ul><li><p><strong>Tell the story of impact.</strong> Replace data dumps with narratives: the problem, the tension, the change achieved.</p></li><li><p><strong>Use visuals for clarity, not complexity.</strong> Architecture diagrams should guide decision-making, not prove sophistication.</p></li><li><p><strong>Practice executive brevity.</strong> Start with the conclusion; then, if invited, unpack the reasoning.</p></li><li><p><strong>Translate metrics into business equivalents.</strong> Latency becomes customer experience; data-pipeline reliability becomes revenue assurance.</p></li><li><p><strong>Share ownership of ideas.</strong> Invite non-technical colleagues into design conversations early; co-creation builds advocacy.</p></li></ul><p>These habits turn technical precision into organizational language.</p><p>Over time, the person who once &#8220;built the system&#8221; becomes the person trusted to <strong>shape where the system should go next</strong>.</p><h2><strong>The Path Forward</strong></h2><p>The gap between technical brilliance and strategic influence isn&#8217;t a flaw in ability &#8212; it&#8217;s a predictable stage in professional evolution.</p><p>Most organizations unintentionally create it by rewarding depth early and expecting breadth later, often without guidance on how to cross the bridge.</p><p>Those who do make the transition discover something surprising: they don&#8217;t lose their edge; they gain <em>range.</em></p><p>They stop being the smartest person in the meeting and start being the one who can make <em>everyone else</em> smarter.</p><p>They move from being experts in technology to becoming <strong>architects of understanding</strong> &#8212; individuals who can translate complexity into clarity, and clarity into action.</p><p>The world needs more of these translators.</p><p>Because the future of technology-driven organizations depends not only on how well systems perform but on how effectively people align around their potential.</p><h3><strong>A Gentle Invitation</strong></h3><p>If this reflection resonates and  if you recognize parts of yourself in these patterns and are curious about what deliberate evolution might look like,  consider subscribing to my writing by clicking the button below. </p><p>That&#8217;s where I write more deeply about the craft of transforming technical excellence into strategic impact, about how influence really grows inside organizations, and about the quiet mindset shifts that turn brilliant experts into trusted partners in shaping direction.</p><p>I also occasionally email useful information to my subscribers not shared elsewhere.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.thefractal.co/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 The Fractal! 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>Your technical mastery doesn&#8217;t need to shrink for your influence to grow. It just needs to speak a language the organization can hear.</em></p><p>Until next time,</p><p>Vijay </p><p>PS. If you really liked this, please consider sharing with a friend you think might find this of value. I would really appreciate that!</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.thefractal.co/?utm_source=substack&amp;utm_medium=email&amp;utm_content=share&amp;action=share&quot;,&quot;text&quot;:&quot;Share The Fractal&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://www.thefractal.co/?utm_source=substack&amp;utm_medium=email&amp;utm_content=share&amp;action=share"><span>Share The Fractal</span></a></p><p></p>]]></content:encoded></item><item><title><![CDATA[The One Skill You Need To Develop In Order To Be Great At Working With Data (That no one talks about!)]]></title><description><![CDATA[Critical skills every data professional should have.]]></description><link>https://www.thefractal.co/p/the-one-skill-you-need-to-develop</link><guid isPermaLink="false">https://www.thefractal.co/p/the-one-skill-you-need-to-develop</guid><dc:creator><![CDATA[Vijay Reddiar]]></dc:creator><pubDate>Sat, 04 Jan 2025 17:09:52 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!gCXr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33b72710-9177-4224-bbbf-64cf1ebb117b_1200x675.heic" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gCXr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33b72710-9177-4224-bbbf-64cf1ebb117b_1200x675.heic" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gCXr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33b72710-9177-4224-bbbf-64cf1ebb117b_1200x675.heic 424w, https://substackcdn.com/image/fetch/$s_!gCXr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33b72710-9177-4224-bbbf-64cf1ebb117b_1200x675.heic 848w, https://substackcdn.com/image/fetch/$s_!gCXr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33b72710-9177-4224-bbbf-64cf1ebb117b_1200x675.heic 1272w, https://substackcdn.com/image/fetch/$s_!gCXr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33b72710-9177-4224-bbbf-64cf1ebb117b_1200x675.heic 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gCXr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33b72710-9177-4224-bbbf-64cf1ebb117b_1200x675.heic" width="1200" height="675" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/33b72710-9177-4224-bbbf-64cf1ebb117b_1200x675.heic&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:675,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:99406,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/heic&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_!gCXr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33b72710-9177-4224-bbbf-64cf1ebb117b_1200x675.heic 424w, https://substackcdn.com/image/fetch/$s_!gCXr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33b72710-9177-4224-bbbf-64cf1ebb117b_1200x675.heic 848w, https://substackcdn.com/image/fetch/$s_!gCXr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33b72710-9177-4224-bbbf-64cf1ebb117b_1200x675.heic 1272w, https://substackcdn.com/image/fetch/$s_!gCXr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F33b72710-9177-4224-bbbf-64cf1ebb117b_1200x675.heic 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>Remember when "I Googled it" became our universal response to any question? Now, with ChatGPT and other Large Language Models (LLMs) in a close horse-race to become the Master who 'knows it all' , that phrase seems to be slowly evaporating from our vocabulary &#8211; like water droplets imperceptibly leaving an ocean. While Google isn't disappearing anytime soon, our approach to information seeking is undergoing a fascinating transformation.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.thefractal.co/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 The Fractal! 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>Ironically, as research for this post, I took the traditional route. I googled "data skills" to see what the well-SEO'd, "authoritative" sources would reveal about the essential skills for data science. Surprisingly, across several pages of results, I couldn't find a single mention of what I consider the most crucial skill:</p><p><strong>Analytical Thinking.</strong></p><p>You might ask, "What exactly is analytical thinking?" Let me explain: Analytical thinking is a multi-dimensional convergence of skills that combines different competencies to optimize (mathematically speaking) the most efficacious answer to the most consequential problem.</p><p>While this might sound obvious, there are several non-obvious challenges in data science (more broadly - pattern recognition; data science is inherently pattern recognition) where analytical thinking proves essential:</p><p><strong>The missing "Meta" of the Problem</strong></p><p>In business settings, we often tackle problems that are either nuanced or remarkably different from what we should be addressing. Why? Because we're missing the crucial context, origin, and ethos surrounding the problem. Each of these elements is vital (I'll delve deeper into these aspects in future posts).</p><p><strong>The Toolbox "Friction"</strong></p><p>Many of us develop a bias toward tools we've mastered, creating resistance to learning new approaches that might offer different perspectives. What we need is a heuristic map &#8211; similar to how emergency rooms have standard operating procedures for various scenarios. While medicine is a science, the ER's intervention process is a combination of science and art. Science as in algorithms making data driven decisions in critical cases such as trauma, cardic arrest, stroke. Art as in human judgment using their experience and intuition to apply pattern recognition and making fast decisions in the most ambiguous situations. ERs don't have a toolbox friction, the cost of that friction is too high. The cost of that friction is a human life. I would argue, these ER doctors would be the savviest analytical thinkers through their gruelling training. Most other places, we are afforded to carry this friction with us, as the cost equation is entirely different, or perceived to be non-consequential, which unfortunately is not true.</p><p><strong>Bringing Guns to a Stick Fight</strong></p><p>Sometimes simple is not only better. Simple is the only viable answer. Just because a complex answer can be built, doesn't mean it is the right answer. I mentioned ethos earlier. Depending on the industry, domain and yes, even organization, data-centricity culture plays a huge role in how we go about producing meaningful data-driven capabilities. This is compounded by what I call a 'Desire for complexity' bias. A lot of us data science professionals go through reasonably complex graduate math materials. There is a need to resist the urge to wield the laser gun in a stick fight.</p><p>There are more of these types of issues require the development of Analytical Thinking skills. And that is fundamental to success in data science and data analytics careers.</p><p></p><p>If you're:</p><ul><li><p>Aspiring to build a career in Artificial Intelligence and Machine Learning</p></li><li><p>Curious about applying pattern recognition skills in various areas of life, or simply want to stoke your curiosity.</p></li></ul><p>Follow me here</p><p><a href="https://www.thefractal.co/">Substack</a>, <a href="https://www.linkedin.com/in/vijayreddiar">LinkedIn</a>, <a href="https://x.com/ReddiarVijay?source=user_about----------------------597df75ea80f---------------">Twitter</a></p><p></p><p>I'll be sharing detailed insights on developing these crucial analytical thinking skills in future posts.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.thefractal.co/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 The Fractal! 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><item><title><![CDATA[Reverse sentiment based ranking classification from Amazon product reviews]]></title><description><![CDATA[This article describes how amazon reviews can be interpreted and classified back into a low or high rank using a bag of words vectorization approach to generate sentiment based on the comment or review left by the buyer.]]></description><link>https://www.thefractal.co/p/reverse-sentiment-based-ranking-classification-from-amazon-product-reviews-6607d8d12a68</link><guid isPermaLink="false">https://www.thefractal.co/p/reverse-sentiment-based-ranking-classification-from-amazon-product-reviews-6607d8d12a68</guid><dc:creator><![CDATA[Vijay Reddiar]]></dc:creator><pubDate>Fri, 09 Jun 2023 04:18:43 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/07b11a18-0955-4e17-b8ee-428c4939773a_800x533.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jVAc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3b58c15-850b-4e5e-9baf-5cf6d268d41d_800x533.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jVAc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3b58c15-850b-4e5e-9baf-5cf6d268d41d_800x533.png 424w, https://substackcdn.com/image/fetch/$s_!jVAc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3b58c15-850b-4e5e-9baf-5cf6d268d41d_800x533.png 848w, https://substackcdn.com/image/fetch/$s_!jVAc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3b58c15-850b-4e5e-9baf-5cf6d268d41d_800x533.png 1272w, https://substackcdn.com/image/fetch/$s_!jVAc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3b58c15-850b-4e5e-9baf-5cf6d268d41d_800x533.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jVAc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3b58c15-850b-4e5e-9baf-5cf6d268d41d_800x533.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e3b58c15-850b-4e5e-9baf-5cf6d268d41d_800x533.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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;: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_!jVAc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3b58c15-850b-4e5e-9baf-5cf6d268d41d_800x533.png 424w, https://substackcdn.com/image/fetch/$s_!jVAc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3b58c15-850b-4e5e-9baf-5cf6d268d41d_800x533.png 848w, https://substackcdn.com/image/fetch/$s_!jVAc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3b58c15-850b-4e5e-9baf-5cf6d268d41d_800x533.png 1272w, https://substackcdn.com/image/fetch/$s_!jVAc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3b58c15-850b-4e5e-9baf-5cf6d268d41d_800x533.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>This article describes how amazon reviews can be interpreted and classified back into a low or high rank using a bag of words vectorization approach to generate sentiment based on the comment or review left by the&nbsp;buyer.</p><p>We perform analysis of comments submitted by buyers of a specific product on Amazon.com and applying NLP techniques to the reviews combined with overall score (1 to 5) as provided by the&nbsp;buyer.</p><p>For the purpose of this analysis, a single product referenced by ASIN (Amazon Standard Identification Number), akin to SKU on a retail outlet floor was used. This product name as sold on Amazon is &#8220;AcuRite 00613 Digital Hygrometer &amp; Indoor Thermometer Pre-Calibrated Humidity&nbsp;Gauge&#8221;.</p><p>At the time of this analysis, it retailed for less than $15, under product category of &#8220;Industrial &amp; Scientific&#8221;. And, there were 21K ratings viewable on amazon.com. The dataset that is used from an archive obtained for this project has 1,229 reviews for this product specifically, along with the detailed text review as well as product&nbsp;rating.</p><p>The objective of this analyis is to predict what rating might the user provide based on the sentiment expressed in the comments. As Amazon ratings are on a 1 to 5 scale, for sake of simplicity, this 5-class problem was created as a 2-class problem by combining ratings {1,2,3} into &#8220;Low&#8221; rating, and, ratings {4,5} into &#8220;High&#8221;&nbsp;rating.</p><p><strong>How natural language processing is applied in this analysis:</strong></p><p>There are three main steps in this analysis.</p><p>(1) Data acquisition and pre-processing of the text&nbsp;data.</p><p>(2) Vectorizing the data using bag of&nbsp;words.</p><p>(3) Applying Na&#239;ve Bayes&#8217; classifier on this vectorized text data to create a predictive model that takes a comment and predicts the user sentiment as Low or&nbsp;High.</p><p><strong>A preview of model&nbsp;results</strong></p><p>The classifier is highly accurate in predicting both &#8220;High&#8221; and &#8220;Low&#8221; ratings, with a F1-score of 0.96 &amp; 0.97 for each class respectively. On inspecting the actual comments, we can see that the predictor did a good job of attributing sentiments such as &#8220;works really good&#8221;, &#8220;works as advertised&#8221;, &#8220;awesome addition&#8221; to a <em>High </em>rating, and attributing sentiments such as &#8220;why bother with reviews&#8221;, &#8220;way off&#8221;, &#8220;worked fine for a month, but&#8221; to a <em>Low </em>rating. Though you will see the way the model in this analysis actually works is not by inferring the sentiment based on sequence of words as described above in quotes, but rather on the count of words.&nbsp;M</p><p>We close this analysis with some limitations and improvements (and if you guessed <em>Transformers </em>as options&#8202;&#8212;&#8202;you are right!). So, let&#8217;s&nbsp;review:</p><p><strong>Step 1: Data Acquisition and Preparation</strong></p><p>The data used for this analysis is different from a standard &#8220;corpora&#8221; dataset in that the original data owned and tracked by Amazon.com is stored as a tabular data with 12 attributes. Of interest to this analysis are only few attributes that were retained. It includes the following:</p><p>&#183; reviewText&#8202;&#8212;&#8202;The actual text comments entered by a&nbsp;buyer</p><p>&#183; summaryStr&#8202;&#8212;&#8202;Summary of the comments as provied by the&nbsp;buyer</p><p>&#183; overall&#8202;&#8212;&#8202;The original rating on a 1&#8211;5&nbsp;scale.</p><p>&#183; ASIN&#8202;&#8212;&#8202;This is the unique ID for a product as noted&nbsp;earlier.</p><p>The data used for this analysis was obtained from an archive on ucsd.edu domain. The original file is in JSON format and has 77,071&nbsp;reviews.</p><p>As the original file obtained for the analysis had ratings and comments for a number of products under the category of &#8220;Industrial &amp; Scientific&#8221;. We picked one specific ASIN (product) on which this analysis could be performed. A group by operation was performed using valuecounts() function to get count of records based on ASIN, and the one with the most records were used for this analysis. The rationale for choosing ASIN with highest number of records was so that we could work with a reasonably larger number of records to train and test the classifier. The finally processed dataset was of the shape 1229 x 4. The 4 members in the DataFrame are of &#8220;object&#8221; type, and therefore need to be typecasted into string (for review) and int (for rating)&nbsp;formats.</p><pre><code>from urllib.request import urlopen
from nltk.corpus import stopwords
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.naive_bayes import MultinomialNB
from sklearn.metrics import classification_report
from sklearn.model_selection import train_test_split
from sklearn.pipeline import Pipeline
from sklearn.metrics import confusion_matrix
import nltk
import os
import json
import gzip
import pandas as pd
import wget
import matplotlib.pyplot as plt
import seaborn as sns
import string</code></pre><pre><code>url="http://deepyeti.ucsd.edu/jianmo/amazon/categoryFilesSmall/Industrial_and_Scientific_5.json.gz"
textfile=wget.download(url)

data = []
with gzip.open(textfile) as f:
    for l in f:
        data.append(json.loads(l.strip()))
    
# total length of list, this number equals total number of products
print(len(data))

# first row of the list
print(data[0])


#quick review of data structures - list, df
df = pd.DataFrame.from_dict(data) #convert dictionary  to dataframe

#check length of dataframe
print(len(df))

#check content of first record
df.iloc[0]
      
#check comments of first record
df.reviewText.iloc[0]

#check summary stats of the dataframe
df.asin.describe()

#alternative way to find the most frequently occuring ASIN to identify candidate product for analysis
df['asin'].value_counts() #shows B0013BKDO8  has the most ratings

asindf=df[df['asin']=='B0013BKDO8'] # keep product of interest

#check shape of new df
asindf.shape #reduced to a single ASIN as above.

asindf=asindf[['asin','overall','reviewText','summary']] # keep four cols</code></pre><p><strong>Basic Exploratory Data&nbsp;Analysis</strong></p><p>Here is a quick view of what this datset looks like. The last column called newrating was created by additional data processing described below.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_wzX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe26ac8be-988d-427f-90ca-4867ec914c18_624x123.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_wzX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe26ac8be-988d-427f-90ca-4867ec914c18_624x123.png 424w, https://substackcdn.com/image/fetch/$s_!_wzX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe26ac8be-988d-427f-90ca-4867ec914c18_624x123.png 848w, https://substackcdn.com/image/fetch/$s_!_wzX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe26ac8be-988d-427f-90ca-4867ec914c18_624x123.png 1272w, https://substackcdn.com/image/fetch/$s_!_wzX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe26ac8be-988d-427f-90ca-4867ec914c18_624x123.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_wzX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe26ac8be-988d-427f-90ca-4867ec914c18_624x123.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e26ac8be-988d-427f-90ca-4867ec914c18_624x123.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!_wzX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe26ac8be-988d-427f-90ca-4867ec914c18_624x123.png 424w, https://substackcdn.com/image/fetch/$s_!_wzX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe26ac8be-988d-427f-90ca-4867ec914c18_624x123.png 848w, https://substackcdn.com/image/fetch/$s_!_wzX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe26ac8be-988d-427f-90ca-4867ec914c18_624x123.png 1272w, https://substackcdn.com/image/fetch/$s_!_wzX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe26ac8be-988d-427f-90ca-4867ec914c18_624x123.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Sample data showing original rating and new&nbsp;rating</figcaption></figure></div><p>There are only four variables originally retained, so EDA is quite quick to do. First, let&#8217;s see textLength.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2Zbt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F826d0a8d-066e-4f57-8c84-c7709a1555cd_867x871.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2Zbt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F826d0a8d-066e-4f57-8c84-c7709a1555cd_867x871.png 424w, https://substackcdn.com/image/fetch/$s_!2Zbt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F826d0a8d-066e-4f57-8c84-c7709a1555cd_867x871.png 848w, https://substackcdn.com/image/fetch/$s_!2Zbt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F826d0a8d-066e-4f57-8c84-c7709a1555cd_867x871.png 1272w, https://substackcdn.com/image/fetch/$s_!2Zbt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F826d0a8d-066e-4f57-8c84-c7709a1555cd_867x871.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2Zbt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F826d0a8d-066e-4f57-8c84-c7709a1555cd_867x871.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/826d0a8d-066e-4f57-8c84-c7709a1555cd_867x871.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!2Zbt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F826d0a8d-066e-4f57-8c84-c7709a1555cd_867x871.png 424w, https://substackcdn.com/image/fetch/$s_!2Zbt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F826d0a8d-066e-4f57-8c84-c7709a1555cd_867x871.png 848w, https://substackcdn.com/image/fetch/$s_!2Zbt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F826d0a8d-066e-4f57-8c84-c7709a1555cd_867x871.png 1272w, https://substackcdn.com/image/fetch/$s_!2Zbt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F826d0a8d-066e-4f57-8c84-c7709a1555cd_867x871.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Distribution of length of text showing buyer&nbsp;feedback</figcaption></figure></div><p>The above chart shows the distribution of the length of the text comments buyers provide in addition to their ratings. And this is what the distribution looks like. Average length of the string is 153 chars with a standard deviation of 239. This is a highly skewed distribution.</p><pre><code>import klib as kl
kl.dist_plot(finaldf.textLength)</code></pre><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!88Tc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9702d83e-044c-41ac-b836-65dc0a08ad04_1024x199.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!88Tc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9702d83e-044c-41ac-b836-65dc0a08ad04_1024x199.png 424w, https://substackcdn.com/image/fetch/$s_!88Tc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9702d83e-044c-41ac-b836-65dc0a08ad04_1024x199.png 848w, https://substackcdn.com/image/fetch/$s_!88Tc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9702d83e-044c-41ac-b836-65dc0a08ad04_1024x199.png 1272w, https://substackcdn.com/image/fetch/$s_!88Tc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9702d83e-044c-41ac-b836-65dc0a08ad04_1024x199.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!88Tc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9702d83e-044c-41ac-b836-65dc0a08ad04_1024x199.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9702d83e-044c-41ac-b836-65dc0a08ad04_1024x199.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!88Tc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9702d83e-044c-41ac-b836-65dc0a08ad04_1024x199.png 424w, https://substackcdn.com/image/fetch/$s_!88Tc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9702d83e-044c-41ac-b836-65dc0a08ad04_1024x199.png 848w, https://substackcdn.com/image/fetch/$s_!88Tc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9702d83e-044c-41ac-b836-65dc0a08ad04_1024x199.png 1272w, https://substackcdn.com/image/fetch/$s_!88Tc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9702d83e-044c-41ac-b836-65dc0a08ad04_1024x199.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Distribution of text length aross all the&nbsp;ratings</figcaption></figure></div><p>Interestingly, longer text is associated with higher ratings as seen in this box&nbsp;plot.</p><pre><code>plt.figure(figsize=(15, 5))
sns.boxplot(data=finaldf, x="rating", y="textLength")</code></pre><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!z0r0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde0c8868-b1bb-42e6-965b-131f154d40d0_1024x361.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!z0r0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde0c8868-b1bb-42e6-965b-131f154d40d0_1024x361.png 424w, https://substackcdn.com/image/fetch/$s_!z0r0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde0c8868-b1bb-42e6-965b-131f154d40d0_1024x361.png 848w, https://substackcdn.com/image/fetch/$s_!z0r0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde0c8868-b1bb-42e6-965b-131f154d40d0_1024x361.png 1272w, https://substackcdn.com/image/fetch/$s_!z0r0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde0c8868-b1bb-42e6-965b-131f154d40d0_1024x361.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!z0r0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde0c8868-b1bb-42e6-965b-131f154d40d0_1024x361.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/de0c8868-b1bb-42e6-965b-131f154d40d0_1024x361.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!z0r0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde0c8868-b1bb-42e6-965b-131f154d40d0_1024x361.png 424w, https://substackcdn.com/image/fetch/$s_!z0r0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde0c8868-b1bb-42e6-965b-131f154d40d0_1024x361.png 848w, https://substackcdn.com/image/fetch/$s_!z0r0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde0c8868-b1bb-42e6-965b-131f154d40d0_1024x361.png 1272w, https://substackcdn.com/image/fetch/$s_!z0r0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde0c8868-b1bb-42e6-965b-131f154d40d0_1024x361.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Distribution of text length by individual ratings.</figcaption></figure></div><p>Next, we&#8217;ll see the&nbsp;rating.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sa88!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7f53850-fc1c-4b39-bbfe-bef81415cd9e_875x507.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sa88!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7f53850-fc1c-4b39-bbfe-bef81415cd9e_875x507.png 424w, https://substackcdn.com/image/fetch/$s_!sa88!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7f53850-fc1c-4b39-bbfe-bef81415cd9e_875x507.png 848w, https://substackcdn.com/image/fetch/$s_!sa88!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7f53850-fc1c-4b39-bbfe-bef81415cd9e_875x507.png 1272w, https://substackcdn.com/image/fetch/$s_!sa88!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7f53850-fc1c-4b39-bbfe-bef81415cd9e_875x507.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sa88!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7f53850-fc1c-4b39-bbfe-bef81415cd9e_875x507.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e7f53850-fc1c-4b39-bbfe-bef81415cd9e_875x507.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!sa88!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7f53850-fc1c-4b39-bbfe-bef81415cd9e_875x507.png 424w, https://substackcdn.com/image/fetch/$s_!sa88!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7f53850-fc1c-4b39-bbfe-bef81415cd9e_875x507.png 848w, https://substackcdn.com/image/fetch/$s_!sa88!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7f53850-fc1c-4b39-bbfe-bef81415cd9e_875x507.png 1272w, https://substackcdn.com/image/fetch/$s_!sa88!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7f53850-fc1c-4b39-bbfe-bef81415cd9e_875x507.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Distribution of buyer rating on the&nbsp;product.</figcaption></figure></div><p>This is an interesting observation, ratings are heavily skewed towards 5, then followed by 4. This must be one of those really well performing products for most buyers. I certainly can vouch for that that because I own one of this, and it is always by my bedstand. Here is the picture of the device I bought many years ago (still working&nbsp;well!)</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aAa9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e6a0dd8-2564-40cc-bff7-a65c80a783a0_1024x768.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aAa9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e6a0dd8-2564-40cc-bff7-a65c80a783a0_1024x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!aAa9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e6a0dd8-2564-40cc-bff7-a65c80a783a0_1024x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!aAa9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e6a0dd8-2564-40cc-bff7-a65c80a783a0_1024x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!aAa9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e6a0dd8-2564-40cc-bff7-a65c80a783a0_1024x768.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aAa9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e6a0dd8-2564-40cc-bff7-a65c80a783a0_1024x768.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9e6a0dd8-2564-40cc-bff7-a65c80a783a0_1024x768.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!aAa9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e6a0dd8-2564-40cc-bff7-a65c80a783a0_1024x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!aAa9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e6a0dd8-2564-40cc-bff7-a65c80a783a0_1024x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!aAa9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e6a0dd8-2564-40cc-bff7-a65c80a783a0_1024x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!aAa9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e6a0dd8-2564-40cc-bff7-a65c80a783a0_1024x768.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Acurite humidity and temperature monitor (sold on Amazon.com)</figcaption></figure></div><p>The correlation of text length to rating is very low (0.18). As we can also see beow there is hardly anything discernable about the impact of comment length to the 5 separate&nbsp;ratings.</p><p>We binarize the ratings with a new attribute called <strong>newrating</strong>, which has two values {Low, High}. Ratings 1,2,3 are binned under Low. Ratings 4,5 are binned under&nbsp;High.</p><pre><code># derive new rating
def set_new_rating (row):
   if row['rating'] == 1 :
      return 'Low'
   if row['rating'] == 2 :
      return 'Low'
   if row['rating'] ==3 :
      return 'Low'
   if row['rating'] ==4 :
      return 'High'
   return 'High'


finaldf['newrating'] = finaldf.apply(set_new_rating, axis=1)</code></pre><p><strong>Step 2: Text Pre-processing for natural language processing</strong></p><p>There are a few key elements that are being used for text preprocessing. We do the following steps:</p><p>a. removing punctuations by reading comments.</p><p>b. removing English stopwords.</p><p>c. returning a list of clean tokenized words.</p><p>The reviewText before and after this processing appears as shown&nbsp;below:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PkhZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39d3b441-dfcd-4606-90d9-606d12ec3151_643x129.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PkhZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39d3b441-dfcd-4606-90d9-606d12ec3151_643x129.png 424w, https://substackcdn.com/image/fetch/$s_!PkhZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39d3b441-dfcd-4606-90d9-606d12ec3151_643x129.png 848w, https://substackcdn.com/image/fetch/$s_!PkhZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39d3b441-dfcd-4606-90d9-606d12ec3151_643x129.png 1272w, https://substackcdn.com/image/fetch/$s_!PkhZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39d3b441-dfcd-4606-90d9-606d12ec3151_643x129.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PkhZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39d3b441-dfcd-4606-90d9-606d12ec3151_643x129.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/39d3b441-dfcd-4606-90d9-606d12ec3151_643x129.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!PkhZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39d3b441-dfcd-4606-90d9-606d12ec3151_643x129.png 424w, https://substackcdn.com/image/fetch/$s_!PkhZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39d3b441-dfcd-4606-90d9-606d12ec3151_643x129.png 848w, https://substackcdn.com/image/fetch/$s_!PkhZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39d3b441-dfcd-4606-90d9-606d12ec3151_643x129.png 1272w, https://substackcdn.com/image/fetch/$s_!PkhZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F39d3b441-dfcd-4606-90d9-606d12ec3151_643x129.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Before and after data processing</figcaption></figure></div><p>Following code block shows the text pre-processing:</p><pre><code>from nltk.tokenize import word_tokenize


def text_processing(varText):
    review = [char for char in varText if char not in string.punctuation]
    review= ''.join(review)
    return [word for word in review.split() if word.lower() not in stopwords.words('english')]</code></pre><p>For removing punctuation, each character is checked against the String.punctuation&#8202;&#8212;&#8202;a constant string that is a property of the string object with a value of &#8216;&#8217;!&#8221;#$%&amp;\&#8217;()*+,-./:;&lt;=&gt;?@[\]^_`{|}~&#8217; <br>Where a match isn&#8217;t found, that character is retained and joined back into a string. Therefore, this string was split again to create words, to then compare against English stopwords imported from NLTK.corpus. Examples of stop words include words that are frequently used in English which typically don&#8217;t carry weight in most text analysis such as &#8220;I&#8221;, &#8220;me&#8221;, &#8220;myself&#8221;, &#8220;we&#8221;, etc. Each reviewText was processed to generate tokens in this&nbsp;manner</p><p>We could have also applied stemming and lemmatization (tokenizing similar words down to a single word e.g. did, doing, done are treated as the same word). This allows similar words to be tagged as the same word allowing for a more precise weight calculation of the presence of such words. It was left out in this exercise, however.</p><p><strong>Vectorization</strong></p><p>Each review is converted as a list of tokens. Each review is now converted as a vector to train the classifier model. We apply bag of words (bow) model to this text. We use Scikit Learn&#8217;s CountVectorizer to convert word in each of the comments into a matrix of token counts (not the token itself&#8202;&#8212;&#8202;since, we already achieved that in the previous step). This allows creating a <strong>vocabulary </strong>of 2,326 words in the dataset and counts occurrence of each word. This same step is applied to individual comments to create a matrix of 1,229 records X 2,326 words. We get a sparse matrix of this dimension with a sparsity index of&nbsp;0.57%.</p><p>An individual record is profiled here for illustration. The 8th reviewers&#8217;s comment in the dataset is as&nbsp;follows.</p><pre><code>import textwrap
reviewer8 = finaldf['reviewTextStr'][7]
print('\n'.join(textwrap.TextWrapper(50).wrap(reviewer8)))</code></pre><pre><code>I love this little unit. It helps me when I am
feeling cold to re-assure me that I indeed don't
need to cut on the heater, and that I just need to
wait for my body heat to normalize to the
environment. Also, it has helped when I
accidentally leave the heater on during a nap. I
can say that, thanks to this unit's Low Temp /
High Temp recording feature, I was able to find
out that I had left the heater on by mistake and
achieved a whopping 95 degrees (F) out of the
space heater.</code></pre><p>The count vectorization code follows below along with a vector representation (truncated for brevity) of reviewer8.</p><pre><code>bow_transformer = CountVectorizer(analyzer=text_processing).fit(finaldf['reviewTextStr'])
# Print total number of vocabulary words
print (len(bow_transformer.vocabulary_))
bow_transformer.vocabulary_ 
</code></pre><p>The vocabulary is the entire list of unique words found in the preprocessed text by the number of occurences. It is easy to see (but not always true) what words might accompany a higher ranking vs a low ranking. Some examples are highlighted in red. Also, this is a single token (single word) count. We are not looking at a n-gram (n word sequence) to evaluate the sentiment. For instance, we notice the word below, &#8220;happy&#8221;, it is currently taken in isolation. The sentiment can easily point in the negative direction and lower the ranking we are trying to derive, if &#8220;happy&#8221;is preceded by the word &#8220;not&#8221;. So that is definitely an improvement that can be made using a bi-gram or n-gram tokenization.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fgqc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F172628c4-8000-423b-8d58-9630f4f2f08a_477x712.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fgqc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F172628c4-8000-423b-8d58-9630f4f2f08a_477x712.png 424w, https://substackcdn.com/image/fetch/$s_!fgqc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F172628c4-8000-423b-8d58-9630f4f2f08a_477x712.png 848w, https://substackcdn.com/image/fetch/$s_!fgqc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F172628c4-8000-423b-8d58-9630f4f2f08a_477x712.png 1272w, https://substackcdn.com/image/fetch/$s_!fgqc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F172628c4-8000-423b-8d58-9630f4f2f08a_477x712.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fgqc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F172628c4-8000-423b-8d58-9630f4f2f08a_477x712.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/172628c4-8000-423b-8d58-9630f4f2f08a_477x712.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!fgqc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F172628c4-8000-423b-8d58-9630f4f2f08a_477x712.png 424w, https://substackcdn.com/image/fetch/$s_!fgqc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F172628c4-8000-423b-8d58-9630f4f2f08a_477x712.png 848w, https://substackcdn.com/image/fetch/$s_!fgqc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F172628c4-8000-423b-8d58-9630f4f2f08a_477x712.png 1272w, https://substackcdn.com/image/fetch/$s_!fgqc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F172628c4-8000-423b-8d58-9630f4f2f08a_477x712.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Count vector of the entire vocabulary (truncated)</figcaption></figure></div><pre><code>bow8 = bow_transformer.transform([reviewer8])
print(bow8)</code></pre><p>This produces forty tokens from the original comment found in reviewer8 record. Some examples are shown&nbsp;below.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!b3r8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96b7319-6e26-4b9d-b20b-f0589c5d3b53_202x190.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!b3r8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96b7319-6e26-4b9d-b20b-f0589c5d3b53_202x190.png 424w, https://substackcdn.com/image/fetch/$s_!b3r8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96b7319-6e26-4b9d-b20b-f0589c5d3b53_202x190.png 848w, https://substackcdn.com/image/fetch/$s_!b3r8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96b7319-6e26-4b9d-b20b-f0589c5d3b53_202x190.png 1272w, https://substackcdn.com/image/fetch/$s_!b3r8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96b7319-6e26-4b9d-b20b-f0589c5d3b53_202x190.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!b3r8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96b7319-6e26-4b9d-b20b-f0589c5d3b53_202x190.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b96b7319-6e26-4b9d-b20b-f0589c5d3b53_202x190.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!b3r8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96b7319-6e26-4b9d-b20b-f0589c5d3b53_202x190.png 424w, https://substackcdn.com/image/fetch/$s_!b3r8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96b7319-6e26-4b9d-b20b-f0589c5d3b53_202x190.png 848w, https://substackcdn.com/image/fetch/$s_!b3r8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96b7319-6e26-4b9d-b20b-f0589c5d3b53_202x190.png 1272w, https://substackcdn.com/image/fetch/$s_!b3r8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96b7319-6e26-4b9d-b20b-f0589c5d3b53_202x190.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Count vector for reviewer8 (truncated)</figcaption></figure></div><pre><code>#check  the English word for the feature in below vectors

print (bow_transformer.get_feature_names_out()[386]) #Temp
print (bow_transformer.get_feature_names_out()[1153]) #heater</code></pre><p>Now that we have generated the vocabulary, we need to establish the entire corpus of preprocessed reviews as a matrix of tokens. Naturally, we expect the number of rows in the matrix to be the same as number of reviews, and the number of columns in the matrix to be the same as the length of vocabulary. This brings us to the shape 1,229 records X 2,326 words, we already established above.</p><p>This is the code to generate the matrix of count&nbsp;vectors.</p><pre><code>comments_bow = bow_transformer.transform(finaldf['reviewTextStr'])
print('Shape of Sparse Matrix: ', comments_bow.shape)
print('Amount of Non-Zero occurences: ', comments_bow.nnz)
print('sparsity: %.2f%%' % (100.0 * comments_bow.nnz / (comments_bow.shape[0] * comments_bow.shape[1])))</code></pre><p>Now that we have laid the numeric ground work much needed for computation, we still have to arrive at a metric that tells us importance of a word relative to another. That is precisely what TFIDF does. TFIDF stands for Term frequency inverse document frequency. It is the product of the two terms&#8202;&#8212;&#8202;Term frequency and Inverse Document Frequency. Term frequency is the ratio of number of times a word occurs in a document (in our case, the entire set of reviews used for this analysis) over the total number of words. So higher the ratio, the more important the term is. Whereas, Inverse Document Frequency is the log of the ratio of total number of documents over number of documents where the term is found. Where does the inverse word come from in IDF? It comes from the idea that this term can also be expressed as the log of the inverse of the ratio of documents where the term is found. It semantically has the same meaning as our first formal definition of IDF. Basically, it&#8217;s like saying x is also the inverse of&nbsp;1/x.</p><p>We check the TFIDF values of some words we think are important.</p><pre><code>tfidf_transformer = TfidfTransformer().fit(comments_bow)

print(tfidf_transformer.idf_[bow_transformer.vocabulary_['recommend']])
print(tfidf_transformer.idf_[bow_transformer.vocabulary_['great']])
print(tfidf_transformer.idf_[bow_transformer.vocabulary_['fantastic']])
print(tfidf_transformer.idf_[bow_transformer.vocabulary_['amazing']])
print(tfidf_transformer.idf_[bow_transformer.vocabulary_['love']])
print(tfidf_transformer.idf_[bow_transformer.vocabulary_['bad']])
comments_tfidf = tfidf_transformer.transform(comments_bow)
</code></pre><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-dVL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d046da0-ae20-4ed2-9abc-c41b5e119b34_483x153.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-dVL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d046da0-ae20-4ed2-9abc-c41b5e119b34_483x153.png 424w, https://substackcdn.com/image/fetch/$s_!-dVL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d046da0-ae20-4ed2-9abc-c41b5e119b34_483x153.png 848w, https://substackcdn.com/image/fetch/$s_!-dVL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d046da0-ae20-4ed2-9abc-c41b5e119b34_483x153.png 1272w, https://substackcdn.com/image/fetch/$s_!-dVL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d046da0-ae20-4ed2-9abc-c41b5e119b34_483x153.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-dVL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d046da0-ae20-4ed2-9abc-c41b5e119b34_483x153.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4d046da0-ae20-4ed2-9abc-c41b5e119b34_483x153.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!-dVL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d046da0-ae20-4ed2-9abc-c41b5e119b34_483x153.png 424w, https://substackcdn.com/image/fetch/$s_!-dVL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d046da0-ae20-4ed2-9abc-c41b5e119b34_483x153.png 848w, https://substackcdn.com/image/fetch/$s_!-dVL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d046da0-ae20-4ed2-9abc-c41b5e119b34_483x153.png 1272w, https://substackcdn.com/image/fetch/$s_!-dVL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d046da0-ae20-4ed2-9abc-c41b5e119b34_483x153.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">TFIDF values of some illustrative &#8220;sentiment expressing&#8221; words</figcaption></figure></div><p>Recall, our goal was to take all the text ratings and see if we can classify them into a high or low ranking. So, for that we check the distribution of our derived rating from the newrating field.</p><pre><code>newaxisvals = finaldf['newrating'].value_counts()
plt.figure(figsize=(30, 10))
plt.subplot(131)
plt.bar(newaxisvals.index,newaxisvals.values)
plt.xticks(fontsize=18)
plt.yticks(fontsize=18)
plt.show()</code></pre><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Sn_G!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1148a922-f2b6-4b8a-b0b6-d61e665aa50e_350x475.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Sn_G!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1148a922-f2b6-4b8a-b0b6-d61e665aa50e_350x475.png 424w, https://substackcdn.com/image/fetch/$s_!Sn_G!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1148a922-f2b6-4b8a-b0b6-d61e665aa50e_350x475.png 848w, https://substackcdn.com/image/fetch/$s_!Sn_G!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1148a922-f2b6-4b8a-b0b6-d61e665aa50e_350x475.png 1272w, https://substackcdn.com/image/fetch/$s_!Sn_G!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1148a922-f2b6-4b8a-b0b6-d61e665aa50e_350x475.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Sn_G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1148a922-f2b6-4b8a-b0b6-d61e665aa50e_350x475.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1148a922-f2b6-4b8a-b0b6-d61e665aa50e_350x475.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!Sn_G!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1148a922-f2b6-4b8a-b0b6-d61e665aa50e_350x475.png 424w, https://substackcdn.com/image/fetch/$s_!Sn_G!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1148a922-f2b6-4b8a-b0b6-d61e665aa50e_350x475.png 848w, https://substackcdn.com/image/fetch/$s_!Sn_G!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1148a922-f2b6-4b8a-b0b6-d61e665aa50e_350x475.png 1272w, https://substackcdn.com/image/fetch/$s_!Sn_G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1148a922-f2b6-4b8a-b0b6-d61e665aa50e_350x475.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Distribution of newly derived ratings (Unbalanced)</figcaption></figure></div><p>This is an unbalanced distribution, which we would have expected based on the distribution of the original ratings we saw in our initial analysis.</p><pre><code>distratio = finaldf['newrating'].value_counts()[0] /  finaldf['newrating'].value_counts()[1] 
print(distratio) # gives a value of 6.68125</code></pre><p>The number of High ranking records is 6x times that of Low ranking. In other words, the ratio of majority class over minority class is 6x. So, before we train a classifier, we need to balance this data. Otherwise, the classifier will have a bias to incorrectly predict ratings with High ranking more than it would for Low&nbsp;ranking.</p><p>We apply random oversampling where the minority class is resampled so that the High and Low rankings are equally distributed. We use RandomOverSampler class to do&nbsp;this.</p><pre><code>from imblearn.over_sampling import RandomOverSampler
oversampler = RandomOverSampler(sampling_strategy='minority', random_state=42)
newx, newy = oversampler.fit_resample(comments_tfidf,finaldf['newrating'])
#when you print newx you will see a sparse matrix of float64 dtype with 2138
#obsevations (upsampled from previously 1229 observations)</code></pre><p>And a quick check shows that the data is now balanced.</p><pre><code>newy.value_counts()
newaxisvals = newy.value_counts()
plt.figure(figsize=(30, 10))
plt.subplot(141)
plt.bar(newaxisvals.index,newaxisvals.values)
plt.xticks(fontsize=18)
plt.yticks(fontsize=18)
plt.show() </code></pre><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vTue!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8176acc-9e81-4790-9c2e-5ae81f698ce2_347x474.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vTue!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8176acc-9e81-4790-9c2e-5ae81f698ce2_347x474.png 424w, https://substackcdn.com/image/fetch/$s_!vTue!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8176acc-9e81-4790-9c2e-5ae81f698ce2_347x474.png 848w, https://substackcdn.com/image/fetch/$s_!vTue!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8176acc-9e81-4790-9c2e-5ae81f698ce2_347x474.png 1272w, https://substackcdn.com/image/fetch/$s_!vTue!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8176acc-9e81-4790-9c2e-5ae81f698ce2_347x474.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vTue!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8176acc-9e81-4790-9c2e-5ae81f698ce2_347x474.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d8176acc-9e81-4790-9c2e-5ae81f698ce2_347x474.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!vTue!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8176acc-9e81-4790-9c2e-5ae81f698ce2_347x474.png 424w, https://substackcdn.com/image/fetch/$s_!vTue!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8176acc-9e81-4790-9c2e-5ae81f698ce2_347x474.png 848w, https://substackcdn.com/image/fetch/$s_!vTue!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8176acc-9e81-4790-9c2e-5ae81f698ce2_347x474.png 1272w, https://substackcdn.com/image/fetch/$s_!vTue!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8176acc-9e81-4790-9c2e-5ae81f698ce2_347x474.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Distribution of newly derived ratings (Balanced) after oversampling</figcaption></figure></div><p>Now that we have the data ready for training the model, we partition it into test and train and then train the model, followed by checking how we fare on predicting by comparing the predicted ranking with actual&nbsp;ranking.</p><p>MultinomialNaiveBayesClassifier is a good model for this work as it takes a sparse matrix as an argument as X, which is exactly what we have setup and takes an array for Y. In our case it is the sentiment (ranking).</p><pre><code>comment_train, comment_test, rating_train, rating_test = train_test_split(newx, newy, test_size=0.3)
rating_detection = MultinomialNB().fit(comment_train, rating_train)
rating_pred = rating_detection.predict(comment_test)
print(classification_report(rating_test, rating_pred))</code></pre><p>We see a pretty good F1 score, which is a harmonic measure of precision and recall combined together as shown in the classification report&nbsp;below.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!W1p0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44635d50-e408-4c77-88d8-8eeb6505ace0_466x176.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!W1p0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44635d50-e408-4c77-88d8-8eeb6505ace0_466x176.png 424w, https://substackcdn.com/image/fetch/$s_!W1p0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44635d50-e408-4c77-88d8-8eeb6505ace0_466x176.png 848w, https://substackcdn.com/image/fetch/$s_!W1p0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44635d50-e408-4c77-88d8-8eeb6505ace0_466x176.png 1272w, https://substackcdn.com/image/fetch/$s_!W1p0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44635d50-e408-4c77-88d8-8eeb6505ace0_466x176.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!W1p0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44635d50-e408-4c77-88d8-8eeb6505ace0_466x176.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/44635d50-e408-4c77-88d8-8eeb6505ace0_466x176.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!W1p0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44635d50-e408-4c77-88d8-8eeb6505ace0_466x176.png 424w, https://substackcdn.com/image/fetch/$s_!W1p0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44635d50-e408-4c77-88d8-8eeb6505ace0_466x176.png 848w, https://substackcdn.com/image/fetch/$s_!W1p0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44635d50-e408-4c77-88d8-8eeb6505ace0_466x176.png 1272w, https://substackcdn.com/image/fetch/$s_!W1p0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44635d50-e408-4c77-88d8-8eeb6505ace0_466x176.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Model evaluation metric for balanced data with NB Classifier</figcaption></figure></div><p>Notice both High Ranking and Low Ranking are predicted equally&nbsp;well.</p><p>It may be worth reiterating the significance of balancing the data. If we don&#8217;t balance the classes, the F1 score for Low Ranking suffers giving us a value of 0.5. If you are interested in seeing if this is true, you might want to run this experiment without the oversampling. Without balancing (6:1 ratio of High:Low ranking in this case), this bias skews the overall accuracy to 0.91 showing the model is highly accurate when in fact it is&nbsp;not.</p><pre><code>#print confusion matrix
cmat = confusion_matrix(rating_test, rating_pred)
plt.figure(figsize=(10,10))
sns.set(font_scale=1.5)
sns.heatmap(cmat.T, square=True, annot=True, fmt='d', cbar=False,
            xticklabels=['High','Low'], yticklabels=['High','Low'])

plt.xlabel('True Rating')
plt.ylabel('Predicted Rating')</code></pre><p>The confusion matrix below shows the true positives, true negatives, false positives and false negatives.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!T6J5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6092a50-5802-4f18-9b87-1203837670c9_498x489.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!T6J5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6092a50-5802-4f18-9b87-1203837670c9_498x489.png 424w, https://substackcdn.com/image/fetch/$s_!T6J5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6092a50-5802-4f18-9b87-1203837670c9_498x489.png 848w, https://substackcdn.com/image/fetch/$s_!T6J5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6092a50-5802-4f18-9b87-1203837670c9_498x489.png 1272w, https://substackcdn.com/image/fetch/$s_!T6J5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6092a50-5802-4f18-9b87-1203837670c9_498x489.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!T6J5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6092a50-5802-4f18-9b87-1203837670c9_498x489.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f6092a50-5802-4f18-9b87-1203837670c9_498x489.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!T6J5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6092a50-5802-4f18-9b87-1203837670c9_498x489.png 424w, https://substackcdn.com/image/fetch/$s_!T6J5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6092a50-5802-4f18-9b87-1203837670c9_498x489.png 848w, https://substackcdn.com/image/fetch/$s_!T6J5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6092a50-5802-4f18-9b87-1203837670c9_498x489.png 1272w, https://substackcdn.com/image/fetch/$s_!T6J5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6092a50-5802-4f18-9b87-1203837670c9_498x489.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h4>Limitations &amp; Improvements</h4><p>There are many improvements that can be done with this experiment. We used word count as the vector for the text representation. This experiment was done for a specific type of niche product among the millions of products sold on Amazon. This specific method of vectorizing using bag of word (BOW) technique introduces sparsity exponentially as more vocabulary is introduced. Which means if there were a lot more reviews, or we open this analysis to a broader array of products, we&#8217;d run into computational issues due to the sparsity. BOW also does not take into account word order and meaning of the word. While this is a simpler technique, it has been extensively used in the past for document and text classification.</p><p>There are better ways to handle text classification. Word embeddings offer a denser representation than what we saw. It is therefore computationally efficient. By combining word embeddings with neural networks different bodies of text such as documents (or in our case reviews) can be classified.</p><p>Lastly, I&#8217;d be remiss to say that Transformers is yet another and newer way to handle text classification. I&#8217;ll cover these in future articles in natural language processing using transformer architectures.</p><p>Until next&nbsp;time!</p><p>References:</p><p><a href="https://nijianmo.github.io/amazon/">Amazon review data</a></p>]]></content:encoded></item><item><title><![CDATA[How to work with Log Linear Models]]></title><description><![CDATA[An approach to applying log linear models (Generalized Linear Models) on categorical data with applications in ecological studies.]]></description><link>https://www.thefractal.co/p/how-to-apply-generalized-linear-models-for-categorical-data-8fea27d59d64</link><guid isPermaLink="false">https://www.thefractal.co/p/how-to-apply-generalized-linear-models-for-categorical-data-8fea27d59d64</guid><dc:creator><![CDATA[Vijay Reddiar]]></dc:creator><pubDate>Mon, 15 May 2023 04:41:18 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/55f47274-df8d-413c-a685-11effe1b0c19_800x533.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QE4Z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81255c27-1ca9-4b01-87f6-cce43f9fd6a5_800x533.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QE4Z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81255c27-1ca9-4b01-87f6-cce43f9fd6a5_800x533.png 424w, https://substackcdn.com/image/fetch/$s_!QE4Z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81255c27-1ca9-4b01-87f6-cce43f9fd6a5_800x533.png 848w, https://substackcdn.com/image/fetch/$s_!QE4Z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81255c27-1ca9-4b01-87f6-cce43f9fd6a5_800x533.png 1272w, https://substackcdn.com/image/fetch/$s_!QE4Z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81255c27-1ca9-4b01-87f6-cce43f9fd6a5_800x533.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QE4Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81255c27-1ca9-4b01-87f6-cce43f9fd6a5_800x533.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/81255c27-1ca9-4b01-87f6-cce43f9fd6a5_800x533.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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;: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_!QE4Z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81255c27-1ca9-4b01-87f6-cce43f9fd6a5_800x533.png 424w, https://substackcdn.com/image/fetch/$s_!QE4Z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81255c27-1ca9-4b01-87f6-cce43f9fd6a5_800x533.png 848w, https://substackcdn.com/image/fetch/$s_!QE4Z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81255c27-1ca9-4b01-87f6-cce43f9fd6a5_800x533.png 1272w, https://substackcdn.com/image/fetch/$s_!QE4Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81255c27-1ca9-4b01-87f6-cce43f9fd6a5_800x533.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><h3>An approach to applying log linear models (Generalized Linear Models) on categorical data with applications in ecological studies.</h3><p>As data science practitioners, we arm ourselves with standard tools in our belt which we tend to put to use when we frame the problem domain to be one of classification or regression problem(for supervised learning), or a clustering problem (for unsupervised learning). These tools give a pretty good mileage for getting results on implementing machine learning solutions when applied to structured data.</p><p>In this article, I discuss a robust modeling tool to work with categorical data: Generalized Linear Model&nbsp;(GLM).</p><p>GLMs are widely used in social sciences, market research, health sciences where categorical scales are predominantly used. In financial services, insurance industry also use GLMs extensively. In market research, for example, a customer preference study done by a market research company on their customer panel between choice of a brand for a shampoo might ask them to state their choice between those made by L&#8217;Oreal, P&amp;G and Unilever. The modeling here is used for identifying how to explain a customer&#8217;s choice or preference based on other variables (aka covariates), each of which is represented further in categorical scales.</p><p><strong>What is categorical data?</strong></p><p>Consider the following examples&nbsp;&#8212;</p><p>Ordered categorical data: A customer service survey showing customer respondes rating the service across choices {poor, ok, excellent}. There is a definite order from low to high in this list of <em>categories.</em></p><p>Unordered categorical data: In a consumer preference study, a demographic variable of where the consumer lives could be a variable. Options may include {urban, suburban, rural.. etc}. There is no concept of order for this&nbsp;option.</p><p>GLMs are great tools to work with when working with studies that require analysis and modeling based on this type of&nbsp;data.</p><p><strong>What is a Generalized Linear&nbsp;Model?</strong></p><p>Before we get into the how, let&#8217;s briefly look at what GLMs&nbsp;are.</p><p>GLMs are a broad set of models that includes linear regression and ANOVA models for continuous data as response variables, as well as models for discrete responses. One such specialized cases of a discrete response model, for binary response is logistic regression model. This modeling technique is used for credit and other risk modeling in financial services as its known for its effectiveness, simplicity and parsimony as it applies to this domain. GLMs also allow for modeling a count (frequency) based response variable.</p><p>A GLM is made of three components &#8212;</p><p>1. A random component (Y) wherein we assume there is a certain probabilistic distribution.</p><p>2. A systematic component which represents the covariates or explanatory variables for the&nbsp;model.</p><p>3. A link function which represents the function of the expected value of Y. And this function allows Y to be expressed as some linear combination of the explanatory variables.</p><p><strong>Modeling and Analysis with&nbsp;GLM</strong></p><p>Next, let&#8217;s look at the analysis and modeling using GLM, along with&nbsp;code.</p><p>In this analysis we use a small dataset from the field of ecology where the day time habitat information of two lizard species&#8202;&#8212;&#8202;Grahami and Opalinus were collected. This data was obtained by observing specific information about habitat locations and the time when it was observed (McCullagh and Nelder,&nbsp;1989).</p><p>Let&#8217;s look at the data to make sure we understand what an entire dataset of cateogorical data type looks&nbsp;like.</p><p>Lizard Species (L): Grahami or Opalinus indicating which species was observed. This is our target variable.</p><p>Illumination (I): indicating whether it was Sun or&nbsp;Shade.</p><p>Perch diameter (D): in inches with following values (aka factors): D&#8804; 2 and D&gt;&nbsp;2.</p><p>Perch height(H): in inches (H) with following values: H&lt;5 and H&#8805;&nbsp;5.</p><p>Time of day (T): also factor variable with three levels: Early, Mid-day and&nbsp;Late.</p><p>As we can see there are no continuous data, all of them are categorical data.</p><p>This modeling was implemented in R. You can implement this in your favorite language including Python. The concept of how to apply categorical data analysis and modeling is the&nbsp;same.</p><p>Let&#8217;s look at the&nbsp;data:</p><pre><code>&gt; lizard.data &lt;-read.table(file = "lizard_data.txt",header = TRUE)
&gt; head(lizard.data)
  Illumination Diameter Height   Time  Species Count
1          Sun      &lt;=2    &lt;=5  Early  Grahami    20
2          Sun      &lt;=2    &lt;=5  Early Opalinus     2
3          Sun      &lt;=2    &lt;=5 Midday  Grahami     8
4          Sun      &lt;=2    &lt;=5 Midday Opalinus     1
5          Sun      &lt;=2    &lt;=5   Late  Grahami     4
6          Sun      &lt;=2    &lt;=5   Late Opalinus     4</code></pre><p>The data is setup in the form of what is called a higher order contingency table. We apply different log linear models on this data. We calculate the effect size, perform best model selection based on AIC. We also perform goodness of fit tests and residual analysis to assess model adequacy.</p><p>The steps taken for this analysis, output and discussion on the model performance are detailed&nbsp;below.</p><p><strong>Fit log-linear models</strong></p><p>Using the lizard data, we first fit three log-linear models including:</p><p>(i) Model of mutual independence,</p><p>(ii) Model of homogeneous association,</p><p>(iii) Model containing all the three-factor interaction terms.</p><pre><code># Create the features from the dataset
I&lt;-factor(lizard.data[,1])
D&lt;-factor(lizard.data[,2])          
H&lt;-factor(lizard.data[,3])
T&lt;-factor(lizard.data[,4])
L&lt;-factor(lizard.data[,5])
Count&lt;-factor(lizard.data[,6])</code></pre><pre><code>library(MASS) #need this package for using loglm 

##create the three models first

#create saturated model
liz.model.sat &lt;- glm(Count ~ I*D*H*T*L, family = poisson, data=lizard.data)
liz.model.sat$formula

#mutual independence
liz.model.mi &lt;- glm(Count ~I+D+H+T+L, family = poisson, data=lizard.data)
summary(liz.model.mi)

#homogeneous association
liz.model.ha &lt;-glm(Count ~ I*D+I*H+I*T+I*L+D*H+D*T+D*L+H*T+H*L+T*L,
                   family = poisson, data=lizard.data)
summary(liz.model.ha)

## then, get LRT stat (deviance, or, g-sq), aic, pearson x-sq, p-value for  model

#mutual independence:
deviance(liz.model.mi) #152.6136 
df.residual(liz.model.mi) # 41
AIC(liz.model.mi) #329.8624
mi.1 &lt;- loglm(Count ~ I + D + H + T + L, data = lizard.data)
x2.mi&lt;-mi.1$pearson
x2.mi  #pearson chi sq is 157.8766
anova(liz.model.mi, liz.model.sat, test = "Chisq")
#p-value is 9.186e-15 ***

#homogenous association
deviance(liz.model.ha)#5.05375 
df.residual(liz.model.ha) # 27
AIC(liz.model.ha) #230.3026
ha.1 &lt;- loglm( Count ~ I * D + I * H + I * T + I * L + D * H + 
                 D * T + D * L + H * T + H * L + T * L, family = poisson, 
               data = lizard.data)
x2.ha&lt;-ha.1$pearson
x2.ha  #pearson chi sq is 20.93927</code></pre><p>We then calculate the goodness of fit using residual deviance, which is the same as the G squared statistic (Goodness of fit), shown in Table 1&nbsp;below.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NADI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc39d444e-c99b-4dbd-a5d5-ea942180f7ab_624x101.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NADI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc39d444e-c99b-4dbd-a5d5-ea942180f7ab_624x101.png 424w, https://substackcdn.com/image/fetch/$s_!NADI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc39d444e-c99b-4dbd-a5d5-ea942180f7ab_624x101.png 848w, https://substackcdn.com/image/fetch/$s_!NADI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc39d444e-c99b-4dbd-a5d5-ea942180f7ab_624x101.png 1272w, https://substackcdn.com/image/fetch/$s_!NADI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc39d444e-c99b-4dbd-a5d5-ea942180f7ab_624x101.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NADI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc39d444e-c99b-4dbd-a5d5-ea942180f7ab_624x101.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c39d444e-c99b-4dbd-a5d5-ea942180f7ab_624x101.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!NADI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc39d444e-c99b-4dbd-a5d5-ea942180f7ab_624x101.png 424w, https://substackcdn.com/image/fetch/$s_!NADI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc39d444e-c99b-4dbd-a5d5-ea942180f7ab_624x101.png 848w, https://substackcdn.com/image/fetch/$s_!NADI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc39d444e-c99b-4dbd-a5d5-ea942180f7ab_624x101.png 1272w, https://substackcdn.com/image/fetch/$s_!NADI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc39d444e-c99b-4dbd-a5d5-ea942180f7ab_624x101.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Table 1: Log-linear models with model representation and residuals</figcaption></figure></div><p><strong>Using AIC to determine best&nbsp;model</strong></p><p>In order to get the goodness of fit, we need a saturated model, a model with df = 0. Unlike (binomial) logistic regression, we cannot solely use AIC because of possible conditional association between two or more terms in a log linear model. We begin the assesment by looking at model selection statistics including goodness of fit (LRT statistic, or deviance), p-value, AIC, Pearson Chi-squared value, and residual degrees of&nbsp;freedom.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!EzQc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ac68f62-bebc-48f8-b14a-690f56dd3f8b_624x132.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!EzQc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ac68f62-bebc-48f8-b14a-690f56dd3f8b_624x132.png 424w, https://substackcdn.com/image/fetch/$s_!EzQc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ac68f62-bebc-48f8-b14a-690f56dd3f8b_624x132.png 848w, https://substackcdn.com/image/fetch/$s_!EzQc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ac68f62-bebc-48f8-b14a-690f56dd3f8b_624x132.png 1272w, https://substackcdn.com/image/fetch/$s_!EzQc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ac68f62-bebc-48f8-b14a-690f56dd3f8b_624x132.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!EzQc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ac68f62-bebc-48f8-b14a-690f56dd3f8b_624x132.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6ac68f62-bebc-48f8-b14a-690f56dd3f8b_624x132.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!EzQc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ac68f62-bebc-48f8-b14a-690f56dd3f8b_624x132.png 424w, https://substackcdn.com/image/fetch/$s_!EzQc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ac68f62-bebc-48f8-b14a-690f56dd3f8b_624x132.png 848w, https://substackcdn.com/image/fetch/$s_!EzQc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ac68f62-bebc-48f8-b14a-690f56dd3f8b_624x132.png 1272w, https://substackcdn.com/image/fetch/$s_!EzQc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ac68f62-bebc-48f8-b14a-690f56dd3f8b_624x132.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Table 2: Goodness of fit tests for different loglinear models for model selection</figcaption></figure></div><p><strong>Adding more complexity to the&nbsp;modeling</strong></p><p>We evaluate the three models created in the previous section that is, single-factor terms, two-factor terms, and, all three-factor terms, and additionally setup a four-factor term based model (code below). Looking at rows 1 to 4 (Table 2), the mutual independence model fits very&nbsp;poorly.</p><pre><code>## create a three factor interaction model, and get diagnostics

liz.model.trif &lt;-glm(Count ~ 
                       I*D*H+I*D*T+I*D*L+I*H*T+I*H*L+I*T*L+D*H*T+D*H*L+D*T*L+H*T*L,
                     family = poisson, data=lizard.data)
summary(liz.model.trif)
deviance(liz.model.trif)#13.23126
df.residual(liz.model.trif) # 11
AIC(liz.model.trif) #250.4801
trif.1 &lt;- loglm( Count ~ I * D * H + I * D * T + I * D * L + I * 
                   H * T + I * H * L + I * T * L + D * H * T + D * H * L + D * 
                   T * L + H * T * L, family = poisson, 
                 data = lizard.data)
x2.trif&lt;-trif.1$pearson
x2.trif  #pearson chi sq is 11.85212

anova(liz.model.trif, liz.model.sat, test = "Chisq")
#p-value is 0.2785</code></pre><pre><code>#create four factor interaction model
liz.model.fourf &lt;- glm(Count ~ I*D*H*T+D*H*T*L,family = poisson, data=lizard.data)
# #Illumination*Species*Height*Time possibly has a zero in cross-class tab, so term removed
summary(liz.model.fourf)
deviance(liz.model.fourf) # 14.63944
df.residual(liz.model.fourf) # 12
AIC(liz.model.fourf) # 249.8883
fourf.1 &lt;- loglm( Count ~ I * D * H * T + D * H * T * L, family = poisson, 
                  data = lizard.data)
x2.fourf&lt;-fourf.1$pearson
x2.fourf  #pearson chi sq is NaN.
anova(liz.model.fourf, liz.model.sat, test = "Chisq")
#p-value is 0.2617</code></pre><p><strong>Pruning too much complexity: Using StepAIC to&nbsp;evaluate</strong></p><p>We need a model that is more complex than the homogeneous association model, but simpler than the three-factor and four-factor interaction term models. In order to get that, we then used <em><strong>StepAIC</strong></em> function by starting with the four-factor to evaluate models with different AIC, We also did the same step with three-factor term model. We picked the models in both cases with lowest AIC in either of them, and then proceeded to remove the redundant terms in each (picking models shown in Rows 5 and 6 in Table&nbsp;2).</p><p>Based on this observation, we select row 6 (D,T,IH,IT,DH,DT,DL,TL,IHL) as the best&nbsp;model.</p><pre><code>## setup multiple models, evaluate each using AIC and goodness of fit 
#use stepAIC to manually select few models that 'appear' good for evaluation.

stepAIC(liz.model.mi) #329.9, residual dev = 152.6
stepAIC(liz.model.ha) #225.7, residual dev = 28.44, 
stepAIC(liz.model.trif)#AIC: 227.4, residual dev =26.1. 
stepAIC(liz.model.fourf)#AIC: 249.9, residual dev=14.64</code></pre><pre><code>##pick the lowest residual models and remove redundant params to fit few models
##and choose one final best model

#model 1
liz.model.besteval.1 &lt;- glm(formula = Count ~ I +  I:H + D:H + I:T + D:T + 
                              + D:L +  T:L + I:H:L+ D:H:T:L,  family = poisson, data = lizard.data)
#I:D:H:T + (fails to converge...so, term removed)
aic1&lt;-AIC(liz.model.besteval.1) 
aic1 #238.254
d1&lt;-deviance(liz.model.besteval.1)  
d1 # 15.00517
df.residual(liz.model.besteval.1) #18

anova(liz.model.besteval.1, liz.model.sat, test = "Chisq") #0.6616
besteval11 &lt;- loglm(Count ~ I  + I:H + D:H + I:T + D:T + 
                      I:L + D:L + H:L + T:L + I:H:L + D:H:T:L,  family = poisson, data = lizard.data)

x2.bestevall11 &lt;-besteval11$pearson
x2.bestevall11 #12.58482

#model 2
liz.model.besteval.2 &lt;- glm(formula = Count ~ D + T +  I:H + D:H + I:T + D:T + 
                              D:L + T:L + I:H:L,  family = poisson, data = lizard.data)
aic2&lt;-AIC(liz.model.besteval.2) 
aic2 #227.3522
d2&lt;-deviance(liz.model.besteval.2)  #26.1033
d2
df.residual(liz.model.besteval.2) #29

anova(liz.model.besteval.2, liz.model.sat, test = "Chisq")#p-value is 0.62
besteval21 &lt;- loglm(Count ~  D +  T + I:H + D:H + I:T + D:T + 
                      + D:L + T:L + I:H:L,  family = poisson, data = lizard.data)

x2.bestevall21 &lt;-besteval21$pearson
x2.bestevall21#25.28304

liz.best=liz.model.besteval.2 #best model.
deviance(liz.best)</code></pre><p><strong>Residual analysis of best&nbsp;model</strong></p><p>Statistics for goodness of fit calculated above show a model that appears to fit to the data reasonably well. It is important that residuals are evaluated at each cell to show the quality of fit. Residual analysis can show that some cells may display lack of fit in a model that otherwise may appear to fit to the data well. We calculate standardized residual using <em><strong>rstandard</strong></em> function, where the observed and fitted counts are divided by their standard errors shown in Table 3&nbsp;below.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!I83H!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93303706-d178-4097-b0b2-01a7cdb7212e_687x316.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!I83H!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93303706-d178-4097-b0b2-01a7cdb7212e_687x316.png 424w, https://substackcdn.com/image/fetch/$s_!I83H!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93303706-d178-4097-b0b2-01a7cdb7212e_687x316.png 848w, https://substackcdn.com/image/fetch/$s_!I83H!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93303706-d178-4097-b0b2-01a7cdb7212e_687x316.png 1272w, https://substackcdn.com/image/fetch/$s_!I83H!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93303706-d178-4097-b0b2-01a7cdb7212e_687x316.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!I83H!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93303706-d178-4097-b0b2-01a7cdb7212e_687x316.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/93303706-d178-4097-b0b2-01a7cdb7212e_687x316.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!I83H!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93303706-d178-4097-b0b2-01a7cdb7212e_687x316.png 424w, https://substackcdn.com/image/fetch/$s_!I83H!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93303706-d178-4097-b0b2-01a7cdb7212e_687x316.png 848w, https://substackcdn.com/image/fetch/$s_!I83H!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93303706-d178-4097-b0b2-01a7cdb7212e_687x316.png 1272w, https://substackcdn.com/image/fetch/$s_!I83H!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93303706-d178-4097-b0b2-01a7cdb7212e_687x316.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Table 3: Residual analysis comparing observed and fitted count using best&nbsp;model</figcaption></figure></div><p>Table 3 output was generated using the following code:</p><pre><code>#get residuals for best model 
pred.best&lt;-fitted(liz.best)
infl&lt;-influence.measures(liz.best)  #residual diagnostics
influencePlot(liz.best) 
influenceIndexPlot(liz.best)
std.resid&lt;-rstandard(liz.best, type = "pearson") # standardized resid
likeli.resid&lt;-rstudent(liz.best, type = "pearson") #likelihood resid
liz.resid&lt;-data.frame(I,D,H,T,L,Count, pred.best, std.resid, likeli.resid)
write.csv(file="lizard_residuals_pearson.csv", liz.resid)</code></pre><p>We perform several checks on the model including <em><strong>influencePlot</strong></em>. Figure below shows a few observations as outliers. A studentized residual value greater than equal to 2 or less than or equal to -2 is considered an outlier. We see two cells, a total of 5 count of lizards as outlier. The size of the bubble indicates measure of the influence of the observation, (it is the square root of cook&#8217;s distance).</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jGtq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f204c1d-caef-42dc-9599-96fcf497cd21_624x250.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jGtq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f204c1d-caef-42dc-9599-96fcf497cd21_624x250.png 424w, https://substackcdn.com/image/fetch/$s_!jGtq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f204c1d-caef-42dc-9599-96fcf497cd21_624x250.png 848w, https://substackcdn.com/image/fetch/$s_!jGtq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f204c1d-caef-42dc-9599-96fcf497cd21_624x250.png 1272w, https://substackcdn.com/image/fetch/$s_!jGtq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f204c1d-caef-42dc-9599-96fcf497cd21_624x250.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jGtq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f204c1d-caef-42dc-9599-96fcf497cd21_624x250.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6f204c1d-caef-42dc-9599-96fcf497cd21_624x250.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!jGtq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f204c1d-caef-42dc-9599-96fcf497cd21_624x250.png 424w, https://substackcdn.com/image/fetch/$s_!jGtq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f204c1d-caef-42dc-9599-96fcf497cd21_624x250.png 848w, https://substackcdn.com/image/fetch/$s_!jGtq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f204c1d-caef-42dc-9599-96fcf497cd21_624x250.png 1272w, https://substackcdn.com/image/fetch/$s_!jGtq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f204c1d-caef-42dc-9599-96fcf497cd21_624x250.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">InfluencePlot for residual analysis of best log-linear model</figcaption></figure></div><p><strong>Framing this as a logistic regression problem</strong></p><p>We can also do a logistic regression where it would require us to transform the 48 record dataset to a 564 record dataset where each record represents the <em>Grahami </em>or the<em> Opalinus </em>species<em>. </em>That would allow us to predict for the given I,D,H,T condtions what lizard species might we find. In order to pursue this method, we convert lizard as response variable.</p><p>Data was converted to a long table with 564 observations, and each variable was recoded 0,1 for all variables and 1,2,3 for T. The header records looks like&nbsp;this:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!do3u!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc55d8558-51ed-4d51-b841-b66e947bcbfa_707x127.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!do3u!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc55d8558-51ed-4d51-b841-b66e947bcbfa_707x127.png 424w, https://substackcdn.com/image/fetch/$s_!do3u!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc55d8558-51ed-4d51-b841-b66e947bcbfa_707x127.png 848w, https://substackcdn.com/image/fetch/$s_!do3u!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc55d8558-51ed-4d51-b841-b66e947bcbfa_707x127.png 1272w, https://substackcdn.com/image/fetch/$s_!do3u!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc55d8558-51ed-4d51-b841-b66e947bcbfa_707x127.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!do3u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc55d8558-51ed-4d51-b841-b66e947bcbfa_707x127.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c55d8558-51ed-4d51-b841-b66e947bcbfa_707x127.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!do3u!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc55d8558-51ed-4d51-b841-b66e947bcbfa_707x127.png 424w, https://substackcdn.com/image/fetch/$s_!do3u!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc55d8558-51ed-4d51-b841-b66e947bcbfa_707x127.png 848w, https://substackcdn.com/image/fetch/$s_!do3u!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc55d8558-51ed-4d51-b841-b66e947bcbfa_707x127.png 1272w, https://substackcdn.com/image/fetch/$s_!do3u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc55d8558-51ed-4d51-b841-b66e947bcbfa_707x127.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Higher order contingency table converted to long&nbsp;table</figcaption></figure></div><pre><code>library(car) # for using Anova
lizard.longdata &lt;-read.csv("lizard_final_binomial.csv")
lizard.longdata
head(lizard.longdata)
lizard.longdata$L

liz.logistic &lt;-  glm(lizard.longdata$L ~ ., family = binomial, data=lizard.longdata)

#effects
logistic.LRT.stats&lt;-Anova(liz.logistic) #default test.stat is LRT, LRT stats 
logistic.LRT.stats
cbind(liz.logistic$coefficients,confint(liz.logistic),exp(confint(liz.logistic)))
anova(liz.logistic)
AIC(liz.logistic)
liz.logistic.sat &lt;-glm(lizard.longdata$L ~ I*P*D*T, family = binomial, data=lizard.longdata)

</code></pre><p>We use Anova function from the car package to get the LRT stats which is shown&nbsp;below</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uffa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fc473ed-8e9d-44bd-8957-a027a45b1c86_574x175.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uffa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fc473ed-8e9d-44bd-8957-a027a45b1c86_574x175.png 424w, https://substackcdn.com/image/fetch/$s_!uffa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fc473ed-8e9d-44bd-8957-a027a45b1c86_574x175.png 848w, https://substackcdn.com/image/fetch/$s_!uffa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fc473ed-8e9d-44bd-8957-a027a45b1c86_574x175.png 1272w, https://substackcdn.com/image/fetch/$s_!uffa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fc473ed-8e9d-44bd-8957-a027a45b1c86_574x175.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uffa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fc473ed-8e9d-44bd-8957-a027a45b1c86_574x175.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9fc473ed-8e9d-44bd-8957-a027a45b1c86_574x175.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!uffa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fc473ed-8e9d-44bd-8957-a027a45b1c86_574x175.png 424w, https://substackcdn.com/image/fetch/$s_!uffa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fc473ed-8e9d-44bd-8957-a027a45b1c86_574x175.png 848w, https://substackcdn.com/image/fetch/$s_!uffa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fc473ed-8e9d-44bd-8957-a027a45b1c86_574x175.png 1272w, https://substackcdn.com/image/fetch/$s_!uffa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fc473ed-8e9d-44bd-8957-a027a45b1c86_574x175.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Anova results</figcaption></figure></div><p>The effects are shown in the table below for 95% confidence interval. The last two column show exponentiated CI.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bZvm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd66c257-f803-42e1-ae87-a51ca1a0fa5e_682x144.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bZvm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd66c257-f803-42e1-ae87-a51ca1a0fa5e_682x144.png 424w, https://substackcdn.com/image/fetch/$s_!bZvm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd66c257-f803-42e1-ae87-a51ca1a0fa5e_682x144.png 848w, https://substackcdn.com/image/fetch/$s_!bZvm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd66c257-f803-42e1-ae87-a51ca1a0fa5e_682x144.png 1272w, https://substackcdn.com/image/fetch/$s_!bZvm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd66c257-f803-42e1-ae87-a51ca1a0fa5e_682x144.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bZvm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd66c257-f803-42e1-ae87-a51ca1a0fa5e_682x144.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cd66c257-f803-42e1-ae87-a51ca1a0fa5e_682x144.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!bZvm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd66c257-f803-42e1-ae87-a51ca1a0fa5e_682x144.png 424w, https://substackcdn.com/image/fetch/$s_!bZvm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd66c257-f803-42e1-ae87-a51ca1a0fa5e_682x144.png 848w, https://substackcdn.com/image/fetch/$s_!bZvm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd66c257-f803-42e1-ae87-a51ca1a0fa5e_682x144.png 1272w, https://substackcdn.com/image/fetch/$s_!bZvm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd66c257-f803-42e1-ae87-a51ca1a0fa5e_682x144.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Confidence Intervals</figcaption></figure></div><p><strong>Best subset using&nbsp;AIC</strong></p><p>We applied stepAIC function on the full variable model which resulted in giving us the same model. In other words, it was the one with the lowest AIC value of 577.62, and a residual deviance of 567.6216.</p><p>L ~ I + P + D +&nbsp;T</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NfS2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44c4175e-bbbc-46cb-a71e-4905bfe89f8b_599x234.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NfS2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44c4175e-bbbc-46cb-a71e-4905bfe89f8b_599x234.png 424w, https://substackcdn.com/image/fetch/$s_!NfS2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44c4175e-bbbc-46cb-a71e-4905bfe89f8b_599x234.png 848w, https://substackcdn.com/image/fetch/$s_!NfS2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44c4175e-bbbc-46cb-a71e-4905bfe89f8b_599x234.png 1272w, https://substackcdn.com/image/fetch/$s_!NfS2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44c4175e-bbbc-46cb-a71e-4905bfe89f8b_599x234.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NfS2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44c4175e-bbbc-46cb-a71e-4905bfe89f8b_599x234.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/44c4175e-bbbc-46cb-a71e-4905bfe89f8b_599x234.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!NfS2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44c4175e-bbbc-46cb-a71e-4905bfe89f8b_599x234.png 424w, https://substackcdn.com/image/fetch/$s_!NfS2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44c4175e-bbbc-46cb-a71e-4905bfe89f8b_599x234.png 848w, https://substackcdn.com/image/fetch/$s_!NfS2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44c4175e-bbbc-46cb-a71e-4905bfe89f8b_599x234.png 1272w, https://substackcdn.com/image/fetch/$s_!NfS2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44c4175e-bbbc-46cb-a71e-4905bfe89f8b_599x234.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Influence plots with residual for logistic regression model on the same&nbsp;data</figcaption></figure></div><p>As we see in the influence plot below the residuals on the best model obtained is much higher than what we get on the loglinear model (Above influence plot for loglinear model).</p><p>We infer that this model does not fit the data&nbsp;well.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DaiI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad927fc6-59d8-4c80-ad12-a372482e7247_624x262.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DaiI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad927fc6-59d8-4c80-ad12-a372482e7247_624x262.png 424w, https://substackcdn.com/image/fetch/$s_!DaiI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad927fc6-59d8-4c80-ad12-a372482e7247_624x262.png 848w, https://substackcdn.com/image/fetch/$s_!DaiI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad927fc6-59d8-4c80-ad12-a372482e7247_624x262.png 1272w, https://substackcdn.com/image/fetch/$s_!DaiI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad927fc6-59d8-4c80-ad12-a372482e7247_624x262.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DaiI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad927fc6-59d8-4c80-ad12-a372482e7247_624x262.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ad927fc6-59d8-4c80-ad12-a372482e7247_624x262.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!DaiI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad927fc6-59d8-4c80-ad12-a372482e7247_624x262.png 424w, https://substackcdn.com/image/fetch/$s_!DaiI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad927fc6-59d8-4c80-ad12-a372482e7247_624x262.png 848w, https://substackcdn.com/image/fetch/$s_!DaiI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad927fc6-59d8-4c80-ad12-a372482e7247_624x262.png 1272w, https://substackcdn.com/image/fetch/$s_!DaiI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad927fc6-59d8-4c80-ad12-a372482e7247_624x262.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><strong>Final words on Logistic and Log-Linear model equivalency</strong></p><p>It would make sense that the two models would be equivalent, we also know that the logistic model doesn&#8217;t know interaction terms. However, in this analysis we don&#8217;t see an equivalency, as the deviance of the two models are quite different. We have obtained 26.1033 for the best log linear model, and deviance of 555.4047 for the best logistic regression model.</p><p>We conclude a log linear model expresses the relationship nicely between the species and its variables that help us discern&nbsp;it.</p><p>There are a lot of great topics to delve into when working with categorical data. I will cover them in future posts. I hope this analysis was helpful in understanding how to work with&nbsp;GLMs.</p><h3></h3><p>Until next&nbsp;time!</p><h3>References:</h3><p>McCullagh, P., Nelder, J.A., 1989. <em>Generalized linear models</em>. London, Chapman &amp; Hall, 511&nbsp;p.</p><p>Agresti, A. 2007. <em>An introduction to categorical data analysis. </em>Wiley.</p><p><a href="https://stats.stackexchange.com/questions/26930/residuals-for-logistic-regression-and-cooks-distance">https://stats.stackexchange.com/questions/26930/residuals-for-logistic-regression-and-cooks-distance</a></p><p><a href="http://users.stat.ufl.edu/~presnell/Links/R-links.shtml">http://users.stat.ufl.edu/~presnell/Links/R-links.shtml</a></p><ul><li><p><a href="https://www.rdocumentation.org">Home - RDocumentation</a></p></li><li><p><a href="https://rdrr.io/cran/aod/man/lizards.html">lizards: A Comparison of Site Preferences of Two Species of Lizard in aod: Analysis of Overdispersed Data</a></p></li></ul>]]></content:encoded></item><item><title><![CDATA[Multivariate time series forecasting and analysis of the US unemployment rate — Part 4 (Final)]]></title><description><![CDATA[Multivariate time series forecasting and analysis of the US unemployment rate &#8212; Part 4 (Final)]]></description><link>https://www.thefractal.co/p/multivariate-time-series-forecasting-and-analysis-of-the-us-unemployment-rate-part-4-final-8eed476b98b0</link><guid isPermaLink="false">https://www.thefractal.co/p/multivariate-time-series-forecasting-and-analysis-of-the-us-unemployment-rate-part-4-final-8eed476b98b0</guid><dc:creator><![CDATA[Vijay Reddiar]]></dc:creator><pubDate>Wed, 10 May 2023 16:40:44 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/bad386c9-d9fd-43c5-8db0-8adf24a18753_800x533.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3>Multivariate time series forecasting and analysis of the US unemployment rate&#8202;&#8212;&#8202;Part 4&nbsp;(Final)</h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nvhC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dc0cd09-d77e-49d6-a767-3459a4d43d7c_800x533.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nvhC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dc0cd09-d77e-49d6-a767-3459a4d43d7c_800x533.png 424w, https://substackcdn.com/image/fetch/$s_!nvhC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dc0cd09-d77e-49d6-a767-3459a4d43d7c_800x533.png 848w, https://substackcdn.com/image/fetch/$s_!nvhC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dc0cd09-d77e-49d6-a767-3459a4d43d7c_800x533.png 1272w, https://substackcdn.com/image/fetch/$s_!nvhC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dc0cd09-d77e-49d6-a767-3459a4d43d7c_800x533.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nvhC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dc0cd09-d77e-49d6-a767-3459a4d43d7c_800x533.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7dc0cd09-d77e-49d6-a767-3459a4d43d7c_800x533.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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;: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_!nvhC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dc0cd09-d77e-49d6-a767-3459a4d43d7c_800x533.png 424w, https://substackcdn.com/image/fetch/$s_!nvhC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dc0cd09-d77e-49d6-a767-3459a4d43d7c_800x533.png 848w, https://substackcdn.com/image/fetch/$s_!nvhC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dc0cd09-d77e-49d6-a767-3459a4d43d7c_800x533.png 1272w, https://substackcdn.com/image/fetch/$s_!nvhC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dc0cd09-d77e-49d6-a767-3459a4d43d7c_800x533.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>In the final part of this series we will compare the results of our modeling work between classical time series models and neural network architectures applied with multivariate data that we previously discussed vs the univariate benchmark models.</p><p>If you haven&#8217;t read the previous posts, please do take a moment to review them. I have added a brief summary below outlining what was covered along with links to those articles.</p><p>In <a href="https://medium.com/@reddiarv/multivariate-time-series-forecasting-and-analysis-of-the-us-unemployment-rate-part-1-f1454b029cb">Part 1</a>, we introduced the importance of US unemployment rate forecasting as well as how a multivariate modeling approach can be&nbsp;applied.</p><p>We also discussed the various macroeconomic variables used in this analysis as well as an overview of the time series modeling approach.</p><p>In <a href="https://medium.com/@reddiarv/multivariate-time-series-forecasting-and-analysis-of-the-us-unemployment-rate-part-2-e865f7ff07a6">Part 2</a>, we discussed important data preparation considerations, as well as exploratory data analysis as it applies to standard time series datasets. We covered time series decomposition, autocorrelation, partial autocorrelations as well as ADF test for stationarity.</p><p>In <a href="https://medium.com/@reddiarv/multivariate-time-series-forecasting-and-analysis-of-the-us-unemployment-rate-part-3-bb789a7487a7">Part 3</a>, we discussed how Vector Autoregressive (VAR) models work. We also covered two neural network architectures including Artificial Neural Network and Recurrent Neural Networks and a discussion on LSTMs. We concluded the discussion in part 3 with model evaluation metrics used for this&nbsp;work.</p><h3><strong>Model development procedures</strong></h3><p>For forecasting the unemployment rate, each of the three methods are first used with a univariate setting, followed by multivariate model fitting and forecasting. The model development was done using Python libraries (version 3.8.5). The details on specific packages and functions are listed in the below&nbsp;tables:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!kAYE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb09a389-a850-4a30-95c9-b77bbd5bdd0d_613x280.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kAYE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb09a389-a850-4a30-95c9-b77bbd5bdd0d_613x280.png 424w, https://substackcdn.com/image/fetch/$s_!kAYE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb09a389-a850-4a30-95c9-b77bbd5bdd0d_613x280.png 848w, https://substackcdn.com/image/fetch/$s_!kAYE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb09a389-a850-4a30-95c9-b77bbd5bdd0d_613x280.png 1272w, https://substackcdn.com/image/fetch/$s_!kAYE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb09a389-a850-4a30-95c9-b77bbd5bdd0d_613x280.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kAYE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb09a389-a850-4a30-95c9-b77bbd5bdd0d_613x280.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/db09a389-a850-4a30-95c9-b77bbd5bdd0d_613x280.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!kAYE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb09a389-a850-4a30-95c9-b77bbd5bdd0d_613x280.png 424w, https://substackcdn.com/image/fetch/$s_!kAYE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb09a389-a850-4a30-95c9-b77bbd5bdd0d_613x280.png 848w, https://substackcdn.com/image/fetch/$s_!kAYE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb09a389-a850-4a30-95c9-b77bbd5bdd0d_613x280.png 1272w, https://substackcdn.com/image/fetch/$s_!kAYE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb09a389-a850-4a30-95c9-b77bbd5bdd0d_613x280.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Libraries used for exploratory data&nbsp;analysis</figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oVbs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54bfe712-2e43-4aae-b309-e4be5afd0a7a_588x87.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oVbs!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54bfe712-2e43-4aae-b309-e4be5afd0a7a_588x87.png 424w, https://substackcdn.com/image/fetch/$s_!oVbs!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54bfe712-2e43-4aae-b309-e4be5afd0a7a_588x87.png 848w, https://substackcdn.com/image/fetch/$s_!oVbs!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54bfe712-2e43-4aae-b309-e4be5afd0a7a_588x87.png 1272w, https://substackcdn.com/image/fetch/$s_!oVbs!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54bfe712-2e43-4aae-b309-e4be5afd0a7a_588x87.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oVbs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54bfe712-2e43-4aae-b309-e4be5afd0a7a_588x87.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/54bfe712-2e43-4aae-b309-e4be5afd0a7a_588x87.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!oVbs!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54bfe712-2e43-4aae-b309-e4be5afd0a7a_588x87.png 424w, https://substackcdn.com/image/fetch/$s_!oVbs!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54bfe712-2e43-4aae-b309-e4be5afd0a7a_588x87.png 848w, https://substackcdn.com/image/fetch/$s_!oVbs!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54bfe712-2e43-4aae-b309-e4be5afd0a7a_588x87.png 1272w, https://substackcdn.com/image/fetch/$s_!oVbs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54bfe712-2e43-4aae-b309-e4be5afd0a7a_588x87.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Libraries used for Univariate Autoregressive Model</figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CgJo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3499814b-fc8c-4315-9bd3-10175802ca64_592x62.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CgJo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3499814b-fc8c-4315-9bd3-10175802ca64_592x62.png 424w, https://substackcdn.com/image/fetch/$s_!CgJo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3499814b-fc8c-4315-9bd3-10175802ca64_592x62.png 848w, https://substackcdn.com/image/fetch/$s_!CgJo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3499814b-fc8c-4315-9bd3-10175802ca64_592x62.png 1272w, https://substackcdn.com/image/fetch/$s_!CgJo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3499814b-fc8c-4315-9bd3-10175802ca64_592x62.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CgJo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3499814b-fc8c-4315-9bd3-10175802ca64_592x62.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3499814b-fc8c-4315-9bd3-10175802ca64_592x62.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!CgJo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3499814b-fc8c-4315-9bd3-10175802ca64_592x62.png 424w, https://substackcdn.com/image/fetch/$s_!CgJo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3499814b-fc8c-4315-9bd3-10175802ca64_592x62.png 848w, https://substackcdn.com/image/fetch/$s_!CgJo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3499814b-fc8c-4315-9bd3-10175802ca64_592x62.png 1272w, https://substackcdn.com/image/fetch/$s_!CgJo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3499814b-fc8c-4315-9bd3-10175802ca64_592x62.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Library used for Multivariate Vector Autoregressive Models</figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!v62m!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6a071c5-6371-4bf1-aa22-afc359b8582a_595x390.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!v62m!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6a071c5-6371-4bf1-aa22-afc359b8582a_595x390.png 424w, https://substackcdn.com/image/fetch/$s_!v62m!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6a071c5-6371-4bf1-aa22-afc359b8582a_595x390.png 848w, https://substackcdn.com/image/fetch/$s_!v62m!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6a071c5-6371-4bf1-aa22-afc359b8582a_595x390.png 1272w, https://substackcdn.com/image/fetch/$s_!v62m!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6a071c5-6371-4bf1-aa22-afc359b8582a_595x390.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!v62m!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6a071c5-6371-4bf1-aa22-afc359b8582a_595x390.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b6a071c5-6371-4bf1-aa22-afc359b8582a_595x390.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!v62m!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6a071c5-6371-4bf1-aa22-afc359b8582a_595x390.png 424w, https://substackcdn.com/image/fetch/$s_!v62m!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6a071c5-6371-4bf1-aa22-afc359b8582a_595x390.png 848w, https://substackcdn.com/image/fetch/$s_!v62m!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6a071c5-6371-4bf1-aa22-afc359b8582a_595x390.png 1272w, https://substackcdn.com/image/fetch/$s_!v62m!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6a071c5-6371-4bf1-aa22-afc359b8582a_595x390.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Libraries used for ANN and LSTM Neural Networks using&nbsp;Keras</figcaption></figure></div><p><strong>Classical Time Series&#8202;&#8212;&#8202;Univariate analysis</strong></p><p>An optimal lag order of 5 was used for univariate model fitting. It is obtained by fitting the model with a max lag of 24 when calling the <em>ar_select_order()</em> function using <em>&#8216;aic&#8217;</em> as the information critieron. The model is fit using the ARIMA library from <em>statsmodels</em> package and a 12-step forecast is obtained. The <em>summary()</em> function provides the below results for&nbsp;AR(5):</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!reqV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3c711c-4613-4995-8352-21d8c32eaf8d_449x441.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!reqV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3c711c-4613-4995-8352-21d8c32eaf8d_449x441.png 424w, https://substackcdn.com/image/fetch/$s_!reqV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3c711c-4613-4995-8352-21d8c32eaf8d_449x441.png 848w, https://substackcdn.com/image/fetch/$s_!reqV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3c711c-4613-4995-8352-21d8c32eaf8d_449x441.png 1272w, https://substackcdn.com/image/fetch/$s_!reqV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3c711c-4613-4995-8352-21d8c32eaf8d_449x441.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!reqV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3c711c-4613-4995-8352-21d8c32eaf8d_449x441.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9c3c711c-4613-4995-8352-21d8c32eaf8d_449x441.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!reqV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3c711c-4613-4995-8352-21d8c32eaf8d_449x441.png 424w, https://substackcdn.com/image/fetch/$s_!reqV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3c711c-4613-4995-8352-21d8c32eaf8d_449x441.png 848w, https://substackcdn.com/image/fetch/$s_!reqV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3c711c-4613-4995-8352-21d8c32eaf8d_449x441.png 1272w, https://substackcdn.com/image/fetch/$s_!reqV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3c711c-4613-4995-8352-21d8c32eaf8d_449x441.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">AR(5) model summary&nbsp;results</figcaption></figure></div><p>The model fit results are shown in above output for AR(5) model. Lags1, 2 and 5 are found to be statistically significant along with a white noise component sigma2.</p><p>Once the model is fit, walk forward multi-step forecasting for a forecast horizon of 12 is done. This is inclusive of all forecast horizons until 12. This forecast is done by providing end of the training period as starting period for forecasting, along with a lag of 5 as the input. Each forecast call returns a forecast for the next 12 periods. The input vector is changed by sliding the input window forward (walk-forward) by one incremental observation at a time and selecting the next 5 observations as input. Each output vector of the 12 forecasted values for the different forecast steps is separately stored in a&nbsp;list.</p><p>Mean Absolute Error is calculated by comparing the lists of actual unemployment rate for the various forecast horizon with the lists containing forecast value from above. Time series data for forecast and actuals is plotted as shown below in figure (forecast in blue, and actuals in&nbsp;red).</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!glKi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7551cf0-cfa0-4de6-b0b4-07b28a09b506_576x197.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!glKi!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7551cf0-cfa0-4de6-b0b4-07b28a09b506_576x197.png 424w, https://substackcdn.com/image/fetch/$s_!glKi!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7551cf0-cfa0-4de6-b0b4-07b28a09b506_576x197.png 848w, https://substackcdn.com/image/fetch/$s_!glKi!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7551cf0-cfa0-4de6-b0b4-07b28a09b506_576x197.png 1272w, https://substackcdn.com/image/fetch/$s_!glKi!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7551cf0-cfa0-4de6-b0b4-07b28a09b506_576x197.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!glKi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7551cf0-cfa0-4de6-b0b4-07b28a09b506_576x197.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e7551cf0-cfa0-4de6-b0b4-07b28a09b506_576x197.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!glKi!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7551cf0-cfa0-4de6-b0b4-07b28a09b506_576x197.png 424w, https://substackcdn.com/image/fetch/$s_!glKi!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7551cf0-cfa0-4de6-b0b4-07b28a09b506_576x197.png 848w, https://substackcdn.com/image/fetch/$s_!glKi!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7551cf0-cfa0-4de6-b0b4-07b28a09b506_576x197.png 1272w, https://substackcdn.com/image/fetch/$s_!glKi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7551cf0-cfa0-4de6-b0b4-07b28a09b506_576x197.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Unemployment Rate Actual vs Forecasted for 0th step using&nbsp;AR(5)</figcaption></figure></div><p>The validity of the data setup is tested by comparing the results of the AR model developed in this analysis for a single forecast horizon window and comparing it with results obtained in the Federal Reserve paper (Cook &amp; Hall, 2017). The MAE obtained is 11.5 bps (basis points). Results of this test and others described in sections described further are summarized in the results and discussions section.</p><p><strong>Classical Time Series&#8202;&#8212;&#8202;Multivariate analysis</strong></p><p>The standard VAR(p) model implementation from <em>statsmodels</em> is not appropriate for non-stationary data, so dataset in this analysis is made stationary. (Vector Autoregressions, 2022). The results of ADF test applied across the entire list of variables was discussed in <a href="https://medium.com/@reddiarv/multivariate-time-series-forecasting-and-analysis-of-the-us-unemployment-rate-part-2-e865f7ff07a6">part 2</a> of this series. The following variables that are shown (and only the leading and trailing records are displayed) in the full time series data, were used for fitting the VAR&nbsp;model.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qMy5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa0d746c-5603-4cb2-96a9-ca41274c6baa_576x162.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qMy5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa0d746c-5603-4cb2-96a9-ca41274c6baa_576x162.png 424w, https://substackcdn.com/image/fetch/$s_!qMy5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa0d746c-5603-4cb2-96a9-ca41274c6baa_576x162.png 848w, https://substackcdn.com/image/fetch/$s_!qMy5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa0d746c-5603-4cb2-96a9-ca41274c6baa_576x162.png 1272w, https://substackcdn.com/image/fetch/$s_!qMy5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa0d746c-5603-4cb2-96a9-ca41274c6baa_576x162.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qMy5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa0d746c-5603-4cb2-96a9-ca41274c6baa_576x162.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa0d746c-5603-4cb2-96a9-ca41274c6baa_576x162.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!qMy5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa0d746c-5603-4cb2-96a9-ca41274c6baa_576x162.png 424w, https://substackcdn.com/image/fetch/$s_!qMy5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa0d746c-5603-4cb2-96a9-ca41274c6baa_576x162.png 848w, https://substackcdn.com/image/fetch/$s_!qMy5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa0d746c-5603-4cb2-96a9-ca41274c6baa_576x162.png 1272w, https://substackcdn.com/image/fetch/$s_!qMy5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa0d746c-5603-4cb2-96a9-ca41274c6baa_576x162.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Final multivariate dataset for VAR(p)&nbsp;model</figcaption></figure></div><p>Again, max lags of 24 is provided to determine optimal lag, where BIC provides 1 as the optimal lag. For selecting the lag <em>select_order()</em> function from <em>statsmodel</em> package is used. Partial output has been reproduced below. The results show that the unemployment rate and the GDP at lag = 1 are statistically significant to explaining unemployment rate at current time&nbsp;t.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Evg3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faade1c9f-6102-4c07-a615-4bba07cda693_576x392.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Evg3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faade1c9f-6102-4c07-a615-4bba07cda693_576x392.png 424w, https://substackcdn.com/image/fetch/$s_!Evg3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faade1c9f-6102-4c07-a615-4bba07cda693_576x392.png 848w, https://substackcdn.com/image/fetch/$s_!Evg3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faade1c9f-6102-4c07-a615-4bba07cda693_576x392.png 1272w, https://substackcdn.com/image/fetch/$s_!Evg3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faade1c9f-6102-4c07-a615-4bba07cda693_576x392.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Evg3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faade1c9f-6102-4c07-a615-4bba07cda693_576x392.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aade1c9f-6102-4c07-a615-4bba07cda693_576x392.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!Evg3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faade1c9f-6102-4c07-a615-4bba07cda693_576x392.png 424w, https://substackcdn.com/image/fetch/$s_!Evg3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faade1c9f-6102-4c07-a615-4bba07cda693_576x392.png 848w, https://substackcdn.com/image/fetch/$s_!Evg3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faade1c9f-6102-4c07-a615-4bba07cda693_576x392.png 1272w, https://substackcdn.com/image/fetch/$s_!Evg3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faade1c9f-6102-4c07-a615-4bba07cda693_576x392.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Results of VAR(1) model&nbsp;fit</figcaption></figure></div><p><strong>Granger causality</strong></p><p>Granger causality test is done using <em>grangercausalitytests</em> function from <em>statsmodels</em> which provides the following results. We pass the value of 1 to maxlag parameter.</p><p>The tests indicate that consumer price index growth rate (CPIGrowthRate1d_x), and Money Supply (LogMoneySupply_1d_x) both are positively correlated with Unemployment Rate (UnemploymentRate_y) and granger causes Unemployment Rate. It is important to note that, though the name suggests &#8220;Causality&#8221; it is not meant to imply causality. The differentiating phrase used is variable x &#8220;granger causes&#8221; variable y. A better way of thinking about it is that it translates to correlation between the two variables.</p><p>The values in this table show the p-values, and, if they are less than the significance level (0.05) then it implies that the coefficients of the corresponding past values is zero, which is to say, the null hypothesis that X does not &#8220;granger&#8221; cause Y can be rejected.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OaP6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd7e4b1c-05c7-4cad-8076-af03fcb95f39_1024x186.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OaP6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd7e4b1c-05c7-4cad-8076-af03fcb95f39_1024x186.png 424w, https://substackcdn.com/image/fetch/$s_!OaP6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd7e4b1c-05c7-4cad-8076-af03fcb95f39_1024x186.png 848w, https://substackcdn.com/image/fetch/$s_!OaP6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd7e4b1c-05c7-4cad-8076-af03fcb95f39_1024x186.png 1272w, https://substackcdn.com/image/fetch/$s_!OaP6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd7e4b1c-05c7-4cad-8076-af03fcb95f39_1024x186.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OaP6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd7e4b1c-05c7-4cad-8076-af03fcb95f39_1024x186.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dd7e4b1c-05c7-4cad-8076-af03fcb95f39_1024x186.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!OaP6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd7e4b1c-05c7-4cad-8076-af03fcb95f39_1024x186.png 424w, https://substackcdn.com/image/fetch/$s_!OaP6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd7e4b1c-05c7-4cad-8076-af03fcb95f39_1024x186.png 848w, https://substackcdn.com/image/fetch/$s_!OaP6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd7e4b1c-05c7-4cad-8076-af03fcb95f39_1024x186.png 1272w, https://substackcdn.com/image/fetch/$s_!OaP6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd7e4b1c-05c7-4cad-8076-af03fcb95f39_1024x186.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Granger causality test&nbsp;results</figcaption></figure></div><p><strong>Classical Time Series&#8202;&#8212;&#8202;Forecasting</strong></p><p>Rolling forecast is applied to get multi step multi output for 12 step horizon using the forecast function from the fitted VAR model. The rolling forecast is obtained in the same way it was done for univariate analysis by creating separate lists to store the actual unemployment rate for various forecast horizons as well as for storing the forecasted unemployment rate fot those forecast horizons. The mean absolute error is then calculated across these lists for each forecast horizon consecutively and reported.</p><p>Following results are obtained by calling the <em>mean_absolute_error()</em> function from <em>sklearn.metrics</em> package. This is done by providing the list with forecasted values along with actual values, one list each for the 3,6,9 and 12 step forecast. The MAE were obtained as 11.2 bps, 19.7 bps, 27.7 bps and 35.9 bps respectively. (More summarized comparative views&nbsp;below).</p><p><strong>Model development using Neural&nbsp;Networks</strong></p><p>A key experimental setup that is replicated across all of the neural network architectures in this analysis across univariate and multivariate analysis is the process of setting up validation data set from the original training dataset, which is from 1963 to 1996. In this dataset, every tenth observation is removed from training data set and passed into a validation data set. Each observation is a set of continuous 36 month data. This dataset is then used to evaluate the performance of the trained model. The testing dataset contains the remainder of the monthly data from 1997 to&nbsp;2014.</p><p>Since this analysis is meant to compare an existing univariate work in a new multivariate setting, we retained the experimental settings similar to univariate work by Cook and Hall. In their work, they use a lag of 36 months of the unemployment rate data for neural networks. Therefore, this analysis also uses lag of 36, specifically for the univariate analysis using ANN. Lastly, they also use the original unemployment rate, the first order difference and the second order difference unemployment rate in the univariate model. The setup for univariate forecasting in this analysis is replicated with their&nbsp;setup.</p><p>When working with Neural Networks it is important to standardize the data, particularly when the data is not scaled. If the data is not standardized, attributes that have higher values will take on higher weights in the model incorrectly influencing the model. For this analysis neural network models have been evaluated separately with both standard scaling and min-max scaling. The <em>sklearn</em> scaler object is fit with the training data separately for dependent and independent data. Then as the next step, independent data (x) is transformed. The scaler object is not fit with testing data so as to avoid data&nbsp;leakage.</p><p>As discussed in the data preparation section, there are two different types of data transformation applied: (1). Standardization and (2) Min-Max Normalization. Each neural network is trained, evaluated and used for forecasting. The final results are reported based on the best model evaluation metrics across the two types of transformation. When the model is trained, and forecast is generated, the forecast is <strong>reverse transformed</strong> to original scale of the data for calculating mean absolute&nbsp;error.</p><p>When working with machine learning algorithms including deep learning algorithms, time series problem needs to be converted into a <strong>supervised learning problem</strong>. This is done by taking sequences of data iteratively from the original time series and splitting the time series data into a set of time series data for training, and another set of time series data for testing. It is in this set of training sequences, the sequestering (hold out) operation described above is done for model evaluation.</p><p>For LSTM under univariate setting, the number of lags is chosen to be 12. On splitting the training data into training and valiation, X training data is obtained with the shape (344,12,3) with 344 samples, 12 lags, and 3 features. The Y training data is of the shape (344,12) with 344 samples and 12 lags. The testing dataset is setup in the same way without the need to sequester any observation, that provides a X testing data of the shape (194, 12, 3) and Y testing data of the shape (194,&nbsp;12).</p><p><em>TensorFlow</em> from the <em>keras</em> package in Python is used for implementing the neural network architectures in this analysis. A tensor is a 2D matrix with additional dimensions. A 3D tensor is an appropriate data structure to store time series data. This can include storing the samples, time steps and features, which is useful especially for a multivariate problem as shown in figure&nbsp;below.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!EnJa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd90656db-b057-4c5d-a495-93f5d26bf384_357x145.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!EnJa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd90656db-b057-4c5d-a495-93f5d26bf384_357x145.png 424w, https://substackcdn.com/image/fetch/$s_!EnJa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd90656db-b057-4c5d-a495-93f5d26bf384_357x145.png 848w, https://substackcdn.com/image/fetch/$s_!EnJa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd90656db-b057-4c5d-a495-93f5d26bf384_357x145.png 1272w, https://substackcdn.com/image/fetch/$s_!EnJa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd90656db-b057-4c5d-a495-93f5d26bf384_357x145.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!EnJa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd90656db-b057-4c5d-a495-93f5d26bf384_357x145.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d90656db-b057-4c5d-a495-93f5d26bf384_357x145.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!EnJa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd90656db-b057-4c5d-a495-93f5d26bf384_357x145.png 424w, https://substackcdn.com/image/fetch/$s_!EnJa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd90656db-b057-4c5d-a495-93f5d26bf384_357x145.png 848w, https://substackcdn.com/image/fetch/$s_!EnJa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd90656db-b057-4c5d-a495-93f5d26bf384_357x145.png 1272w, https://substackcdn.com/image/fetch/$s_!EnJa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd90656db-b057-4c5d-a495-93f5d26bf384_357x145.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">A 3D tensor representing time series data (Chollet, 2018)</figcaption></figure></div><p><strong>Keras model development workflow</strong>:</p><p>The workflow required for model development using Keras requires is as follows (Chollet, 2018):</p><p>1. Define the training data using numpy arrays or&nbsp;tensors.</p><p>2. Define a model that is a network of layers which maps the inputs to&nbsp;outputs.</p><p>3. Choose a loss function, optimizer and a model evaluation metric for monitoring the model&nbsp;training</p><p>4. Loop through the training data by calling <em>fit()</em>&nbsp;method</p><p>A <em>Tensorflow</em> model is defined by creating an object of the class <em>Sequential()</em> that creates linearly stacked layers. A LSTM layer is added with 32 nodes, <em>relu</em> activation function along with the specification of the input shape that includes the number of lags, and number of features. This is followed by addition of a Dense (final output) layer with as many nodes as the number of forecast steps. A <em>ModelCheckpoint</em> is created to save the best model information based on lowest validation loss. Finally, the model is compiled by choosing &#8216;<em>adam&#8217;</em> optimizer and the model is set to be optimized for lowest&nbsp;MAE.</p><p>On fitting the LSTM model with 100 epochs, following summary results shows the type of layers is obtained. It shows the two linearly stacked layers LSTM and&nbsp;Dense.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5B10!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28160f57-20d8-4ed6-bc0b-5d0471b6119f_576x277.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5B10!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28160f57-20d8-4ed6-bc0b-5d0471b6119f_576x277.png 424w, https://substackcdn.com/image/fetch/$s_!5B10!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28160f57-20d8-4ed6-bc0b-5d0471b6119f_576x277.png 848w, https://substackcdn.com/image/fetch/$s_!5B10!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28160f57-20d8-4ed6-bc0b-5d0471b6119f_576x277.png 1272w, https://substackcdn.com/image/fetch/$s_!5B10!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28160f57-20d8-4ed6-bc0b-5d0471b6119f_576x277.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5B10!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28160f57-20d8-4ed6-bc0b-5d0471b6119f_576x277.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/28160f57-20d8-4ed6-bc0b-5d0471b6119f_576x277.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!5B10!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28160f57-20d8-4ed6-bc0b-5d0471b6119f_576x277.png 424w, https://substackcdn.com/image/fetch/$s_!5B10!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28160f57-20d8-4ed6-bc0b-5d0471b6119f_576x277.png 848w, https://substackcdn.com/image/fetch/$s_!5B10!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28160f57-20d8-4ed6-bc0b-5d0471b6119f_576x277.png 1272w, https://substackcdn.com/image/fetch/$s_!5B10!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28160f57-20d8-4ed6-bc0b-5d0471b6119f_576x277.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Univariate LSTM model&nbsp;summary</figcaption></figure></div><p>The training loss and validation loss drops in less than 10 epochs, and plateaus after 50 epochs as shown&nbsp;below.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!XM61!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f66f999-505e-4f03-8b65-1f998df91516_576x231.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!XM61!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f66f999-505e-4f03-8b65-1f998df91516_576x231.png 424w, https://substackcdn.com/image/fetch/$s_!XM61!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f66f999-505e-4f03-8b65-1f998df91516_576x231.png 848w, https://substackcdn.com/image/fetch/$s_!XM61!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f66f999-505e-4f03-8b65-1f998df91516_576x231.png 1272w, https://substackcdn.com/image/fetch/$s_!XM61!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f66f999-505e-4f03-8b65-1f998df91516_576x231.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!XM61!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f66f999-505e-4f03-8b65-1f998df91516_576x231.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6f66f999-505e-4f03-8b65-1f998df91516_576x231.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!XM61!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f66f999-505e-4f03-8b65-1f998df91516_576x231.png 424w, https://substackcdn.com/image/fetch/$s_!XM61!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f66f999-505e-4f03-8b65-1f998df91516_576x231.png 848w, https://substackcdn.com/image/fetch/$s_!XM61!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f66f999-505e-4f03-8b65-1f998df91516_576x231.png 1272w, https://substackcdn.com/image/fetch/$s_!XM61!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f66f999-505e-4f03-8b65-1f998df91516_576x231.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Figure 3: Training and validation loss for univariate LSTM&nbsp;model</figcaption></figure></div><p>A12-step horizon using the best model was obtained. Which was then then reverse scaled to calculate the error on forecasted data. Following results were obtained for univariate LSTM:</p><p>Overall mean absolute error in percent&nbsp;:&nbsp;0.3539</p><p>Overall mean absolute error in basis points&nbsp;:&nbsp;35.39</p><p>The below chart shows the forecasted vs actual value for the 0th step forecast (first month) in the 12 month forecast&nbsp;horizon.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Z_TD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7a6c6e3-0a34-4c3d-9618-69466d935232_576x197.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Z_TD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7a6c6e3-0a34-4c3d-9618-69466d935232_576x197.png 424w, https://substackcdn.com/image/fetch/$s_!Z_TD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7a6c6e3-0a34-4c3d-9618-69466d935232_576x197.png 848w, https://substackcdn.com/image/fetch/$s_!Z_TD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7a6c6e3-0a34-4c3d-9618-69466d935232_576x197.png 1272w, https://substackcdn.com/image/fetch/$s_!Z_TD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7a6c6e3-0a34-4c3d-9618-69466d935232_576x197.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Z_TD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7a6c6e3-0a34-4c3d-9618-69466d935232_576x197.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a7a6c6e3-0a34-4c3d-9618-69466d935232_576x197.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!Z_TD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7a6c6e3-0a34-4c3d-9618-69466d935232_576x197.png 424w, https://substackcdn.com/image/fetch/$s_!Z_TD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7a6c6e3-0a34-4c3d-9618-69466d935232_576x197.png 848w, https://substackcdn.com/image/fetch/$s_!Z_TD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7a6c6e3-0a34-4c3d-9618-69466d935232_576x197.png 1272w, https://substackcdn.com/image/fetch/$s_!Z_TD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7a6c6e3-0a34-4c3d-9618-69466d935232_576x197.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Actual vs Forecast for 0th step using univariate LSTM&nbsp;model</figcaption></figure></div><p><strong>Discussion on Multivariate forecasting with&nbsp;LSTM</strong></p><p>The setup for multivariate forecasting for LSTM is the same as that for univariate except for the data setup. The supervised data set for training and testing includes multiple variables as shown&nbsp;below.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yYaS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9bfb601-f3a9-4962-ad3c-7d86eb2a7bbf_576x191.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yYaS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9bfb601-f3a9-4962-ad3c-7d86eb2a7bbf_576x191.png 424w, https://substackcdn.com/image/fetch/$s_!yYaS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9bfb601-f3a9-4962-ad3c-7d86eb2a7bbf_576x191.png 848w, https://substackcdn.com/image/fetch/$s_!yYaS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9bfb601-f3a9-4962-ad3c-7d86eb2a7bbf_576x191.png 1272w, https://substackcdn.com/image/fetch/$s_!yYaS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9bfb601-f3a9-4962-ad3c-7d86eb2a7bbf_576x191.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yYaS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9bfb601-f3a9-4962-ad3c-7d86eb2a7bbf_576x191.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e9bfb601-f3a9-4962-ad3c-7d86eb2a7bbf_576x191.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!yYaS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9bfb601-f3a9-4962-ad3c-7d86eb2a7bbf_576x191.png 424w, https://substackcdn.com/image/fetch/$s_!yYaS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9bfb601-f3a9-4962-ad3c-7d86eb2a7bbf_576x191.png 848w, https://substackcdn.com/image/fetch/$s_!yYaS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9bfb601-f3a9-4962-ad3c-7d86eb2a7bbf_576x191.png 1272w, https://substackcdn.com/image/fetch/$s_!yYaS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9bfb601-f3a9-4962-ad3c-7d86eb2a7bbf_576x191.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Variables used in fitting multivariate LSTM&nbsp;model</figcaption></figure></div><p>The tensors setup for multivariate forecasting are of the following shape</p><p>XTrain: (344,12,25)</p><p>YTrain: (344,12)</p><p>XTest: (194,12,25)</p><p>YTest: (194,12)</p><p>LSTM model for multivariate forecasting is also setup with two layers as shown&nbsp;below:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!EcCg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32bc1b84-2f1d-4622-8365-ce98d54bc262_576x289.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!EcCg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32bc1b84-2f1d-4622-8365-ce98d54bc262_576x289.png 424w, https://substackcdn.com/image/fetch/$s_!EcCg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32bc1b84-2f1d-4622-8365-ce98d54bc262_576x289.png 848w, https://substackcdn.com/image/fetch/$s_!EcCg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32bc1b84-2f1d-4622-8365-ce98d54bc262_576x289.png 1272w, https://substackcdn.com/image/fetch/$s_!EcCg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32bc1b84-2f1d-4622-8365-ce98d54bc262_576x289.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!EcCg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32bc1b84-2f1d-4622-8365-ce98d54bc262_576x289.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/32bc1b84-2f1d-4622-8365-ce98d54bc262_576x289.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!EcCg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32bc1b84-2f1d-4622-8365-ce98d54bc262_576x289.png 424w, https://substackcdn.com/image/fetch/$s_!EcCg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32bc1b84-2f1d-4622-8365-ce98d54bc262_576x289.png 848w, https://substackcdn.com/image/fetch/$s_!EcCg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32bc1b84-2f1d-4622-8365-ce98d54bc262_576x289.png 1272w, https://substackcdn.com/image/fetch/$s_!EcCg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32bc1b84-2f1d-4622-8365-ce98d54bc262_576x289.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Model summary for multivariate LSTM&nbsp;model</figcaption></figure></div><p>The training loss and validation loss are outputted as follows. The loss convergence is similar to the univariate LSTM model training.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tMfg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb80506e9-80dc-4cad-91ad-f5e09dee0f8d_576x228.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tMfg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb80506e9-80dc-4cad-91ad-f5e09dee0f8d_576x228.png 424w, https://substackcdn.com/image/fetch/$s_!tMfg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb80506e9-80dc-4cad-91ad-f5e09dee0f8d_576x228.png 848w, https://substackcdn.com/image/fetch/$s_!tMfg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb80506e9-80dc-4cad-91ad-f5e09dee0f8d_576x228.png 1272w, https://substackcdn.com/image/fetch/$s_!tMfg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb80506e9-80dc-4cad-91ad-f5e09dee0f8d_576x228.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tMfg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb80506e9-80dc-4cad-91ad-f5e09dee0f8d_576x228.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b80506e9-80dc-4cad-91ad-f5e09dee0f8d_576x228.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!tMfg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb80506e9-80dc-4cad-91ad-f5e09dee0f8d_576x228.png 424w, https://substackcdn.com/image/fetch/$s_!tMfg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb80506e9-80dc-4cad-91ad-f5e09dee0f8d_576x228.png 848w, https://substackcdn.com/image/fetch/$s_!tMfg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb80506e9-80dc-4cad-91ad-f5e09dee0f8d_576x228.png 1272w, https://substackcdn.com/image/fetch/$s_!tMfg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb80506e9-80dc-4cad-91ad-f5e09dee0f8d_576x228.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Training and validation loss for multivariate LSTM&nbsp;model</figcaption></figure></div><p>The model evaluation error obtained is 0.0292. Again, forecasting with the best LSTM multivariate model, a vector of 12 step forecast is obtained. For illustration the first record of the forecasted values and actual values are reproduced below:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!A4cF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3406499-a8c0-46b4-9f4c-2c5c7a333790_514x67.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!A4cF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3406499-a8c0-46b4-9f4c-2c5c7a333790_514x67.png 424w, https://substackcdn.com/image/fetch/$s_!A4cF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3406499-a8c0-46b4-9f4c-2c5c7a333790_514x67.png 848w, https://substackcdn.com/image/fetch/$s_!A4cF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3406499-a8c0-46b4-9f4c-2c5c7a333790_514x67.png 1272w, https://substackcdn.com/image/fetch/$s_!A4cF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3406499-a8c0-46b4-9f4c-2c5c7a333790_514x67.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!A4cF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3406499-a8c0-46b4-9f4c-2c5c7a333790_514x67.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a3406499-a8c0-46b4-9f4c-2c5c7a333790_514x67.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!A4cF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3406499-a8c0-46b4-9f4c-2c5c7a333790_514x67.png 424w, https://substackcdn.com/image/fetch/$s_!A4cF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3406499-a8c0-46b4-9f4c-2c5c7a333790_514x67.png 848w, https://substackcdn.com/image/fetch/$s_!A4cF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3406499-a8c0-46b4-9f4c-2c5c7a333790_514x67.png 1272w, https://substackcdn.com/image/fetch/$s_!A4cF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3406499-a8c0-46b4-9f4c-2c5c7a333790_514x67.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">12 step forecast for first&nbsp;input</figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fcr6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa1129cf-68b1-4080-bca6-ef2e1ca7fad6_576x67.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fcr6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa1129cf-68b1-4080-bca6-ef2e1ca7fad6_576x67.png 424w, https://substackcdn.com/image/fetch/$s_!fcr6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa1129cf-68b1-4080-bca6-ef2e1ca7fad6_576x67.png 848w, https://substackcdn.com/image/fetch/$s_!fcr6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa1129cf-68b1-4080-bca6-ef2e1ca7fad6_576x67.png 1272w, https://substackcdn.com/image/fetch/$s_!fcr6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa1129cf-68b1-4080-bca6-ef2e1ca7fad6_576x67.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fcr6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa1129cf-68b1-4080-bca6-ef2e1ca7fad6_576x67.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fa1129cf-68b1-4080-bca6-ef2e1ca7fad6_576x67.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!fcr6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa1129cf-68b1-4080-bca6-ef2e1ca7fad6_576x67.png 424w, https://substackcdn.com/image/fetch/$s_!fcr6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa1129cf-68b1-4080-bca6-ef2e1ca7fad6_576x67.png 848w, https://substackcdn.com/image/fetch/$s_!fcr6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa1129cf-68b1-4080-bca6-ef2e1ca7fad6_576x67.png 1272w, https://substackcdn.com/image/fetch/$s_!fcr6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa1129cf-68b1-4080-bca6-ef2e1ca7fad6_576x67.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">12 step horizon actual for first&nbsp;input</figcaption></figure></div><p>Compared to the univariate LSTM mode the forecast for the first month of the 12 month period shows lesser accuracy (as you will see, not good!). The chart below shows the performance of the LSTM multivariate model after inverse transforming the forecast.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!XdJE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fd8c222-83cc-4d22-870d-e38a95e2674a_576x195.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!XdJE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fd8c222-83cc-4d22-870d-e38a95e2674a_576x195.png 424w, https://substackcdn.com/image/fetch/$s_!XdJE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fd8c222-83cc-4d22-870d-e38a95e2674a_576x195.png 848w, https://substackcdn.com/image/fetch/$s_!XdJE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fd8c222-83cc-4d22-870d-e38a95e2674a_576x195.png 1272w, https://substackcdn.com/image/fetch/$s_!XdJE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fd8c222-83cc-4d22-870d-e38a95e2674a_576x195.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!XdJE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fd8c222-83cc-4d22-870d-e38a95e2674a_576x195.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1fd8c222-83cc-4d22-870d-e38a95e2674a_576x195.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!XdJE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fd8c222-83cc-4d22-870d-e38a95e2674a_576x195.png 424w, https://substackcdn.com/image/fetch/$s_!XdJE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fd8c222-83cc-4d22-870d-e38a95e2674a_576x195.png 848w, https://substackcdn.com/image/fetch/$s_!XdJE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fd8c222-83cc-4d22-870d-e38a95e2674a_576x195.png 1272w, https://substackcdn.com/image/fetch/$s_!XdJE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1fd8c222-83cc-4d22-870d-e38a95e2674a_576x195.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Actual vs Forecast for multivariate LSTM model for first&nbsp;month</figcaption></figure></div><p>The MAE for the the 12 step forecast horizons is as shown&nbsp;below:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nZxw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99eb31d-c384-4567-87f5-69a8ae8b6a3a_543x106.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nZxw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99eb31d-c384-4567-87f5-69a8ae8b6a3a_543x106.png 424w, https://substackcdn.com/image/fetch/$s_!nZxw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99eb31d-c384-4567-87f5-69a8ae8b6a3a_543x106.png 848w, https://substackcdn.com/image/fetch/$s_!nZxw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99eb31d-c384-4567-87f5-69a8ae8b6a3a_543x106.png 1272w, https://substackcdn.com/image/fetch/$s_!nZxw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99eb31d-c384-4567-87f5-69a8ae8b6a3a_543x106.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nZxw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99eb31d-c384-4567-87f5-69a8ae8b6a3a_543x106.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c99eb31d-c384-4567-87f5-69a8ae8b6a3a_543x106.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!nZxw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99eb31d-c384-4567-87f5-69a8ae8b6a3a_543x106.png 424w, https://substackcdn.com/image/fetch/$s_!nZxw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99eb31d-c384-4567-87f5-69a8ae8b6a3a_543x106.png 848w, https://substackcdn.com/image/fetch/$s_!nZxw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99eb31d-c384-4567-87f5-69a8ae8b6a3a_543x106.png 1272w, https://substackcdn.com/image/fetch/$s_!nZxw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc99eb31d-c384-4567-87f5-69a8ae8b6a3a_543x106.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">MAE for multivariate LSTM&nbsp;model</figcaption></figure></div><p><strong>Discussion on Univariate Forecasting with Feed Forward&nbsp;ANN:</strong></p><p>For fitting an ANN model using Tensorflow in Keras, the data used for LSTM needs to be reshaped such that the structure of the input data is stored as (samples, features). In this analysis, forecasting using ANNs was done with both min-max scaling and standardization scaling. The model results were better when using standardization for univariate setting, while the results were better when using min-max normalization for multivariate setting.</p><p>All the other experimental conditions were retained as before, an input lag of 12 was chosen. Again, two linearly stacked layers were chosen for fitting the ANN. The univariate model output was obtained as&nbsp;follows:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dom8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7225c817-15c2-4d88-bfac-bf2fcfae5bc9_558x290.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dom8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7225c817-15c2-4d88-bfac-bf2fcfae5bc9_558x290.png 424w, https://substackcdn.com/image/fetch/$s_!dom8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7225c817-15c2-4d88-bfac-bf2fcfae5bc9_558x290.png 848w, https://substackcdn.com/image/fetch/$s_!dom8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7225c817-15c2-4d88-bfac-bf2fcfae5bc9_558x290.png 1272w, https://substackcdn.com/image/fetch/$s_!dom8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7225c817-15c2-4d88-bfac-bf2fcfae5bc9_558x290.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dom8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7225c817-15c2-4d88-bfac-bf2fcfae5bc9_558x290.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7225c817-15c2-4d88-bfac-bf2fcfae5bc9_558x290.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!dom8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7225c817-15c2-4d88-bfac-bf2fcfae5bc9_558x290.png 424w, https://substackcdn.com/image/fetch/$s_!dom8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7225c817-15c2-4d88-bfac-bf2fcfae5bc9_558x290.png 848w, https://substackcdn.com/image/fetch/$s_!dom8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7225c817-15c2-4d88-bfac-bf2fcfae5bc9_558x290.png 1272w, https://substackcdn.com/image/fetch/$s_!dom8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7225c817-15c2-4d88-bfac-bf2fcfae5bc9_558x290.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Model summary for univariate ANN</figcaption></figure></div><p>After fitting the model, MAE of validation was obtained as&nbsp;follows:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!N8Fi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa6296144-c6d8-403a-bb6c-8b839e9ec53d_559x87.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!N8Fi!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa6296144-c6d8-403a-bb6c-8b839e9ec53d_559x87.png 424w, https://substackcdn.com/image/fetch/$s_!N8Fi!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa6296144-c6d8-403a-bb6c-8b839e9ec53d_559x87.png 848w, https://substackcdn.com/image/fetch/$s_!N8Fi!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa6296144-c6d8-403a-bb6c-8b839e9ec53d_559x87.png 1272w, https://substackcdn.com/image/fetch/$s_!N8Fi!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa6296144-c6d8-403a-bb6c-8b839e9ec53d_559x87.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!N8Fi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa6296144-c6d8-403a-bb6c-8b839e9ec53d_559x87.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a6296144-c6d8-403a-bb6c-8b839e9ec53d_559x87.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!N8Fi!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa6296144-c6d8-403a-bb6c-8b839e9ec53d_559x87.png 424w, https://substackcdn.com/image/fetch/$s_!N8Fi!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa6296144-c6d8-403a-bb6c-8b839e9ec53d_559x87.png 848w, https://substackcdn.com/image/fetch/$s_!N8Fi!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa6296144-c6d8-403a-bb6c-8b839e9ec53d_559x87.png 1272w, https://substackcdn.com/image/fetch/$s_!N8Fi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa6296144-c6d8-403a-bb6c-8b839e9ec53d_559x87.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">MAE for validation forf univariate ANN</figcaption></figure></div><p>After fitting with the best model, forecasting the 12-step output, and inverse transforming, the following plot is obtained:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yGKQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18625800-e278-4ddf-922c-4a3cb3246911_576x196.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yGKQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18625800-e278-4ddf-922c-4a3cb3246911_576x196.png 424w, https://substackcdn.com/image/fetch/$s_!yGKQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18625800-e278-4ddf-922c-4a3cb3246911_576x196.png 848w, https://substackcdn.com/image/fetch/$s_!yGKQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18625800-e278-4ddf-922c-4a3cb3246911_576x196.png 1272w, https://substackcdn.com/image/fetch/$s_!yGKQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18625800-e278-4ddf-922c-4a3cb3246911_576x196.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yGKQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18625800-e278-4ddf-922c-4a3cb3246911_576x196.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/18625800-e278-4ddf-922c-4a3cb3246911_576x196.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!yGKQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18625800-e278-4ddf-922c-4a3cb3246911_576x196.png 424w, https://substackcdn.com/image/fetch/$s_!yGKQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18625800-e278-4ddf-922c-4a3cb3246911_576x196.png 848w, https://substackcdn.com/image/fetch/$s_!yGKQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18625800-e278-4ddf-922c-4a3cb3246911_576x196.png 1272w, https://substackcdn.com/image/fetch/$s_!yGKQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18625800-e278-4ddf-922c-4a3cb3246911_576x196.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Actual vs Forecast for month 1 using univariate ANN</figcaption></figure></div><p>The MAE for the 12 step forecast with the univariate ANN is obtained as&nbsp;shown:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ucdg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4269e0be-4399-4b8f-b68b-f5b7130a7d4a_460x89.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ucdg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4269e0be-4399-4b8f-b68b-f5b7130a7d4a_460x89.png 424w, https://substackcdn.com/image/fetch/$s_!ucdg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4269e0be-4399-4b8f-b68b-f5b7130a7d4a_460x89.png 848w, https://substackcdn.com/image/fetch/$s_!ucdg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4269e0be-4399-4b8f-b68b-f5b7130a7d4a_460x89.png 1272w, https://substackcdn.com/image/fetch/$s_!ucdg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4269e0be-4399-4b8f-b68b-f5b7130a7d4a_460x89.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ucdg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4269e0be-4399-4b8f-b68b-f5b7130a7d4a_460x89.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4269e0be-4399-4b8f-b68b-f5b7130a7d4a_460x89.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!ucdg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4269e0be-4399-4b8f-b68b-f5b7130a7d4a_460x89.png 424w, https://substackcdn.com/image/fetch/$s_!ucdg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4269e0be-4399-4b8f-b68b-f5b7130a7d4a_460x89.png 848w, https://substackcdn.com/image/fetch/$s_!ucdg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4269e0be-4399-4b8f-b68b-f5b7130a7d4a_460x89.png 1272w, https://substackcdn.com/image/fetch/$s_!ucdg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4269e0be-4399-4b8f-b68b-f5b7130a7d4a_460x89.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">MAE for forecasting with univariate ANN</figcaption></figure></div><p><strong>Discussion on Multivariate Feed Forward Artificial Neural&nbsp;Network</strong></p><p>This model is also a 2-layer linearly stacked neural network. The model information is provided&nbsp;below.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6fMX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f938b64-cee5-4413-a8b3-d23c0ebb029e_561x291.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6fMX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f938b64-cee5-4413-a8b3-d23c0ebb029e_561x291.png 424w, https://substackcdn.com/image/fetch/$s_!6fMX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f938b64-cee5-4413-a8b3-d23c0ebb029e_561x291.png 848w, https://substackcdn.com/image/fetch/$s_!6fMX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f938b64-cee5-4413-a8b3-d23c0ebb029e_561x291.png 1272w, https://substackcdn.com/image/fetch/$s_!6fMX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f938b64-cee5-4413-a8b3-d23c0ebb029e_561x291.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6fMX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f938b64-cee5-4413-a8b3-d23c0ebb029e_561x291.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f938b64-cee5-4413-a8b3-d23c0ebb029e_561x291.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!6fMX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f938b64-cee5-4413-a8b3-d23c0ebb029e_561x291.png 424w, https://substackcdn.com/image/fetch/$s_!6fMX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f938b64-cee5-4413-a8b3-d23c0ebb029e_561x291.png 848w, https://substackcdn.com/image/fetch/$s_!6fMX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f938b64-cee5-4413-a8b3-d23c0ebb029e_561x291.png 1272w, https://substackcdn.com/image/fetch/$s_!6fMX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f938b64-cee5-4413-a8b3-d23c0ebb029e_561x291.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Model summary for Multivariate ANN</figcaption></figure></div><p>The test loss and test accuracy is shown as&nbsp;below:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!M7TQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff61b26a0-5857-473c-84f4-f05fbbe795da_536x77.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!M7TQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff61b26a0-5857-473c-84f4-f05fbbe795da_536x77.png 424w, https://substackcdn.com/image/fetch/$s_!M7TQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff61b26a0-5857-473c-84f4-f05fbbe795da_536x77.png 848w, https://substackcdn.com/image/fetch/$s_!M7TQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff61b26a0-5857-473c-84f4-f05fbbe795da_536x77.png 1272w, https://substackcdn.com/image/fetch/$s_!M7TQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff61b26a0-5857-473c-84f4-f05fbbe795da_536x77.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!M7TQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff61b26a0-5857-473c-84f4-f05fbbe795da_536x77.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f61b26a0-5857-473c-84f4-f05fbbe795da_536x77.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!M7TQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff61b26a0-5857-473c-84f4-f05fbbe795da_536x77.png 424w, https://substackcdn.com/image/fetch/$s_!M7TQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff61b26a0-5857-473c-84f4-f05fbbe795da_536x77.png 848w, https://substackcdn.com/image/fetch/$s_!M7TQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff61b26a0-5857-473c-84f4-f05fbbe795da_536x77.png 1272w, https://substackcdn.com/image/fetch/$s_!M7TQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff61b26a0-5857-473c-84f4-f05fbbe795da_536x77.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">MAE for validation using Mutlivariate ANN</figcaption></figure></div><p>The training loss and validation loss is plotted&nbsp;below:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qF5n!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c5b2edd-e335-4507-aa6f-01a2d9d5c7bf_576x194.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qF5n!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c5b2edd-e335-4507-aa6f-01a2d9d5c7bf_576x194.png 424w, https://substackcdn.com/image/fetch/$s_!qF5n!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c5b2edd-e335-4507-aa6f-01a2d9d5c7bf_576x194.png 848w, https://substackcdn.com/image/fetch/$s_!qF5n!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c5b2edd-e335-4507-aa6f-01a2d9d5c7bf_576x194.png 1272w, https://substackcdn.com/image/fetch/$s_!qF5n!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c5b2edd-e335-4507-aa6f-01a2d9d5c7bf_576x194.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qF5n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c5b2edd-e335-4507-aa6f-01a2d9d5c7bf_576x194.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8c5b2edd-e335-4507-aa6f-01a2d9d5c7bf_576x194.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!qF5n!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c5b2edd-e335-4507-aa6f-01a2d9d5c7bf_576x194.png 424w, https://substackcdn.com/image/fetch/$s_!qF5n!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c5b2edd-e335-4507-aa6f-01a2d9d5c7bf_576x194.png 848w, https://substackcdn.com/image/fetch/$s_!qF5n!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c5b2edd-e335-4507-aa6f-01a2d9d5c7bf_576x194.png 1272w, https://substackcdn.com/image/fetch/$s_!qF5n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8c5b2edd-e335-4507-aa6f-01a2d9d5c7bf_576x194.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Training and validation loss for multivariate ANN</figcaption></figure></div><p>Again, after forecasting with the best model, inverse transform is done followed by calculation of the MAE. Results obtained are shown&nbsp;below.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NmkO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa76ff33b-3024-4764-9e52-f665ed149ba5_576x108.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NmkO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa76ff33b-3024-4764-9e52-f665ed149ba5_576x108.png 424w, https://substackcdn.com/image/fetch/$s_!NmkO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa76ff33b-3024-4764-9e52-f665ed149ba5_576x108.png 848w, https://substackcdn.com/image/fetch/$s_!NmkO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa76ff33b-3024-4764-9e52-f665ed149ba5_576x108.png 1272w, https://substackcdn.com/image/fetch/$s_!NmkO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa76ff33b-3024-4764-9e52-f665ed149ba5_576x108.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NmkO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa76ff33b-3024-4764-9e52-f665ed149ba5_576x108.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a76ff33b-3024-4764-9e52-f665ed149ba5_576x108.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!NmkO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa76ff33b-3024-4764-9e52-f665ed149ba5_576x108.png 424w, https://substackcdn.com/image/fetch/$s_!NmkO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa76ff33b-3024-4764-9e52-f665ed149ba5_576x108.png 848w, https://substackcdn.com/image/fetch/$s_!NmkO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa76ff33b-3024-4764-9e52-f665ed149ba5_576x108.png 1272w, https://substackcdn.com/image/fetch/$s_!NmkO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa76ff33b-3024-4764-9e52-f665ed149ba5_576x108.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Forecasting MAE for multivariate ANN</figcaption></figure></div><p>The plot for the first month forecast in the 12-month forecast horizon is plotted&nbsp;below.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VXm2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8fedefe0-b436-4df8-bc99-153070e1f00f_576x196.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VXm2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8fedefe0-b436-4df8-bc99-153070e1f00f_576x196.png 424w, https://substackcdn.com/image/fetch/$s_!VXm2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8fedefe0-b436-4df8-bc99-153070e1f00f_576x196.png 848w, https://substackcdn.com/image/fetch/$s_!VXm2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8fedefe0-b436-4df8-bc99-153070e1f00f_576x196.png 1272w, https://substackcdn.com/image/fetch/$s_!VXm2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8fedefe0-b436-4df8-bc99-153070e1f00f_576x196.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VXm2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8fedefe0-b436-4df8-bc99-153070e1f00f_576x196.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8fedefe0-b436-4df8-bc99-153070e1f00f_576x196.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!VXm2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8fedefe0-b436-4df8-bc99-153070e1f00f_576x196.png 424w, https://substackcdn.com/image/fetch/$s_!VXm2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8fedefe0-b436-4df8-bc99-153070e1f00f_576x196.png 848w, https://substackcdn.com/image/fetch/$s_!VXm2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8fedefe0-b436-4df8-bc99-153070e1f00f_576x196.png 1272w, https://substackcdn.com/image/fetch/$s_!VXm2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8fedefe0-b436-4df8-bc99-153070e1f00f_576x196.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Actual vs Forecast for month 1 using multivariate ANN</figcaption></figure></div><p>Of all of the model used so far, it is easy to tell visually that this model performs poorly (of all the other models) developed in this analysis.</p><p>Let&#8217;s look at how we did across all the&nbsp;models.</p><h3><strong>Model Evaluation Results</strong></h3><p>A comparative analysis of the models is tabulated as shown in table&nbsp;below.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4O2n!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e5c9e83-cc7d-4c33-b86f-d26fc40f4025_598x344.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4O2n!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e5c9e83-cc7d-4c33-b86f-d26fc40f4025_598x344.png 424w, https://substackcdn.com/image/fetch/$s_!4O2n!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e5c9e83-cc7d-4c33-b86f-d26fc40f4025_598x344.png 848w, https://substackcdn.com/image/fetch/$s_!4O2n!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e5c9e83-cc7d-4c33-b86f-d26fc40f4025_598x344.png 1272w, https://substackcdn.com/image/fetch/$s_!4O2n!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e5c9e83-cc7d-4c33-b86f-d26fc40f4025_598x344.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4O2n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e5c9e83-cc7d-4c33-b86f-d26fc40f4025_598x344.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9e5c9e83-cc7d-4c33-b86f-d26fc40f4025_598x344.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!4O2n!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e5c9e83-cc7d-4c33-b86f-d26fc40f4025_598x344.png 424w, https://substackcdn.com/image/fetch/$s_!4O2n!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e5c9e83-cc7d-4c33-b86f-d26fc40f4025_598x344.png 848w, https://substackcdn.com/image/fetch/$s_!4O2n!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e5c9e83-cc7d-4c33-b86f-d26fc40f4025_598x344.png 1272w, https://substackcdn.com/image/fetch/$s_!4O2n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e5c9e83-cc7d-4c33-b86f-d26fc40f4025_598x344.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Comparison of MAE for unemployment rate forecasting. Benchmarks sourced from Cook &amp; Hall paper on &#8220;Macroeconomic Indicator Forecasting with Deep Neural Networks&#8221;. Metrics represented in basis points (bps). 1 basis point =&nbsp;0.01%</figcaption></figure></div><p>The Mean MAE is shown for the VAR, ANN and LSTM models. Each model has an univariate (U) and multivariate (M) result tested on out of sample data from 1997 to&nbsp;2014.</p><p>The last column shows benchmarks obtained from the data published by SPF (Survey of Professional Forecasters) at Philadelphia Federal Reserve Bank. These benchmarks were used for comparison of univariate analysis and forecasting by Cook and Hall (2017). This analysis used the same data and benchmarks as the previous analysis by the Fed Reserve authors which was done using univariate methods.</p><p>The below figure shows graphical assessment of the MAE of the different models over the multiple forecast windows when compared to the SPF benchmark. The brown line in the center indicates the SPF forecast. The top two lines indicate the multivariate neural networks. The bottom four lines indicates the univariate AR model, neural networks and the VAR(1) multivariate model. A comparative explanation of models generated from this analysis vis-a-vis the benchmarks follow.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!WsFy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c77b39b-2b3e-472f-ab1e-6ad401e7e13d_576x272.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WsFy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c77b39b-2b3e-472f-ab1e-6ad401e7e13d_576x272.png 424w, https://substackcdn.com/image/fetch/$s_!WsFy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c77b39b-2b3e-472f-ab1e-6ad401e7e13d_576x272.png 848w, https://substackcdn.com/image/fetch/$s_!WsFy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c77b39b-2b3e-472f-ab1e-6ad401e7e13d_576x272.png 1272w, https://substackcdn.com/image/fetch/$s_!WsFy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c77b39b-2b3e-472f-ab1e-6ad401e7e13d_576x272.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WsFy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c77b39b-2b3e-472f-ab1e-6ad401e7e13d_576x272.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7c77b39b-2b3e-472f-ab1e-6ad401e7e13d_576x272.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!WsFy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c77b39b-2b3e-472f-ab1e-6ad401e7e13d_576x272.png 424w, https://substackcdn.com/image/fetch/$s_!WsFy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c77b39b-2b3e-472f-ab1e-6ad401e7e13d_576x272.png 848w, https://substackcdn.com/image/fetch/$s_!WsFy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c77b39b-2b3e-472f-ab1e-6ad401e7e13d_576x272.png 1272w, https://substackcdn.com/image/fetch/$s_!WsFy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7c77b39b-2b3e-472f-ab1e-6ad401e7e13d_576x272.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">MAE Distribution for AR, VAR, LSTM, ANN vs Benchmark across 4&nbsp;quarters</figcaption></figure></div><p><strong>This research Univariate vs Fed Univariate&#8202;&#8212;</strong>&#8202;In this analysis, the AR(5) model compared relatively better than Fed&#8217;s Directed AR Model (DARM). It performed just marginally better than SPF&#8217;s forecast. It also performs better than benchmark univariate LSTM. While there is not enough information on the model specific hyper tuning parameters used in their univariate LSTM, it is plausible their model could perform equally well under similar parameters. It is also plausible that the univariate AR model from this analysis outperformed the directed AR model because of the usage of optimal lag and usage of first order and second order difference as model inputs. There is no information on how the DARM was setup by Federal Reserve to further comment on causes for performance differences between the&nbsp;two.</p><p><strong>This research Multivariate VAR Model Performance&#8202;&#8212;</strong>&#8202;The VAR model from this analysis performed best for the three month forecast period, with comparable performance with the neural network univariate models for six month and nine month forecast period, while its performance was slightly unfavorable compared to the twelve month forecast period. The multivariate VAR(1) model outperformed the univariate AR model across all quarters with diminishing gap in their performance as the number of forecast steps increased. It also performed better than the vanilla LSTM model by Cook &amp; Hall and other Federal Reserve models. Based on these results obtained in the VAR model, it can be concluded that the information contained in the macroeconomic indicators chosen for forecasting unemployment rate have a reasonably strong relationship with unemployment rate, more than the strength of the relationship solely found as a result of autocorrelation of lagged unemployment rate data, at least for shorter forecasting period.</p><p><strong>This research Univariate Neural Network models&#8202;&#8212;</strong>&#8202;The univariate ANN and LSTM models performed better than VAR(1) specifically for the 12 step forecast period with comparable performance for three and six step forecast periods. It is possible that a more optimally tuned neural network and other architectures might be able to beat the VAR(1) model not just for the longer step forecast periods, but consistently across all the&nbsp;periods.</p><p><strong>This research Multivariate Neural Network models</strong>&#8202;&#8212;&#8202;The neural network models showed promisingly low MAE for validation data. However, both LSTM and ANN fared poorly on the test data. The LSTM model had two to three times the MAE on an average compared to SPF models. This is likely due to reasons such as overfitting and propagating errors due to predicting multiple variables.</p><p>The three subsequent tables below show the MAE and Standard Deviation for each models developed in this analysis and they are compared with benchmark MAE and Standard Deviation. The standard deviation was computed for the forecast errors. Three of the models&#8202;&#8212;&#8202;multivariate VAR(1), univariate LSTM and univariate ANN have a smaller dispersion around the mean when compared to the dispersion of the SPF benchmark model around their respective means. Whereas, the univariate AR(5), multivariate LSTM and multivariate ANN all have a larger dispersion compared to that of the SPF benchmark models. All of models developed in this analysis, including the best performing multivariate VAR(1) model have a larger dispersion around the mean relative to Cook &amp; Hall&#8217;s standard deviation around their model means. MAE and SD are in basis&nbsp;points.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!BPsy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F100a89d0-2569-4ae9-b22a-9f7bfd39eb81_576x165.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BPsy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F100a89d0-2569-4ae9-b22a-9f7bfd39eb81_576x165.png 424w, https://substackcdn.com/image/fetch/$s_!BPsy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F100a89d0-2569-4ae9-b22a-9f7bfd39eb81_576x165.png 848w, https://substackcdn.com/image/fetch/$s_!BPsy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F100a89d0-2569-4ae9-b22a-9f7bfd39eb81_576x165.png 1272w, https://substackcdn.com/image/fetch/$s_!BPsy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F100a89d0-2569-4ae9-b22a-9f7bfd39eb81_576x165.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BPsy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F100a89d0-2569-4ae9-b22a-9f7bfd39eb81_576x165.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/100a89d0-2569-4ae9-b22a-9f7bfd39eb81_576x165.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!BPsy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F100a89d0-2569-4ae9-b22a-9f7bfd39eb81_576x165.png 424w, https://substackcdn.com/image/fetch/$s_!BPsy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F100a89d0-2569-4ae9-b22a-9f7bfd39eb81_576x165.png 848w, https://substackcdn.com/image/fetch/$s_!BPsy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F100a89d0-2569-4ae9-b22a-9f7bfd39eb81_576x165.png 1272w, https://substackcdn.com/image/fetch/$s_!BPsy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F100a89d0-2569-4ae9-b22a-9f7bfd39eb81_576x165.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Comparison of MAE and SD for Autoregressive models vs benchmark models.</figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sUSW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27a552c4-47ea-4ab7-bc26-d1ee5febec50_576x170.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sUSW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27a552c4-47ea-4ab7-bc26-d1ee5febec50_576x170.png 424w, https://substackcdn.com/image/fetch/$s_!sUSW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27a552c4-47ea-4ab7-bc26-d1ee5febec50_576x170.png 848w, https://substackcdn.com/image/fetch/$s_!sUSW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27a552c4-47ea-4ab7-bc26-d1ee5febec50_576x170.png 1272w, https://substackcdn.com/image/fetch/$s_!sUSW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27a552c4-47ea-4ab7-bc26-d1ee5febec50_576x170.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sUSW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27a552c4-47ea-4ab7-bc26-d1ee5febec50_576x170.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/27a552c4-47ea-4ab7-bc26-d1ee5febec50_576x170.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!sUSW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27a552c4-47ea-4ab7-bc26-d1ee5febec50_576x170.png 424w, https://substackcdn.com/image/fetch/$s_!sUSW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27a552c4-47ea-4ab7-bc26-d1ee5febec50_576x170.png 848w, https://substackcdn.com/image/fetch/$s_!sUSW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27a552c4-47ea-4ab7-bc26-d1ee5febec50_576x170.png 1272w, https://substackcdn.com/image/fetch/$s_!sUSW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27a552c4-47ea-4ab7-bc26-d1ee5febec50_576x170.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Comparison of MAE and SD for LSTM models vs benchmark models.</figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!YyXD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bc954f8-f568-4996-8eff-0470656d2df7_573x160.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YyXD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bc954f8-f568-4996-8eff-0470656d2df7_573x160.png 424w, https://substackcdn.com/image/fetch/$s_!YyXD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bc954f8-f568-4996-8eff-0470656d2df7_573x160.png 848w, https://substackcdn.com/image/fetch/$s_!YyXD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bc954f8-f568-4996-8eff-0470656d2df7_573x160.png 1272w, https://substackcdn.com/image/fetch/$s_!YyXD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bc954f8-f568-4996-8eff-0470656d2df7_573x160.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YyXD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bc954f8-f568-4996-8eff-0470656d2df7_573x160.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9bc954f8-f568-4996-8eff-0470656d2df7_573x160.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!YyXD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bc954f8-f568-4996-8eff-0470656d2df7_573x160.png 424w, https://substackcdn.com/image/fetch/$s_!YyXD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bc954f8-f568-4996-8eff-0470656d2df7_573x160.png 848w, https://substackcdn.com/image/fetch/$s_!YyXD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bc954f8-f568-4996-8eff-0470656d2df7_573x160.png 1272w, https://substackcdn.com/image/fetch/$s_!YyXD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bc954f8-f568-4996-8eff-0470656d2df7_573x160.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Comparison of MAE and SD for ANN models vs benchmark models.</figcaption></figure></div><h3>Conclusion</h3><p>One of the questions this research set out to answer was whether adding more variables helps improve model performance. The results established that is true, as shown by the results of the multivariate vector autoregressive model, specifically for shorter forecast&nbsp;windows.</p><p>Another question this research sought out to answer was whether using a neural network model can help improve the forecast accuracy. The results provide a mixed answer to this question. The univariate neural network models&#8202;&#8212;&#8202;both ANN and LSTM did favorably well when compared to Fed&#8217;s models. However when more data was introduced into the neural networks, the model performance deteriorated significantly. The neural networks had minimal tuning. It is possible that under the right set of hyper parameters, as well as by using other more recently developed neural network architectures may result in better outcomes for forecasting unemployment rate.</p><h3>Limitations</h3><p>One of the limitations of these models is they are not grounded in the economic theories that underpin the relationship between the macroeconomic variables. So, attributing causality from any of the other multivariate features to explain the dependent variable is not feasible. This research can be extended using Structural VAR which allows modeling assumptions of directional relationship between the various variables.</p><p>This research also did not consider implementation of cointegration in these models, which in finance and economics is the idea of equilibrium achieved between two different economic variables over a long run (Zivot &amp; Wang,&nbsp;2003).</p><h3>Recommendations for further&nbsp;research</h3><p>There are several avenues that can be explored in the future to extend this&nbsp;work.</p><ol><li><p>There is an opportunity to expand the VAR model by including other variables<strong> </strong>that can explain unemployment rate, variables related to other economic activity such as stock market returns, private investments such as equity financing and many other economic indicators.</p></li><li><p>Explore other recurrent neural network architectures such as Bi-directional LSTM<strong> </strong>in a multivariate setting.</p></li><li><p>Employ permuting of multivariate combinations as well as hyper parameter optimization for neural network training.</p></li><li><p>There is volatility in the unemployment rate which could be modeled using Generalized Autoregressive Conditional Heteroskedasticity (GARCH) to handle different volatility across different times.</p></li><li><p>The unemployment rate appear to in different regimes across different long-run economic cycles. One option to model this would be to use regime switching using Hidden Markov Models&nbsp;(HMM).</p></li><li><p>Lastly, and importantly, with recent advancements in transformer architectures and its application to time series data, there is an opportunity to consider implementing these architectures to forecasting unemployment rate.</p></li></ol><p>In closing, this was an interesting and very worthwhile exercise in applying academic rigor to real world financial forecasting application. This work was the basis of my talk at ASA (American Statistical Association) Symposium on Data Science and Statistics at Pittsburgh, PA (June&nbsp;&#8217;22)</p><p>I know there are many other considerations I could have included in the analysis. I welcome your comments/feedback, and look forward to being in broader conversation with you on application of data science techniques.</p><p><br></p><h3>Acknowledgement</h3><p>A shout out and acknowledgement to all the researchers, educators and authors who spent countless hours building and teaching this knowledge base over the many decades. It is only out of their efforts do data science practioners like myself are able to do what we do. I am grateful to all of&nbsp;you.</p><p>Until next&nbsp;time!</p><h3>References:</h3><p>Chollet, F. (2018). <em>Deep Learning with Python.</em> NY:&nbsp;Manning.</p><p>Cook, T., &amp; Hall, A. S. (2017). <em>Macroeconomic Indicator Forecasting with Deep Neural Networks.</em> Retrieved from dx.doi.org: <a href="https://dx.doi.org/10.18651/RWP2017-11">https://dx.doi.org/10.18651/RWP2017-11</a></p><p>Karpathy, A. (2015). Retrieved from <a href="http://karpathy.github.io/2015/05/21/rnn-effectiveness/">http://karpathy.github.io/2015/05/21/rnn-effectiveness/</a></p><p>Montgomery, A., &amp; Zarnowitz, V. (1998). Forecasting the US Unemployment Rate. <em>Journal of the American Statistical Association</em>, 478.</p><p>SPF. (2022). <em>Survey of Professional Forecasters</em>. Retrieved from Federal Reserve Bank Philadephia: <a href="https://www.philadelphiafed.org/surveys-and-data/real-time-data-research/survey-of-professional-forecasters">https://www.philadelphiafed.org/surveys-and-data/real-time-data-research/survey-of-professional-forecasters</a></p><p><em>Vector Autoregressions</em>. (2022). Retrieved from Statsmodels: <a href="https://www.statsmodels.org/dev/vector_ar.html">https://www.statsmodels.org/dev/vector_ar.html</a></p><p>Zivot, E., &amp; Wang, J. (2003). Vector Autoregressive Models for Multivariate Time Series. In E. Zivot, &amp; J. Wang, <em>Modeling Financial Time Series with S-Plus&#174;.</em> New York, NY, USA: Springer. doi:https://doi.org/10.1007/978-0-387-21763-5_11</p>]]></content:encoded></item><item><title><![CDATA[Multivariate time series forecasting and analysis of the US unemployment rate — Part 3]]></title><description><![CDATA[Multivariate time series forecasting and analysis of the US unemployment rate &#8212; Part 3]]></description><link>https://www.thefractal.co/p/multivariate-time-series-forecasting-and-analysis-of-the-us-unemployment-rate-part-3-bb789a7487a7</link><guid isPermaLink="false">https://www.thefractal.co/p/multivariate-time-series-forecasting-and-analysis-of-the-us-unemployment-rate-part-3-bb789a7487a7</guid><dc:creator><![CDATA[Vijay Reddiar]]></dc:creator><pubDate>Tue, 09 May 2023 15:44:23 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/3042c4fe-997b-4f0a-b2e9-f75a2e82022c_800x533.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3>Multivariate time series forecasting and analysis of the US unemployment rate&#8202;&#8212;&#8202;Part&nbsp;3</h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!kJKH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F719716b6-54a3-4fba-9aa2-c2e169dea2ca_800x533.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kJKH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F719716b6-54a3-4fba-9aa2-c2e169dea2ca_800x533.png 424w, https://substackcdn.com/image/fetch/$s_!kJKH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F719716b6-54a3-4fba-9aa2-c2e169dea2ca_800x533.png 848w, https://substackcdn.com/image/fetch/$s_!kJKH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F719716b6-54a3-4fba-9aa2-c2e169dea2ca_800x533.png 1272w, https://substackcdn.com/image/fetch/$s_!kJKH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F719716b6-54a3-4fba-9aa2-c2e169dea2ca_800x533.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kJKH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F719716b6-54a3-4fba-9aa2-c2e169dea2ca_800x533.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/719716b6-54a3-4fba-9aa2-c2e169dea2ca_800x533.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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;: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_!kJKH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F719716b6-54a3-4fba-9aa2-c2e169dea2ca_800x533.png 424w, https://substackcdn.com/image/fetch/$s_!kJKH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F719716b6-54a3-4fba-9aa2-c2e169dea2ca_800x533.png 848w, https://substackcdn.com/image/fetch/$s_!kJKH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F719716b6-54a3-4fba-9aa2-c2e169dea2ca_800x533.png 1272w, https://substackcdn.com/image/fetch/$s_!kJKH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F719716b6-54a3-4fba-9aa2-c2e169dea2ca_800x533.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>In my previous posts on this topic we covered two parts so&nbsp;far.</p><p>In <a href="https://medium.com/@reddiarv/multivariate-time-series-forecasting-and-analysis-of-the-us-unemployment-rate-part-1-f1454b029cb">Part 1</a>, we discussed the importance and relevance of US unemployment rate forecasting and why a multivariate modeling approach is necessary.</p><p>We also discussed the various macroeconomic variables used in this analysis as well as an overview of the time series modeling approach.</p><p>In <a href="https://medium.com/@reddiarv/multivariate-time-series-forecasting-and-analysis-of-the-us-unemployment-rate-part-2-e865f7ff07a6">Part 2</a>, we discussed the data prep steps as well as exploratory data analysis as it applies to standard time series datasets including time series decomposition, autocorrelation, partial autocorrelations as well as test for stationarity.</p><p>In this post, we will begin the discussion with step 5 of the 6 stepped process we outlined in part 1 of this&nbsp;series.</p><p>Let&#8217;s go to step&nbsp;5:</p><p><strong>5. Choosing and Fitting Models:</strong> In this step, models are trained using the training data and evaluated using validation data. These are chosen based on assumptions the researchers make that the model satisfies. Models are built using multiple parameter (or, hyperparameter values) to build the most efficacious model using historical data. In this post we will discuss Vector Autoregressive model as well as two Neural Network architectures.</p><h4>Vector Autoregression (VAR)&nbsp;Models</h4><p>A <em>vector autoregression (VAR) model</em> is a flexible time series model that is used for multivariate analysis. It is an extension of the univariate Auto regressive (AR) model and works with multivariate time&nbsp;series.</p><p>A VAR model contains a system of equations of <em>n</em> distinct, stationary response variables as linear functions of lagged responses and other terms. VAR models are also characterized <em>p</em> lags of all variables in the system, denoted as a VAR(<em>p</em>)&nbsp;model.</p><p>A bivariate VAR(2) model with time series variables y<em>1t </em>and y<em>2t</em> can be represented as&nbsp;follows:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!KYKg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67db73b6-7cb6-4810-a976-717d03a8ad6f_407x105.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!KYKg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67db73b6-7cb6-4810-a976-717d03a8ad6f_407x105.png 424w, https://substackcdn.com/image/fetch/$s_!KYKg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67db73b6-7cb6-4810-a976-717d03a8ad6f_407x105.png 848w, https://substackcdn.com/image/fetch/$s_!KYKg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67db73b6-7cb6-4810-a976-717d03a8ad6f_407x105.png 1272w, https://substackcdn.com/image/fetch/$s_!KYKg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67db73b6-7cb6-4810-a976-717d03a8ad6f_407x105.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!KYKg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67db73b6-7cb6-4810-a976-717d03a8ad6f_407x105.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/67db73b6-7cb6-4810-a976-717d03a8ad6f_407x105.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!KYKg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67db73b6-7cb6-4810-a976-717d03a8ad6f_407x105.png 424w, https://substackcdn.com/image/fetch/$s_!KYKg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67db73b6-7cb6-4810-a976-717d03a8ad6f_407x105.png 848w, https://substackcdn.com/image/fetch/$s_!KYKg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67db73b6-7cb6-4810-a976-717d03a8ad6f_407x105.png 1272w, https://substackcdn.com/image/fetch/$s_!KYKg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67db73b6-7cb6-4810-a976-717d03a8ad6f_407x105.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">(Zivot &amp; Wang,&nbsp;2003)</figcaption></figure></div><p>VAR models belong to a class of multivariate linear time series models called <em>vector autoregression moving average (VARMA)&nbsp;models</em>.</p><p>Interpretation of a general VAR(p) model is difficult due to complex interactions between the variables in the model. So the model is described using different types of structural analysis summaries including Granger causality, Impulse response functions and forecast error variance decomposition. This analysis includes Granger causality of other predictor time series data on the unemployment data. Granger causality is covered in part 4 of this&nbsp;series.</p><h4>Whu use Vector Autoregressive Models?</h4><p>VAR models are linear models. However, non-linearities can be modeled by applying various adjustments including number of lags to include for each time series, which co-variate to use, incorporating moving-average components and accommodating co-integration (Hyndman &amp; Athanasopoulos, 2021).</p><p>The number of lags that are appropriate for forecasting the dependent variable is obtained by minimizing information criterion measures such as Akaike Information Criterion (AIC), Bayes Information Criterion (BIC), Hannan-Quinn Information Criterion (HQIC) and Final Prediction Error (FPE) (Lower, Eric, 2021). The lag that had the smallest information criterion value across all of these measures was chosen to provide a parsimonious model (ResearchGate, 2022). Deciding what variables to use can be done by applying Granger Causality tests. Granger Causality only provides the correlation across the variables and is not a true test of causality. In this analysis, the number of variables used for forecasting is small, so all the variables that were sourced were used for forecasting with VAR. Vector Autoregressive models have been proven to be useful for describing and forecasting economic and financial time series data. Similar to DSGE described above, VAR models are also used for structural inference and policy analysis (Zivot &amp; Wang,&nbsp;2003).</p><h4>Artificial Neural&nbsp;Networks</h4><p>The fundamental pattern based on which deep learning models are built is a perceptron. A perceptron has three set of nodes&#8202;&#8212;&#8202;(1) input nodes, (2) computational nodes, and (3) output nodes. Each set is called a layer. What uniquely differentiates a perceptron is that it has a single computational layer. This computational layer is also called the hidden&nbsp;layer.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!WwgS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F034813ce-d769-46bf-9956-7aad807bb254_576x151.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WwgS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F034813ce-d769-46bf-9956-7aad807bb254_576x151.png 424w, https://substackcdn.com/image/fetch/$s_!WwgS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F034813ce-d769-46bf-9956-7aad807bb254_576x151.png 848w, https://substackcdn.com/image/fetch/$s_!WwgS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F034813ce-d769-46bf-9956-7aad807bb254_576x151.png 1272w, https://substackcdn.com/image/fetch/$s_!WwgS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F034813ce-d769-46bf-9956-7aad807bb254_576x151.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WwgS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F034813ce-d769-46bf-9956-7aad807bb254_576x151.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/034813ce-d769-46bf-9956-7aad807bb254_576x151.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!WwgS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F034813ce-d769-46bf-9956-7aad807bb254_576x151.png 424w, https://substackcdn.com/image/fetch/$s_!WwgS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F034813ce-d769-46bf-9956-7aad807bb254_576x151.png 848w, https://substackcdn.com/image/fetch/$s_!WwgS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F034813ce-d769-46bf-9956-7aad807bb254_576x151.png 1272w, https://substackcdn.com/image/fetch/$s_!WwgS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F034813ce-d769-46bf-9956-7aad807bb254_576x151.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Figure 1: A perceptron model (Cook &amp; Hall,&nbsp;2017)</figcaption></figure></div><p>The perceptron model uses a linear combination of inputs with some weights. It then applies an activation function to produce an estimated output. This model takes input of <em>k </em>lags of time series <em>x. </em>And it estimates the value of the time series at a period <em>t+n. </em>The values<em> &#969;o </em>to<em> &#969;k </em>are the weights associated with each of the inputs. These weights are calculated using a cost function that minimizes the error, MSE (mean squared error). The perceptron without the activation function is nothing but a linear regression of the inputs with the weights. It is the transformation applied by the activation function that allows non-linearity of the underlying relationship to be&nbsp;modeled.</p><p>When there is one or more than one hidden layers wherein the information flows from previous layer to the next layer, the architecture is called Multilayered Feed Forward Neural&nbsp;Network.</p><p>The weights is what is used to determine which signal, or input should pass through. The weights are assigned randomly initially. An activation function (sigmoid, tangent hyperbolic (tanh), rectified linear unit (relu), or softmax) is applied to the linear combination of the input nodes. The result is passed to next layers, this step is repeated until the output layer which generates a vector of probabilities for various outputs. The resulting prediction is compared with actual values to determine error and this &#8220;feedback&#8221; is backpropagated to the nodes to readjust the weights and reapply the activation all over again. This is re-iterated until the cost function or loss function is minimized.</p><h4>Why use&nbsp;ANN?</h4><p>For this specific problem, non-linear relationship is assumed to be exist between the predictors and the target variables. ANNs are known to be effective in modeling non-linear relationships. ANNs were also found to be significantly better in forecasting unemployment rates when compared to autoregressive models. This however holds true when there is sufficient data, and the neural networks have an appropriate architecture and are not simplistic such as having a single hidden layer. In this analysis the neural network has a dense hidden layer. Further, the data obtained for this analysis is assumed to be sufficient to outperform autoregressive model. (Mulaudzi &amp; Ajoodha,&nbsp;2021)</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lpXb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f91962b-5815-4136-b72c-4de01adf229d_576x426.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lpXb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f91962b-5815-4136-b72c-4de01adf229d_576x426.png 424w, https://substackcdn.com/image/fetch/$s_!lpXb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f91962b-5815-4136-b72c-4de01adf229d_576x426.png 848w, https://substackcdn.com/image/fetch/$s_!lpXb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f91962b-5815-4136-b72c-4de01adf229d_576x426.png 1272w, https://substackcdn.com/image/fetch/$s_!lpXb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f91962b-5815-4136-b72c-4de01adf229d_576x426.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lpXb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f91962b-5815-4136-b72c-4de01adf229d_576x426.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8f91962b-5815-4136-b72c-4de01adf229d_576x426.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!lpXb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f91962b-5815-4136-b72c-4de01adf229d_576x426.png 424w, https://substackcdn.com/image/fetch/$s_!lpXb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f91962b-5815-4136-b72c-4de01adf229d_576x426.png 848w, https://substackcdn.com/image/fetch/$s_!lpXb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f91962b-5815-4136-b72c-4de01adf229d_576x426.png 1272w, https://substackcdn.com/image/fetch/$s_!lpXb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f91962b-5815-4136-b72c-4de01adf229d_576x426.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Figure 2:Multilayer feedforward neural&nbsp;network</figcaption></figure></div><h4>Recurrent Neural&nbsp;Networks</h4><p>A recurrent neural network (RNN) is different from a plain vanilla neural network as discussed in the previous section in that a plain vanilla neural network accepts an input X that is of fixed length, and outputs a Y that is also of a fixed length. RNNs on the other hand can accept a sequence of inputs, more specifically, a sequence of vectors and output a sequence of vectors (Karpathy, 2015). In RNNs, the hidden layers store the information captured in previous stages of sequential data. The term &#8216;recurrent&#8217; in RNNs is used because these neural networks perform the same task for every element of the sequence, specifically that of utilizing previously seen sequence to predict future unseen sequential data.</p><p>In Figure 3 below, the right hand side shows <strong>X </strong>at time <em>0</em> to time <em>t.</em> Each neuron or group of neurons, <em><strong>A</strong></em><strong> </strong>produces a cell state <em>h </em>that is passed on to the next set of neurons. The cell state of the neuron at time <em>t </em>is remembered as h<em>t</em>. The left hand side shows the recurrence relationship of the pattern where h is updated at each time step. The right hand side shows the recurrence relationship in an unrolled&nbsp;view.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tGye!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87d55d9d-d397-4a56-83e6-94d58ddc689a_545x161.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tGye!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87d55d9d-d397-4a56-83e6-94d58ddc689a_545x161.png 424w, https://substackcdn.com/image/fetch/$s_!tGye!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87d55d9d-d397-4a56-83e6-94d58ddc689a_545x161.png 848w, https://substackcdn.com/image/fetch/$s_!tGye!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87d55d9d-d397-4a56-83e6-94d58ddc689a_545x161.png 1272w, https://substackcdn.com/image/fetch/$s_!tGye!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87d55d9d-d397-4a56-83e6-94d58ddc689a_545x161.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tGye!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87d55d9d-d397-4a56-83e6-94d58ddc689a_545x161.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/87d55d9d-d397-4a56-83e6-94d58ddc689a_545x161.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!tGye!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87d55d9d-d397-4a56-83e6-94d58ddc689a_545x161.png 424w, https://substackcdn.com/image/fetch/$s_!tGye!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87d55d9d-d397-4a56-83e6-94d58ddc689a_545x161.png 848w, https://substackcdn.com/image/fetch/$s_!tGye!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87d55d9d-d397-4a56-83e6-94d58ddc689a_545x161.png 1272w, https://substackcdn.com/image/fetch/$s_!tGye!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87d55d9d-d397-4a56-83e6-94d58ddc689a_545x161.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Figure 3: RNN Architecture(Left Unrolled NN, Right Rolled NN) [Colah,&nbsp;2015]</figcaption></figure></div><p>For an excellent reading on RNNs and LSTM, I recommend seeing Colah&#8217;s blog. Link to the original article is in references section.</p><p>Back to the discussion&#8202;&#8212;&#8202;The RNN can be represented mathematically in two steps occurring repeatedly across each time step. In the forward pass the following steps are&nbsp;done.</p><p>a. Calculate the hidden state: This is obtained by applying an activation function to the current input and previous state. The hidden state is given&nbsp;by</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NHVm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23f529d9-6363-43cd-ae8d-c2967af7cae5_205x45.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NHVm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23f529d9-6363-43cd-ae8d-c2967af7cae5_205x45.png 424w, https://substackcdn.com/image/fetch/$s_!NHVm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23f529d9-6363-43cd-ae8d-c2967af7cae5_205x45.png 848w, https://substackcdn.com/image/fetch/$s_!NHVm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23f529d9-6363-43cd-ae8d-c2967af7cae5_205x45.png 1272w, https://substackcdn.com/image/fetch/$s_!NHVm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23f529d9-6363-43cd-ae8d-c2967af7cae5_205x45.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NHVm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23f529d9-6363-43cd-ae8d-c2967af7cae5_205x45.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/23f529d9-6363-43cd-ae8d-c2967af7cae5_205x45.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!NHVm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23f529d9-6363-43cd-ae8d-c2967af7cae5_205x45.png 424w, https://substackcdn.com/image/fetch/$s_!NHVm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23f529d9-6363-43cd-ae8d-c2967af7cae5_205x45.png 848w, https://substackcdn.com/image/fetch/$s_!NHVm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23f529d9-6363-43cd-ae8d-c2967af7cae5_205x45.png 1272w, https://substackcdn.com/image/fetch/$s_!NHVm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23f529d9-6363-43cd-ae8d-c2967af7cae5_205x45.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The tanh function applies a non-linearity and pushes the activation output to be in the range from -1 to&nbsp;+1.</p><p>b. Calculate the output: The output for time step t, formally y-hat of t, is obtained&nbsp;by</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!TQu3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F293dd6bf-7e08-45af-b650-18d812abb687_129x45.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!TQu3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F293dd6bf-7e08-45af-b650-18d812abb687_129x45.png 424w, https://substackcdn.com/image/fetch/$s_!TQu3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F293dd6bf-7e08-45af-b650-18d812abb687_129x45.png 848w, https://substackcdn.com/image/fetch/$s_!TQu3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F293dd6bf-7e08-45af-b650-18d812abb687_129x45.png 1272w, https://substackcdn.com/image/fetch/$s_!TQu3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F293dd6bf-7e08-45af-b650-18d812abb687_129x45.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!TQu3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F293dd6bf-7e08-45af-b650-18d812abb687_129x45.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/293dd6bf-7e08-45af-b650-18d812abb687_129x45.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!TQu3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F293dd6bf-7e08-45af-b650-18d812abb687_129x45.png 424w, https://substackcdn.com/image/fetch/$s_!TQu3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F293dd6bf-7e08-45af-b650-18d812abb687_129x45.png 848w, https://substackcdn.com/image/fetch/$s_!TQu3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F293dd6bf-7e08-45af-b650-18d812abb687_129x45.png 1272w, https://substackcdn.com/image/fetch/$s_!TQu3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F293dd6bf-7e08-45af-b650-18d812abb687_129x45.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The learning that occurs in the RNN is really the calculation of the optimal weights across the three matrices that minimize the loss function. The matrices, again&nbsp;are:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PZJj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01a0de0b-9c29-4d5b-9a46-b138a5d3244a_243x38.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PZJj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01a0de0b-9c29-4d5b-9a46-b138a5d3244a_243x38.png 424w, https://substackcdn.com/image/fetch/$s_!PZJj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01a0de0b-9c29-4d5b-9a46-b138a5d3244a_243x38.png 848w, https://substackcdn.com/image/fetch/$s_!PZJj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01a0de0b-9c29-4d5b-9a46-b138a5d3244a_243x38.png 1272w, https://substackcdn.com/image/fetch/$s_!PZJj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01a0de0b-9c29-4d5b-9a46-b138a5d3244a_243x38.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PZJj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01a0de0b-9c29-4d5b-9a46-b138a5d3244a_243x38.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/01a0de0b-9c29-4d5b-9a46-b138a5d3244a_243x38.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!PZJj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01a0de0b-9c29-4d5b-9a46-b138a5d3244a_243x38.png 424w, https://substackcdn.com/image/fetch/$s_!PZJj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01a0de0b-9c29-4d5b-9a46-b138a5d3244a_243x38.png 848w, https://substackcdn.com/image/fetch/$s_!PZJj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01a0de0b-9c29-4d5b-9a46-b138a5d3244a_243x38.png 1272w, https://substackcdn.com/image/fetch/$s_!PZJj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01a0de0b-9c29-4d5b-9a46-b138a5d3244a_243x38.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><strong>Problem with&nbsp;RNNs</strong></p><p>However, there is a drawback with a typical generic RNN that these networks remember only a few earlier steps in the sequence and thus are not suitable to memorizing longer sequences of data. RNNs when trained using backpropagation suffer from the vanishing gradient problem, wherein the gradients become so small that there is no real learning that can occur from inputs that were provided in the distant past time step. A class of RNN Long Short-Term Memory (LSTM) recurrent network overcomes this challenge.</p><p>LSTM is a special kind of RNNs that are designed to memorize long-term dependency in a sequence of data. There are four layers within each cell of LSTM as shown in Figure 4 whereas each cell of RNN has only one layer as shown in Figure&nbsp;5.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4JPi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73b839a4-fbc1-4474-8c2c-eeef261d33f7_403x157.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4JPi!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73b839a4-fbc1-4474-8c2c-eeef261d33f7_403x157.png 424w, https://substackcdn.com/image/fetch/$s_!4JPi!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73b839a4-fbc1-4474-8c2c-eeef261d33f7_403x157.png 848w, https://substackcdn.com/image/fetch/$s_!4JPi!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73b839a4-fbc1-4474-8c2c-eeef261d33f7_403x157.png 1272w, https://substackcdn.com/image/fetch/$s_!4JPi!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73b839a4-fbc1-4474-8c2c-eeef261d33f7_403x157.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4JPi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73b839a4-fbc1-4474-8c2c-eeef261d33f7_403x157.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/73b839a4-fbc1-4474-8c2c-eeef261d33f7_403x157.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!4JPi!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73b839a4-fbc1-4474-8c2c-eeef261d33f7_403x157.png 424w, https://substackcdn.com/image/fetch/$s_!4JPi!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73b839a4-fbc1-4474-8c2c-eeef261d33f7_403x157.png 848w, https://substackcdn.com/image/fetch/$s_!4JPi!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73b839a4-fbc1-4474-8c2c-eeef261d33f7_403x157.png 1272w, https://substackcdn.com/image/fetch/$s_!4JPi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73b839a4-fbc1-4474-8c2c-eeef261d33f7_403x157.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Figure 4: The &#8216;recurrent&#8217; module in a standard RNN with single layer. [Colah,&nbsp;2015]</figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!G7xl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f4913f4-9614-4897-8ded-7ef03e0ba3cc_423x166.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!G7xl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f4913f4-9614-4897-8ded-7ef03e0ba3cc_423x166.png 424w, https://substackcdn.com/image/fetch/$s_!G7xl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f4913f4-9614-4897-8ded-7ef03e0ba3cc_423x166.png 848w, https://substackcdn.com/image/fetch/$s_!G7xl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f4913f4-9614-4897-8ded-7ef03e0ba3cc_423x166.png 1272w, https://substackcdn.com/image/fetch/$s_!G7xl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f4913f4-9614-4897-8ded-7ef03e0ba3cc_423x166.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!G7xl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f4913f4-9614-4897-8ded-7ef03e0ba3cc_423x166.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0f4913f4-9614-4897-8ded-7ef03e0ba3cc_423x166.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!G7xl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f4913f4-9614-4897-8ded-7ef03e0ba3cc_423x166.png 424w, https://substackcdn.com/image/fetch/$s_!G7xl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f4913f4-9614-4897-8ded-7ef03e0ba3cc_423x166.png 848w, https://substackcdn.com/image/fetch/$s_!G7xl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f4913f4-9614-4897-8ded-7ef03e0ba3cc_423x166.png 1272w, https://substackcdn.com/image/fetch/$s_!G7xl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f4913f4-9614-4897-8ded-7ef03e0ba3cc_423x166.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Figure 5: The &#8216;recurrent&#8217; module in a LSTM with four interacting layers. [Colah,&nbsp;2015]</figcaption></figure></div><p>There are two types of information passing that occurs in LSTM. The top line shown in the cell in Figure 5 represents the information about the cell state. Information can be added to or removed from the cell state line which is controlled using&nbsp;gates.</p><p>The first layer uses a sigmoid activation to select between fully remembering or fully forgetting the information from the prior cell state. This is also called the forget&nbsp;gate.</p><p>The second layer also uses a sigmoid activation (also called as input gate layer), is used to select which information should be updated. The third layer uses a hyperbolic tangent activation that creates a vector of new possible values, that can be added to the cell&nbsp;state.</p><p>The next step is to update the new cell state by combining operations to forget what was determined to be forgotten and add new candidate value. The final step is to output which is based on a combination of sigmoid and tanh activations. The sigmoid activation determines which part of the cell state to output (sigmoid chooses between 0 and 1), whereas the tanh activation will finally push the output (tanh chooses between +1 and&nbsp;-1)</p><h4>Why use&nbsp;LSTM?</h4><p>LSTMs are essentially NNs that incorporate feedback loops. The architecture of LSTM described above allows for its use in sequence modeling. Specially, features of the data from the long running memory, as well as short term memory where most recent sequence of information is utilized. These models outperformed autoregressive models in an experiment conducted to forecast unemployment rates in the US (Mulaudzi &amp; Ajoodha,&nbsp;2021).</p><p>Next we&#8217;ll look at the setup for using the forecasting models and evaluating it.</p><p><strong>6. Using and Evaluating a Forecasting Model:</strong></p><p>The last step is to make forecasts and evaluate the performance of those forecasts. The model evaluation is performed to determine the efficacy of the models. In this analysis, back-testing is done with historical data.</p><p>Each of the neural network based multivariate model is compared with its corresponding univariate model. The multivariate models are also compared against one another. Finally, each of the multivariate model is compared with the Survey of Professional Forecasters (SPF) benchmark model data provided by Federal Reserve (Cook &amp; Hall,&nbsp;2017)</p><p>In traditional data mining methods when working with data that is not time series, k-fold cross validation is used to systematically divide the samples into k groups, where each group (in the k groups) is iteratively held out for model validation. This works for datasets that are not temporal in nature (they have no time dependency), therefore, in those cases each observation is independent.</p><p>Time series data has a unique characteristic in that there is a temporal dependence of variables. Machine Learning techniques require setting up a time series data as a supervised data set. In addition, this requires the splitting of the data for training the model and evaluation to be done differently from traditional machine learning&nbsp;methods.</p><p>The models are compared against one another using the metric Mean Absolute Error (MAE) and standard deviation (SD). This is a well-known criterion for comparing forecasting accuracy of time series models. (Katris,&nbsp;2019)</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!10sW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93abf886-2df1-4cd4-8f91-6ec92f4dbfb5_286x57.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!10sW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93abf886-2df1-4cd4-8f91-6ec92f4dbfb5_286x57.png 424w, https://substackcdn.com/image/fetch/$s_!10sW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93abf886-2df1-4cd4-8f91-6ec92f4dbfb5_286x57.png 848w, https://substackcdn.com/image/fetch/$s_!10sW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93abf886-2df1-4cd4-8f91-6ec92f4dbfb5_286x57.png 1272w, https://substackcdn.com/image/fetch/$s_!10sW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93abf886-2df1-4cd4-8f91-6ec92f4dbfb5_286x57.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!10sW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93abf886-2df1-4cd4-8f91-6ec92f4dbfb5_286x57.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/93abf886-2df1-4cd4-8f91-6ec92f4dbfb5_286x57.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!10sW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93abf886-2df1-4cd4-8f91-6ec92f4dbfb5_286x57.png 424w, https://substackcdn.com/image/fetch/$s_!10sW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93abf886-2df1-4cd4-8f91-6ec92f4dbfb5_286x57.png 848w, https://substackcdn.com/image/fetch/$s_!10sW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93abf886-2df1-4cd4-8f91-6ec92f4dbfb5_286x57.png 1272w, https://substackcdn.com/image/fetch/$s_!10sW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93abf886-2df1-4cd4-8f91-6ec92f4dbfb5_286x57.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Where, y<em>t</em> is the actual unemployment rate for a period, and y-hat <em>t </em>is the forecasted unemployment rate for the same period, and N is the number of forecasts.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nUiE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70b5b2da-ee41-422a-b209-c781f2287021_446x83.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nUiE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70b5b2da-ee41-422a-b209-c781f2287021_446x83.png 424w, https://substackcdn.com/image/fetch/$s_!nUiE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70b5b2da-ee41-422a-b209-c781f2287021_446x83.png 848w, https://substackcdn.com/image/fetch/$s_!nUiE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70b5b2da-ee41-422a-b209-c781f2287021_446x83.png 1272w, https://substackcdn.com/image/fetch/$s_!nUiE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70b5b2da-ee41-422a-b209-c781f2287021_446x83.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nUiE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70b5b2da-ee41-422a-b209-c781f2287021_446x83.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/70b5b2da-ee41-422a-b209-c781f2287021_446x83.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!nUiE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70b5b2da-ee41-422a-b209-c781f2287021_446x83.png 424w, https://substackcdn.com/image/fetch/$s_!nUiE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70b5b2da-ee41-422a-b209-c781f2287021_446x83.png 848w, https://substackcdn.com/image/fetch/$s_!nUiE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70b5b2da-ee41-422a-b209-c781f2287021_446x83.png 1272w, https://substackcdn.com/image/fetch/$s_!nUiE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70b5b2da-ee41-422a-b209-c781f2287021_446x83.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>As this research is an extension of previous work done by researchers Cook and Hall (2017), this analysis uses the same feature <em>UNRATE </em>(unemployment rate data as made available by the Federal Reserve) for the same periods and partitioned the data for training and validation (1963 to 1996) as well as testing (1997 to 2014). The results obtained from this analysis were compared with the researchers results as well as other benchmarks referred to in the original paper. The creation of the validation data was done in the same manner as their paper by sequestering every 10th observation of the training data into a validation data&nbsp;set.</p><p>At this point we have all the elements ready for model building and evaluation. And that is what we will discuss in the next&nbsp;post.</p><p></p><p>References:</p><p>Colah&#8217;s blog: <a href="https://colah.github.io/posts/2015-08-Understanding-LSTMs/">https://colah.github.io/posts/2015-08-Understanding-LSTMs/</a></p><p>Cook, T., &amp; Hall, A. S. (2017). <em>Macroeconomic Indicator Forecasting with Deep Neural Networks.</em> Retrieved from dx.doi.org: <a href="https://dx.doi.org/10.18651/RWP2017-11">https://dx.doi.org/10.18651/RWP2017-11</a></p><p>FRED. (2021&#8211;2022). <em>Fed Reserve Economic Research</em>. Retrieved from Fed Reserve Economic Data: <a href="https://fred.stlouisfed.org/">https://fred.stlouisfed.org/</a></p><p>Hyndman, R., &amp; Athanasopoulos, G. (2021). <em><a href="https://otexts.com/fpp3/.">https://otexts.com/fpp3/.</a></em> OTexts.</p><p>Karpathy, A. (2015). Retrieved from <a href="http://karpathy.github.io/2015/05/21/rnn-effectiveness/">http://karpathy.github.io/2015/05/21/rnn-effectiveness/</a></p><p>Katris, C. (2019). Prediction of Unemployment Rates with Time Series and Machine Learning Techniques. <em>Computational Economics</em>, 682.</p><p>Lower, Eric. (2021). <em>Introduction to the Fundamentals of Vector Autoregressive Models</em>. Retrieved from Aptech: <a href="https://www.aptech.com/blog/introduction-to-the-fundamentals-of-vector-autoregressive-models/">https://www.aptech.com/blog/introduction-to-the-fundamentals-of-vector-autoregressive-models/</a></p><p>Montgomery, A., &amp; Zarnowitz, V. (1998). Forecasting the US Unemployment Rate. <em>Journal of the American Statistical Association</em>, 478.</p><p>Mulaudzi, R., &amp; Ajoodha, R. (2021). Application of Deep Learning to Forecast the South African Unemployment Rate: A Multivariate Approach. <em>IEEE&nbsp;Xplore</em>.</p><p><em>ResearchGate</em>. (2022). Retrieved from researchgate.net: <a href="https://www.researchgate.net/post/How-do-you-choose-the-optimal-laglength-in-a-time-series">https://www.researchgate.net/post/How-do-you-choose-the-optimal-laglength-in-a-time-series</a></p><p><em>Vector Autoregressions</em>. (2022). Retrieved from Statsmodels: <a href="https://www.statsmodels.org/dev/vector_ar.html">https://www.statsmodels.org/dev/vector_ar.html</a></p><p>Zivot, E., &amp; Wang, J. (2003). Vector Autoregressive Models for Multivariate Time Series. In E. Zivot, &amp; J. Wang, <em>Modeling Financial Time Series with S-Plus&#174;.</em> New York, NY, USA: Springer. doi:https://doi.org/10.1007/978-0-387-21763-5_11</p>]]></content:encoded></item><item><title><![CDATA[Multivariate time series forecasting and analysis of the US unemployment rate — Part 2]]></title><description><![CDATA[Multivariate time series forecasting and analysis of the US unemployment rate &#8212; Part 2]]></description><link>https://www.thefractal.co/p/multivariate-time-series-forecasting-and-analysis-of-the-us-unemployment-rate-part-2-e865f7ff07a6</link><guid isPermaLink="false">https://www.thefractal.co/p/multivariate-time-series-forecasting-and-analysis-of-the-us-unemployment-rate-part-2-e865f7ff07a6</guid><dc:creator><![CDATA[Vijay Reddiar]]></dc:creator><pubDate>Tue, 09 May 2023 00:30:38 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/7b4a5172-4b2d-40f9-8a93-b9b7f51d71bc_1024x683.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3>Multivariate time series forecasting and analysis of the US unemployment rate&#8202;&#8212;&#8202;Part&nbsp;2</h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3zL6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48735dd4-262a-45b3-908f-f819e2d63add_1024x683.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3zL6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48735dd4-262a-45b3-908f-f819e2d63add_1024x683.jpeg 424w, https://substackcdn.com/image/fetch/$s_!3zL6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48735dd4-262a-45b3-908f-f819e2d63add_1024x683.jpeg 848w, https://substackcdn.com/image/fetch/$s_!3zL6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48735dd4-262a-45b3-908f-f819e2d63add_1024x683.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!3zL6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48735dd4-262a-45b3-908f-f819e2d63add_1024x683.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3zL6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48735dd4-262a-45b3-908f-f819e2d63add_1024x683.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/48735dd4-262a-45b3-908f-f819e2d63add_1024x683.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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;: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_!3zL6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48735dd4-262a-45b3-908f-f819e2d63add_1024x683.jpeg 424w, https://substackcdn.com/image/fetch/$s_!3zL6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48735dd4-262a-45b3-908f-f819e2d63add_1024x683.jpeg 848w, https://substackcdn.com/image/fetch/$s_!3zL6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48735dd4-262a-45b3-908f-f819e2d63add_1024x683.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!3zL6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48735dd4-262a-45b3-908f-f819e2d63add_1024x683.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@polarmermaid?utm_source=medium&amp;utm_medium=referral">Anne Nyg&#229;rd</a> on&nbsp;<a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure></div><p>In the previous post (linked here: <a href="https://medium.com/@reddiarv/multivariate-time-series-forecasting-and-analysis-of-the-us-unemployment-rate-part-1-f1454b029cb">Part 1</a>) we discussed the importance of unemployment rate forecasting. We also framed how we approach the analysis and time series modeling. So far we covered the problem definition and the data sources&nbsp;used.</p><p>In this post, we&#8217;ll look at few relevant python code, charts and data snippets.</p><p>And importantly, we will cover the data preparation phase and look at the exploratory data analysis which has unique set of analytical tools to understanding the time series&nbsp;data.</p><p>So, continuing on&nbsp;&#8230;</p><p>Here are the libraries used for this analysis. Statsmodels is a very useful package for working with classical time series&nbsp;methods.</p><pre><code>import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from statsmodels.tsa.seasonal import seasonal_decomposepu
from statsmodels.tsa.stattools import adfuller
from statsmodels.graphics.tsaplots import plot_acf
from statsmodels.graphics.tsaplots import acf
from statsmodels.graphics.tsaplots import plot_pacf
from statsmodels.tsa.stattools import grangercausalitytests
from statsmodels.tsa.ar_model import AutoReg
import statsmodels.api as sm </code></pre><p>Here is a snapshot of a few sample records from the multivariate time&nbsp;series.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!F0Sv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e8b5b3d-12bc-4b18-a1b0-cd5868a1a377_1024x291.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!F0Sv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e8b5b3d-12bc-4b18-a1b0-cd5868a1a377_1024x291.png 424w, https://substackcdn.com/image/fetch/$s_!F0Sv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e8b5b3d-12bc-4b18-a1b0-cd5868a1a377_1024x291.png 848w, https://substackcdn.com/image/fetch/$s_!F0Sv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e8b5b3d-12bc-4b18-a1b0-cd5868a1a377_1024x291.png 1272w, https://substackcdn.com/image/fetch/$s_!F0Sv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e8b5b3d-12bc-4b18-a1b0-cd5868a1a377_1024x291.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!F0Sv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e8b5b3d-12bc-4b18-a1b0-cd5868a1a377_1024x291.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7e8b5b3d-12bc-4b18-a1b0-cd5868a1a377_1024x291.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!F0Sv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e8b5b3d-12bc-4b18-a1b0-cd5868a1a377_1024x291.png 424w, https://substackcdn.com/image/fetch/$s_!F0Sv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e8b5b3d-12bc-4b18-a1b0-cd5868a1a377_1024x291.png 848w, https://substackcdn.com/image/fetch/$s_!F0Sv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e8b5b3d-12bc-4b18-a1b0-cd5868a1a377_1024x291.png 1272w, https://substackcdn.com/image/fetch/$s_!F0Sv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e8b5b3d-12bc-4b18-a1b0-cd5868a1a377_1024x291.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Multivariate time series data for Unemployment Rate forecasting</figcaption></figure></div><p>Using seaborn for univariate seasonal&nbsp;plots:</p><pre><code>plt.subplots(figsize=(20,5))
sns.boxplot(x=ue_seasonal_plotdf['month'],y=ue_seasonal_plotdf['UnemploymentRate'])py</code></pre><p>This gives us the seasonal plot by month, followed by seasonal plot by quarter. Leads us to believe nothing quite extraordinarily different across months or quarters.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!M217!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F024b9245-7634-429c-8edb-17260ec55350_1024x290.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!M217!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F024b9245-7634-429c-8edb-17260ec55350_1024x290.png 424w, https://substackcdn.com/image/fetch/$s_!M217!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F024b9245-7634-429c-8edb-17260ec55350_1024x290.png 848w, https://substackcdn.com/image/fetch/$s_!M217!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F024b9245-7634-429c-8edb-17260ec55350_1024x290.png 1272w, https://substackcdn.com/image/fetch/$s_!M217!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F024b9245-7634-429c-8edb-17260ec55350_1024x290.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!M217!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F024b9245-7634-429c-8edb-17260ec55350_1024x290.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/024b9245-7634-429c-8edb-17260ec55350_1024x290.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!M217!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F024b9245-7634-429c-8edb-17260ec55350_1024x290.png 424w, https://substackcdn.com/image/fetch/$s_!M217!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F024b9245-7634-429c-8edb-17260ec55350_1024x290.png 848w, https://substackcdn.com/image/fetch/$s_!M217!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F024b9245-7634-429c-8edb-17260ec55350_1024x290.png 1272w, https://substackcdn.com/image/fetch/$s_!M217!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F024b9245-7634-429c-8edb-17260ec55350_1024x290.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Unemployment Rate Seasonal Plot by&nbsp;Month</figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OJq8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51ed2937-2b79-49ca-a61d-adf7c8bad6c9_1024x290.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OJq8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51ed2937-2b79-49ca-a61d-adf7c8bad6c9_1024x290.png 424w, https://substackcdn.com/image/fetch/$s_!OJq8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51ed2937-2b79-49ca-a61d-adf7c8bad6c9_1024x290.png 848w, https://substackcdn.com/image/fetch/$s_!OJq8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51ed2937-2b79-49ca-a61d-adf7c8bad6c9_1024x290.png 1272w, https://substackcdn.com/image/fetch/$s_!OJq8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51ed2937-2b79-49ca-a61d-adf7c8bad6c9_1024x290.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OJq8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51ed2937-2b79-49ca-a61d-adf7c8bad6c9_1024x290.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/51ed2937-2b79-49ca-a61d-adf7c8bad6c9_1024x290.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!OJq8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51ed2937-2b79-49ca-a61d-adf7c8bad6c9_1024x290.png 424w, https://substackcdn.com/image/fetch/$s_!OJq8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51ed2937-2b79-49ca-a61d-adf7c8bad6c9_1024x290.png 848w, https://substackcdn.com/image/fetch/$s_!OJq8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51ed2937-2b79-49ca-a61d-adf7c8bad6c9_1024x290.png 1272w, https://substackcdn.com/image/fetch/$s_!OJq8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51ed2937-2b79-49ca-a61d-adf7c8bad6c9_1024x290.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Unemployment Rate Seasonal Plot by&nbsp;Quarter</figcaption></figure></div><p><strong>3. Data Preparation Phase</strong>&#8202;&#8212;&#8202;Time series data has a unique characteristic in that there is a temporal dependence of variables. A variable at a current time has dependence on the variable at one or more than one&nbsp;periods.</p><p>A time series has three &#8220;systematic&#8221; components that can be described and modeled. These are &#8217;base level&#8217;, &#8217;trend&#8217; and &#8217;seasonality&#8217;, plus one &#8220;non-systematic&#8221; component called &#8217;noise&#8217;. The base level is the mean value in the series. The time series is said to have a trend when the time series values increase or decrease over time (positive or negative slope). When there is a pattern repeated at regular intervals, the time series is said to have seasonality. Any random variations is the noise. Every time series data is a combination of these four components. While, base level and noise always exist in a time series data, trend and seasonality can optionally exist.</p><p>There are several factors that need to be considered due to the nature of time series data which includes preprocessing and preparation of data for the analysis of such data. There are several transformations that are applied to make the data work with the methods used in the analysis and forecasting of the time series data. Additional feature engineering is done using these transformations.</p><p>a. Box Cox / Log Transformation&#8202;&#8212;&#8202;This removes the changing variance over time. This is done using <em>np.log()</em> function using <em>numpy</em> library. This is applied to variables MoneySupply, ProducerPriceIndex, CandILoans and CRELoans for training and forecasting with the neural network&nbsp;models.</p><p>b. Differencing&#8202;&#8212;&#8202;This is applied to de-trend the data and to make the data stationary. Differencing is used to attain stationary time series which is a model assumption for working with Vector Autoregressive (VAR) models. The differencing involves using the difference in values over two consecutive periods of time. This is done using <em>diff()</em> function from the <em>pandas</em> library to calculate a differenced time series&nbsp;value.</p><p>c. Normalizing&#8202;&#8212;&#8202;Normalization of data makes value of each time series data point to be between 0 and 1. This data transformation is required to work with neural networks. This is done using <em>MinMaxScaler()</em> function from the <em>sklearn.preprocessing</em> library.</p><p>d. Standardizing&#8202;&#8212;&#8202;Standardization of data normalizes value of each time series data point on a z-scale with a mean of 0 and standard deviation of 1. This was done using <em>StandardScaler()</em> function from the <em>sklearn.preprocessing</em> library. This data transformation is required to work with neural networks.</p><p>For final forecasting of future (test) data, the normalization and standardization are reversed to compute the error. Both normalization and standardization is applied as part of data transformation to train and forecast using neural networks.</p><p><strong>4. Preliminary (Exploratory Data) Analysis</strong>: The datasets for this analysis were sourced from the Federal Reserve database that did not have issues with missing data. The analysis is done separately for univariate setting, followed by multivariate setting.</p><h4>Univariate Analysis</h4><p>As shown in Figure 1 the unemployment rate is stationary (constant mean) with varying volatility over the range of period shown&nbsp;here.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DrDC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff29678e2-9fc9-45ae-9229-73e1d1940339_576x219.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DrDC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff29678e2-9fc9-45ae-9229-73e1d1940339_576x219.png 424w, https://substackcdn.com/image/fetch/$s_!DrDC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff29678e2-9fc9-45ae-9229-73e1d1940339_576x219.png 848w, https://substackcdn.com/image/fetch/$s_!DrDC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff29678e2-9fc9-45ae-9229-73e1d1940339_576x219.png 1272w, https://substackcdn.com/image/fetch/$s_!DrDC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff29678e2-9fc9-45ae-9229-73e1d1940339_576x219.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DrDC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff29678e2-9fc9-45ae-9229-73e1d1940339_576x219.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f29678e2-9fc9-45ae-9229-73e1d1940339_576x219.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!DrDC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff29678e2-9fc9-45ae-9229-73e1d1940339_576x219.png 424w, https://substackcdn.com/image/fetch/$s_!DrDC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff29678e2-9fc9-45ae-9229-73e1d1940339_576x219.png 848w, https://substackcdn.com/image/fetch/$s_!DrDC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff29678e2-9fc9-45ae-9229-73e1d1940339_576x219.png 1272w, https://substackcdn.com/image/fetch/$s_!DrDC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff29678e2-9fc9-45ae-9229-73e1d1940339_576x219.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Figure 1: Time series plot of US unemployment</figcaption></figure></div><p>Figure 2 shows the distribution of unemployment rate for this period, it ranges from 3.5% to over 10.5% with the distribution skewed to the right. This data doesn&#8217;t quite have a normal distribution.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7mfT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F534c185f-f50d-4139-b988-432c47959024_576x208.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7mfT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F534c185f-f50d-4139-b988-432c47959024_576x208.png 424w, https://substackcdn.com/image/fetch/$s_!7mfT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F534c185f-f50d-4139-b988-432c47959024_576x208.png 848w, https://substackcdn.com/image/fetch/$s_!7mfT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F534c185f-f50d-4139-b988-432c47959024_576x208.png 1272w, https://substackcdn.com/image/fetch/$s_!7mfT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F534c185f-f50d-4139-b988-432c47959024_576x208.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7mfT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F534c185f-f50d-4139-b988-432c47959024_576x208.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/534c185f-f50d-4139-b988-432c47959024_576x208.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!7mfT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F534c185f-f50d-4139-b988-432c47959024_576x208.png 424w, https://substackcdn.com/image/fetch/$s_!7mfT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F534c185f-f50d-4139-b988-432c47959024_576x208.png 848w, https://substackcdn.com/image/fetch/$s_!7mfT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F534c185f-f50d-4139-b988-432c47959024_576x208.png 1272w, https://substackcdn.com/image/fetch/$s_!7mfT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F534c185f-f50d-4139-b988-432c47959024_576x208.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Figure 2: Distribution of Unemployment Rate</figcaption></figure></div><p>Figure 3 shows a comparative view of the unemployment rate and its first order difference (1D) computed by calculating the difference in consecutive values of the unemployment rate&nbsp;data).</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jmqc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ffd0da3-e26e-4ce1-a9b8-082c1f3fcf87_576x365.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jmqc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ffd0da3-e26e-4ce1-a9b8-082c1f3fcf87_576x365.png 424w, https://substackcdn.com/image/fetch/$s_!jmqc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ffd0da3-e26e-4ce1-a9b8-082c1f3fcf87_576x365.png 848w, https://substackcdn.com/image/fetch/$s_!jmqc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ffd0da3-e26e-4ce1-a9b8-082c1f3fcf87_576x365.png 1272w, https://substackcdn.com/image/fetch/$s_!jmqc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ffd0da3-e26e-4ce1-a9b8-082c1f3fcf87_576x365.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jmqc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ffd0da3-e26e-4ce1-a9b8-082c1f3fcf87_576x365.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7ffd0da3-e26e-4ce1-a9b8-082c1f3fcf87_576x365.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!jmqc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ffd0da3-e26e-4ce1-a9b8-082c1f3fcf87_576x365.png 424w, https://substackcdn.com/image/fetch/$s_!jmqc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ffd0da3-e26e-4ce1-a9b8-082c1f3fcf87_576x365.png 848w, https://substackcdn.com/image/fetch/$s_!jmqc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ffd0da3-e26e-4ce1-a9b8-082c1f3fcf87_576x365.png 1272w, https://substackcdn.com/image/fetch/$s_!jmqc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ffd0da3-e26e-4ce1-a9b8-082c1f3fcf87_576x365.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Figure 3: Distribution of first order difference of unemployment rate compared to unemployment rate</figcaption></figure></div><p>Figure 4 shows the distribution of the first order differenced unemployment rate. This data is centered around&nbsp;zero.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Rsta!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a7ffe8-699b-4ee1-a82c-bc402724d612_576x240.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Rsta!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a7ffe8-699b-4ee1-a82c-bc402724d612_576x240.png 424w, https://substackcdn.com/image/fetch/$s_!Rsta!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a7ffe8-699b-4ee1-a82c-bc402724d612_576x240.png 848w, https://substackcdn.com/image/fetch/$s_!Rsta!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a7ffe8-699b-4ee1-a82c-bc402724d612_576x240.png 1272w, https://substackcdn.com/image/fetch/$s_!Rsta!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a7ffe8-699b-4ee1-a82c-bc402724d612_576x240.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Rsta!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a7ffe8-699b-4ee1-a82c-bc402724d612_576x240.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/11a7ffe8-699b-4ee1-a82c-bc402724d612_576x240.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!Rsta!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a7ffe8-699b-4ee1-a82c-bc402724d612_576x240.png 424w, https://substackcdn.com/image/fetch/$s_!Rsta!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a7ffe8-699b-4ee1-a82c-bc402724d612_576x240.png 848w, https://substackcdn.com/image/fetch/$s_!Rsta!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a7ffe8-699b-4ee1-a82c-bc402724d612_576x240.png 1272w, https://substackcdn.com/image/fetch/$s_!Rsta!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11a7ffe8-699b-4ee1-a82c-bc402724d612_576x240.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Figure 4: Frequency distribution of first order difference in unemployment rate</figcaption></figure></div><p><strong>Time Series Decomposition</strong></p><p>To improve forecasting accuracy time series data often requires to be analyzed by decomposing it to understand the underlying patterns.</p><p>There are three components: trend, seasonality and residuals. Additive decomposition can be expressed as:</p><p>Unemployment Rate = Trend + Seasonality + Residuals</p><p>In Figure 5 below, the top chart shows the original time series (same as Figure 1 above). This is decomposed into the three components trend, seasonality and the residuals, which is whatever remains after the trend and seasonality have been separated from the time series. This time series does not have a trend, but it does have a strong seasonality to it. The residuals are dispersed around the mean of&nbsp;zero.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!LYeZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99eb0cac-6261-4063-8f98-4e8609bab426_495x329.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!LYeZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99eb0cac-6261-4063-8f98-4e8609bab426_495x329.png 424w, https://substackcdn.com/image/fetch/$s_!LYeZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99eb0cac-6261-4063-8f98-4e8609bab426_495x329.png 848w, https://substackcdn.com/image/fetch/$s_!LYeZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99eb0cac-6261-4063-8f98-4e8609bab426_495x329.png 1272w, https://substackcdn.com/image/fetch/$s_!LYeZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99eb0cac-6261-4063-8f98-4e8609bab426_495x329.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!LYeZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99eb0cac-6261-4063-8f98-4e8609bab426_495x329.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/99eb0cac-6261-4063-8f98-4e8609bab426_495x329.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!LYeZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99eb0cac-6261-4063-8f98-4e8609bab426_495x329.png 424w, https://substackcdn.com/image/fetch/$s_!LYeZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99eb0cac-6261-4063-8f98-4e8609bab426_495x329.png 848w, https://substackcdn.com/image/fetch/$s_!LYeZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99eb0cac-6261-4063-8f98-4e8609bab426_495x329.png 1272w, https://substackcdn.com/image/fetch/$s_!LYeZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99eb0cac-6261-4063-8f98-4e8609bab426_495x329.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Figure 5: Classical additive unemployment rate time series decomposition</figcaption></figure></div><p>Figure 6 shows a histogram of residuals which shows that the residuals are normally distributed across the mean&nbsp;zero.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9FZi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e58d4db-cd59-471a-8b84-83d25917ee92_490x319.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9FZi!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e58d4db-cd59-471a-8b84-83d25917ee92_490x319.png 424w, https://substackcdn.com/image/fetch/$s_!9FZi!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e58d4db-cd59-471a-8b84-83d25917ee92_490x319.png 848w, https://substackcdn.com/image/fetch/$s_!9FZi!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e58d4db-cd59-471a-8b84-83d25917ee92_490x319.png 1272w, https://substackcdn.com/image/fetch/$s_!9FZi!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e58d4db-cd59-471a-8b84-83d25917ee92_490x319.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9FZi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e58d4db-cd59-471a-8b84-83d25917ee92_490x319.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5e58d4db-cd59-471a-8b84-83d25917ee92_490x319.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!9FZi!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e58d4db-cd59-471a-8b84-83d25917ee92_490x319.png 424w, https://substackcdn.com/image/fetch/$s_!9FZi!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e58d4db-cd59-471a-8b84-83d25917ee92_490x319.png 848w, https://substackcdn.com/image/fetch/$s_!9FZi!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e58d4db-cd59-471a-8b84-83d25917ee92_490x319.png 1272w, https://substackcdn.com/image/fetch/$s_!9FZi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e58d4db-cd59-471a-8b84-83d25917ee92_490x319.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Figure 6: Unemployment rate time series decomposition</figcaption></figure></div><p><strong>Autocorrelation and Partial Autocorrelation</strong></p><p>Autocorrelation shows the extent of linear relationship between the value of a variable in a time series at time <em>t</em> and the value of variable in that time series at a time <em>t+h</em> or <em>t-h</em>. A positive correlation indicates the value of the variables move in the same direction, whereas a negative correlation indicates the value of the variables move in opposite directions. When autocorrelation is zero, the temporal dependency is difficult to establish. Autocorrelation plots help understand this temporal relationship. In Figure 7 shown below, the x axis shows number of lags, and the y axis shows the autocorrelation which is normalized between the values of 1 and -1. The orange band shows the 95% confidence interval. This chart shows that unemployment rate autocorrelation can be seen until 24 lags (24&nbsp;months).</p><p>Not only is there linear relationship between x<em>t</em> and x<em>t+h</em> or x<em>t-h </em>there is linear relationship between x<em>t</em> and the lags leading upto x<em>t+h</em> or x<em>t-h</em>. In other words, x<em>t</em> also has dependency on intermediate lags, therefore autocorrelation is not the correct measure of mutual correlation between x<em>t</em> and x<em>t+h</em> or x<em>t-h</em>. This requires removing dependency of the intermediate lags. This is done using partial autocorrelation function. Figure 8 shows a partial autocorrelation chart which shows temporal dependence of unemployment rate at a time <em>t</em> with that of <em>t-1</em> or lag=1 with some weak dependency shown between lags 2 to&nbsp;5.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!LNlX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fe0ea71-a407-488e-8b85-47a834b30dd5_576x209.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!LNlX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fe0ea71-a407-488e-8b85-47a834b30dd5_576x209.png 424w, https://substackcdn.com/image/fetch/$s_!LNlX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fe0ea71-a407-488e-8b85-47a834b30dd5_576x209.png 848w, https://substackcdn.com/image/fetch/$s_!LNlX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fe0ea71-a407-488e-8b85-47a834b30dd5_576x209.png 1272w, https://substackcdn.com/image/fetch/$s_!LNlX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fe0ea71-a407-488e-8b85-47a834b30dd5_576x209.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!LNlX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fe0ea71-a407-488e-8b85-47a834b30dd5_576x209.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7fe0ea71-a407-488e-8b85-47a834b30dd5_576x209.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!LNlX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fe0ea71-a407-488e-8b85-47a834b30dd5_576x209.png 424w, https://substackcdn.com/image/fetch/$s_!LNlX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fe0ea71-a407-488e-8b85-47a834b30dd5_576x209.png 848w, https://substackcdn.com/image/fetch/$s_!LNlX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fe0ea71-a407-488e-8b85-47a834b30dd5_576x209.png 1272w, https://substackcdn.com/image/fetch/$s_!LNlX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fe0ea71-a407-488e-8b85-47a834b30dd5_576x209.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Figure 7: Autocorrelation plot for unemployment rate</figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5Aqd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dd786f1-cc08-452e-9927-2d71a5bc54b8_576x211.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5Aqd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dd786f1-cc08-452e-9927-2d71a5bc54b8_576x211.png 424w, https://substackcdn.com/image/fetch/$s_!5Aqd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dd786f1-cc08-452e-9927-2d71a5bc54b8_576x211.png 848w, https://substackcdn.com/image/fetch/$s_!5Aqd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dd786f1-cc08-452e-9927-2d71a5bc54b8_576x211.png 1272w, https://substackcdn.com/image/fetch/$s_!5Aqd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dd786f1-cc08-452e-9927-2d71a5bc54b8_576x211.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5Aqd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dd786f1-cc08-452e-9927-2d71a5bc54b8_576x211.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0dd786f1-cc08-452e-9927-2d71a5bc54b8_576x211.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!5Aqd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dd786f1-cc08-452e-9927-2d71a5bc54b8_576x211.png 424w, https://substackcdn.com/image/fetch/$s_!5Aqd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dd786f1-cc08-452e-9927-2d71a5bc54b8_576x211.png 848w, https://substackcdn.com/image/fetch/$s_!5Aqd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dd786f1-cc08-452e-9927-2d71a5bc54b8_576x211.png 1272w, https://substackcdn.com/image/fetch/$s_!5Aqd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0dd786f1-cc08-452e-9927-2d71a5bc54b8_576x211.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Figure 8: Partial Autocorrelation plot for unemployment rate</figcaption></figure></div><p><strong>Test for Stationarity</strong></p><p>One important assumption that is made for inferential statistics to be reliable is that the population from which a sample is drawn does not undergo any fundamental change over the individual samples or over the time during which the samples are collected. This assumption is important for the inferential statistics to be reliably representing samples not previously seen before. This assumption also applies to time series data (Pal &amp; Prakash, 2017). This assumption in time series is called stationarity, and it implies that the mean, variance, and autocorrelation are constant, and so these can be used for future occurrences of the time&nbsp;series.</p><p>Augmented Dickey-Fuller (ADF) tests are used for detecting stationarity in time series data. On applying ADF tests on Unemployment Rate the p-value of the ADF test was found to be 0.033. And, since the p-value for Augmented Dickey-Fuller test is &lt; 0.05, the null hypothesis that the time series is non-stationery is rejected, concluding that the unemployment time series is stationery. Detailed test results of ADF test on all the variables is reproduced in table below. ADF Tests (H<em>0</em>: time series is non-stationary) are assessed at a 5% significance level on original data after differencing (1d) used in unemployment rate analysis and forecasting are shown below. The <em>p-values</em> are obtained for 4 significant digits.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xaiv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc35649f1-7058-4689-932d-42ba2b8fc939_602x430.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xaiv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc35649f1-7058-4689-932d-42ba2b8fc939_602x430.png 424w, https://substackcdn.com/image/fetch/$s_!xaiv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc35649f1-7058-4689-932d-42ba2b8fc939_602x430.png 848w, https://substackcdn.com/image/fetch/$s_!xaiv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc35649f1-7058-4689-932d-42ba2b8fc939_602x430.png 1272w, https://substackcdn.com/image/fetch/$s_!xaiv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc35649f1-7058-4689-932d-42ba2b8fc939_602x430.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xaiv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc35649f1-7058-4689-932d-42ba2b8fc939_602x430.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c35649f1-7058-4689-932d-42ba2b8fc939_602x430.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!xaiv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc35649f1-7058-4689-932d-42ba2b8fc939_602x430.png 424w, https://substackcdn.com/image/fetch/$s_!xaiv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc35649f1-7058-4689-932d-42ba2b8fc939_602x430.png 848w, https://substackcdn.com/image/fetch/$s_!xaiv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc35649f1-7058-4689-932d-42ba2b8fc939_602x430.png 1272w, https://substackcdn.com/image/fetch/$s_!xaiv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc35649f1-7058-4689-932d-42ba2b8fc939_602x430.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Results of Augmented Dickey-Fuller test for stationarity</figcaption></figure></div><p><strong>Multivariate Data&nbsp;Analysis</strong></p><p>Figure 9 shows all of the original macroeconomic indicators that are used for forecasting unemployment rate. Each of these indicators have been plotted for the same historic period this analysis was done for. A brief discussion of interesting observations for each of the variable&nbsp;follows.</p><p>The fed funds rate which is the interest rate that banks charge each other for overnight borrowings was near zero during the financial crisis of 2008 and following that for few years. Producer Price Index (Supplier price inflation), Money Supply (Amount of liquidity provided by Treasury) and Commercial Loan Activities (Commercial &amp; Industrial loans, and CRE loans), are not stationary as determined by ADF tests. These four indicators were differenced to make them stationary.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gZ1W!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6134bcdc-1680-477a-bc2f-1a43415254a7_576x628.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gZ1W!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6134bcdc-1680-477a-bc2f-1a43415254a7_576x628.png 424w, https://substackcdn.com/image/fetch/$s_!gZ1W!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6134bcdc-1680-477a-bc2f-1a43415254a7_576x628.png 848w, https://substackcdn.com/image/fetch/$s_!gZ1W!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6134bcdc-1680-477a-bc2f-1a43415254a7_576x628.png 1272w, https://substackcdn.com/image/fetch/$s_!gZ1W!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6134bcdc-1680-477a-bc2f-1a43415254a7_576x628.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gZ1W!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6134bcdc-1680-477a-bc2f-1a43415254a7_576x628.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6134bcdc-1680-477a-bc2f-1a43415254a7_576x628.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!gZ1W!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6134bcdc-1680-477a-bc2f-1a43415254a7_576x628.png 424w, https://substackcdn.com/image/fetch/$s_!gZ1W!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6134bcdc-1680-477a-bc2f-1a43415254a7_576x628.png 848w, https://substackcdn.com/image/fetch/$s_!gZ1W!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6134bcdc-1680-477a-bc2f-1a43415254a7_576x628.png 1272w, https://substackcdn.com/image/fetch/$s_!gZ1W!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6134bcdc-1680-477a-bc2f-1a43415254a7_576x628.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Figure 9: Macroeconomic indicators for forecasting unemployment rate</figcaption></figure></div><p>Additionally, there was differencing applied not only across a single month, but also over a three month period as shown in Figure 10. This was done so as to understand the pattern in the data consistent with methods used for financial data analysis. Financial data is not only evaluated month over month, but also over key recurring periods for financial reporting such as quarter over quarter change, year over year change. This analysis was done using only the three month rate change for the purpose of exploratory analysis. It was not extended for use with any models in this analysis so as to keep the scope of variables to a limited&nbsp;size.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!BKMB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccbf1f5a-e458-4b8a-b2d0-6648f63babb6_576x651.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BKMB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccbf1f5a-e458-4b8a-b2d0-6648f63babb6_576x651.png 424w, https://substackcdn.com/image/fetch/$s_!BKMB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccbf1f5a-e458-4b8a-b2d0-6648f63babb6_576x651.png 848w, https://substackcdn.com/image/fetch/$s_!BKMB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccbf1f5a-e458-4b8a-b2d0-6648f63babb6_576x651.png 1272w, https://substackcdn.com/image/fetch/$s_!BKMB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccbf1f5a-e458-4b8a-b2d0-6648f63babb6_576x651.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BKMB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccbf1f5a-e458-4b8a-b2d0-6648f63babb6_576x651.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ccbf1f5a-e458-4b8a-b2d0-6648f63babb6_576x651.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!BKMB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccbf1f5a-e458-4b8a-b2d0-6648f63babb6_576x651.png 424w, https://substackcdn.com/image/fetch/$s_!BKMB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccbf1f5a-e458-4b8a-b2d0-6648f63babb6_576x651.png 848w, https://substackcdn.com/image/fetch/$s_!BKMB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccbf1f5a-e458-4b8a-b2d0-6648f63babb6_576x651.png 1272w, https://substackcdn.com/image/fetch/$s_!BKMB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccbf1f5a-e458-4b8a-b2d0-6648f63babb6_576x651.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Figure 10: Macroeconomic indicators with 1 and 3 month rate&nbsp;changes</figcaption></figure></div><p>This concludes the exploratory data analysis.</p><p>In part 3 we will cover autoregressive methods for both univariate and multivariate analysis.</p><p>Until next&nbsp;time.</p><p>References:</p><p>Cook, T., &amp; Hall, A. S. (2017). <em>Macroeconomic Indicator Forecasting with Deep Neural Networks.</em> Retrieved from dx.doi.org: <a href="https://dx.doi.org/10.18651/RWP2017-11">https://dx.doi.org/10.18651/RWP2017-11</a></p><p>Pal, A., &amp; Prakash, P. (2017). <em>Practical Time Series Analysis.</em> Birmingham: Packt.</p><p>Hyndman, R., &amp; Athanasopoulos, G. (2021). <em><a href="https://otexts.com/fpp3/.">https://otexts.com/fpp3/.</a></em> OTexts.</p>]]></content:encoded></item><item><title><![CDATA[Multivariate time series forecasting and analysis of the US unemployment rate — Part 1]]></title><description><![CDATA[Multivariate time series forecasting and analysis of the US unemployment rate &#8212; Part 1]]></description><link>https://www.thefractal.co/p/multivariate-time-series-forecasting-and-analysis-of-the-us-unemployment-rate-part-1-f1454b029cb</link><guid isPermaLink="false">https://www.thefractal.co/p/multivariate-time-series-forecasting-and-analysis-of-the-us-unemployment-rate-part-1-f1454b029cb</guid><dc:creator><![CDATA[Vijay Reddiar]]></dc:creator><pubDate>Mon, 08 May 2023 01:55:25 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/7f4019ec-6c67-4a13-bfe6-7939b21a41c1_1024x512.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3>Multivariate time series forecasting and analysis of the US unemployment rate&#8202;&#8212;&#8202;Part&nbsp;1</h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!06Mt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64656c39-4c33-4a67-b12d-22fcf201e517_1024x512.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!06Mt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64656c39-4c33-4a67-b12d-22fcf201e517_1024x512.png 424w, https://substackcdn.com/image/fetch/$s_!06Mt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64656c39-4c33-4a67-b12d-22fcf201e517_1024x512.png 848w, https://substackcdn.com/image/fetch/$s_!06Mt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64656c39-4c33-4a67-b12d-22fcf201e517_1024x512.png 1272w, https://substackcdn.com/image/fetch/$s_!06Mt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64656c39-4c33-4a67-b12d-22fcf201e517_1024x512.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!06Mt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64656c39-4c33-4a67-b12d-22fcf201e517_1024x512.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/64656c39-4c33-4a67-b12d-22fcf201e517_1024x512.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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;: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_!06Mt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64656c39-4c33-4a67-b12d-22fcf201e517_1024x512.png 424w, https://substackcdn.com/image/fetch/$s_!06Mt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64656c39-4c33-4a67-b12d-22fcf201e517_1024x512.png 848w, https://substackcdn.com/image/fetch/$s_!06Mt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64656c39-4c33-4a67-b12d-22fcf201e517_1024x512.png 1272w, https://substackcdn.com/image/fetch/$s_!06Mt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64656c39-4c33-4a67-b12d-22fcf201e517_1024x512.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>The unemployment rate is an important macroeconomic indicator that is monitored by US government agencies for the purpose of ensuring the proper functioning of the overall economy. Since the unemployment rate is the measure of joblessness in the economy, it is necessary to build better forecast models for unemployment. These models are also used by the government to implement policy changes to increase employment opportunities and reduce financial hardship on the unemployed during recession.</p><p>In this multi-part article, I will discuss the usage of classical time series methods such as Vector Autoregressive Models and different neural network architectures, specifically, Feed Forward Artificial Neural Networks and Recurrent Neural Networks, specifically, Long Short-term Memory Networks.</p><p>With these methods, we assess the improvement in forecasting of unemployment rates against their univariate time series equivalent as well as a benchmark model used by the Federal Reserve. These multivariate methods consider historic macroeconomic variables listed below. Explanations for these follow in subsequent sections.</p><p>Gross Dometic&nbsp;Product,</p><p>Inflation,</p><p>Federal Funds&nbsp;Rate,</p><p>Commercial Loan Activities, and,</p><p>Money Supply (Liquidity).</p><p>We further compare models across forecasts over the quarters of a year using mean absolute error and standard deviation. On these metrics multivariate autoregressive model outperformed all the models for shorter forecast horizons, while the univariate neural networks performed better for longer forecast horizons.</p><p><strong>What is the Unemployment Rate?</strong></p><p>The unemployment rate is defined by the Federal Reserve as follows: &#8220;The unemployment rate represents the number of unemployed as a percentage of the labor&nbsp;force.</p><p>The Bureau of Labor Statistics (BLS) releases this data every&nbsp;month.</p><p><strong>Why is it important to accurately forecast the Unemployent Rate?</strong></p><p>The unemployment rate not only gives a measure of joblessness, but also is an indicator of economic growth. This is a lagging indicator and therefore is used to measure the impact of recession whether it is just beginning or is in the decline. It also provides a confirmation of the state of economy when evaluated in combination with other macroeconomic variables. When the unemployment rate increases, as it did during the last financial crisis in 2008, with an unemployment rate of 7 to 8%, which peaked at 10%, the government intervenes by stimulating the economy through a myriad of policy implementation including adding unemployment benefits, adding liquidity into the economy&#8202;&#8212;&#8202;&#8216;quantitative easing&#8217;, lowering interest rates, and, lowering tax rates to allow access to capital for households and businesses as well as introducing other government spending programs to increase employment opportunities.</p><p><strong>Key questions this modeling and analysis is trying to&nbsp;answer:</strong></p><p>1. Does including multivariate data improve model performance relative to univariate models?</p><p>2. Which multivariate models improve model performance?</p><p>3. How do these multivariate models compare with a benchmark consensus forecast from Survey of Professional Forecasters (SPF) at Federal Reserve Bank at Philadelphia.</p><p>This article discusses an extension of research conducted by the Federal Reserve at Kansas City (Cook &amp; Hall, 2017), specifically, modeling Unemployment Rate as an univariate time series problem using deep learning architectures.</p><p>Univariate time series forecasting of the US unemployment rate do not accurately represent asymmetries which arise from unemployment rate moving countercyclically up during economic contractions and downward in expansions.</p><p>The unemployment rate has an inherent contemporaneous dependency of many of the macroeconomic factors. These factors are considered as multiple features, or multiple time series in addition to the time lag (auto-regression) of the dependent variable for forecasting the unemployment rate. Fed Researchers noted that adding more data is expected to improve performance than using a univariate model.</p><p><strong>Modeling Approach:</strong></p><p>Due to the temporal relationship in the data, CRISP-DM methodology, which is the standard data mining framework, does not work well&nbsp;here.</p><p>This analysis is performed using a standardized approach used for time series data (Hyndman &amp; Athanasopoulos, 2021). This original method was enhanced by adding a step for data processing as an explicit step to get the data ready for analysis and modeling. This consists of a six step&nbsp;process:</p><p>1. Problem Definition</p><p>2. Data Gathering</p><p>3. Data Preparation</p><p>4. Preliminary (Exploratory) Analysis</p><p>5. Choosing and fitting&nbsp;model</p><p>6. Evaluating model</p><p>Each step is elaborated below:</p><ol><li><p><strong>Problem Definition</strong>:</p></li></ol><p>As stated, the main objective of this analysis is to learn if adding relevant variables can improve forecasting accuracy of the US civilian unemployment rate. This data is a time series. Problem definition is generally considered the most difficult part of the process due to the subjectivity of the nature of the problem defined. It is important to know who will be using the forecast and its intended usage. In this analysis, the forecasts are being generated for the purpose of answering important questions stated in the three questions described under the Key Question header&nbsp;above.</p><p><strong>2. Gathering Information</strong>:</p><p>This involved collecting historical data for the purpose of analysis and modeling. Additionally, in this phase, supporting information and knowledge base was applied to interpret the information as well as to understand the analysis. The data source for this analysis leverages publications by the Federal Reserve. Federal Reserve Economic Database (FRED, 2021&#8211;2022) is the source used for unemployment data as well as for sourcing other data for this analysis. Table 1 shows the time series data are being used for the multivariate analysis.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!J8db!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2333ee4d-6453-43c9-8b4b-790ee5bb8f84_673x369.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!J8db!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2333ee4d-6453-43c9-8b4b-790ee5bb8f84_673x369.png 424w, https://substackcdn.com/image/fetch/$s_!J8db!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2333ee4d-6453-43c9-8b4b-790ee5bb8f84_673x369.png 848w, https://substackcdn.com/image/fetch/$s_!J8db!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2333ee4d-6453-43c9-8b4b-790ee5bb8f84_673x369.png 1272w, https://substackcdn.com/image/fetch/$s_!J8db!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2333ee4d-6453-43c9-8b4b-790ee5bb8f84_673x369.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!J8db!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2333ee4d-6453-43c9-8b4b-790ee5bb8f84_673x369.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2333ee4d-6453-43c9-8b4b-790ee5bb8f84_673x369.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&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_!J8db!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2333ee4d-6453-43c9-8b4b-790ee5bb8f84_673x369.png 424w, https://substackcdn.com/image/fetch/$s_!J8db!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2333ee4d-6453-43c9-8b4b-790ee5bb8f84_673x369.png 848w, https://substackcdn.com/image/fetch/$s_!J8db!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2333ee4d-6453-43c9-8b4b-790ee5bb8f84_673x369.png 1272w, https://substackcdn.com/image/fetch/$s_!J8db!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2333ee4d-6453-43c9-8b4b-790ee5bb8f84_673x369.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption"><em>Table 1: List of predictors used for multivariate modeling</em></figcaption></figure></div><p>All the data sets are produced monthly and are not adjusted, except for the GDP which is seasonally adjusted as well as Unemployment Rate, the target variable which is also seasonally adjusted. Below is a brief description of each of the variables and how it is related to unemployment.</p><p>a. <strong>Civilian Unemployment Rate </strong>(UNRATE): This is the target variable. The unemployment rate represents the number of unemployed as a percentage of the labor force. This includes individuals 16 and above in the 50 US states. It excludes active-duty personnel. This is the variable used for forecasting in this analysis.</p><p>b. <strong>Fed Funds Rate</strong> (FEDFUNDS): The federal funds rate is the interest rate at which depository institutions trade federal funds (balances held at Federal Reserve Banks) with each other overnight. When a depository institution has surplus balances in its reserve account, it lends to other banks in need of larger balances. In simpler terms, a bank with excess cash, which is often referred to as liquidity, will lend to another bank that needs to quickly raise liquidity.</p><p>The federal funds rate is the central interest rate in the U.S. financial market. It influences other interest rates such as the prime rate, which is the rate banks charge their customers with higher credit ratings. Additionally, the federal funds rate indirectly influences longer term interest rates such as mortgages, loans, and savings, all of which are very important to consumer wealth and confidence according to the Board of Governors of the Federal Reserve System. (FRED, 2021&#8211;2022)</p><p>c. <strong>Money Supply </strong>(M2NS): This is one of the measurements (of the three&#8202;&#8212;&#8202;M1, M2, M3) of United States money supply, also known as the money aggregates. M1 includes money that is in circulation at a given time including checkable deposits in banks, whereas M2 includes M1 plus saving deposits (less than $100,000), and money market mutual funds. M3 includes M2 plus large time (fixed) deposits. The reason M2 is chosen as it is the most watched indicator of money supply and future inflation. The less the money supply, the less liquidity in the system. Optimal level of liquidity is important for access to capital for businesses to continue and expand their operations which further ensures unemployment rates are kept in&nbsp;check.</p><p>d. <strong>Producer Price Index </strong>(PPIACO): This measure provides information on the price index similar to CPI which is generally used for consumer price index (inflation as more commonly known). PPIACO is used as a leading indicator to predict consumer price increases, as it follows a producer price increase. When PPI increases, the cost of raw materials increases and therefore cost of doing business increases. When this price increase is not passed down to the end consumer or is marginally passed down, employers bear the brunt of the cost pressures, putting a risk to employment for the workforce.</p><p>e. <strong>Inflation </strong>(CPALTT01USM657N): This represents CPI (consumer price index) described in section d above. When CPI increases, demand for certain type of goods, services contract. Sustained inflation without intervention from the central bank and Fed can further hurt business sales, and therefore margins, increasing unemployment risk as inflation combined with economic slowdown continues over longer&nbsp;term.</p><p>f. <strong>GDP Growth </strong>(BBKMGDP): Gross Domestic Product (GDP) is the measure of economic activity of a country. It is measured as the total market value of goods and services produced by an economy during a given period. GDP is published only quarterly. An alternative GDP measure is being used here referred to as Brave-Butters-Kelley Monthly GDP. This measure is published by the Fed as a monthly time series data. All data used in this analysis is&nbsp;monthly.</p><p>g. <strong>Commercial &amp; Industrial Business Loan activity </strong>(BUSLOANSNSA): This measure provides commercial lending and is indicator of capital usage by the businesses. A strong loan demand is indicative of demand for labor and therefore a lower unemployment rate.</p><p>h. <strong>Commercial Real Estate Business Loan activity </strong>(REALLNNSA): This measure is similar to the commercial lending activity, except it is specifically for commercial real estate which includes physical properties used for commercial purposes. In an expanding economy with newer offices, facilities, and factories, jobs are expected to be increasing reducing unemployment rate. Both g and h are leading indicators of unemployment rate.</p><p>The last two variables described above for business loan activity was not actively found to be used in macroeconomic forecasting literature. However, based on economic theories, we understand that access to capital through loans helps companies plan for growth which requires hiring workforce among other investments, and, therefore higher the loan activity under a rising GDP environment, there is an expectation that the employment rate will be higher. Consequently, the unemployment rate will be lower. After conducting exploratory data analysis, the last two variables were subsequently dropped from modeling.</p><p>In part 2 of this series, we will continue the article starting with the data preparation needed for this analysis and modeling.</p><p></p><p>Until next&nbsp;time.</p><p>References:</p><p>Cook, T., &amp; Hall, A. S. (2017). <em>Macroeconomic Indicator Forecasting with Deep Neural Networks.</em> Retrieved from dx.doi.org: <a href="https://dx.doi.org/10.18651/RWP2017-11">https://dx.doi.org/10.18651/RWP2017-11</a></p><p>FRED. (2021&#8211;2022). <em>Fed Reserve Economic Research</em>. Retrieved from Fed Reserve Economic Data: <a href="https://fred.stlouisfed.org/">https://fred.stlouisfed.org/</a></p><p>Hyndman, R., &amp; Athanasopoulos, G. (2021). <em><a href="https://otexts.com/fpp3/.">https://otexts.com/fpp3/.</a></em> OTexts.</p><p>Karpathy, A. (2015). Retrieved from <a href="http://karpathy.github.io/2015/05/21/rnn-effectiveness/">http://karpathy.github.io/2015/05/21/rnn-effectiveness/</a></p><p>Katris, C. (2019). Prediction of Unemployment Rates with Time Series and Machine Learning Techniques. <em>Computational Economics</em>, 682.</p><p>Lower, Eric. (2021). <em>Introduction to the Fundamentals of Vector Autoregressive Models</em>. Retrieved from Aptech: <a href="https://www.aptech.com/blog/introduction-to-the-fundamentals-of-vector-autoregressive-models/">https://www.aptech.com/blog/introduction-to-the-fundamentals-of-vector-autoregressive-models/</a></p><p>Montgomery, A., &amp; Zarnowitz, V. (1998). Forecasting the US Unemployment Rate. <em>Journal of the American Statistical Association</em>, 478.</p><p>SPF. (2022). <em>Survey of Professional Forecasters</em>. Retrieved from Federal Reserve Bank Philadephia: <a href="https://www.philadelphiafed.org/surveys-and-data/real-time-data-research/survey-of-professional-forecasters">https://www.philadelphiafed.org/surveys-and-data/real-time-data-research/survey-of-professional-forecasters</a></p>]]></content:encoded></item></channel></rss>