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 that reads a coordinate off the outcome , the randomness lives entirely in which nature draws. This reframing is the key to everything: once you see as a function on the Probability Spaces , its distribution is just the probability measure pushed forward through that function, and manipulating distributions becomes calculus.
Definition: a measurable function
is a random variable if it is -measurable: for every Borel set , the preimage lies in . Measurability is exactly the condition that "" is an event we can assign probability to. It is equivalent to requiring for all , since intervals generate the Borel σ-algebra.
The law (or distribution) of is the pushforward measure on : Everything about 's randomness is encoded in ; the underlying is scaffolding we can usually forget once we have the law.
The CDF: the universal description
The cumulative distribution function carries in a single monotone function: Every CDF is (i) non-decreasing, (ii) right-continuous, (iii) with limits , . 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 is exactly the point mass .
- Discrete : is a sum of atoms; described by a pmf , with a step function.
- Continuous : is absolutely continuous, so there is a density with The density is not a probability, it can exceed , but approximates . This is why 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 with monotone and differentiable, the density transforms by the Jacobian: The absolute value keeps densities non-negative regardless of whether increases or decreases. For non-monotone , sum the contribution of every branch .
Worked example, lognormal from normal. Let and , the canonical model for a price. Then with derivative , so for That is the lognormal density, positive support, right skew, and the reason Black–Scholes prices are what they are. Note the 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 is continuous with CDF , then , and conversely has CDF . 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 the joint CDF is , with joint density in the continuous case.
Marginals integrate out the other coordinate, they recover the individual laws:
Conditionals renormalise a slice: This is the density version of conditioning and the seed of Bayes' Theorem: reversing the roles gives .
Independence is the statement that the joint factors: , equivalently , 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 has ). Never report 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 with symmetric, forgetting the second root halves the density and undercounts.
- Correlation ≠ dependence. and can be uncorrelated yet functionally dependent; only independence (full factorisation) rules out all dependence.
In interviews
Expect the change-of-variables drill: "if is standard normal, what is the density of ?" (a chi-squared with one degree of freedom, remember both roots and the factor). Expect " uniform on , find the density of " (standard exponential, this is inverse-transform sampling in disguise). A conceptual favourite: "what does it mean that but takes some value?", separate density from probability. And know that independence implies zero correlation but not conversely, with 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