<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tanav</title>
    <description>The latest articles on DEV Community by Tanav (@tanav2202).</description>
    <link>https://dev.to/tanav2202</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F658056%2Fccc6983d-065b-4333-b001-b455b40a598f.jpg</url>
      <title>DEV Community: Tanav</title>
      <link>https://dev.to/tanav2202</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tanav2202"/>
    <language>en</language>
    <item>
      <title>Multiple Random Variables</title>
      <dc:creator>Tanav</dc:creator>
      <pubDate>Sun, 06 Feb 2022 21:17:57 +0000</pubDate>
      <link>https://dev.to/tanav2202/multiple-random-variables-12df</link>
      <guid>https://dev.to/tanav2202/multiple-random-variables-12df</guid>
      <description>&lt;p&gt;Topics Covered — Joint PMF and Marginal PMF of 2 or more Random Variables.&lt;br&gt;
Prerequisite — Random Variables&lt;br&gt;
This article is basically the math behind the PMF of random variables and how it can be used if more than one are involved.&lt;/p&gt;

&lt;h2&gt;
  
  
  Joint PMF
&lt;/h2&gt;

&lt;p&gt;Assume X and Y are Discrete Random Variables defined in the same probability space.&lt;br&gt;
Range of X = Tx&lt;br&gt;
Range of Y = Ty&lt;br&gt;
Then Fₓᵧ(x,y) is a function from Tx × Ty to [0,1]&lt;br&gt;
F(t₁ , t₂) = P( X=t₁ and Y=t₂ ) such that t₁ ∈ Tx and t₂ ∈ Ty&lt;br&gt;
P(X,Y) means P(X and Y) here&lt;br&gt;
When we write Joint PMF it is written usually in form of a table or matrix&lt;br&gt;
Let’s take an example to understand it better.&lt;br&gt;
&lt;strong&gt;Tossing a fair coin twice.&lt;/strong&gt;&lt;br&gt;
Let Xᵢ = 1 if i’th toss is heads and Xᵢ = 0 if i’th toss is tails&lt;br&gt;
Here i= 1,2&lt;br&gt;
Fₓ₁ₓ₂(0,0) = P(X₁=0 , X₂=0)=1/2 * 1/2 = 1/4&lt;br&gt;
Fₓ₁ₓ₂(0,1)= P(X₁=0 , X₂=1) = 1/2 *1/2 = 1/4&lt;br&gt;
The same info in Tabular form -&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KMnxiVUk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e4r0ix943b81beilpzcv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KMnxiVUk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e4r0ix943b81beilpzcv.png" alt="tabular form" width="301" height="137"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since all entries have equal probability a proper distinction cannot be seen in the various PMFs so let’s take another example to understand this better&lt;br&gt;
&lt;strong&gt;Random Number Less than 100&lt;/strong&gt;&lt;br&gt;
X is the Units place and Y is the remainder of the number when divided by 4&lt;br&gt;
Like in case of 31 X=1 and Y=3&lt;br&gt;
Fₓᵧ(0,0) = P(X=0, Y=0) = P(Number ending in 0 and Divisible by 4)&lt;br&gt;
So the set of numbers in this category are {00,20,40,60,80}&lt;br&gt;
P({0,20,40,60,80}) = 5/100 or 1/20&lt;br&gt;
Similarly&lt;br&gt;
Fₓᵧ(4,2) = P( X=4 , Y=2) = P(Number ends in 4 and has 2 as remainder)&lt;br&gt;
Set of numbers = {14,34,54,74,94}&lt;br&gt;
P({14,34,54,74,94}) = 5/100=1/20&lt;br&gt;
Right now it seems like the above case where all values where equal but this is really not the case for this example&lt;br&gt;
Fₓᵧ(1,0) = P( X=1 , Y=0) = P(Number ends in 1 and has no remainder)&lt;br&gt;
Set of numbers = ϕ&lt;br&gt;
Because there is no such number&lt;br&gt;
So, P(X=1,Y=0)=0&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--r0dRXc_j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m7krod2ekruqwxo6q6is.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--r0dRXc_j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m7krod2ekruqwxo6q6is.png" alt="Image description" width="700" height="564"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Such a table can be formed depicting all values of Fₓᵧ&lt;br&gt;
Also if you note sum of one column or row depicts the probability of that individual event happening&lt;br&gt;
That is what we will be discussing in the next part of this article&lt;/p&gt;

&lt;h2&gt;
  
  
  Marginal PMF
&lt;/h2&gt;

