<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="http://blog.qiras-lab.net/feed.xml" rel="self" type="application/atom+xml" /><link href="http://blog.qiras-lab.net/" rel="alternate" type="text/html" hreflang="en" /><updated>2025-12-08T10:39:42+00:00</updated><id>http://blog.qiras-lab.net/feed.xml</id><title type="html">Ariq’s Personal Blog</title><subtitle>Just a research blog</subtitle><author><name>Ariq Ahmer</name></author><entry><title type="html">The Hope That was Forgotten - The Light Shines in its Magnificence</title><link href="http://blog.qiras-lab.net/the-light-shines-in-its-magnificence/" rel="alternate" type="text/html" title="The Hope That was Forgotten - The Light Shines in its Magnificence" /><published>2025-12-08T00:00:00+00:00</published><updated>2025-12-08T00:00:00+00:00</updated><id>http://blog.qiras-lab.net/the-light-shines-in-its-magnificence</id><content type="html" xml:base="http://blog.qiras-lab.net/the-light-shines-in-its-magnificence/"><![CDATA[<h2 id="the-light-and-calm-in-my-eyes">The Light and Calm in My Eyes</h2>
<p>I am gonna save you the trouble of reading all of it and give it to you now. I am getting married 😁 In’sha’Allah (God Willing) in the next few days. You have to wonder how all of this might have happened in such a short time. The honest truth? I still can’t understand how. All I can say is, Alhamdulillah (All praise and thanks be to Allah). But the fact that it did, I am happy. It’s like a switch wen-…. No. At this point I don’t wanna talk about me. In fact, let’s talk about my love who struck me with awe. I owe it to Allah for eternity for rescuing me through her. She came to my life exactly when I had almost lost all hope.</p>

<p>When I tell you she is the best thing to happen to me, it would be an understatement. Her character caught me like the sweet, warm aroma from a nearby bakery when it’s raining outside on a Thursday evening. The fragrant smell of vanilla, butter and caramel, all coming through the misty air from the rain. I could describe our encounter like so:</p>

<p>As I was walking down the road under an umbrella in the rain, I didn’t know where I was going and almost walked into a ditch. But when she opened the doors of her bakery, all those sweet aroma from the pastries and confectionaries took my attention away. So much so, that I had to stop, appreciate her art and passion, and had to turn back to go in her bakery, just to see who could create such a masterpiece. That’s when I had to walk into her shop, and take a seat. As I sat on the chair, next to the glass wall and seeing the rain pour down, she came to me and asked what I would like. When I turned my head to see who’d speak with such a soft and precious voice, I was struck with awe. And behold, the artist of the masterpiece was right in front of me. I couldn’t fathom her beauty, and truly she was the best creation of Allah that I had seen to date. And all praise be to Allah for creating such a human being. As she waited for my order with a smile and blush, I knew I wouldn’t know what to choose. So, I asked her to surprise me. She gave a faint smile, perhaps a smirk, and noted what I had ordered.</p>

<p>As I waited and waited, I couldn’t help but be more curious. Her charm, her beauty, her care, her subtleties, all that I had seen just made me that impatient. Every second that passed felt like a full minute, as I couldn’t wait for her to bring my order. A few minutes pass, and there she appears. Holding a mug full of a hot beverage. The steam was just the right amount, but the fragrance it gave? Let me tell you… I could smell the love and care she put into making that one cup of hot chocolate. She asked if she could place it on my table, and I asked her if she could stay. She smiled and stayed with me and she asked “Would you like to share this with someone?”. And I couldn’t help but say “Yes, with you”. She blushed and put the warm mug between us. As I reached for the mug, wrapping it with my cold hands from the rain, the warmth just filled me up with joy. But my hands were trembling. And as observant as she was, she brought her hands out from the pockets in her apron, and wrapped them over mine. Her warmth exceeded that of the mug, but was more satisfying and relieving. As she struck a conversation, I wanted her to keep her warm, soft hands wrapped over mine.</p>

<p>We talked from here to there. About anything and everything. Her smile and joy was something to behold. I could feel that she felt the scars on my face, but I couldn’t help but feel the scars on her arms. There was a brief silence, a brief pause. But, all that we could express was our gratitude to Allah, for bringing us this close and planning it this far. At the end, we still laughed and chuckled, only to realize the hot chocolate had gone cold. We broke out laughing and smiling. But we knew, at the end of that evening, we would be there for each other. The visit was worth it, every second of it. As the rain stopped pouring and the city was calm, she prepared the shop – ready for the next day. I had stayed behind to help her out, because what sane man would let her do all this by herself. She flipped the sign to “Closed” and switched off the lights. We both walked out and closed the door. The next evening came, and one right after. I made sure that I would visit her bakery, all the evening that come after.</p>

