<?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:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Qbearproject on Medium]]></title>
        <description><![CDATA[Stories by Qbearproject on Medium]]></description>
        <link>https://medium.com/@qbearproject?source=rss-22b18b3762de------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*PNRNw6uSXFx6-IPMZQvxGw.jpeg</url>
            <title>Stories by Qbearproject on Medium</title>
            <link>https://medium.com/@qbearproject?source=rss-22b18b3762de------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 05:22:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@qbearproject/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Fifth seat]]></title>
            <link>https://medium.com/@qbearproject/the-fifth-seat-9f14ac844ef5?source=rss-22b18b3762de------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f14ac844ef5</guid>
            <category><![CDATA[teen-patti]]></category>
            <category><![CDATA[predictions]]></category>
            <category><![CDATA[probability]]></category>
            <category><![CDATA[cards-game]]></category>
            <category><![CDATA[game-theory]]></category>
            <dc:creator><![CDATA[Qbearproject]]></dc:creator>
            <pubDate>Thu, 10 Jul 2025 13:47:57 GMT</pubDate>
            <atom:updated>2025-07-10T13:47:57.265Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kz33VtpuI9iDS8Fm5OuIow.png" /></figure><p>Ravi hadn’t always played cards.</p><p>He had studied engineering once — numbers, logic, models. Then he discovered <strong>Teen Patti</strong>, and realized something most people at the table didn’t:</p><p>It wasn’t a game of luck.</p><p>It was a language.</p><p>And most people? They never learned to read.</p><p>That night, he sat in the third seat again — middle ground. A place with just enough silence to think. A place without pressure to act first or fear going last.</p><p>He watched Maya throw in her blind — <strong>$10</strong>, no hesitation.</p><p>Ramesh followed. Blind, too. Arjun looked at his cards, then matched the bet. <strong>Seen. </strong>Nikhil called as well. It came to Ravi. He slid his blind in. Five players. <strong>$50</strong> in the pot.</p><p>Now the real game began.</p><blockquote>“Five players in means five sets of cards. That’s fifteen cards dealt from the deck. Out of 52. That leaves 37 cards unaccounted for. Every fold changes those numbers. Every elimination shrinks the universe I’m calculating in.”</blockquote><p>He remembered something from his notes: a term most players never heard — <strong>hypergeometric distribution</strong>. It sounded complicated, but it wasn’t.</p><blockquote>“Imagine you have a bag with 52 marbles — each one a unique card. When 15 are taken out and given to players, the odds of getting any specific card changes for everyone else. You’re not picking randomly from the full bag anymore. You’re picking from what’s left — and that’s how the odds twist.”</blockquote><p>The dealer moved fast. New round.</p><p>Maya raised. <strong>$20 more.</strong></p><p>Arjun called again. He always did.</p><p>Ravi still hadn’t looked at his cards. He called too. No emotion. <strong>$80</strong> now sat in the middle of the table.</p><p>He looked down.</p><p><strong>Ten♦ — Jack♦ — Queen♦</strong></p><p>A <strong>Pure Sequence</strong>. All in the same suit. In perfect order.</p><blockquote>“Rare. Happens less than once in 500 hands. Some players never see one in a night. This is the hand that beats nearly everything except three of a kind. That’s called a Trail — and even that shows up only 1 in 70 games.”</blockquote><p>He stayed quiet. Still.</p><blockquote>“Let them build the pot. This is where position matters.”</blockquote><p>He was in <strong>seat 3</strong>, right in the middle.</p><blockquote>“If I was first, they’d have no reason to bet. If I was last, I’d have too much pressure to act. But here, I get to watch. Let them move first. Let them reveal their rhythms.”</blockquote><p>The bet came around again. Ramesh folded. First blood.</p><blockquote>“That changes things. With four players left, my odds of winning go up. That’s the thing about eliminations — they don’t just remove people. They stretch your chances wider. When one person folds, it’s like your own cards get slightly stronger — even though they haven’t changed.”</blockquote><p>In Ravi’s mind, the game wasn’t about bluffing.</p><p>It was about understanding <strong>how every player leaving the table reshaped reality</strong>.</p><blockquote>“If all five players are in, and you’re holding a basic hand like high card, your chances are awful. But if three people fold? That same hand starts looking valuable. It’s not your hand that changed — it’s the battlefield that shrank.”</blockquote><p>That was the hidden rule. Every fold was a shift in gravity.</p><p>Maya was still in.</p><p>And Maya was sharp. She didn’t overbet. She didn’t play for ego. She raised again.</p><p>Nikhil dropped out.</p><p>Arjun stared. Folded. Finally.</p><p>Now it was just her and Ravi.</p><p>She met his gaze. He saw something in her eyes — not fear, but suspicion. She knew something wasn’t normal. She knew she was walking into a trap.</p><p>He called.</p><p>The pot sat around <strong>$180</strong> now.</p><p>She raised again.</p><blockquote>“She’s challenging. Wants me to show fear. But I won’t.”</blockquote><p>He raised back. Just a little. Not enough to scare her. Just enough to <strong>give her the illusion of control</strong>.</p><p>She called. Showdown.</p><p>She flipped her cards.</p><p><strong>King♠ — King♥ — Eight♣</strong></p><p>A Pair.</p><blockquote>“Most common hand after High Card. Happens in about <strong>17%</strong> of all deals. Reliable, but not against a Pure Sequence.”</blockquote><p>Ravi turned his cards over, slowly. Maya blinked.</p><blockquote>“Damn.”</blockquote><p>He took the pot.</p><p>Again.</p><p><strong>Want to play like Ravi — calm, precise, and always one move ahead?</strong><br> At <strong>Qbear</strong>, we’re working on <strong>Project Trinetra</strong> — a statistics and game theory–driven engine that models the real-time flow of Teen Patti games and builds adaptive strategies to help players win more consistently.<br> If you’re fascinated by probability, decision-making, or the psychology of play, join us in this research project.</p><p>Contact us : qbearproject@yahoo.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f14ac844ef5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bridging the Markets: How Global Indices Shape India’s Nifty 50]]></title>
            <link>https://medium.com/@qbearproject/bridging-the-markets-how-global-indices-shape-indias-nifty-50-9c059591e142?source=rss-22b18b3762de------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c059591e142</guid>
            <category><![CDATA[financial-markets]]></category>
            <dc:creator><![CDATA[Qbearproject]]></dc:creator>
            <pubDate>Tue, 17 Jun 2025 16:10:37 GMT</pubDate>
            <atom:updated>2025-06-17T16:10:37.994Z</atom:updated>
            <content:encoded><![CDATA[<p><em>By Kanak C. Dahal</em></p><h3>🌍 Introduction: A Financial World More Connected Than Ever</h3><p>In today’s financial ecosystem, borders are becoming irrelevant. Markets from New York to Frankfurt, Hong Kong to Mumbai, are constantly responding to one another in real-time, creating complex cross-market dynamics. But how deep do these interconnections run?</p><p>In this research, I sought to answer a very specific question:<br> <strong>Can we predict India’s Nifty 50 movements using historical data from major global stock indices?</strong></p><p>To tackle this, I blended classical machine learning techniques with the predictive power of deep learning — specifically using Random Forest Regressors and Bidirectional Long Short-Term Memory (BiLSTM) neural networks. This article takes you behind the scenes of that journey.</p><h3>🔍 The Goal of the Study</h3><p>I wanted to go beyond anecdotal assumptions of “the US sneezes and the world catches a cold.”<br> Instead, this study quantifies how much influence each major global index has on the Nifty 50, India’s benchmark stock index.</p><p>The indices included in the analysis:</p><ul><li>S&amp;P 500 🇺🇸</li><li>NASDAQ Composite 🇺🇸</li><li>FTSE 100 🇬🇧</li><li>DAX 🇩🇪</li><li>CAC 40 🇫🇷</li><li>EURO STOXX 50 🇪🇺</li><li>Hang Seng 🇭🇰</li><li>Nifty 50 🇮🇳 <em>(target variable)</em></li></ul><h3>🧠 Why LSTM?</h3><p>Unlike typical regression models, LSTM networks are designed for sequence learning — perfect for stock market prediction. They remember information over long periods, learning from past patterns to make future predictions.</p><p>I implemented a <strong>Bidirectional LSTM</strong>, which doesn’t just learn from past data but also captures backward trends — crucial in a globally reactive market.</p><h3>🛠️ Research Methodology</h3><h3>1. Data Collection</h3><p>Using Python’s yfinance, I scraped nearly <strong>5 years of daily historical closing prices and volumes</strong> for each index. Dates were aligned to retain only common trading days, ensuring clean, consistent time series.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NubR0T5GH8vSFiUYeucWqg.png" /></figure><h3>2. Exploratory Data Analysis (EDA)</h3><p>Correlation matrices revealed that the <strong>S&amp;P 500 and NASDAQ have over 90% correlation</strong> with the Nifty 50 — suggesting that movements in US markets are echoed in India almost 9 out of 10 times.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vBep1xy0MpAIFQHrHaSRXw.png" /></figure><p>💡Surprise Insight:<br> The <strong>Hang Seng Index showed weak correlation (≈ 0.44)</strong>, despite geographical proximity, highlighting how political/regulatory divergence can outweigh location-based intuition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nxR9okofIMQOHrHMjwSJEQ.png" /></figure><h3>3. Volume Distribution: A Liquidity Lens</h3><p>Trading volume distributions unveiled something else:</p><ul><li>US indices (especially NASDAQ) showed deep, stable volumes.</li><li>European markets had occasional bursts.</li><li>Nifty 50 had a healthy but maturing volume pattern, peaking between 150M–250M shares per session.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g_KWPhN3GVcFN-EMmPp8_A.jpeg" /></figure><h3>🧪 Building the Models</h3><h3>Bidirectional LSTM ⚙️</h3><p>Here’s where it gets interesting. Using a 60-day window of lagged prices and volumes, the BiLSTM was trained to predict the 61st-day Nifty 50 closing price.</p><p>Hyperparameters:</p><ul><li>Epochs: 50</li><li>Batch size: 64</li><li>Validation split: 0.2</li><li>Optimizer: Adam with learning rate 0.0005</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*FsXrjfUvHGTwzDxZIzwYEg.png" /></figure><p>The training and validation loss curves showed healthy convergence with minimal overfitting — thanks to dropout layers and early stopping.</p><h3>🎯 Evaluation: How Well Did It Predict?</h3><p>After inverse-scaling predictions to match actual price levels, here’s how the model performed:</p><ul><li><strong>MAE:</strong> 543.2</li><li><strong>RMSE:</strong> 701.38</li><li><strong>R² Score:</strong> 0.72</li></ul><p>This means the model explains <strong>72% of Nifty’s variance</strong> — which is impressive, considering it uses no domestic features!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oRktAG-CX6-zddmpleCnLQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jnq1jCRZgDyzpndIHjgxUQ.png" /></figure><h3>🔍 Bonus Analysis: The NASDAQ–Nifty Spread</h3><p>This one’s for the quants.</p><p>By creating a <strong>spread variable</strong> between NASDAQ and Nifty and normalizing it, I observed a leading indicator behavior.</p><p><strong>Hypothesis:</strong></p><blockquote><em>Changes in the NASDAQ–Nifty spread often precede short-term Nifty moves.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z1QDrTg3EuvLTLZ7P7YP3A.png" /></figure><h3>📌 Key Takeaways</h3><ul><li>US indices (especially the S&amp;P 500 and NASDAQ) have a <strong>strong influence</strong> on the Nifty 50.</li><li>LSTM models — particularly <strong>Bidirectional LSTMs</strong> — can effectively learn from these relationships and forecast Indian market trends with decent accuracy.</li><li>Spread-based indicators open up potential <strong>alpha-generating</strong> strategies and new research areas.</li></ul><h3>🧭 What’s Next?</h3><p>Future iterations of this project could:</p><ul><li>Integrate <strong>macroeconomic indicators</strong> (like US interest rates or crude oil prices).</li><li>Add <strong>sentiment analysis</strong> from global financial news.</li><li>Test <strong>real-time predictions</strong> for short-term trading strategies.</li></ul><h3>👋 Final Thoughts</h3><p>This project was more than just a modeling exercise — it was a lens into how financial globalization is now being interpreted through machine learning.</p><p>If you’re into quantitative finance, cross-market strategies, or deep learning for time series forecasting — follow along. I’ll be posting the complete code and notebooks soon!</p><p>🔗 [Link to GitHub/Colab if available]<br> 🧠 Drop a comment if you’d like to collaborate on extensions or improvements!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c059591e142" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>