Quant Memo
Foundational

Random Variables & Distributions

Random variables as measurable functions that push a probability measure forward into a distribution, CDFs, densities, the change-of-variables formula for transformations, and the joint/marginal/conditional structure that underlies every multivariate model.

Prerequisites: Probability Spaces

A random variable is not a "variable that is random". It is a deterministic function X:ΩRX: \Omega \to \mathbb{R} that reads a coordinate off the outcome ω\omega, the randomness lives entirely in which ω\omega nature draws. This reframing is the key to everything: once you see XX as a function on the Probability Spaces (Ω,F,P)(\Omega, \mathcal{F}, \mathbb{P}), its distribution is just the probability measure pushed forward through that function, and manipulating distributions becomes calculus.

Definition: a measurable function

X:ΩRX: \Omega \to \mathbb{R} is a random variable if it is F\mathcal{F}-measurable: for every Borel set BRB \subseteq \mathbb{R}, the preimage X1(B)={ω:X(ω)B}X^{-1}(B) = \{\omega : X(\omega) \in B\} lies in F\mathcal{F}. Measurability is exactly the condition that "XBX \in B" is an event we can assign probability to. It is equivalent to requiring {ω:X(ω)x}F\{\omega : X(\omega) \le x\} \in \mathcal{F} for all xx, since intervals (,x](-\infty, x] generate the Borel σ-algebra.

The law (or distribution) of XX is the pushforward measure μX\mu_X on R\mathbb{R}: μX(B)=P(X1(B))=P(XB).\mu_X(B) = \mathbb{P}\big(X^{-1}(B)\big) = \mathbb{P}(X \in B). Everything about XX's randomness is encoded in μX\mu_X; the underlying Ω\Omega is scaffolding we can usually forget once we have the law.

The CDF: the universal description

The cumulative distribution function carries μX\mu_X in a single monotone function: FX(x)=P(Xx)=μX((,x]).F_X(x) = \mathbb{P}(X \le x) = \mu_X\big((-\infty, x]\big). Every CDF is (i) non-decreasing, (ii) right-continuous, (iii) with limits F()=0F(-\infty) = 0, F(+)=1F(+\infty) = 1. Conversely any function with those properties is the CDF of some random variable, so CDFs and distributions are in bijection. The CDF handles discrete, continuous, and mixed variables uniformly: a jump of size F(x)F(x)F(x) - F(x^-) is exactly the point mass P(X=x)\mathbb{P}(X = x).

  • Discrete XX: μX\mu_X is a sum of atoms; described by a pmf p(x)=P(X=x)p(x) = \mathbb{P}(X = x), with FF a step function.
  • Continuous XX: FF is absolutely continuous, so there is a density fXf_X with FX(x)=xfX(t)dt,fX(x)=FX(x),RfX=1.F_X(x) = \int_{-\infty}^x f_X(t)\,dt, \qquad f_X(x) = F_X'(x), \qquad \int_{\mathbb{R}} f_X = 1. The density is not a probability, it can exceed 11, but fX(x)dxf_X(x)\,dx approximates P(X[x,x+dx])\mathbb{P}(X \in [x, x+dx]). This is why P(X=x)=0\mathbb{P}(X = x) = 0 for continuous laws (see Probability Spaces): probability is area, and a point has none.

Transformations: change of variables

Quant work is drenched in transformations, log-returns, standardisations, option payoffs. If Y=g(X)Y = g(X) with gg monotone and differentiable, the density transforms by the Jacobian: fY(y)=fX(g1(y))ddyg1(y).f_Y(y) = f_X\big(g^{-1}(y)\big)\left|\frac{d}{dy}\,g^{-1}(y)\right|. The absolute value keeps densities non-negative regardless of whether gg increases or decreases. For non-monotone gg, sum the contribution of every branch xi=g1(y)x_i = g^{-1}(y).