<p>– The End</p>]]></content><author><name>Ariq Ahmer</name></author><summary type="html"><![CDATA[The exponential development within the period of 30 days. And that made me get my smile back. It's another life update. A huge one in the making. For the previous readers, you can actually anticipate what.]]></summary></entry><entry><title type="html">The Imbalance of Work + MSc + Personal Life</title><link href="http://blog.qiras-lab.net/the-imbalance-of-work-msc-personal-life/" rel="alternate" type="text/html" title="The Imbalance of Work + MSc + Personal Life" /><published>2025-10-27T00:00:00+00:00</published><updated>2025-10-27T00:00:00+00:00</updated><id>http://blog.qiras-lab.net/the-imbalance-of-work-msc-personal-life</id><content type="html" xml:base="http://blog.qiras-lab.net/the-imbalance-of-work-msc-personal-life/"><![CDATA[<h2 id="msc">MSc…</h2>
<p>Firstly, <strong>I thank Allah</strong> for making me pass my coursework and proceed to the dissertation stage. Since this semester started, I haven’t been putting nearly the amount of effort that I would like to put into my thesis. My friends and colleagues keep on telling me that whatever effort I put in is enough, but I know that it really isn’t. Maybe it’s just imposter syndrome but oh-well… if someone has the solution to imposter syndrome then let me know. Because one thing for sure, just telling yourself that “you have done enough” is <strong>not</strong> the solution. In any case, I am still working on the <strong>draft of the proposal</strong> (lol, not even the actual proposal XD). The most painful part is looking for literature around an area that hasn’t been researched no matter how much you convince yourself that it has been researched, even though you know it hasn’t been researched. And besides all of that, I have constantly gotten the comment (from my supervisor, sister, cousins, very close-bros, indirect-bros and close friend-bros) that the topic I am pursuing is apparently very “over the top”
and I should make it into something that’s actually doable. <strong>Keep in mind</strong>, this was before my supervisor finally agreed for me to do this. How can I explain to all of them that I don’t know what a topic feels like for Masters, PhD, Undergrad, or just regular research grade? I have come across papers that are PhD worthy yet are published as part of a journal. In any case, let bygones be bygones. The topic has been chosen and I have been working on it.</p>

<p>Now coming to actually write up the drafts and submit them to my supervisor. By the way, <strong>I cannot express enough how SUPPORTIVE he has been this entire time</strong>. I guess I was right in asking him to be my supervisor. Whatever emotions he shows are just enough (and just the way it should be). I like the way he can give actual constructive criticism and can give you a reality check when you actually need it. He is uncompromising yet kind. He knows what’s feasible and what’s not. Yet he doesn’t hinder or stop research from actually happening. A true academic in my opinion. My only regret is that I wish I could give him the feedback he wants in time. This brings me to why I haven’t been able to give timely feedback or give the effort I wanted to.</p>

<h2 id="work">Work…</h2>
<p>Work is fun when people know what they are doing. If the people implementing solutions don’t know what they are doing then the clients will be facing stresses that they shouldn’t be facing to begin with. In any case, right after the semester started, work got hectic to a point where we were knocking off (on avg.) 3+ hours after work hours almost 4/5 days in the week. This took a toll on all of us here, and it wouldn’t be just to call only myself a victim in this. I even stopped claiming overtime because I didn’t even have the energy to in the forms, and didn’t think it was worth getting those. In any case, this took a significant amount of energy out of me and gave me fatigue that I never faced before. Truth be told I don’t think anyone expected that amount of work, I surely didn’t. This lead me to the point where I couldn’t even work on the thesis draft. All I could think about over the weekend is how to get some rest and sleep. If anything, there were <strong>weeks</strong> (including weekends) where I didn’t even turn on my laptop. Simply because I wanted to get some rest (though I didn’t because of the guilt of not working on the thesis). During this time and even quite recently, I fell ill several times. Food poisoning being the recurrent one. Though, can I really blame the food at this point if I neglect eating proper food? And I call it neglect because I knew that eating <strong>this much</strong> outside food is gonna do more harm than good, yet I still ate outside food because I didn’t have the strength to cook meals at home. This is also overlooking the fact that a <strong>person would be lucky if they didn’t manage to trip</strong> when walking across the living room. Yeah, it’s that bad. Was, then cleaned, now became still is.</p>

<p><strong>DISCLAIMER: this regularly happened a while back–&gt;.</strong> Regardless, I think another aspect that isn’t exactly related but we can consider it is that, at work I am facing issues where I cannot innovate or experiment. Yes, granted the place has strict security policies. But they really should work on improving policies around R&amp;D. It’s just way too restrictive to implement any improvements. And on top of that, a person (or two, or three) at the work place is very reluctant to investigating (or maybe just shuts down) any form of new ideas I might have. Like, can you at least hear me out before you shut me down? Can we at least look into it before saying “No”? This, not only pisses me off but also prevents my career from growing. How am I supposed to improve my role as a Systems Analyst if I cannot improve my analytical skills? If there is something I can  improve by bringing in something new, why not see its theoretical effect before disposing it completely? If I were to play the devil’s advocate against myself then yes, there is an actual problem in the organization itself. And whatever the person (or people) was (were) doing is per the protocol. But I’ll tell you this now… You cannot expect the place to change if you don’t welcome any change but portray that you actually are progressing towards change. It’s a false facade that (may Allah forbid) could potentially negatively affect all the “users” of the organization. <strong>I stopped trying to bring up any new ideas <em>nowadays</em></strong> because I know I can’t budge them to accepting it because they’re just gonna put it down. <strong>So much for being an academic/scientist in a place that literally pretends they are researching but really aren’t even trying to and have policies that restrict what they are trying to (a little bit hypocritical if you ask me).</strong></p>

<p>But I do have to emphasize that if you ignore this the place is very, very good. If anything I am here for the people and the type of work. A work place will always be really good if the people around you are really good. And I like the people I am around (minus what I said, albeit it’s only for 1,2 or 3 person/people). It doesn’t mean they are bad people or that I don’t like them. If anything, I like them but it’s just that aspect of them that I don’t like.</p>

<h2 id="personal-life">Personal Life…</h2>
<p>So yeah, the people kept their words… Marriage still looks like a fantasy at this point in time. There’s no point in ranting about something for which you should have majority of the control but don’t because of problems from the past that incurred which you were not part of, yet the aftermath of that is what get’s you to be at the position you are in right now. (Deep breath). What I realized, and this is in general, is that if people fail to defend reasonably and justifiably their points to me, and expect no follow up questions if they didn’t justify enough, I get really frustrated. Angry? Maybe… I’d say around 2%. Disappointed? Absolutely! I guess this is just a heads up to the reader: If you know we aren’t that close or don’t know me at a very personal level, then next time we talk and some discussion comes up, please please please oh please I ask of you to <strong>NOT get offended if I ask you follow up questions</strong> about your statement. Because as bad as it sounds reading whatever you read right now, I for one welcome various opinions and views from others. And I am gladly willing to accept if you can justify just enough. <strong>BUT</strong>, if I have some questions and concerns about your opinion or view, it’s not because I don’t trust you or that I think my way is the only right way (eww for even writing this coz that’s very egotistical). It’s because I genuinely want to understand your perspective.</p>

<p>And that’s another thing. I will ask a question when I don’t understand something. If I understand it, then I wouldn’t be asking follow up questions. By the way, this does not mean that you have to justify every single thing. You’ll know when we are going into that discussion phase just from the conversation alone. So while this is kind of a big deal for me, rest assured it happens very rarely. So yeah, we can actually have casual conversations but just be a bit mindful of this.</p>

<h2 id="textvarwmp-ne-0">$\text{Var}(W+M+P) \ne 0$…</h2>
<p>So, if we take all of this turmoil in my life at the moment, it’s very imbalanced and bad. At this point I wouldn’t be surprised if I died before my parents and sister. The life I am living right now is both the best and the hardest (to date at least). My health is going downhill, I am not able to put in the effort that I want to in my masters, I have become very lazy in the things that matter the most, and I am getting used to living alone. Yeah… I think that’s what scares me a lot right now that I am getting used to living alone. While it’s good in some ways, at least for me, it is terrible. I don’t want anyone to spend the rest of their lives alone. Sometimes I wonder if it’s just the hormone talking or if it’s actually realistic for me to worry about what I am worrying. But I know one thing for sure, there is a void in me that I am trying to fill but can’t. No matter how much I chase after the answers, I can never seem to reach it. No matter how I try to fill in that void, the void just sucks it in. It’s like a black-hole that’s never growing but is ever present. You know that the void will go away eventually if it meets something with enough mass to saturate it. For now, I am terrified and not well. But I am grateful for everyone and everything around me.</p>

<p>And most importantly, I express my gratitude, praise and thanks to Allah for still making me see His beautiful creations. I am eternally indebted to Him for making me experience the good that only a few can ever dream of experiencing. And I eternally seek refuge and forgiveness in Him for all the tough and bad times I am in.</p>

<p>Thank you Allah… for everything….</p>

<p>– A A</p>]]></content><author><name>Ariq Ahmer</name></author><summary type="html"><![CDATA[Things that have happened and have been happening is affecting me in ways I never imagined. Just read it if interested. Don't force yourself if you don't want to.]]></summary></entry><entry><title type="html">Not in the right state of mind…</title><link href="http://blog.qiras-lab.net/not-in-the-right-state-of-mind/" rel="alternate" type="text/html" title="Not in the right state of mind…" /><published>2025-03-28T00:00:00+00:00</published><updated>2025-03-28T00:00:00+00:00</updated><id>http://blog.qiras-lab.net/not-in-the-right-state-of-mind</id><content type="html" xml:base="http://blog.qiras-lab.net/not-in-the-right-state-of-mind/"><![CDATA[<p>The past month has been hectic. Like a lot hectic. Not only the work stress but also the university stress for my MSc. Although, the workload is manageable, it gets to me all the time. Just today I got some time to breathe. There were assignments to complete and submit. I’ll be real, the assignments weren’t even complicated. Just simple implementation, running, collecting data and writing the report. All of which could’ve been done within 3-4 days. The assignments were given $1\frac{1}{2}$ months in advance, but I couldn’t even begin due to the on going workload. It became so busy at the office, but it’s something I expected.</p>

<p>Although the workload got a lot, it’s still manageable. Like I said, it’s something that’s genuinely manageable. Even when I have to start some assignments after lectures in the evening, I can still manage. But the problem comes when I want to take a break in-between my assignments. When I want to take a break from constantly looking at the screen. I can’t even do that coz the next available recreational “thing” I can do is watch TV or be on the phone… Which is utterly horrendous! I don’t want my attention to switch from screen to screen. I need it to change from intangible to something tangible. It’s suffocating to not be able to interact with something tangible. Now you might wonder “why not call your family? or call a friend?” (keep in mind I am living alone). Well, to that I would say… read the previous sentences again. Talking over the phone is as good as talking to a robot or AI generated voice. Long story short, the conversation ends when the phone dies, electricity goes, or network is down. It’s still intangible.</p>

<p>Having a roommate is not feasible right now. Marriage is a really viable option, and feasible, but (I’m gonna quote Howard Stark on this one) “I am limited by the technology of my time”. In a metaphoric sense of course. I don’t wanna make this blog more personal than it needs to be. If you know me in real life and I have told you why, then you know why, otherwise, don’t bother asking. It’s better to keep somethings to one’s self than to expose it and bring ruins to someone else. So yeah… roommate and marriage is out of the question, although the latter is a perfectly reasonable solution. Then again, I’m willing to be patient on this… let’s see if people stick true to their words and keep their promises…</p>

<p>In any case, switching topics for a bit, I haven’t been getting proper rest. I have been losing a lot of sleep from time to time, waking up at odd hours and haven’t even been able to stick to my proper bathing schedule! Which is crazy!!!!!! Like, at least I gotta keep myself clean! I don’t know how to get back that energy. Sometimes I wish to remain asleep and not wake up. Sometimes I am not able to recall a lot of recent memories. I am forgetting a lot of things. Speech impairment is subtle but there. I have been monitoring my tremors on the left hand, and so far it’s on and off. But there and not completely gone. I was awake for 27 hours straight. I had to be in the office though. I kept dozing during the work. My supervisor was kind enough to notice and told me to get some rest. I went to the car and slept for 50 minutes. Which helped a LOT! During this time, the amount of discombobulation was too much! I couldn’t tell if I was dreaming or physically present. It also felt like my body is responding and talking out of reflex. No thoughts behind what I was doing because my mind was like I have to sleep, but my body was just trying to keep a conversation.</p>

