<?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 Abbas Shakiba on Medium]]></title>
        <description><![CDATA[Stories by Abbas Shakiba on Medium]]></description>
        <link>https://medium.com/@abshakiba?source=rss-53fa0e589bf9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*WK8lMYcvfU_DVB8ByzX5pg@2x.jpeg</url>
            <title>Stories by Abbas Shakiba on Medium</title>
            <link>https://medium.com/@abshakiba?source=rss-53fa0e589bf9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 15:19:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abshakiba/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 Best Way to Half(ass) a Marathon]]></title>
            <link>https://abshakiba.medium.com/the-best-way-to-half-ass-a-marathon-64fb40911b1e?source=rss-53fa0e589bf9------2</link>
            <guid isPermaLink="false">https://medium.com/p/64fb40911b1e</guid>
            <category><![CDATA[marathon]]></category>
            <category><![CDATA[lifestyle]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[growth]]></category>
            <category><![CDATA[achievement]]></category>
            <dc:creator><![CDATA[Abbas Shakiba]]></dc:creator>
            <pubDate>Sun, 09 Jun 2024 22:44:35 GMT</pubDate>
            <atom:updated>2024-06-09T22:45:59.736Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZOvF0mXwM49R7GIi" /></figure><p>A couple of years ago, I ran the Chicago full marathon for the first time. It was an emotional roller coaster! From dealing with inner thoughts and missing friends and family to officially finishing it in the last second; to be accurate, I was 7th from the last!</p><p>Today, I finished the Chicago half marathon. Since the last race, I have lost 25 pounds and was running at a much higher pace, but I got muscle cramps at mile 11 and was forced to walk the last two miles. However, I managed to run at mile 13 to finish the race within 2 hours and 37 minutes, which is still a personal record.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wwpnlYcE1hobd6sxBFCylA.jpeg" /></figure><p>Here are some of my thoughts during the race. Not as dramatic as last time, but still…</p><p>I think these kinds of endurance events, such as marathons, triathlons, and Ironman races, offer an extremely fast overview of a lifetime! They cover almost everything that may happen in someone’s life.</p><p>At the start, you are fresh, fast, and kind of lost among thousands of people, not knowing what’s going to “really” happen in the next few hours. Just like someone who is just starting to understand their life. Nothing really here to say! You don’t know what you are doing. You just follow the people.</p><p>You start running and everything seems to be fine until your brain brings up memories that you never thought you still had. For me, the biggest challenge is still the mental one, not the physical. You think about everything, more than once, from beginning to end and then rewind! Your body starts to yell at you that it is in pain, but the show must go on and you keep going! Isn’t it a familiar feeling? That you are in deep trouble, not feeling well, not happy about so many things in your life, but still keep going? Do you stop at all? Maybe some do, but I don’t think you should. (Maybe if you are actually really hurt.) The moment you stop, the race is over! That’s the end of what you are fighting for. The level of effort is definitely different, but also if you run too fast, your body rejects that effort; if you run too slow, you never get to your destination or maybe it is too late! You must know yourself well enough to be able to finish the race. I guess everyone agrees that the more you know yourself, the more successful and happy you will be.</p><p>Toward the end or in the second half of the race, the real pain kicks in, and that’s expected for most amateurs since they are putting a lot of pressure on their bodies, which is an unknown territory. The rule applies here: do not stop. You may slow down, you may walk a little bit, but stopping is not an option. I think the pain at this level is much higher and less manageable, but that’s a sign that you have pushed yourself into something new and are learning how to deal with it and move past it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JckXk5E_btww9VPO24Myjw.jpeg" /></figure><p>Finally, I think what someone can really learn from endurance events is that life is not as short as everyone says, and life events are not always as easy as you would expect! If you feel a bit more pressure than last time, it means you are in a different area, and if you think you are struggling, it means you need to act differently, maybe you just need more practice, or you need a new set of trainings.</p><p>What do you think? Have you had similar experiences? Have you run marathons or participated in other endurance events? What were your thoughts and experiences during those times? Do you find that these events reflect the challenges and triumphs of life as well? I’d love to hear your stories and reflections.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64fb40911b1e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Demystifying the Null Hypothesis: The Backbone of Statistical Testing — Part 1]]></title>
            <link>https://abshakiba.medium.com/demystifying-the-null-hypothesis-the-backbone-of-statistical-testing-part-1-53bc6bbf8d26?source=rss-53fa0e589bf9------2</link>
            <guid isPermaLink="false">https://medium.com/p/53bc6bbf8d26</guid>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[education]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[mathematics]]></category>
            <dc:creator><![CDATA[Abbas Shakiba]]></dc:creator>
            <pubDate>Fri, 31 May 2024 20:47:35 GMT</pubDate>
            <atom:updated>2024-05-31T20:47:35.385Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FhhyQ2GmuHXXkXNf" /><figcaption>Photo by <a href="https://unsplash.com/@aaronburden?utm_source=medium&amp;utm_medium=referral">Aaron Burden</a></figcaption></figure><h3>Demystifying the Null Hypothesis: The Backbone of Statistical Testing — Part 1</h3><h3>Introduction</h3><p>I have been studying statistics on and off for the past few years, mainly due to my job or career advancement. However, my studies often get interrupted when I find a new job where I don’t use statistics in my daily work. This pattern is common for many topics, as most jobs only require a handful of specific skills on a daily basis.</p><p>In statistics, there’s one topic that I’ve never fully understood: the null hypothesis and the infamous p-value. In the past, I would memorize this topic just for interviews and then forget it soon after. This also applies to A/B testing, which I never quite grasped deeply.</p><p>Recently, for reasons that might be worth another post, I developed a genuine interest in probability and statistics. I started reading college textbooks as if I were taking the classes. Currently, my main references are <a href="https://amzn.to/3x59qUm">Probability and Statistical Inference (9th Edition)</a> and <a href="https://amzn.to/3KlV4lJ">An Introduction to Statistical Learning (Python)</a>.</p><p>If you’re in the field of data, you’ve likely heard about and studied the null hypothesis, p-value, and A/B testing multiple times. I’ve studied and forgotten them many times myself. There are a few reasons why this happens, but perhaps that’s a discussion for another time.</p><p>This time, I’ve decided to dive a little bit deeper into these topics to ensure I won’t forget them again. At the very least, I want to create a reference for myself to review later. The article below is the result of my study. I hope you learn as much from it as I did. This article takes a more practical approach and is less focused on theoretical or academic aspects.</p><p>Make sure to save and share this post so others can benefit from it. Also, don’t be shy — please leave a comment or feedback. I would love to hear from you.</p><h3>Basics of the Null Hypothesis</h3><p>The null hypothesis, denoted as H₀ (H naught or H zero), suggests that the new change or update has no effect or no difference, effectively telling the scientific narrative, “Move along, there’s nothing to see here!” On the other side of the coin, the alternative hypothesis, Hₐ or H₁ , is like the lead guitarist at a concert, claiming, “Hey, check this out; something noteworthy is happening!”</p><h4>Key Aspects of the Null Hypothesis:</h4><ul><li><strong>Simplicity and Clarity:</strong> The null hypothesis is typically a statement of simplicity and maintains the status quo. It suggests that any observed changes are due to chance or non-systematic factors.</li><li><strong>Testability: </strong>It is structured so that it can be clearly tested using statistical methods. This ensures that conclusions drawn from data analysis are not just subjective interpretations but are backed by rigorous testing.</li><li><strong>Foundation for Statistical Significance:</strong> By testing the null hypothesis, researchers can determine whether the results they observe in their data are significant or if they could reasonably occur by random chance.</li><li><strong>Basis for Comparison:</strong> The null hypothesis provides a baseline or a control scenario against which the experimental outcomes are compared. This comparison helps in validating the effect of experimental manipulations.</li></ul><p>Formulating a null hypothesis requires stating that no relationship exists between two measured phenomena or that there is no association among groups. For example, if we want to test whether a new teaching method improves student performance compared to the current method, the null hypothesis would be set as:</p><p>​H₀: (μ) New = (μ) <em>Current [μ represents the mean score of students.]</em></p><p>This asserts that the mean (μ) performance of students under both teaching methods is the same. By testing this hypothesis, we aim to see if the new method can statistically prove its superiority over the current method.</p><h3>Testing the Hypotheses with the test statistics</h3><p>The test statistic is a statistical test used to determine whether there is a significant difference between the means of two groups, which may be related in certain features or measurements. It is most commonly used when the test statistic follows a normal distribution and the standard deviation of the population from which the samples were drawn is not known. The formula for the t-test varies slightly depending on the type of test being conducted (one-sample, independent two-sample, or paired), but the basic principle remains the same: comparing the means of two groups to see if they are statistically different from each other.</p><p>For the independent two-sample t-test, the formula is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/118/1*ua6WPIOPUfW1SgnIR--5Og.png" /><figcaption>Where μ is the mean of the sample, δ² is the variance of the sample, and n is the size of the population for both samples.</figcaption></figure><p>This formula calculates the t-statistic, which is then used to determine whether the differences between the group means are statistically significant. The calculated t-table is compared against a critical value from the t-distribution table, taking into account the desired confidence level and the degrees of freedom (which are calculated as n1 + n2–2 for this problem).</p><p>If the absolute value of the t-statistic is greater than the critical value, the null hypothesis (that the means are equal) is rejected, suggesting a statistically significant difference between the groups.</p><h3>The Infamous P-Value and Reading Statistics Tables (t-table)</h3><p>Once the t-test has been performed and the t-statistics calculated, the next step is interpreting this statistic through the lens of the p-value and the t-table. The p-value is a crucial statistic in hypothesis testing, indicating the probability of observing results as extreme as, or more extreme than, the results obtained, under the assumption that the null hypothesis is correct. A smaller p-value suggests stronger evidence against the null hypothesis, typically leading researchers to reject it if the p-value falls below a predetermined significance level, such as 0.05 (for a 95% confidence level).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/422/1*8VOBdepFryRj5MR3viJNjw.png" /><figcaption>Source: <a href="https://www.medcalc.org/">medcalc.org</a></figcaption></figure><p>To use the <a href="https://www.sjsu.edu/faculty/gerstman/StatPrimer/t-table.pdf">t-table</a> effectively, locate the degrees of freedom (df) corresponding to your test (n1+n2–2 in this example where n1 + n2 is the sample size), and find the row that matches this number. Across the top of the table are listed significance levels; find the column for the significance level you are using (e.g., 0.05 for a 95% confidence level). The intersection of this row and column gives the critical value of t. If your calculated t-statistic is greater than this critical value (in absolute terms for a two-tailed test), then the null hypothesis can be rejected, indicating significant results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*gNP4XsQOQOBDOUdnVETpZA.jpeg" /><figcaption>Let’s say the df is 60 and the t-statistic is 2.211. Are we going to fail to reject or reject the null hypothesis for the 0.05 level?</figcaption></figure><p>If the calculated test statistic from your t-table is less than the corresponding critical value in the t-table for your chosen significance level (for instance, 0.05 for 95% confidence), this result implies that there is not enough statistical evidence to conclude that there is a significant difference between the groups being compared. Essentially, we fail to reject the Null Hypothesis — the data does not show a statistically significant departure from the null hypothesis. On the other hand, if the p-value is close to 1, we have strong support for the Null Hypothesis. Contrary to what is commonly thought, a p-value isn’t just about “rejecting” or “not rejecting” the null hypothesis. While a small p-value (typically less than 0.05) indicates strong evidence against the null hypothesis, a large p-value suggests that the data is very consistent with the null hypothesis.</p><h3>Sample Code</h3><pre>import numpy as np<br>from scipy import stats<br><br># Random seed for reproducibility<br>np.random.seed(42)<br><br># Generate random data for current and new teaching methods<br>current_scores = np.random.normal(loc=50, scale=10, size=30)<br>new_method_scores = np.random.normal(loc=55, scale=10, size=30)<br><br># Perform a two-sample t-test<br>t_stat, p_val = stats.ttest_ind(new_method_scores, current_scores)<br><br>print(&quot;T-statistic:&quot;, t_stat)<br>print(&quot;P-value:&quot;, p_val)</pre><p>Output: (Might be different in your system)</p><pre>T-statistic: 1.9959<br>P-value: 0.051</pre><p>Should we reject the null hypothesis? You may check the t-table <a href="https://www.sjsu.edu/faculty/gerstman/StatPrimer/t-table.pdf">here</a>.</p><h3>Summary</h3><p>In this article, I delve into the crucial role of the null hypothesis (H₀) in statistical testing, particularly within data science and machine learning contexts. The null hypothesis proposes no effect or difference, serving as a skeptical baseline against which scientific claims are tested. It is contrasted with the alternative hypothesis (Hₐ or H₁), which posits that a notable effect or difference exists.</p><p>The practical application of the null hypothesis is illustrated through the use of the t-test, which assesses whether the means of two groups differ significantly. The mechanics of calculating the t-statistic and interpreting p-values are explained, demonstrating how a small p-value leads to rejecting the null hypothesis, thereby suggesting significant results.</p><h3>Next</h3><p>Looking forward, the next post will discuss A/B testing and further applications of the null hypothesis in enhancing machine learning models, bridging theoretical statistical principles with practical machine learning implementations.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=53bc6bbf8d26" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>