Worked example, lognormal from normal. Let XN(μ,σ2)X \sim \mathcal{N}(\mu, \sigma^2) and Y=eXY = e^X, the canonical model for a price. Then g1(y)=lnyg^{-1}(y) = \ln y with derivative 1/y1/y, so for y>0y > 0 fY(y)=1y2πσexp ⁣((lnyμ)22σ2).f_Y(y) = \frac{1}{y\sqrt{2\pi}\,\sigma}\exp\!\left(-\frac{(\ln y - \mu)^2}{2\sigma^2}\right). That is the lognormal density, positive support, right skew, and the reason Black–Scholes prices are what they are. Note the 1/y1/y Jacobian factor is precisely what tilts the symmetric normal into a skewed law on prices.

A second essential transform is the probability integral transform: if XX is continuous with CDF FF, then U=F(X)Uniform(0,1)U = F(X) \sim \text{Uniform}(0,1), and conversely F1(U)F^{-1}(U) has CDF FF. This is inverse-transform sampling, how you simulate any distribution from a uniform generator, and it underlies copula methods, which model dependence separately from marginals.

Joint, marginal, conditional

Portfolios are multivariate, so the real action is in joint laws. For a random vector (X,Y)(X, Y) the joint CDF is F(x,y)=P(Xx,Yy)F(x,y) = \mathbb{P}(X \le x, Y \le y), with joint density f(x,y)=2F/xyf(x,y) = \partial^2 F / \partial x \partial y in the continuous case.

Marginals integrate out the other coordinate, they recover the individual laws: fX(x)=Rf(x,y)dy.f_X(x) = \int_{\mathbb{R}} f(x,y)\,dy.

Conditionals renormalise a slice: fYX(yx)=f(x,y)fX(x),fX(x)>0.f_{Y \mid X}(y \mid x) = \frac{f(x,y)}{f_X(x)}, \qquad f_X(x) > 0. This is the density version of conditioning and the seed of Bayes' Theorem: reversing the roles gives fXYfY=f(x,y)=fYXfXf_{X\mid Y}\,f_Y = f(x,y) = f_{Y\mid X}\,f_X.

Independence is the statement that the joint factors: F(x,y)=FX(x)FY(y)F(x,y) = F_X(x)F_Y(y), equivalently f(x,y)=fX(x)fY(y)f(x,y) = f_X(x)f_Y(y), equivalently every conditional equals its marginal. Independence is far stronger than zero correlation, it constrains the whole joint law, not just its second moment, a distinction that matters intensely in risk where tail dependence survives even when correlation is small.

Failure modes and subtleties

  • Density is not probability. A density above 1 is fine (a Uniform(0,0.5)\text{Uniform}(0, 0.5) has f=2f = 2). Never report f(x)f(x) as a probability.
  • Mixed distributions are common. Insurance losses, censored data, and "return is zero with some mass, else continuous" are neither discrete nor continuous; work with the CDF, which always exists, rather than forcing a density.
  • Marginals do not determine the joint. Two portfolios with identical marginal return distributions can have wildly different joint tail risk, the copula (dependence structure) is a separate degree of freedom. Assuming a Gaussian joint from Gaussian-looking marginals is a classic risk-model error.
  • Non-monotone transforms need every branch. For Y=X2Y = X^2 with XX symmetric, forgetting the second root halves the density and undercounts.
  • Correlation ≠ dependence. XX and X2X^2 can be uncorrelated yet functionally dependent; only independence (full factorisation) rules out all dependence.

In interviews

Expect the change-of-variables drill: "if XX is standard normal, what is the density of Y=X2Y = X^2?" (a chi-squared with one degree of freedom, remember both roots and the dx/dy|dx/dy| factor). Expect "XX uniform on [0,1][0,1], find the density of lnX-\ln X" (standard exponential, this is inverse-transform sampling in disguise). A conceptual favourite: "what does it mean that P(X=3)=0\mathbb{P}(X = 3) = 0 but XX takes some value?", separate density from probability. And know that independence implies zero correlation but not conversely, with X,X2X, X^2 as the counterexample. These push cleanly into Expectation, Variance & Moments and Common Distributions, where the specific laws you will meet on a desk get named.

Related concepts

Practice in interviews

Further reading

  • Durrett, Probability: Theory and Examples (Ch. 1)
  • Casella & Berger, Statistical Inference
  • Billingsley, Probability and Measure
ShareTwitterLinkedIn