<p>Which brings me to say something important. For the past however many years of my life, I always used to have thoughts running through my head. I mean, a large portion of those thoughts were induced due to my psychosis. But, two years back I stopped my medication for psychosis because my mind became stable at that point. I still don’t hear voices like I used to. Now it’s just the regular inner monologues and chain of thoughts. Which I would say is normal. But recently, for two separate occasions (from at least what I can recall), my mind went completely quiet. Like no thoughts, no voices, no processing inputs from my ear, just completely blank and quiet. I only realized that once I “snapped back to reality”. It’s the first time I am experiencing something like this. I don’t know if that’s normal, because for a moment I felt bliss but at the same time it was so disorienting. I don’t know how someone can survive without having a single thought behind their brain.</p>

<p>I am not saying that I want my psychosis back. In fact I <strong>don’t</strong> want it ever! And I am not saying that I want a “stressful” life because that’s just insanity. But what I am saying is that the physical voices around is good to have in moderation. Well, everything is good in moderation. But being in that state of mind where I was unable to think, unable to process anything, was truly terrifying. I guess I will have to monitor it as time goes on. I just pray that it’s not anything serious. Speaking of tremors, my left hand’s twitching has become less frequent. Which is a good thing. But it looks like the times my hand twitches, it sticks around for longer and is more intense. I don’t know how this even started, but it’s something I noticed. And speaking of health issues, I am facing general diffused pain on my left side of the chest. Though it’s more towards the upper-left peck, towards the spleen area than towards the center. I have strong reasons to believe that it’s due to gas build up in the stomach and maybe general, improper sleeping postures. However, I am cautiously monitoring this relative to my diet.</p>

<p>Overall, when a new day begins, I wake up not because I want to, but because Allah has deemed it that I wake up and returns my soul to the body. That’s why I wake up. And I trust Allah above all. So if He deems it worthy to return my soul back, that means He has a reason for it. And He knows everything and Has knowledge of all. He is The Creator and The Sustainer after all… So when I wake up, I need to make my time worth it. Every time I sin, I make sure that I repent for it. Because if a day comes when I am unable to repent or be remorseful, that’s the day I know that I have lost everything. If my Creator leaves me, then I will be in utter loss and will have no way back. So, until my last breath, I will try my best to continue repenting, to try an behave well with others, to treat others with kindness, to give a helping hand to who ask for it (if I am able).</p>

<p>If you have met me in real life and have seen my bad side or have treated you badly, then I sincerely apologize as it was never my intention to behave like such. And I ask you not to associate my bad behaviour with those of a Muslim. Because, Muslims are perfect, but I am not. So if you need to blame someone then blame me for my mistake and not the entire Muslim nation. And this would go for anyone trying to insult someone. Don’t insult them because you may be indirectly (or even directly) insulting someone who is completely innocent.</p>

<p>If you have seen a good side of me, then that’s the version of myself I want to be. I want to be good. I want to be better. I want be a calm in people’s eyes without losing my integrity. But above all, I want to be a good person (the best I can be) in front of Allah. I need only His approval and His satisfaction for my life to move on.</p>

<p>I owe everything to Him. We all are in infinite debt to Him. And I am ever thankful to Him for what He has given me…. It’s more than what I could’ve ever dreamed of. Deep down, I am truly satisfied. Any <strong>complaints</strong> are more towards the people who have affected me and <strong>not to Allah!</strong> I don’t know what the future holds and I don’t know if I will be alive to experience it. But whatever it is I am, and will be thankful to Allah for giving me that experience. It could be a punishment or it could be a test. But whatever it is, I pray to You (Allah) that You grant me the strength and courage to pass it.</p>

<p>Take care of yourself and remember to treat others with kindness. Be humble and practice patience. Get rid of your ego and don’t be selfish. But remember, whatever you do, <strong>do it in moderation</strong>. For now… I am signing off….</p>

<p>– A A</p>]]></content><author><name>Ariq Ahmer</name></author><summary type="html"><![CDATA[Just read the blog... not enough to summarize]]></summary></entry><entry><title type="html">Back Propagation Using New Definition</title><link href="http://blog.qiras-lab.net/backpropagation-using-new-definition/" rel="alternate" type="text/html" title="Back Propagation Using New Definition" /><published>2024-10-20T00:00:00+00:00</published><updated>2024-10-20T00:00:00+00:00</updated><id>http://blog.qiras-lab.net/backpropagation-using-new-definition</id><content type="html" xml:base="http://blog.qiras-lab.net/backpropagation-using-new-definition/"><![CDATA[<p>In this article I will use the notations used from the previous blog <a href="https://ariqahmer.github.io/new-definitions-for-neural-network-operations/">New Definitions for Neural Network Operations</a> and discuss how the notations may change for the backpropagation process.</p>

<h2 id="1-definitions">1. Definitions</h2>
<p>Let us first familiarize ourselves with the standard backpropagation strategy. Our main objective is to find the <strong>optimal</strong> weights connecting to each neuron in each layer. We also note that our <strong>inputs and bias</strong> terms remain constant in each layer. Hence, if we assume the following:</p>

<p>Our inputs consist of ${h_0, h_1, h_2, …, h_{n-1}, 1}$ which have $n-1$ features with a bias value of $1$ in a layer $h$. The bias value of $1$ prevents a case where all input values from $h_0$ to $h_{n-1}$ are all $0$. Hence, if the sum of the products are calculated, the value of the node in the next layer will also be $0$.</p>

<p>${w_0, w_1, w_2, …, w_n}$ are our weights for all $n$ inputs from layer $h$.</p>

<h3 id="11-sum-of-weights-and-bias">1.1. Sum of weights and bias</h3>
<p>Then we can obtain our prediction $y$, using the following expression:</p>

\[y = \sum^{n}_{i=0} h_{i}w_{i}\]

<p>If we use vectors/matrix notations, we can obtain the following expressions instead. However we will be using the “sum of products” notation:</p>

\[y = \vec{w} \cdot \vec{h} \quad \text{or} \quad y = \textbf{w}^\text{T}\textbf{h}\]

<h3 id="12-mapping-to-probability-space-using-a-non-linear-activation-function">1.2. Mapping to probability space using a non-linear Activation Function</h3>
<p>One we obtain $y$, it’s easy to note that $y \in (-\infty, \infty)$. Therefore  we need a way to normalize the values between $0$ and $1$, such that, $y \in [0, 1]$. This helps us to convert our output into values of probabilities. Functions that do such are called <strong>activation</strong> functions in the context of neural networks. These activation functions are usually <strong>non-linear</strong>. For our example, I am going to use the <strong>logistic</strong> function, also known as sigmoid function, denoted as $\sigma(x)$. Our activation function (in this case the logistic function) will take the output of the sum of our products $y$, and normalize its values in the range $[0, 1]$. This operation is as follows:</p>

<h4 id="definition-of-sigmax">Definition of $\sigma(x)$</h4>