&lt;p&gt;Suppose X and Y are jointly distributed discrete random variables&lt;br&gt;
with joint PMF Fₓᵧ . The PMF of the individual random variables X and Y are called&lt;br&gt;
as marginal PMFs. It can be shown that&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--V0DyMU4T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fbbb1yao0zp7brh9rss7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--V0DyMU4T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fbbb1yao0zp7brh9rss7.png" alt="Image description" width="305" height="98"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important Point- Marginal PMF is Simple PMF if the other variable did not exist.&lt;/strong&gt;&lt;br&gt;
That math above looks weirdly complex but all it means is if we form a PMF table and add a row or column then it gives us the probability of that individual event&lt;br&gt;
For example in the above example we had formed the table&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Q8tUcBST--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cqjwc4qnj0d13koqfa61.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Q8tUcBST--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cqjwc4qnj0d13koqfa61.png" alt="Image description" width="700" height="470"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add all the probabilities of column 0 ( Remainder of number is 0)&lt;br&gt;
Probability of this happening is 1/4 because remainder can be one of 0,1,2,3 this is also shown by sum of all rows in that column.&lt;br&gt;
So we can say&lt;br&gt;
Fₓ₂(0)=1/4 →1/20 + 1/20 + 1/20 + 1/20 + 1/20&lt;/p&gt;

&lt;p&gt;Similarly for rows&lt;br&gt;
Probability of Units place being 5 is 1/10 and it is same as sum of all columns associated with that row.&lt;br&gt;
Fₓ₁(5)=1/10 → 1/20 + 1/20&lt;/p&gt;

&lt;h2&gt;
  
  
  Joint PMF of more than two discrete random variables
&lt;/h2&gt;

&lt;p&gt;Suppose X₁, X₂, . . . , Xₙ are discrete random variables defined in the same probability space. Let the range of Xᵢ be Tₓᵢ. The joint PMF of Xᵢ , denoted by Fₓ₁,ₓ₂,….ₓₙ, is a function from Tₓ₁ × Tₓ₂ × . . . × Tₓₙ to [0, 1] defined as&lt;br&gt;
Fₓ₁,ₓ₂,….ₓₙ = P(X₁ = t₁, X₂ = t₂, . . . , Xn = tₙ); tᵢ ∈ Tₓ&lt;br&gt;
This is exactly like using the “and” operator to get all Variables together and find their Joint PMF.&lt;/p&gt;

&lt;h2&gt;
  
  
  Marginal PMF in case of more than two discrete random variables
&lt;/h2&gt;

&lt;p&gt;Suppose X₁, X₂, . . . , Xₙ are jointly distributed discrete random variables with joint PMF Fₓ₁,ₓ₂,….ₓₙ The PMF of the individual random variables X₁, X₂, . . . , Xₙ are called as marginal PMFs. It can be shown in form of&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JTWYncra--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/idzflj95v0btg9umr2uk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JTWYncra--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/idzflj95v0btg9umr2uk.png" alt="formula" width="518" height="192"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In simple terms the above math jargon says — Take the Joint PMF of all the given variables except the one who’s marginal PMF is being found.&lt;br&gt;
For example -&lt;br&gt;
Let’s take 3 random variables X₁ , X₂ and X₃&lt;br&gt;
To find marginal PMF of X₁. Find the Joint PMF of X₂ and X₃&lt;br&gt;
&lt;strong&gt;This can also be grouped up and is called Marginalisation&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--77QtyT8a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n7kgssz15bmd5jsyri7n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--77QtyT8a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n7kgssz15bmd5jsyri7n.png" alt="formula" width="596" height="47"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above formula’s simplification is Sum everything that is not needed.&lt;br&gt;
X₁, X₂, X₃ and X₄ are random variables forming a Joint PMF&lt;br&gt;
To find Marginalised PMF of X₁ and X₃ we find Joint PMF of X₂ and X₄&lt;/p&gt;

&lt;p&gt;Stay Tuned&lt;/p&gt;

</description>
      <category>statistics</category>
      <category>machinelearning</category>
      <category>datascience</category>
      <category>maths</category>
    </item>
    <item>
      <title>Statistics In Data Science</title>
      <dc:creator>Tanav</dc:creator>
      <pubDate>Sun, 06 Feb 2022 20:36:37 +0000</pubDate>
      <link>https://dev.to/tanav2202/statistics-in-data-science-odg</link>
      <guid>https://dev.to/tanav2202/statistics-in-data-science-odg</guid>
      <description>&lt;p&gt;This will be a series of articles dealing with statistical concepts from Random variables to various distributions to likelihood estimation and hypothesis testing.&lt;br&gt;
Prerequisite- Basic Probability.&lt;/p&gt;

