<?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 Mihir Patel on Medium]]></title>
        <description><![CDATA[Stories by Mihir Patel on Medium]]></description>
        <link>https://medium.com/@mihirpatelx?source=rss-95df8b0f6b80------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*a5YVHi-rm1RhM8O8R6Sc_Q.jpeg</url>
            <title>Stories by Mihir Patel on Medium</title>
            <link>https://medium.com/@mihirpatelx?source=rss-95df8b0f6b80------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 22:48:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mihirpatelx/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[Sometimes you can feel sad for no reason.]]></title>
            <link>https://medium.com/@mihirpatelx/sometimes-you-can-feel-sad-for-no-reason-542d0b63b340?source=rss-95df8b0f6b80------2</link>
            <guid isPermaLink="false">https://medium.com/p/542d0b63b340</guid>
            <category><![CDATA[depression]]></category>
            <category><![CDATA[mental-health]]></category>
            <category><![CDATA[meditation]]></category>
            <category><![CDATA[yoga]]></category>
            <category><![CDATA[happiness]]></category>
            <dc:creator><![CDATA[Mihir Patel]]></dc:creator>
            <pubDate>Fri, 19 Jun 2020 18:03:44 GMT</pubDate>
            <atom:updated>2020-06-19T18:03:44.617Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*Rgx2d5kNNRY3-Z3SCACmLA.jpeg" /><figcaption><a href="https://sadanimalfacts.com/">https://sadanimalfacts.com/</a></figcaption></figure><p>You ever wake up and immediately get sad or annoyed at the day ahead. Not anything in particular that you hate about the day its just kinda like you don’t feel particularly excited to do anything. This feeling is even worse if you don’t have anything to do or have any plans for the day. The world is your oyster and you have the freedom to do anything you want. But you don’t want to do anything you just want to go back to bed and the day to be over. Maybe the first thing you’ll do is grab your phone and scroll for a bit until you get bored and want to move to the couch to sit there and scroll. Maybe binge a show that you’ve already seen 5 times anything easy to add some background noises so you don’t have to sit with your own thoughts. Your heads foggy.</p><p>Why wouldn’t you want to sit in silence? Well then you’ll start ruminating on ever possible mistake you made from now since you were born. Maybe you’ll just relive it in your head, maybe you’ll take it a step further and start coming up with all the “shoulds”, like you should have been perfect and you should’ve known what to do all the time and exactly when to do it so you wouldn’t have any mistakes or awkward moments and you’d be the model human. When written out it obviously sounds unrealistic and stupid. You’ve already made mistakes it’s over with why should it matter or be brought up now? But when you’re sitting there doing nothing just in your own head thats what you’re thinking about; never pausing to tell yourself “ thats stupid and unrealistic”. But thats what happens sometimes when we sit with our thoughts and don’t have to focus on work, friends or a task. We ruminate on things that can’t be changed cause they are in the past or we worry about things that are not in our control. We judge ourselves too much.</p><p>Ok you have these thoughts, they’re irrational and unrealistic. How do you make them go away forever so you can be less stressed out, focus on what needs to be done and not have to rely on distractions to get through the day?</p><p>Based on my experience and what I know from reading and speaking with people, The answer is <strong>never. </strong>The thoughts will always be there, you’ll always be ashamed of mistakes you made in the past, you’ll always worry about the future. Sometimes if you’re all by yourself and your friends and family aren’t around you’ll feel lonely. New things and big changes will make you anxious. If you really don’t feel this way ever, then you’re a weirdo. It’s very human to ruminate, be anxious, be lonely if no one is around, and to worry. Living in the moment all the time isn’t realistic. You need time to plan, learn from past mistakes, be cautious about new things. It’s very normal.</p><p>There is a time though when these thoughts become overwhelming and become maladaptive. Thats when it’s good to take a break and live in the moment and maybe question if those thoughts are rational. There are many ways to do this all helpful, so you can do as many as you need to</p><ol><li>Meditate — Use as app like headspace and calm or youtube videos if doing so on your own is hard at first. When trying to focus on something simple like your breathe, repeating a mantra like “om” or just mindfully doing a task like walking or painting or cooking a dish that you know how to make already. You’ll get hundreds of thoughts getting in the way of what you’re focusing on. What meditation teaches you is how to let go of these thoughts when they come up. It’s not to have zero thoughts and only think about breathing although I’m sure thats possible for everyone with a lot of practice and it must feel great.</li><li>Journal — Write down how you feel, whats troubling, whats wrong and read it back to yourself, its a great way to follow your thoughts and figure out whats irrational and not helpful. When ruminating this is particularly helpful because when thinking about past mistakes you can write down what you want to learn and take away from them. This will help you be a better person as you grow.</li><li>Exercise — Literally anything to get you moving and your blood pumping, you’re not going to have much time to think when you’re playing a basketball game, skateboarding, going for a jog, speed walking, jumping if you’ll be focused on pushing your body to do the activity. Also just in general working out and exercise is healthy for your body too</li><li>Yoga — People assume it’s just bending your body into as many weird positions as possible. Although thats a part of it thats not why people do it. Yoga roughly translates to “union”. When you do yoga and are stretching and breathing in various ways that process shows you how your body is feeling. Your neck maybe stiff at certain angles, carrying your breath in your stomach might be short and heavy at first, stretching your legs could reveal a sharp pain. You sit breathe into it and slowly you learn about yourself and where that pain exactly is. You develop a more realistic picture of your body. Yoga is about developing the connection with the part of you that observes your thoughts with your body and mind.</li></ol><p>Doing these things wont make your rumination or loneliness or pain go away completely. But it will ease those emotions more and more every time until they are manageable. Thats better than having no remedy for it and the sooner you start the sooner you’ll be able to reap the benefits of these practices.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=542d0b63b340" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kalman Filters]]></title>
            <link>https://medium.com/@mihirpatelx/kalman-filters-c7a3306babfd?source=rss-95df8b0f6b80------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7a3306babfd</guid>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[kalman-filter]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[robotics]]></category>
            <category><![CDATA[fun]]></category>
            <dc:creator><![CDATA[Mihir Patel]]></dc:creator>
            <pubDate>Tue, 24 Oct 2017 00:54:38 GMT</pubDate>
            <atom:updated>2020-05-29T13:02:14.841Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*oju-XTS_8BvM3JE6eOgKYA.png" /></figure><p>When my friend and I started to learn about Kalman filters it was a nightmare everything thing was way too complex, what the hell did all these variables mean. Long story, short every resource we tried reading from seemed to be incredibly complex and didnt just get to the point. So I’m going to attempt to simplify this stuff for the non academic types.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/1*BRL5Q7nVr3-D-Fv_lNX8Ew.gif" /></figure><p>The <strong>k</strong>’s on the subscript are states. Here we can treat it as discrete time intervals, such as k=1 means 1 second and k =2 means 2 seconds.</p><p>Our purpose is to find X(hat)_k which is denoted by the little carot <strong>aka</strong> “^” on top of the X. This is the estimate of the signal x and we want to find it for each k. So far easy right. We know what we want!</p><p>Also here is Z_k is the measurement value. This is measured by a sensor and we are never perfectly sure of these values. If the sensors were able to perfectly predict everything then we wouldn’t need Kalman filters. K_k is called the “<strong>Kalman Gain”</strong> which is the key concept here, I call it the Big K. and X(hat)_k-1 is the estimate of the signal on the previous state.</p><p>The unknown concept in the above equation is the Kalman gain. We have the measurement values, we have the previous estimated signal. You should calculate this Kalman Gain for each state. This ain’t easy but trust me its worth it.</p><p>Lets just do an experiment and assume Kalman Gain to be 0.5. What happens now? The complicated equation above becomes a simple averaging problem. The whole idea of a Kalman filter is to find a the optimal averaging factor at each state while remembering somehting about the past state.</p><h3>Lets build a model,</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/215/1*sqD5hCrmVlKzcOQTAj2tCg.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/115/1*9iEbvOo_yqDtYBT7-cQGtg.gif" /></figure><p>The first equation tells us that x_k can be evaluated using the stochastic equation. Any x_k is a linear combination of its previous value plus a control signal u_k and a process noise w_k-1.</p><p>The second equation tells us that any measurement value is linear combination of the signal value and measurement noise v_k both are considered to be Gaussian.</p><p>When something is considered to be Gaussian its a fancy name for a bell curve probablity distributiuon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kMdeG3SbaENDxzaQdWTN0w.png" /><figcaption>Gaussian Probabiltiy Distribution</figcaption></figure><p>The process noise and measurement noise do not affect each other in fancy terms theyre considered to be statistically independent.</p><p><strong>A, B and H </strong>are matrices. But in most problems we use models so that these entities are just numeric values. In physics most of the time these values will change in between states but not by much so the purpose of our model we can assume that these values will be constant.</p><p>Now we check if our system fits into this model. To do so we check if the system we are trying to apply this to has the necessary known and unknowns. The only thing left is to estimate the mean and standard deviation of the noise functions W_k-1 and V_k. In reality no signal is purely Gaussian but its an abstraction assumed to make our model.</p><p>The better you can estimate the noise parameters the better estimates that you can get.</p><p>The process,</p><p>Now we have to determine the necessary parameters and initial values. The prediction equations and measurement equations are applied at the Kth state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wTa8I39bX7NgHY906LFmcw.png" /></figure><p>We made our model earlier, so we’ll assume the matrixes A, B, H most likely they’ll be numerical constants and most proably theyll be equal to 1.</p><p>The last thing to do is determine R and Q. R is easy to figuire out because its easy to know the noise in the environoment. But finding out Q is the process noise or the noise created by the object moving, speaking just doing its thing.</p><p>To begin our process we need to estimate x_0 and P_0</p><h3>Iterate,</h3><p>The x(hat)_k with the little minus at the top is something called a priori estimate. Its a rough estimate before the measurement update. P_k with the minus on top is the priori error coverariance. These estimates are then used in the Measurement update equations after being obtained from the time update equations.</p><p>In the measurement update equations we find x(hat)_k which is the esimate of x at time k ( the very thing we wish to find). Also we find P_k which is necessary for the future k+1 estimate.</p><p>The Kalman gain we found is not needed for the next K+1 iteration it is specific to the present value and changes for the next K+1 step.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7a3306babfd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>