\[\sigma(x) = \frac{1}{1 + e^{-x}} \quad \text{ where $e$ is Euler's constant}\]

<h4 id="normalizing-the-value-of-y">Normalizing the value of $y$</h4>
<p>If we let $s$ be the normalized output of $y$, then:</p>

\[s = \sigma(y)\]

<h3 id="13-calculating-error">1.3. Calculating error</h3>
<p>To calculate the error between our predicted value $y$ and the ground truth $t$, we have to define an error function. In our case, we use the <strong>Mean Squared Error</strong>, defined by the function $E$, as defined below:</p>

\[E(t, s) = \frac{1}{2} (t - s)^2\]

<p>Note that the $\frac{1}{2}$ is <strong>not part of the mean</strong>. It is used as a constant that will be useful during the backpropagation process. <strong>Note:</strong> that this <strong>works because</strong> our ground truth $t$ is <strong>also normalized</strong> in the range $[0, 1]$.</p>

<h2 id="2-backpropagation">2. Backpropagation</h2>
<p><strong>Backpropagation just finds the gradients of the <em>errors of NODES with respect to weights</em> $-$ PROPAGATING BACKWARDS to each layer</strong> . That’s it! But from our definitions above, it is clear that our weights $w$, aren’t variables in the error function $E$. Well at least, <strong>not directly</strong>. But it <strong>is</strong> there! Let’s see the breakdown.</p>

<h3 id="21-the-gradient">2.1. The Gradient</h3>
<p>We know that $s$ is just the output for the function $\sigma$. So we can, in essence, just note the implications:</p>

\[s \Rightarrow s(y) \Rightarrow \sigma(y)\]

<p>Ahh! But there’s more! We can also note that the variable $y$ itself is also a function. How so? Well, from our previous implications, we can also imply that:</p>

\[y \Rightarrow y(\vec{w},\vec{h}) = \sum^{n}_{i=0} w_{i} \cdot h_{i}\]

<p>Meaning, in essence, we can breakdown as follows:</p>

\[E(t, s(y(w,h))) = \frac{1}{2} (t - s(y(w,h)))^2\]

<p>Note that the above (and below) expression is just for <strong>one</strong> weight. Since we established that $h$ is constant, and we need to optimize the weight variable $w$, the following <strong>chain rule</strong> can be used to find the derivative of the error function $E$ with respect to (wrt) $w$ as follows:</p>

\[\frac{dE}{dw} = \frac{dE}{ds} \times \frac{ds}{dy} \times \frac{dy}{dw}\]

<h3 id="22-the-update-learning-step---stochastic-gradient-descent">2.2. The Update (Learning step) - Stochastic Gradient Descent</h3>
<p>Gradient descent is an iterative formula that finds the optimal value for a function. The gradient descent algorithm is given below, where the value of $x$ that yields the optimum value for a function $f(x)$:</p>

\[x_{i+1} = x_{i} - \eta \cdot x_{i} \cdot f'(x_i)\]

<p>where:</p>
<ul>
  <li>$f’(x_i)$ is the derivative of the function $f(x)$ evaluated at point $x_i$</li>
  <li>$\eta$ is the learning rate. It determines how “quickly” it should try and learn (you can think of it as the confidence).</li>
  <li>$x_i$ is the current “optimum” value of $x$, which is used to calculate the next (hopefully better) optimum value $x_{i+1}$.</li>
</ul>

<p>From the expression above, we can note that we are trying to <strong>optimize an arbitrary function $f(x)$ with respect to the variable $x$</strong>.
Similarly, during the <strong>backpropagation</strong> process, we are trying to <strong>optimize the <em>error</em> function $E$, with respect to the weight $w$</strong>.</p>

<p><strong>Note</strong> that <em>optimizing a function</em> means <strong>either</strong> find a value that, when input in my function, gives the <em>minimum</em> value the function can produce <strong><em>(minimizing)</em></strong>, <strong>or</strong>, find a value that, when input in my function, gives the <em>maximum</em> value the function can produce <strong><em>(maximizing)</em></strong>. In our problem’s context, we are dealing with an <em>error function</em>. So naturally, we want our error to be as low as possible i.e. <strong><em>minimize our error function $E$</em></strong>.</p>

<p>Therefore, putting it all together, “The Update” happens i.e. our weight <em>learns</em>, when the gradient descent algorithm is applied. Therefore, to update our weight, we use the following expression:</p>

\[w_{i+1} = w_{i} - \eta \cdot w_i \cdot \frac{dE}{dw_i}\]

<h2 id="3-using-the-new-notation">3. Using the New Notation</h2>
<p>Using the new notations from <a href="https://ariqahmer.github.io/new-definitions-for-neural-network-operations/">my previous article linked here</a>, we can define the following variables (with very loose notations):</p>
<ol>
  <li>$w(p_n, q_m)$ is the single weight that associates the value of the $n^{\text{th}}$ node in the current layer $p$, with the $m^\text{th}$ node in the next layer $q$.</li>
  <li>The output value of $\Gamma(P, W_{q_m})$, where \(P = \{p_0, p_1, p_2, ..., p_{n-1}, 1\}\) is the value of node $q_m$.</li>
  <li>The set function $\Gamma^* (P, W_{Q_{h-1}})$ produces all the <strong>normalized values for the nodes</strong> $A(q) \in Q_h$ for a given layer $h$.</li>
  <li>The arbitrary error function $E(R, Q_h)$ is used to calculate the error between the ground truth $R$ and the output $Q_h$. Note that $R, Q_h \in \mathbb{R}^{a \times b}$ for $a,b \in \mathbb{N}$.</li>
</ol>

<h3 id="31-backpropagation">3.1. Backpropagation</h3>
<p>Therefore, using the above definitions, we can now write the following:</p>

\[\frac{d E(R, Q_h)}{d w(p_n, q_m)} = \frac{dE(R, Q_h)}{dA(q_m)} \times \frac{dA(q_m)}{dq_m} \times \frac{dq_m}{dw(p_n, q_m)}\]

<p>where $q_m \in Q_h$</p>

<p>This above notation captures the detailed calculation to update a simple weight $w(p_n, q_m)$ from node $p_n$ to $q_m$. But if we introduce our set-function notation, then we can calculate the gradients for <strong>all</strong> the weights $W_Q$ for a given layer $Q$ as follows:</p>

\[\frac{dE}{dW_Q} = \frac{dE}{d \Gamma^*_Q} \times \frac{d \Gamma^*_Q}{d \Gamma_Q} \times \frac{d \Gamma_Q}{dW_Q}\]

<p>Here:</p>

\[\frac{d \Gamma^*_Q}{d \Gamma_Q} = \{A'(q) \quad | \quad q = \Gamma(P, W_q)\}\]

<p>But since we know that $q \in Q$, and $W_Q$ contains all weights needed for the <strong>layer</strong> $Q$, then we can further simplify it (loosely) to:</p>

\[\frac{d \Gamma^*_Q}{d \Gamma_Q} = \Gamma^{*'}_{Q}(P, W_Q) = A'(Q)\]

<p>Which means the derivative of the activation function $A'$ is applied to all nodes $q \in Q$. We can also note a similar simplification for the last term as:</p>

\[\frac{d \Gamma_Q}{d W_Q} = \Gamma'(P, W_Q)\]

<h3 id="32-gradient-descent">3.2. Gradient Descent</h3>
<p>Now that we have the notations clearly defined, we now have the following iterative function using the gradient descent algorithm:</p>

\[W_Q := W_Q - \eta \cdot W_Q \cdot \frac{dE}{dW_Q}\]

<h2 id="4-conclusion">4. Conclusion</h2>
<p>The iterative expression in section 3.2 encapsulates the updating/learning of all the weights $W_Q$ in layer $Q$. It should be <strong>strongly noted that</strong> I deliberately chose to represent the function, responsible for <em>summing</em> the products of weights and inputs, in an arbitrary manner, in this case with the function $\Gamma$. This is because, as I have stated in my previous blog, I intend to investigate the effects of <strong>non-linear combinations</strong> of the weights and inputs.</p>

<p>Until next time, I am signing off…</p>

<p>– A A</p>]]></content><author><name>Ariq Ahmer</name></author><summary type="html"><![CDATA[This article will use the notations used from the previous blog: "New Definitions for Neural Network Operations" and discuss how the notations may change for the backpropagation process]]></summary></entry><entry><title type="html">New Definitions for Neural Network Operations</title><link href="http://blog.qiras-lab.net/new-definitions-for-neural-network-operations/" rel="alternate" type="text/html" title="New Definitions for Neural Network Operations" /><published>2024-10-11T00:00:00+00:00</published><updated>2024-10-11T00:00:00+00:00</updated><id>http://blog.qiras-lab.net/new-definitions-for-neural-network-operations</id><content type="html" xml:base="http://blog.qiras-lab.net/new-definitions-for-neural-network-operations/"><![CDATA[<p>I am currently investigating the possibility of having non-linear combinations in neural networks, how it may be computed (if at all), and its performance impact compared to the current linear combination in neural network.</p>

<h2 id="new-notation">New Notation</h2>
<p>There is the pseudo-standard notation for denoting which weight belongs to which hidden node using a similar form of $w^{(0)}_{h_0}$  which represents the $0^{\text{th}}$ weight connecting to hidden node $h_0$ . This notation works (to an extent) since the operations are mostly linear and don’t need to deal with exponents as often. I have skipped over notations used for other terms deliberately as I am assuming the person who is reading this should already be familiar with them.</p>

<p>Since I am investigating non-linear combinations, I am going to use the following notations for the rest of my investigations. Keep in mind this isn’t anything final and the notations are expected to change. If you are unfamiliar with the current notations, then do not worry. As long as you understand the concept of Machine Learning using Multilayer Perceptron model, you should be able to follow. Again, the CONCEPT and NOT the EXACT NOTATIONS USED!!!</p>

<h2 id="re-writing-current-notation">Re-Writing Current Notation</h2>
<p>In this section, I go over how the current notation can be re-written to capture the same concepts of MLPs/NNs/DNNs. I intend to use variations of these notations for my investigations.</p>

<h3 id="variables">Variables</h3>
<p>Below are the variables I tend to use for my investigations:</p>

<p>$p$ is the previous node.</p>

<p>$q$ is the next node.</p>

<p>$w(p, q) \in \mathbb{R}$ is the weight going from node $p$ to node $q$.</p>

<p>$P = {p_0, p_1, p_2, …, p_{n-1}, 1}$ and $p_n \in \mathbb{R}, \forall n \in \mathbb{N}$.</p>

<p>$Q = {q_0, q_1, q_2, …, q_{m-1}, 1}$ and $q_m \in \mathbb{R}, \forall m \in \mathbb{N}$.</p>

<p>$ |Q| $ is the cardinality of set $Q$ meaning, the number of elements in $Q$.</p>

<p>$E(\cdot, \cdot)$ is an error function.</p>

<p>$A(\cdot)$ is an activation function.</p>

<h3 id="functions">Functions</h3>
<h4 id="neuron-function">Neuron Function</h4>
<p>The neuron function $\Gamma$ takes the sum of the product of input value (node) $p \in P$ and its associated weight value (edge) $w(p,q) \in W_q$. The output of $\Gamma$ is the value for node $q \in Q$.</p>

\[\Gamma (P, W_q) = \sum_{p \in P, w \in W_q} p \cdot w(p, q)\]

<h4 id="layer-function">Layer Function</h4>
<p>The layer function $\Gamma^{*}$ outputs $m$ nodes that describe a layer $Q$ in a Multilayer Perceptron (Deep Neural Network) model. It takes all the points in $P$ and the weights $W_Q$ which is the set of all weights (edges) between all nodes in $P$ and $Q$. It can be observed that if all the nodes in $P$ are connected to all the nodes in $Q$, then the total number of edges is $n \times m$. This is obtained as follows:</p>

<p>$ |P| = n \quad \Rightarrow \quad |W_q| = n \quad \because \quad p \in P \Leftrightarrow w(p, q) \in W_q $</p>

<p>$ |Q| = m \quad \Rightarrow \quad |W_Q| = n \times m \quad \because \quad q \in Q \Leftrightarrow W_q \in W_Q $ since $q$ connects to all $n$ edges in $W_q$</p>

<p>Hence, the layer function is given as follows:</p>

\[\Gamma^{*} (P, W_Q) = \{A(q_m)\quad |\quad q_m = \Gamma_{m}(P, W_q), 0 \le m \le |Q|\}\]

<h4 id="model-set">Model Set</h4>
<p>A model $Q^* $ is an <strong>ordered</strong> set where each element is a layer object i.e. the output of the layer function $\Gamma^* $.</p>

\[Q^* = \{Q_{n} \quad | \quad Q_{n} = \Gamma^*(Q_{n-1}, W_{Q_n}), \quad n,m \in \mathbb{N} \text{ and } 0 \le n \le m\}\]

\[\text{if } n=0, \quad Q_0 = \{x_0, x_1, x_2, ..., x_{n-1}, 1\} \quad \text{which is the input layer}\]

\[\text{if }n = m, \quad Q_m \text{ is the final output layer}\]

<h3 id="feed-forward-lemma">Feed Forward Lemma</h3>
<p>From the definitions proposed above, the following can be noted:</p>

<blockquote>
  <p>If a model $Q^*$ has $n$ elements i.e. $n$ layers, then, the model has an input layer $Q_0$, hidden layers $Q_1$ to $Q_{n-1}$, and an output layer $Q_n$.</p>
</blockquote>

<p>Given that $Q^*$ is an <strong>ordered set</strong>, it follows that a <strong>Feed Forward</strong> operation occurs as $n$ increases from $1$ to $n$.</p>

<h2 id="conclusion">Conclusion</h2>
<p>In summary, we have defined a new function $\Gamma$ that calculates the value of a neuron $q$ based on the <strong>set</strong> of values of the neurons $P$ it is connected to using weights/edges $W_q$. We also defined a set-generating function $\Gamma^* $ that outputs a <strong>set</strong> of neurons $Q$ for a layer based on the neurons from the previous layer $P$ and <strong>all</strong> its associated weights $W_Q$. We defined the ordered set $Q^* $ which contains all the layers of a neural network, where the first element $Q_0$ is the input layer and the $Q_n$ is the output layer. And finally, we noted that if $n$ increases from $1$ to $n$ in the set $Q^*$, it describes the feed forward operation of a traditional neural network.</p>]]></content><author><name>Ariq Ahmer</name></author><summary type="html"><![CDATA[I am currently investigating the possibility of having non-linear combinations in neural networks, how it may be computed (if at all), and its performance impact compared to the current linear combination in neural network.]]></summary></entry><entry><title type="html">A Life Update - A lot has changed…</title><link href="http://blog.qiras-lab.net/a-life-update/" rel="alternate" type="text/html" title="A Life Update - A lot has changed…" /><published>2024-09-12T00:00:00+00:00</published><updated>2024-09-12T00:00:00+00:00</updated><id>http://blog.qiras-lab.net/a-life-update</id><content type="html" xml:base="http://blog.qiras-lab.net/a-life-update/"><![CDATA[<p>Now let’s see where to begin. A lot has happened since May 1, 2024. Here is the gist of it…</p>

<h2 id="i-got-a-job">I got a job!</h2>
<p>I was working at a local ISP as an intern for two months. Then another job calling came about. This time it was a really good offer. So I switched to the new job. I am just grateful to Allah that some sort of stability is there for the time being. It’s a good position even as a trainee. The work seems quite interesting and quite different from what I had percieved a <q>typical Computer Science related job</q> could be like. Regardless, a job is a job nonetheless. I am just happy to finally relax (the term relax is in a superposition right now) and not have to worry about a lot of worriesome? things for the time being. Indeed Allah is the best of planners.</p>

<blockquote>
  <p><q>And the disbelievers made a plan ˹against Jesus˺, but Allah also planned—and Allah is the best of planners.</q>
— Quran 3:54</p>
</blockquote>

<h2 id="studying-masters">Studying Masters…</h2>
<p>Right after the job, I started my Masters degree in Computer Science in the same university where I did my undergraduate. I must say, I am a bit surprised by the lecturers’ emotions towards graduate students. I think that if you are currently donig your undergraduate degree and you dislike a lecturer for some reason. Try to give them another chance if you intend to pursue your graduate degree in the same university. It looks like they are more flexible and comfortable with graduate students than undergraduate students. <strong>On a very important note!!!</strong> This advice should be applicable to anyone with any type of undergraduate degree in any field. Try and get some practical work exposure that is <strong>not</strong> teaching oriented (unless of course your degree is in the Ed field) in the industry. It can make a night-and-day difference when you start your masters degree. If the work environment is good enough (or busy enough), you will be able to quickly relate to a lot of topics that you’d learn during masters. This time, you will actually posses some practical knowledge about your field, and you’ll be able to appreciate the topics that are being taught.</p>

<p>From my workplace, I managed to learn (and am still learning) a few things and terms about basic software project management. To my surprise, during one of the modules in my course that deals a bit with project management, I actually managed (pun intended) to relate a lot of the things from the workplace. I would also highly suggest that if you have the intention to pursue your masters degree, try and keep up the momentum right after your bachelors degree. And try to pursue it while working. You won’t have any life (as currently, I technically have no life outside just work and study), but I feel like:</p>

<blockquote>
  <p>Get the pain over with. If you anticipate the pain and prepare for it for a long time, it is going to hurt worse when it comes. And while waiting for that pain, you’ll just be stressed and paranoid for no obvious reason.</p>
</blockquote>

<h2 id="the-banking-system-research-thingy">The Banking System Research Thingy</h2>
<p>I’ll be blunt. I just simply don’t have that extra time to research this any further at the present. So I have put it on pause for now. However, I don’t want to give “nothing”. Instead, I have linked the draft PDF of my write up. It has the background preliminaries about the different banking systems. Some technical content like the algorithms and mathematical models but I guess it’s something. You can find it in the <a href="https://github.com/AriqAhmer/banking-system-modelling">main repository (link)</a> or access it <a href="https://github.com/AriqAhmer/banking-system-modelling/blob/main/Banking_System_Comparison.pdf">directly here</a>. You’ll notice that there are no citations or refernces 💀. I am yet to find the relevant references to back up my claims.</p>

<p>But for now… I am signing off for the night.</p>

<p>— A A</p>]]></content><author><name>Ariq Ahmer</name></author><summary type="html"><![CDATA[This post is just going give a life update and how the Banking System Comparison research is not being worked on... for now...]]></summary></entry><entry><title type="html">An Update of the Banking Systems Comparison</title><link href="http://blog.qiras-lab.net/an-update-of-the-banking-systems-work/" rel="alternate" type="text/html" title="An Update of the Banking Systems Comparison" /><published>2024-05-01T00:00:00+00:00</published><updated>2024-05-01T00:00:00+00:00</updated><id>http://blog.qiras-lab.net/an-update-of-the-banking-systems-work</id><content type="html" xml:base="http://blog.qiras-lab.net/an-update-of-the-banking-systems-work/"><![CDATA[<p>Hello there! It’s been more than a month now for this work, but it has been fruitful to say the least. Firstly in the <a href="https://ariqahmer.github.io/comparison-of-banking-systems-part-2/">previous post</a> I have indicated that the simulation works to show Islamic Banking System (PLS) performs better than the Interest Based (Conventional) Banking System. But that was only a simulation using some algortihms. This whole research initially intended to <strong>prove</strong> that the PLS model is better than Conventional model. While that might be the case (and it is), I still have to pursue this as a scientist an mathematician so that the work isn’t biased. So going forward, the study will be more focused on the comparison of the two models than to prove that one is better than the other. I do have a few hypotheses regarding the outcome of this whole research, but I am also considering the alternate hypothesis and expecting a few to be true. Regardless that was jus the brief of the whole “change of approach” in a sense. The next section outlines the new developments and progress regarding the models themselves.</p>

<h2 id="important">IMPORTANT</h2>
<p>The Islamic scheme stated in the <a href="https://ariqahmer.github.io/comparison-of-banking-systems-part-2/">previous post</a> was making the assumption of using the <em>Mudarabah</em> policy. But it turns out, I was actually using <em>Musharakah</em> policy.</p>

<h2 id="new-developments-and-works">New Developments and Works</h2>
<p>One thing to note is that the simulation idea came later. At first, I came up with a few basic equations to model the business’s growth and other aspects, but soon I realized that my approach was too “basic” and it failed to model the core of the business’s operations properly. Hence as an alternative approach, I thought to myself “why not treat the business operations as algorithms… since they are essentially a step by step set of operations?”. That’s when it hit me (the EUREKA moment)! A business’s operations consist primarily of — <strong>Investment → Revenue → Expenses → Profit</strong>. At the end of the trading period, the cycle starts again with some of the profit from the previous period being used to invest in the next. <strong>That’s when</strong> I decided to take the algorithmic approach and come up wih the simulation program for the two models. After analyzing the results (I was shocked and didn’t expect it to work) I thought that: an algorithm in essence can be converted into a mathematical function. So I set out to convert the simulation code into actual mathematical equations and functions.</p>

<p>Since these are finance models <strong>and</strong> they are <em>time dependent</em>, the first thing I thought of is it must be a set of “time-series” models. But I didn’t know how to exactly go about them since time-series models are mostly dependent on discrete values. But hang on… that’s exactly it! Even the simulation is discrete value dependent! And the values used in the model are dependent on the previous values from the previous interation. So that can only mean (in my head) a recursive definition of each of the model’s variables that is based on discrete time intervals. Hence I set out to convert the simulation into something more analytical. I looked at how each of the variables were being updated in each iteration and incorporated them accordingly in the mathematical definitions. After the set of recurrence relations definitons were complete for both of the models, I needed to convert them into their explicit forms so that the models can take any real values ($\mathbb{R}$) as inputs. That’s where the second hurdle came about and where I had to spend most of my time.</p>

<p>I took the naive approach to convert the recurrence relation models into explicit form by simply thinking of them as “simple non-homogeneous recurrence relations”. Once I was “happy” that I came up with the models, I had to test the explicit solutions and graph them to check if indeed they align with the simulation. And 1, 2, 3… they didn’t! The graphs ended up being asymptotic in nature and the values went to the asymptotes where they shouldn’t have gone. I tried to recalculate and re-solve the recurrence relations but no luck. But then, I remebered from my good friend’s WhatsApp message when I asked him about the type of questions he did during his Acturial Science course in university (THANKS A BUNCH Daniel Bannister! That message gave me the hype I needed). This was roughly 5 years ago from now. I think it was something to do with modelling Donald Trump’s hair as it moved back and forth using ODEs???. I saw that the finance questions were modeled using Ordinary Differential Equations (ODE). That’s when I changed the approach and tried to convert them using ODEs. I found a fantastic Math Stack Exchange thread (<a href="https://math.stackexchange.com/questions/1773205/relation-between-differential-equations-and-sequence-recursions">link here</a>) that was discussing how to go about it! From there, I set out to convert them explicitly into a system of ODEs and finally ended up with working models. I am not even going to discuss the amount of decoupling of equations I had to do :’) but that’s something else. I believe the strong cohesive nature of the equations would be evident from the simulation codes. Regradless, I finally have <strong><em>continuous analytical mathematical models</em></strong> for the systems.</p>

