[Image goes here]
Published on

Random Variables

Most of this stuff is derived from Probability With Martingales by Williams. Maybe I'll add other sources too in the coming future.

Overview

I've never really had a good intuition for what a random variable really is. In EECS126, we define random variables as X:ΩXX : \Omega \xrightarrow{} \mathcal{X} mappings from our probability space to some set of values X\mathcal{X}, such that if we define a σ\sigma-algebra on X\mathcal{X}, then the preimage of every BΣB \in \Sigma is in the σ\sigma-algebra F\mathcal{F} of our probability space. Then, the distribution of this random variable is the function μ=PX1\mu = \mathbb{P} \circ X^{-1}, which defines a probability measure on X\mathcal{X}.

This definition makes sense (and indeed after reading Williams' book aligns with the measure-theoretic formalism of random variables as measurable functions) but is never really used in the class. Also, I have some outstanding questions:

  • Why is the distribution function a valid probability measure?
  • Given a distribution, can we construct a corresponding random variable (ie. in 126, we say some random variable is sampled from an exponential distribution, but it's unclear why that RV exists?)

Measurable Functions

Williams' mostly works with real-valued random variables, so I'll be doing the same, but the definitions extend to general measurable spaces. Given a measurable space (S,Σ)(S, \Sigma), we define

Definition: Σ\Sigma-measurable function: Given h:SRh : S \xrightarrow{} \mathbb{R}, hh is Σ\Sigma-measurable if h1(A)Σ,ABh^{-1}(A) \in \Sigma, \forall A \in \mathbb{B}.

Recall B\mathcal{B} is B(R)\mathcal{B}(\mathbb{R}) the Borel sets on the usual topology on R\mathbb{R}. Ok, this agrees with 126 definition.

Remark: It's interesting to see the parallels between topological definitions of continuous functions and the definition of measurable functions here. Instead of the preimage of open sets being open, we have the preimage of measurable sets being measurable. There are more cool parallels like this going forward!

With this definition, we can consider useful properties of measurable functions:

  • If we have some class CB\mathcal{C} \subseteq \mathcal{B} such that σ(C)=B\sigma(\mathcal{C}) = \mathcal{B} (that is, the class generates the Borel sets), then h1:CΣ    hmΣh^{-1} : \mathcal{C} \xrightarrow{} \Sigma \implies h \in m\Sigma. That is, measurability on this class implies measurability alltogether. (Quick proof: Take E\Epsilon as the class of BB:h1(B)ΣB \in \mathcal{B} : h^{-1}(B) \in \Sigma. h1h^{-1} preserves set operations, so E\Epsilon is a σ\sigma-algebra. By construction, EC\Epsilon \supseteq \mathcal{C}, so it must be that σ(C)=BE    E=B\sigma(\mathcal{C}) = \mathcal{B} \subseteq \Epsilon \implies \Epsilon = \mathcal{B}.)
  • If SS is topological and h:SRh : S \xrightarrow{} \mathbb{R} is continuous, then hh is Borel.

It turns out that mΣm\Sigma is also an algebra over R\mathbb{R}, so λR,h,h1,h2mΣ\forall \lambda \in \mathbb{R}, h, h_1, h_2 \in m\Sigma, h1+h2mΣ,h1h2mΣ,λhmΣh_1 + h_2 \in m\Sigma, h_1 h_2 \in m\Sigma, \lambda h \in m\Sigma.

Moreover, the composition of measurable functions is measurable: hmΣ,fmB    fhmΣh \in m\Sigma, f \in m\mathcal{B} \implies f \circ h \in m\Sigma. Consider the following picture:

ShRfRΣh1Bf1B\begin{aligned} & S \xrightarrow{h} \mathbb{R} \xrightarrow{f}\mathbb{R} \\ & \Sigma \xleftarrow{h^{-1}} \mathcal{B} \xrightarrow{f^{-1}} \mathcal{B} \end{aligned}

So, a measurable set passed through the backwards f1f^{-1} map is still measurable, which passed through the backwards h1h^{-1} map is still measurable.

Useful Lemma: For any measurable (S,Σ)(S, \Sigma), h:SRh : S \xrightarrow{} \mathbb{R} is Σ\Sigma-measurable if {hc}{sS:h(s)c}ΣcR\{h \leq c\} \triangleq \{s \in S : h(s) \leq c\} \in \Sigma \forall c \in \mathbb{R}. This directly follows from the fact that (,c]c(-\infty, c] \forall c is a π\pi-system on R\mathbb{R} that generates B\mathcal{B}, from which we can use our above result to say that hh is Σ\Sigma-measurable.

Lastly, given a sequence (hn)nNmΣ(h_n)_{n \in \mathbb{N}} \in m\Sigma, infhn,liminfhn,limsuphn\inf h_n, \lim \inf h_n, \lim\sup h_n are all Σ\Sigma-measurable (this time not technically into B\mathcal{B} but rather into B(R{,})\mathcal{B}(\mathbb{R} \cup \{-\infty, \infty\})) (Proof needed??!?!!?)

The definition of a random variable directly follows from looking at measurable function. Given some (measurable) porbability space (Σ,F)(\Sigma, \mathcal{F}), a random variable is just some hmFh \in m\mathcal{F}.

σ\sigma-algebra generated by collection of functions on Σ\Sigma: If we are given Ω,(Yλ)λC,Yλ:ΩR\Omega, (Y_\lambda)_{\lambda \in C}, Y_\lambda : \Omega \xrightarrow{} \mathbb{R}, define Fσ(Yλ:λC)\mathcal{F} \triangleq \sigma(Y_\lambda : \lambda \in C) as the smallest σ\sigma-algebra F\mathcal{F} on Ω\Omega such that each map YλY_\lambda is F\mathcal{F}-measurable. Clearly, σ(Yλ:λC)=σ({Yλ1(B):λC,BB})\sigma(Y_\lambda : \lambda \in C) = \sigma(\{Y_\lambda^{-1}(B) : \lambda \in C, B \in \mathcal{B}\}), our σ\sigma-algebra is generated by (must contain at least) the preimage of every Borel set through every function in our collection.

With 202A fresh in my mind, this seems really similar to the initial topology given some set XX and a family of topological spaces with functions taking XX to those spaces. Instead of the coarsest topology that makes all the functions continuous, here we have the smallest σ\sigma-algebra that makes all the functions measurable with respect to that algebra.

A Coin Tossing Example

Lets take a countable sequence of coin tosses such that Ω={H,T}N\Omega = \{H, T\}^N, ω=(ω1,ω2,),ωn{H,T}\omega = (\omega_1, \omega_2, \cdots), \omega_n \in \{H, T\}.

Distributions

If we have a random variable X:ΩRX : \Omega \xrightarrow{} \mathbb{R}, we have

ΩXR[0,1]PFX1B\begin{aligned} & \Omega \xrightarrow{X} \mathbb{R} \\ & [0, 1] \xleftarrow{P} \mathcal{F} \xleftarrow{X^{-1}} \mathcal{B} \\ \end{aligned}

So we can immediately define the probability law of this RV as LXPX1L_X \triangleq P \circ X^{-1}, which maps from our Borel sets to [0,1][0, 1] -- this is consistent with the pushforward measure given in the 126 notes. However, note that π(R)={(,c]:cR)}\pi(\mathbb{R}) = \{(-\infty, c] : c \in \mathbb{R})\} generates B\mathcal{B}, so LXL_X is fully determined by some FXF_X on the π\pi-system, which we can define as