&lt;h2&gt;
  
  
  Random Variables
&lt;/h2&gt;

&lt;p&gt;The literal definition for Random Variable is “ A function with domain as the sample space of an experiment and range as real numbers”. This just means random variables are numerical versions of outcomes of any experiment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Simplest possible example - Coin Toss :&lt;/strong&gt;&lt;br&gt;
Sample Space = {Heads , Tails}&lt;br&gt;
So random variable X can be written as X(Heads)=1 , X(Tails)=0.&lt;br&gt;
This can be any number we assign but usually meaningful functions are considered.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Throw a dice -&lt;/strong&gt;&lt;br&gt;
Sample Space = {1,2,3,4,5,6}&lt;br&gt;
X is defined as X(1)= x₁, X(2)= x₂ ….. X(6)=x₆&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are the values of x₁, x₂, x₃ , x₄, x₅, x₆?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;These xᵢ’s are essentially same as sample space and distinct for a one-to-one function. But the need not be distinct and can be same as well.&lt;/p&gt;

&lt;p&gt;Example - In the same Die roll the condition is of Even vs Odd Numbers&lt;br&gt;
Random Variables- E(2)=E(4)=E(6)=1 and E(1)=E(3)=E(5)=0&lt;/p&gt;

&lt;h2&gt;
  
  
  Random Variables and Events
&lt;/h2&gt;

&lt;p&gt;If X is a random variable then&lt;br&gt;
(X
Similarly (X&amp;gt;x) , (X=x) , (X ≤ x) and (X≥x) are all events.&lt;/p&gt;

&lt;p&gt;In the die example-&lt;br&gt;
S={1,2,3,4,5,6}&lt;br&gt;
X(1)= 1 , X(2) = 2 , X(3) = 3 , X(4) = 4 , X(5)= 5 and X(6) =6&lt;br&gt;
For event (X&amp;lt;4) : { 1,2,3}&lt;br&gt;
Event {2,5} can also be written as (X = 2) ⋂ (X=5)&lt;br&gt;
&lt;strong&gt;Why use Random Variables?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of trying to assign probabilities to the entire outcome we assign them to events defined through them.&lt;br&gt;
This reduces the detail in outcome to something simpler&lt;br&gt;
Using limited data only random variables can be studied&lt;br&gt;
&lt;strong&gt;Types of Random Variables -&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Discrete Random Variable&lt;/li&gt;
&lt;li&gt;Continuous Random Variable&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Discrete Random Variable
&lt;/h2&gt;

&lt;p&gt;If the range of random variables is a discrete set it is called discrete random variable. Usually described by it’s Probability Mass Function (PMF).&lt;br&gt;
PMF = Random Variable X set on Range T&lt;br&gt;
Fₓ(t) : T -&amp;gt; [0,1] is defined as Fₓ(t)= P(X=t) for t ∈ T&lt;br&gt;
X=t is the event&lt;br&gt;
P(X=t) is probability of X taking the value of t.&lt;br&gt;
For example-&lt;br&gt;
A fair coin is tossed 3 times&lt;br&gt;
Sample Space = {HHH , HHT , HTH , HTT , THH , THT , TTH , TTT}&lt;br&gt;
X= Number of heads&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--c_QAYDyS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/visgc4jgt8jv5fw038uq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--c_QAYDyS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/visgc4jgt8jv5fw038uq.png" alt="Sample Space Table" width="627" height="292"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;X ∈ {0,1,2,3}&lt;br&gt;
Fₓ(0) = 1/8&lt;br&gt;
Fₓ(1)=3/8&lt;br&gt;
Fₓ(2)=3/8&lt;br&gt;
Fₓ(3)=1/8&lt;br&gt;
This shows the PMFs of various discrete random variables. The main thing to remember about PMF is that **sum of all PMFs in the range is 1 **at all times.&lt;br&gt;
0 ≤ Fₓ(t) ≤ 1&lt;br&gt;
∑ Fₓ(t)=1 here (t ∈T)&lt;/p&gt;

&lt;h2&gt;
  
  
  Continuous Random Variable -
&lt;/h2&gt;

&lt;p&gt;A random variable X with CDF Fₓ is said to be continuous random variable if Fₓ is continuous at every x. CDF has no jumps or steps .&lt;br&gt;
CDF = Cumulative Distribution Function&lt;br&gt;
This is a very detailed topic so I will be writing another article discussing this in detail.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stay tuned.
&lt;/h2&gt;

</description>
      <category>statistics</category>
      <category>machinelearning</category>
      <category>datascience</category>
      <category>maths</category>
    </item>
  </channel>
</rss>