<p>The next problem came out when trying to run the equations as-is in code. Long story short, it’s not feasible using the compute resources I have at the moment to arrive at symbolic solutions using Python which can later be converted into a function. I had to change my approach from getting a symbolic solution and then using it for the simulation, to solving the set of ODEs numerically and simulate it that way. The speed up is more than “whatever-number-greater-than-1-you want-to-use” times faster, simply because the program couldn’t even finish solving the ODEs symbolically with +4 mins of runtime. At that point I just gave up and had to choose a different approach, hence arriving at solving the ODEs numerically. I went for using Euler’s method to solve the equations. It should be noted that symbolically it’s pratically not feasible under realistic assumptions where there are fluctuations in the models’ behaviours i.e. stochasticity and noise of the functions in the model. Regardless, I managed to arrive at the equations and am now able to solve them numerically using the computer for simulation purposes.</p>

<h2 id="conclusion-for-now">Conclusion for now</h2>
<p>Right now, the core part of the research is done. But now I am simultaneously trying to use existing metrics to evaluate the business’s performance using these models <strong>and</strong> writing up a draft “thesis/research article” to make it a bit formal. When I am done with the initial draft write up, I really need to get this reviewed. I would probably consult some lecturers at my university and get some feedback regarding this. I still have a long way to go, but so far, the work looks promising! Let’s pray for the best!</p>

