Random Variables
In machine learning, we can consider any unknown quantities as random variables. A random variable
associates a distinct numerical value with each possible outcome in the sample space. (Formally, it is a
single valued fuction.) Usually, we denote a random variable by a capital letter (\(X\)) and a specific value taken by a
random variable by the corresponding lower case letter (\(x\)).
A random variable is discrete if the number of possible values it takes is finite or countably infinite.
We can describe the collection of probabilities as a function of \(x\):
\[
f(x) = P(X = x)
\]
we call \(f(x)\) a probability mass function (p.m.f.).
Then
- \(f(x) \geq 0\) for all \(x\).
- \(\sum_{x} f(x) = 1\).
Cumulative distribution function(c.d.f.) of p.m.f. is \[ F(x) = P(X \leq x) = \sum_{k \leq x} f(k). \] Note: \(P(a \leq X \leq b) = F(b) - F(a - 1)\).
A random variable is continuous if it can be any value from one of more intervales of real numbers. Since the possible values are uncountably infinte, instead of p.m.f., we use the probability density function (p.d.f.).
- \(0 \leq f(x) \leq 1\) for .
- \(\int_{- \infty}^\infty f(x)\,dx = 1\)
- \(P(a \leq X \leq b) = \int_{a}^b f(x)\,dx\) for any \(a \leq b\)
Cumulative distribution function(c.d.f.) of p.d.f. is \[ F(x) = P(X \leq x) = \int_{- \infty}^x f(u)\,du. \] So, by the Fundamental Theorem of Calculus, \[ f(x) = \frac{dF(x)}{dx}. \] Note: \(P(a \leq X \leq b) = \int_{a}^b f(x)\,dx = F(b) - F(a)\).