FX(c)LX(,c]=P(Xc)=P(ω:X(ω)c)\begin{aligned} F_X(c) \triangleq L_X(-\infty, c] = P(X \leq c) = P(\omega : X(\omega) \leq c) \end{aligned}

But this is just the CDF of the random variable! So, the CDF fully determines our probability law of XX because of the nice property of π\pi-systems, that two probability measures agreeing on a π\pi-system agree on the σ\sigma-algebra generated by that π\pi-system. There is one other thing that we actually should have checked earlier too:

LXL_X is a valid probability measure on R,B\mathbb{R}, \mathcal{B}: LX(R)=P(ω:X(ω)R)=1L_X(\mathbb{R}) = P(\omega : X(\omega) \in \mathbb{R}) = 1, so it assigns measure 1 to R\mathbb{R}. Then, lets check countable additivity: Take disjoint Borel sets iBi\sqcup_i B_i. Then,

LX(iBi)=P(ω:X(ω)iBi)\begin{aligned} L_X(\sqcup_i B_i) = P(\omega : X(\omega) \in \sqcup_i B_i) \end{aligned}

It must be that X(ω)BiX(\omega) \in B_i for exactly one BiB_i, else they would not be pairwise disjoint. So, ωX1BiF\omega \in X^{-1}B_i \in \mathcal{F}. Then, given disjoint Bi,BjB_i, B_j, X1Bi,X1BjX^{-1}B_i, X^{-1}B_j must be disjoint. For if they werent, that would imply one ω\omega satisfies both X(ω)BiX(\omega) \in B_i and X(ω)BjX(\omega) \in B_j, which is a contradiction. So, our expression becomes

LX(iBi)=P(iX1Bi)=iP(X1Bi)=iLX(Bi)\begin{aligned} L_X(\sqcup_i B_i) = P( \sqcup_i X^{-1}B_i) = \sum_i P(X^{-1}B_i) = \sum_i L_X(B_i) \end{aligned}

So countable additivity of LXL_X follows from countable additivity of PP.

Constructing Random Variables From Distributions

It turns out we can go the other way too. If we have a "nicely behaved" distribution function FF, we can construct a probability measure LL such that L(,x]=F(x)xL(-\infty, x] = F(x) \forall x. Then, if we take our probability triple to be (Ω,F,P)=(R,B,L),X(ω)=ω(\Omega, \mathcal{F}, P) = (\mathbb{R}, \mathcal{B}, \mathcal{L}), X(\omega) = \omega, then FX(x)=F(x)xF_X(x) = F(x) \forall x, that is, there exists a random variable whose distribution function equals our given one at all points. What does nicely behaved mean?

  • F:R[0,1],xy    F(x)F(y)F : \mathbb{R} \xrightarrow{} [0, 1], x \leq y \implies F(x) \leq F(y)
  • limxF(x)=1,limxF(x)=0\lim_{x \xrightarrow{} \infty} F(x) = 1, \lim_{x \xrightarrow{} -\infty} F(x) = 0
  • FF is right continuous (see this is true for FX(c)=P(XC)F_X(c) = P(X \leq C): P(Xx+1n)P(Xx)P(X \leq x + \frac{1}{n}) \downarrow{} P(X \leq x) by monotone convergence,)