<p>— A A</p>]]></content><author><name>Ariq Ahmer</name></author><summary type="html"><![CDATA[There have been some new developemnts in this work. This post is just about an update of the work as a whole.]]></summary></entry><entry><title type="html">Comparison of Banking Systems - Part 2</title><link href="http://blog.qiras-lab.net/comparison-of-banking-systems-part-2/" rel="alternate" type="text/html" title="Comparison of Banking Systems - Part 2" /><published>2024-03-13T00:00:00+00:00</published><updated>2024-03-13T00:00:00+00:00</updated><id>http://blog.qiras-lab.net/comparison-of-banking-systems-part-2</id><content type="html" xml:base="http://blog.qiras-lab.net/comparison-of-banking-systems-part-2/"><![CDATA[<p>Let’s get the pleasantries out of the way first. The full code and simulation files are <a href="https://github.com/AriqAhmer/banking-system-modelling">here: https://github.com/AriqAhmer/banking-system-modelling</a>. So if you feel like skipping this blog and jump straight to the code, then go ahead. You’ll find all the necessary assumptions and logics there.</p>

<p>Now the rest of the story…</p>

<h3 id="the-long-wait">The Long Wait…</h3>
<p>It took waaaaaay longer than expected to post this update, not because the model itself was complicated but… but… I simply couldn’t find time to do it. I’ve been busy a lot lately with unemployment, that’s why I managed to pass the time by doing this.</p>

<h3 id="the-content">The Content</h3>
<p>This time, the comparison was done using very basic profit-expense-reinvestment scheme. The purpose of this simulation was to take a look at the payment period needed to overcome the debt incurred by the business after taking a loan from the bank. Assumptions are that the Islamic Bank is using the <em>Mudarabah</em> model while the Traditional Bank is using the <em>Compound Interest</em> model.</p>

<p>This post is mainly to update about this whole research and come up with a simulation model that I can use further for this ongoing research. Sadly the analytic approach is still in progress, and I’ll see how to proceed with it in the future. For now this is what I have come up with.</p>

<p>Feel free to check it out and play with the model and give me a feedback on any improvements I can make or any mistakes I can fix.</p>

<p>–A A</p>]]></content><author><name>Ariq Ahmer</name></author><summary type="html"><![CDATA[A simulation of Islamic Banking System and Traditional Banking System]]></summary></entry><entry><title type="html">Comparison of Banking Systems - Part 1</title><link href="http://blog.qiras-lab.net/comparison-of-banking-systems-part-1/" rel="alternate" type="text/html" title="Comparison of Banking Systems - Part 1" /><published>2023-08-14T00:00:00+00:00</published><updated>2023-08-14T00:00:00+00:00</updated><id>http://blog.qiras-lab.net/comparison-of-banking-systems-part-1</id><content type="html" xml:base="http://blog.qiras-lab.net/comparison-of-banking-systems-part-1/"><![CDATA[<p>The purpose of this project is to come up with a very basic an rough mathematical model of the Islamic Banking system and the Traditional banking system. The idea is to compare and see the differences, similarities and how they may affect an entity involved in these systems.
<strong>Full Disclosure:</strong> The model is very basic an is designed in such a way that it could be understood by someone with a bit of basic calculus knowledge and experience. The models are based on the simple concepts of profit and loss. Nothing major. I am not a scholar of Islamic Finance hence my knowledge in this is very shallow. I have just used common assumptions and variables when modeling these. Feel free to correct me where I have gone wrong (check my contact page if need be).</p>

<h2 id="some-concepts-of-the-two-systems">Some concepts of the two systems</h2>
<p>For our purposes, we will only consider the scenario of a bank giving out a “loan” to a business and how the business and the bank benefits from each other.
In <strong>Islamic Banking (Finance)</strong>, the concept of <em>interest</em> is non-existent. It operates on sharing profits and losses. That is, if a client <strong>C</strong> wanted to start a business but does not have enough capital, then they may request for some amount of initial capital <strong>C<sub>0</sub></strong> from an Islamic Bank <strong>I</strong>. The policy for <em>I</em> is that instead of charging interest on <em>C<sub>0</sub></em> on <em>C</em>, <em>I</em> would share some percentage of the profit/loss gained by <em>C</em> over a period of time. This is to say that the amount <em>C<sub>0</sub></em> will be repaid to <em>I</em> as well some amount of profit gained by <em>C</em> for a limited period of time. This amount may be a percentage <em>p</em>.
In <strong>Traditional Banking</strong>, the bank <strong>T</strong> gives out a loan to <em>C</em>. And as a method of repayment, <em>T</em> charges an interest (mostly compound interest) with rate <em>i</em> on the initial capital <em>C<sub>0</sub></em>. The client <em>C</em> has to repay the total amount with interest regardless of whether <em>C</em> makes any profit or not.</p>

<h2 id="variables">Variables</h2>
<ul>
  <li>The earning of Islamic Bank, <strong>I</strong></li>
  <li>The earning of Traditional Bank, <strong>T</strong></li>
  <li>The earning of client, <strong>C</strong></li>
  <li>Initial capital given by <em>I</em> and <em>T</em> to <em>C</em>, <strong>C<sub>0</sub></strong></li>
  <li>Percentage profit/loss shared by <em>I</em> and <em>C</em>, <strong>p</strong></li>
  <li>Interest rate of <em>T</em>, <strong>i</strong></li>
  <li>A time period, <strong>t</strong></li>
</ul>

<h2 id="assumptions">Assumptions</h2>
<ul>
  <li>The earning <em>C</em> is ideal and grows exponentially over time (assuming the business grows and opens new branches).</li>
  <li>To have a “fair” earning rate for both <em>I</em> and <em>T</em>, the values of <em>p</em> and <em>i</em> are equal, i.e. <em>p</em>=<em>i</em>.</li>
</ul>

<h2 id="the-models">The Models</h2>
<h3 id="model-of-cs-growth">Model of C’s growth</h3>
<p>Using the above assumptions, it can be concluded that <em>C</em> is a function of <em>t</em> and can be modelled as</p>

\[C(t) = C_{0}\text{exp}(\alpha t)\]

<p>where, \(\alpha\) is a constant.</p>

<p>The profit made by the client at any given time \(t\) can be derived to be the following:</p>

\[C'(t) = C_{0}\alpha\text{exp}(\alpha t)\]

<p>And the following is my reasoning.
The total revenue at any given time \(t\) is \(C(t)\). Hence the revenue in the next time period is \(C(t + \Delta t)\). Then it follows that the profit gained in time \(\Delta t\) is \(C(t + \Delta t)-C(t)\). Hence the rate of profit gained is the profit divied by \(\Delta t\). Therefore if we take the limit as \(\Delta t \to \infty\) we obtain the following expression:</p>

\[\lim_{\Delta t \to \infty} = \frac{C(t + \Delta t) - C(t)}{\Delta t} = C'(t)\]

<h3 id="model-of-is-earning">Model of I’s earning</h3>
<p>Based on the concept above, it can be concluded that \(I\) is a function of \(t\) and depends on the function \(C'(t)\) and the constant \(p\). Hence our model becomes:</p>

\[I(t) = pC'(t)\]

\[I(t) = pC_{0}\alpha\text{exp}(\alpha t)\]

<p>And the rate at which this profit increases is the function \(I'(t) = pC_{0}\alpha^{2}\text{exp}(\alpha t)\)
From this we can deduce the <em>net profit</em> of the client can be given by:</p>

\[C^\ast = C(t) - I(t)\]

\[C^\ast = (1-p) C_{0}\alpha\text{exp}(\alpha t)\]

<h3 id="model-of-ts-earning">Model of T’s earning</h3>
<p>Traditional banks use mostly compound interest when they give out loans to businesses. Hence the following can be deduced:</p>

\[T(t) = C_{0}{(1+i)}^{t} - C_{0}\]

<p>Similarly the rate of increase in T’s profit is simply the function \(T'(t) = \ln(1+i)C_{0}{(1+i)}^{t}\)
From the previous expressions, we can derive that C’s <em>net profit</em> my be given by the expression:</p>

\[C^{\ast\ast} = C_{0}\alpha\text{exp}(\alpha t) - C_{0}{(1+i)}^{t} + C_{0}\]

<h2 id="parameter-values">Parameter values</h2>
<ul>
  <li>\(C_{0} = 100,000\) for the initial capital</li>
  <li>\(p = i = 0.10\) as the profit and interest rates</li>
  <li>\(\alpha = 0.9\) for best case</li>
  <li>\(\alpha = 0.2\) for intermediate case</li>
  <li>\(\alpha = 0.05\) for worst case</li>
  <li>\(t = 10\) with values from \([0,10]\) with 1 step increment</li>
</ul>

<h2 id="results">Results</h2>
<p>The code for the model can be found <a href="https://github.com/AriqAhmer/random-projects/tree/main/models">here</a>. There are three Jupyter Notebooks (Python Codes) for the best, intermediate and worst cases.</p>

<h3 id="growth-of-c">Growth of C</h3>
<p>The following graphs show the best, intermediate and worst case for the growth of <em>C</em> (in that order)</p>

<p><img src="/assets/financial_model_results/best_growth_c.png" alt="best growth of C" /></p>

<p><img src="/assets/financial_model_results/intermediate_growth_c.png" alt="intermediate growth of C" /></p>

<p><img src="/assets/financial_model_results/worst_growth_c.png" alt="worst growth of C" /></p>

<h3 id="profit-of-i-vs-t">Profit of I vs T</h3>
<p>These graphs compare the profits earned by <em>I</em> and <em>T</em> using the best, intermediate and worst case growth of <em>C</em> (in that order)</p>

<p><img src="/assets/financial_model_results/best_profit_i_t.png" alt="best profit I vs T" /></p>

<p><img src="/assets/financial_model_results/intermediate_profit_i_t.png" alt="intermediate profit I vs T" /></p>

<p><img src="/assets/financial_model_results/worst_profit_i_t.png" alt="worst profit I vs T" /></p>

<h3 id="profit-of-i-and-c">Profit of I and C</h3>
<p>The following graphs compare how both I and C gain profits using the same order of cases as above</p>

<p><img src="/assets/financial_model_results/best_profit_i_c.png" alt="best profit I vs C" /></p>

<p><img src="/assets/financial_model_results/intermediate_profit_i_c.png" alt="intermediate profit I vs C" /></p>

<p><img src="/assets/financial_model_results/worst_profit_i_c.png" alt="worst profit I vs C" /></p>

<h3 id="profit-of-t-and-c">Profit of T and C</h3>
<p>The following graphs compare how T’s and C’s profits evolve over time using the same order of cases as above</p>

<p><img src="/assets/financial_model_results/best_profit_t_c.png" alt="best profit T vs C" /></p>

<p><img src="/assets/financial_model_results/intermediate_profit_t_c.png" alt="intermediate profit T vs C" /></p>

<p><img src="/assets/financial_model_results/worst_profit_t_c.png" alt="worst profit T vs C" /></p>

<h2 id="discussion">Discussion</h2>
<p>In this best case scenario, where C’s growth is very good, I and C manage to make profits. However, T makes less profit over the years as compared to I. This might be beneficial to the community as I will now be able to help out more businesses with more investments in each business.
In this intermediary scenario, where C’s growth is quite good, I and C still manage to make profits. However, T manages to make more profit over the years than I. But the net profit of C declines over the years where at year ~3.5, C starts making losses.
In this worst case scenario, where C’s growth is okay (almost linear), I and C still manage to make profits although the rate is slow. However, T makes more profit than I. This may be good for T but C loses out as its business model cannot cope with the interest rates over the years. Hence C makes losses from the very beginning and the business shuts down.</p>

<h2 id="conclusion">Conclusion</h2>
<p>Using a bit of “basic” mathematics, we are able to witness that the Islamic Banking system is better than the traditional banking system. This has been just a rough model. This is part 1. In part 2, I will try and model how these systems may affect the economic systems and balance of a country. Keep in mind that one can make the model as complex as they would like. This is just the tip of the iceberg and a proof of concept. Please feel free to correct me where I might have made mistakes and suggest on how this model can be improved further.</p>]]></content><author><name>Ariq Ahmer</name></author><summary type="html"><![CDATA[A rough mathematical model of the comparison between Islamic Banking System and Traditional Banking System]]></summary></entry><entry><title type="html">Solving World Politics</title><link href="http://blog.qiras-lab.net/some-politics/" rel="alternate" type="text/html" title="Solving World Politics" /><published>2023-08-12T00:00:00+00:00</published><updated>2023-08-12T00:00:00+00:00</updated><id>http://blog.qiras-lab.net/some-politics</id><content type="html" xml:base="http://blog.qiras-lab.net/some-politics/"><![CDATA[<p>Testing testing 123</p>

<p>In majority of the cases, a country is run by a party through democracy. Well there is no problem with democracy per say, but there is a problem (in my opinion) with how a decision is made and passed by the current government of that country.</p>

<h2 id="scenario">Scenario</h2>
<p>Let’s take the scenario where in a country <strong>C</strong>, there are three political parties <strong>X</strong>, <strong>Y</strong> and <strong>Z</strong>. Suppose party <strong>X</strong> is in charge of the country currently. What would happen if the current government pushes a decision that goes against the interests and betterment of the people? Naturally there would be opposing forces at play, the current government party, <strong>X</strong>, would get a bad reputation, and the other parties <strong>Y</strong> and <strong>Z</strong> get popularity as they would try and exploit that “wrong” decision. This is the norm, and this is what happens on a regular basis in any multiparty country. So what am I proposing here?</p>

<h2 id="a-possible-solution">A Possible Solution</h2>
<p>Let us introduce a neutral party <strong>N</strong> in our situation. What is the purpose of this party? To put it simply, their objectives don’t include any interests in any traditional “political” matter, rather their interests are solely on how to improve and develop the quality of life (this may be a broad term but you get the idea) of the population in that country as well as to ensure peace between the government and the people. Unlike other parties, <strong>N cannot</strong> AND <strong>will not</strong> take part in any form of elections. They do not have the right to delegate new people in the government. Nor can they take down the current government. So what’s happening here?</p>

<p>Suppose the government <strong>X</strong> decides to pass a new rule/regulation in the country <strong>C</strong>. But despite obvious flaws in that regulation, the government pushes it anyway. Here is where <strong>N</strong> comes into play. Since <strong>N</strong> has decided and have seen that the rule is flawed, they call in a special vote. In this vote, the public is made aware of the rule to be passed and are asked to vote for or against the rule. A second vote is then conducted with the parties <strong>X</strong>, <strong>Y</strong> and <strong>Z</strong>. Then, <strong>N</strong> decides and concludes the voting with consideration of both the numbers i.e. the votes of the public and the votes done at the party level. Majority of the votes for the particular notion wins.</p>

<h2 id="isnt-this-the-same-as-having-an-advisor">Isn’t This The Same As Having An Advisor?</h2>
<p>The advisor of any government fall in the category of being a member of the ruling party. So in our case, the advisor of <strong>X</strong> in country <strong>C</strong> would still be a member of that party. The advisor does not hold any authority or power to oppose the current government. In my proposed solution, <strong>N</strong> has the power to oppose the government and their decision, hence bringing forth the vote-for-a-decision. And in this case, the government has no choice but to comply.</p>

<h2 id="why-would-this-be-effective-at-all">Why Would This Be Effective At All?</h2>
<p>To put it simply, <strong>It’s a mind game and a psychological pressure</strong> system. As long as the ruling government is a physical human being, this might work. Why though? Because we, humans, love power more than anything. So if <strong>X</strong> thinks they need to be in power for longer, obviously they would do what’s “right” for the people and the nation. This is so because they would not want to lose in the next election/campaign. Hence they would try and comply with the unanimous decision. Once the they’ve gained the popularity of the people, then they are sure to win (given normal circumstances).</p>

<h2 id="some-things-to-note">Some Things To Note</h2>
<p>There is a possibility that once the people are made aware of the “bad decision”, parties <strong>Y</strong> and <strong>Z</strong> might try and manipulate the supporters or the people in general to vote for their decisions (which they show are right but may not be). To avoid such a case from arising, there should be strict monitoring on the opposing parties such that they cannot force their decisions on the people. If they do so, their votes at the gathering conducted by <strong>N</strong> will be declared null and void. Let’s also recognize that in an ideal system, not all the opposing parties would oppose the decision given by the government. After all, if the decision is indeed right, then there is no reason to intervene in the first place.</p>

<p>Keep in mind that the party <strong>N</strong> in any given country <strong>C</strong> cannot and should not have interest in the population of another country <strong>C’</strong>. <strong>N</strong>’s sole duty is to lookout for the people of <strong>C</strong>. However, should there be a conflict between the current party <strong>X</strong> and the parties <strong>Y</strong>, <strong>Z</strong> and <strong>N</strong>, and <strong>Y</strong>, <strong>Z</strong>, <strong>N</strong> and the population of <strong>C</strong> are in one agreement, then <strong>N</strong> has the right and holds authority to call <strong>N’</strong>, <strong>N’‘</strong>, <strong>N’’‘</strong> and so on from countries <strong>C’</strong>, <strong>C’‘</strong>, <strong>C’’‘</strong> and so on respectively. This is done in order to intervene with <strong>X</strong> and negotiate and come to an agreement. Should the <strong>N-primes</strong> from the other countries impose decisions that may align with the interests and benefit to the other countries <strong>C-primes</strong>, then the <strong>N-primes</strong> should be dismantled from making any decisions in their respective countries and a new group of people will for the <strong>N</strong> party.</p>

<h2 id="matter-of-safety">Matter Of Safety</h2>
<p>Obviously there will be attempts from the current government to eliminate <strong>N</strong>. The contingency for this that the members of <strong>N</strong> for <strong>C</strong> will be located around the world in other countries. And it would be the job of <strong>ALL</strong> the parties in that country to conceal their locations and whereabouts. Let me reiterate the point that <strong>no N of any country will serve together to bring about their own interests</strong>. The <strong>N</strong> for any country <strong>C</strong> must remain within the interests of that country <strong>ONLY</strong>.</p>

<h2 id="conclusion">Conclusion</h2>
<p>This is just a theoretical framework and a work in progress on my take of how a country could be run. There may be flaws here and there, or loop-holes within this current system that I have described. This is only an alpha version of this system. Maybe you could say version v0.1??? So I might decide to work on and improve the model later on. But for now, this is what I have got.</p>]]></content><author><name>Ariq Ahmer</name></author><summary type="html"><![CDATA[Here is my take on how the world's political system can be improved (in a way... I guess...)]]></summary></entry></feed>