BetaFree coursewareRewritten from MIT OpenCourseWareCC BY-NC-SA 4.0
Open CosmologyPhysics & cosmology, from high school to a graduate year

Probability: two or more random variables

Two random variables have a joint density. Integrating out one variable gives the density of the other; slicing the joint density at a fixed value of one gives a conditional density, and Bayes' theorem connects the two. Variables are statistically independent when the joint density factors. These tools derive the Poisson density from first principles and describe correlated noise through the jointly Gaussian density.

You need this first

On this page · 5 sections
  1. Joint densities
  2. Conditional probability and Bayes' theorem
  3. Deriving the Poisson density
  4. Jointly Gaussian variables
  5. Summary

Physical questions often involve several random variables at once: the velocity components of an atom, or a noise voltage measured at two times. This lecture extends the one-variable tools to two variables and introduces three new ideas: reducing to one variable, conditional probability and statistical independence (slides 1–17; the slides' closing exam problem on collision products is left for the course's problem pages; notes pp. 19–34). (MIT's material for this lecture is Greytak's slides and his probability notes, Chapter 2; this page follows them in its own words, with its own worked example. The notes' figures are not reproduced. The notes write a conditional density with a vertical bar, p(x|y); this page writes it as p(x given y), which read-aloud can say.)

Joint densities#

Much carries over directly from one variable (notes p. 19; slides 2–3):

Joint density and distribution
px,y(ζ,η) dζ dη≡prob(ζ<x≤ζ+dζ and η<y≤η+dη),Px,y(ζ,η)=∫−∞ζ∫−∞ηpx,y(ζ′,η′) dζ′ dη′p_{x,y}(\zeta, \eta)\,d\zeta\,d\eta \equiv \text{prob}\left(\zeta < x \le \zeta + d\zeta \text{ and } \eta < y \le \eta + d\eta\right), \qquad P_{x,y}(\zeta, \eta) = \int_{-\infty}^{\zeta}\int_{-\infty}^{\eta}p_{x,y}(\zeta', \eta')\,d\zeta'\,d\eta'
In words

p sub x y ( zeta, eta ) d zeta d eta is defined as prob the quantity zeta less than x is less than or equal to zeta plus d zeta and eta less than y is less than or equal to eta plus d eta, capital P sub x y ( zeta, eta ) equals the integral from minus infinity to zeta of the integral from minus infinity to eta of p sub x y ( zeta prime, eta prime ) d zeta prime d eta prime

with px,y=∂2Px,y/∂ζ ∂ηp_{x,y} = \partial^2P_{x,y}/\partial\zeta\,\partial\eta, and averages ⟨f(x,y)⟩=∫∫f(ζ,η) px,y(ζ,η) dζ dη\langle f(x, y)\rangle = \int\int f(\zeta, \eta)\,p_{x,y}(\zeta, \eta)\,d\zeta\,d\eta.

Reduction to a single variable (notes p. 19). The density of xx regardless of yy comes from integrating over all yy:

Reduction to one variable
px(ζ)=∫−∞∞px,y(ζ,η) dηp_x(\zeta) = \int_{-\infty}^{\infty}p_{x,y}(\zeta, \eta)\,d\eta
In words

p sub x ( zeta ) equals the integral from minus infinity to infinity of p sub x y ( zeta, eta ) d eta

Conditional probability and Bayes' theorem#

At the other extreme, suppose yy is known. The conditional density px(ζ given y)p_x(\zeta \text{ given } y) is the density of xx given that yy has that value; in it ζ\zeta is the variable and yy only a parameter (notes pp. 19–20). Knowing yy restricts the possibilities to the line η=y\eta = y in the plane, so px(ζ given y)p_x(\zeta \text{ given } y) must be proportional to the slice px,y(ζ,y)p_{x,y}(\zeta, y). Integrating over ζ\zeta fixes the constant as py(y)p_y(y) (notes p. 20), which gives Bayes' theorem, the fundamental law of conditional probability (slides 4–6):

Bayes' theorem
p(x,y)=p(x given y) p(y)=p(y given x) p(x),p(x given y)=p(x,y)p(y)p(x, y) = p(x \text{ given } y)\,p(y) = p(y \text{ given } x)\,p(x), \qquad p(x \text{ given } y) = \frac{p(x, y)}{p(y)}
In words

p(x, y) equals p(x given y) p(y) equals p(y given x) p(x), p(x given y) equals p(x, y) over p(y)

Read one way, it finds a conditional density by slicing the joint density and renormalizing; read the other way, it rebuilds the joint density by stacking the conditional slices, weighted by the density of the conditioning variable, much as a loaf can be reassembled from its slices, in the notes' image (notes p. 21).

Statistical independence (notes p. 22; slide 6). Two variables are statistically independent (S.I.) if

Statistical independence
px,y(ζ,η)=px(ζ) py(η),equivalentlyp(x given y)=p(x)p_{x,y}(\zeta, \eta) = p_x(\zeta)\,p_y(\eta), \qquad \text{equivalently} \quad p(x \text{ given } y) = p(x)
In words

p sub x y ( zeta, eta ) equals p sub x ( zeta ) p sub y ( eta ), equivalently p(x given y) equals p(x)

Knowing one then tells nothing more about the other than its own density already did.

A uniform disk (notes pp. 22–24; slides 7–8). For points spread uniformly over a disk (the notes take radius 1, density 1/π1/\pi; the slides radius aa), integrating across the disk gives p(x)=2π1−x2p(x) = \frac{2}{\pi}\sqrt{1 - x^2} for ∣x∣≤1|x| \le 1, and the same form for yy. Their product is not 1/π1/\pi, so xx and yy are not independent. The conditional density is p(x given y)=1/(21−y2)p(x \text{ given } y) = 1/\left(2\sqrt{1 - y^2}\right) for ∣x∣≤1−y2|x| \le \sqrt{1 - y^2}: uniform along the chord at height yy, as one would expect, but over a range that depends on yy.

Deriving the Poisson density#

The tools are enough to derive the Poisson density quoted in Lecture 1 (notes pp. 24–27; slides 10–12). Events occur along a line with probability r ΔXr\,\Delta X for one event in a short stretch ΔX\Delta X, independently in different stretches.

No events (notes p. 25). Cut LL into pieces dLdL so short that p(0)≫p(1)≫p(n>1)p(0) \gg p(1) \gg p(n > 1), so p(0)≈1−r dLp(0) \approx 1 - r\,dL. The pieces are independent, so the probability of no event anywhere is the product over the L/dLL/dL pieces; taking the logarithm, ln⁡p(0;L)≈∑(−r dL)=−rL\ln p(0; L) \approx \sum(-r\,dL) = -rL:

Probability of no events
p(n=0;L)=e−rLp(n = 0; L) = e^{-rL}
In words

p(n equals 0; L) equals e to the power minus r L

(This is not a density for LL: it does not integrate to 1 over LL. It is one entry of the density for nn, with LL as a parameter.)

A recursion (notes p. 26). Extend the interval from LL to L+ΔLL + \Delta L. Having nn events in all means either nn in LL and none in ΔL\Delta L, or n−1n - 1 in LL and one in ΔL\Delta L; so p(n;L+ΔL)=p(n;L)(1−rΔL)+p(n−1;L) rΔLp(n; L + \Delta L) = p(n; L)(1 - r\Delta L) + p(n - 1; L)\,r\Delta L, and in the limit

Recursion for the Poisson probabilities
ddLp(n;L)+r p(n;L)=r p(n−1;L)\frac{d}{dL}p(n; L) + r\,p(n; L) = r\,p(n - 1; L)
In words

d over d L p(n; L) plus r p(n; L) equals r p of the quantity n minus 1; L

The solution (notes p. 27). Differentiating p(n;L)=1n!(rL)ne−rLp(n; L) = \frac{1}{n!}(rL)^ne^{-rL} gives exactly r p(n−1;L)−r p(n;L)r\,p(n - 1; L) - r\,p(n; L), and with the boundary conditions p(0;L)=e−rLp(0; L) = e^{-rL} and p(n;0)=0p(n; 0) = 0 for n≠0n \ne 0 the solution is unique. The slides reach the same result another way: put nn identical events into NN boxes of length L/NL/N, count the arrangements (the binomial coefficient, N choose n), and let N→∞N \to \infty (slides 11–12).

Jointly Gaussian variables#

A circuit with all sources off still shows a fluctuating voltage at high gain: thermal (Johnson) noise from the random motion of electrons, distinct from the shot noise of discrete charges (notes pp. 27–28). It has zero mean; a fairly well defined typical size; statistics that do not change in time; and a correlation time τc\tau_c, over which it changes little, with values much further apart statistically independent. Such a fluctuating signal is a random process (other examples: pressure or temperature fluctuations, thermal radiation fields, seismic background; slide 13). Sampling it at two times gives two random variables, often described by the jointly Gaussian density (notes p. 29; slide 14):

Jointly Gaussian density
p(v1,v2)=12πσ21−ρ2exp⁡(−v12−2ρv1v2+v222σ2(1−ρ2))p(v_1, v_2) = \frac{1}{2\pi\sigma^2\sqrt{1 - \rho^2}}\exp\left(-\frac{v_1^2 - 2\rho v_1v_2 + v_2^2}{2\sigma^2\left(1 - \rho^2\right)}\right)
In words

p( v one, v two ) equals 1 over the quantity 2 pi sigma squared the square root of 1 minus rho squared, end of root, times exp (- the quantity v one squared minus 2 rho v one v two plus v two squared, all over the quantity 2 sigma squared the quantity 1 minus rho squared, )

σ\sigma sets the size; the correlation coefficient ρ\rho, with ∣ρ∣≤1|\rho| \le 1, depends on the time separation τ=∣t2−t1∣\tau = |t_2 - t_1|, close to 1 for short separations and falling to 0 for long ones. Contours of constant probability are ellipses with their long axis along v1=v2v_1 = v_2 for ρ>0\rho > 0 (along v1=−v2v_1 = -v_2 for ρ<0\rho < 0), long and narrow as ∣ρ∣→1|\rho| \to 1 and circles at ρ=0\rho = 0 (notes p. 29).

From it (notes pp. 31–33): each voltage alone is a zero-mean Gaussian of variance σ2\sigma^2, the same at all times; the two are independent only when ρ=0\rho = 0; and

Conditional density of the second voltage
p(v2 given v1)=12πσ2(1−ρ2)exp⁡(−(v2−ρv1)22σ2(1−ρ2))p(v_2 \text{ given } v_1) = \frac{1}{\sqrt{2\pi\sigma^2\left(1 - \rho^2\right)}}\exp\left(-\frac{\left(v_2 - \rho v_1\right)^2}{2\sigma^2\left(1 - \rho^2\right)}\right)
In words

p( v two given v one ) equals 1 over the square root of 2 pi sigma squared the quantity 1 minus rho squared, times exp (- the quantity v two minus rho v one, all squared over the quantity 2 sigma squared the quantity 1 minus rho squared, )

a Gaussian with mean ρv1\rho v_1 and variance σ2(1−ρ2)\sigma^2(1 - \rho^2). Integrating v2v_2 against this, and then v1v_1, gives the correlation function (notes p. 33):

Correlation function
R(τ)≡⟨v(t) v(t+τ)⟩=σ2ρ(τ)R(\tau) \equiv \langle v(t)\,v(t + \tau)\rangle = \sigma^2\rho(\tau)
In words

capital R ( tau ) is defined as the average of v(t) v of the quantity t plus tau, equals sigma squared rho ( tau )

so ρ\rho is the normalized correlation function. It need not stay positive: for noise from a circuit resonant near one frequency, say 500 Hz, a positive value tends to be followed by a negative one half a period (1 ms) later, and ρ(τ)\rho(\tau) oscillates as it decays (notes pp. 33–34).

The page's own illustration, computed from the formulas above with σ=1\sigma = 1 and a first reading v1=1.5σv_1 = 1.5\sigma: the conditional density of the second reading (solid) against its unconditioned density (dashed). At ρ=0\rho = 0 they coincide; as ρ\rho grows, knowing v1v_1 centres the second reading on ρv1\rho v_1 and narrows it.
Worked example

A triangle of probability

(a) Points are spread uniformly over the triangle 0<y<x<10 < y < x < 1, so p(x,y)=2p(x, y) = 2 there. Find p(x)p(x), p(y)p(y) and p(x given y)p(x \text{ given } y). Are xx and yy independent? (b) Find ⟨x⟩\langle x\rangle, ⟨y⟩\langle y\rangle and ⟨xy⟩−⟨x⟩⟨y⟩\langle xy\rangle - \langle x\rangle\langle y\rangle. (c) Two noise samples are jointly Gaussian with σ=1.0\sigma = 1.0 mV and ρ=0.8\rho = 0.8; the first reads 1.5 mV. Find the mean and standard deviation of the second.

(a) Densities

p(x)=∫0x2 dy=2xp(x) = \int_0^x2\,dy = 2x and p(y)=∫y12 dx=2(1−y)p(y) = \int_y^12\,dx = 2(1 - y), both on (0,1)(0, 1). Then p(x given y)=22(1−y)=11−yp(x \text{ given } y) = \frac{2}{2(1 - y)} = \frac{1}{1 - y} for y<x<1y < x < 1: uniform, over a range set by yy. Since 2x⋅2(1−y)≠22x \cdot 2(1 - y) \ne 2, they are not independent.

(b) Averages

⟨x⟩=∫012x2dx=23\langle x\rangle = \int_0^12x^2dx = \frac23, ⟨y⟩=∫012y(1−y)dy=13\langle y\rangle = \int_0^12y(1 - y)dy = \frac13, and ⟨xy⟩=∫01∫0x2xy dy dx=∫01x3dx=14\langle xy\rangle = \int_0^1\int_0^x2xy\,dy\,dx = \int_0^1x^3dx = \frac14. So ⟨xy⟩−⟨x⟩⟨y⟩=14−29=136\langle xy\rangle - \langle x\rangle\langle y\rangle = \frac14 - \frac29 = \frac{1}{36}: positive, since a large yy forces a large xx.

(c) Correlated noise

The second reading has mean ρv1=0.8×1.5=1.2\rho v_1 = 0.8 \times 1.5 = 1.2 mV and standard deviation σ1−ρ2=0.6\sigma\sqrt{1 - \rho^2} = 0.6 mV, compared with 0 and 1.0 mV without the first reading.

Summary#

  • A joint density p(x,y)p(x, y) gives probabilities for pairs; integrating out yy gives p(x)p(x).
  • Bayes' theorem: p(x,y)=p(x given y) p(y)p(x, y) = p(x \text{ given } y)\,p(y); the conditional density is a renormalized slice.
  • Statistical independence means p(x,y)=p(x)p(y)p(x, y) = p(x)p(y); points uniform in a disk are not independent in xx and yy.
  • Independence of short intervals yields the Poisson density through dp(n)dL=r p(n−1)−r p(n)\frac{dp(n)}{dL} = r\,p(n - 1) - r\,p(n); jointly Gaussian noise samples have conditional mean ρv1\rho v_1, variance σ2(1−ρ2)\sigma^2(1 - \rho^2), and ⟨v(t)v(t+τ)⟩=σ2ρ(τ)\langle v(t)v(t + \tau)\rangle = \sigma^2\rho(\tau).

Symbols on this page

Show the 48 symbols used here
Δ\Delta capital delta.
A change or difference in a quantity, e.g. Δx = x₂ − x₁. Say it: “capital delta”.
ζ\zeta zeta.
A dummy variable standing for a value of x. Say it: “zeta” (sounds like “zay-ta or zee-ta”).
π\pi pi.
The ratio of a circle's circumference to its diameter, π ≈ 3.14159. Say it: “pi”.
ρ\rho rho.
The correlation coefficient of two jointly Gaussian variables. Say it: “rho”.
σ\sigma sigma.
The standard deviation of each noise voltage. Unit: V. Say it: “sigma”.
τ\tau tau.
The time separation between the two samples. Unit: s. Say it: “tau” (sounds like “rhymes with cow”).
∞\infty infinity.
Infinity: larger than any number. Say it: “infinity”.
≈\approx approximately equal.
Is approximately equal to. Say it: “is approximately”.
≡\equiv identical to.
Is defined as (or is identically equal to). Say it: “is defined as”.
≫\gg much greater than.
Is much greater than. Say it: “is much greater than”.
≤\le less than or equal.
Is less than or equal to. Say it: “is less than or equal to”.
≠\neq not equal.
Is not equal to. Say it: “is not equal to”.
→\to arrow.
Goes to (tends to), or becomes. Say it: “goes to”.
×\times times.
Times (multiplication). Between two vectors: the cross product. Say it: “times”.
⋅\cdot dot.
Times (multiplication). Between two vectors: the dot product. Say it: “times”.
⟨\langle angle brackets.
The average (mean value) of what is inside, ⟨…⟩. Say it: “the average of”.
∂\partial partial.
Partial derivative: the rate of change with one variable, holding the others fixed. Say it: “partial”.
∫\int integral.
Integral: the sum of infinitely many small pieces, such as the area under a curve. Say it: “the integral of”.
∑\sum sum.
Sum: add up the terms over the range written below and above. Say it: “the sum of”.
ln⁡\ln natural logarithm.
Natural logarithm (base e ≈ 2.718). Say it: “log”.
aa a.
The radius of the disk in the slides' version. Say it: “a”.
exp⁡\exp exponential.
The exponential function. Say it: “exp”.
xx x.
A random variable. Say it: “x”.
yy y.
A second random variable. Say it: “y”.
tt t.
Time. Unit: s. Say it: “t”.
dd d.
The d of an integral or derivative. Say it: “d”.
nn n.
The number of events in an interval. Say it: “n”.
ee e.
Euler's number. Say it: “e”.
ff f.
Any function of the random variables. Say it: “f”.
vv v.
The noise voltage v(t). Unit: V. Say it: “v”.
rr r.
The rate of events per unit length. Unit: 1/m. Say it: “r”.
LL L.
The length of the interval. Unit: m. Say it: “L”.
NN N.
The number of boxes the interval is cut into. Say it: “capital N”.
pp p.
A probability density (joint, single or conditional). Say it: “p”.
RR R.
The correlation function ⟨v(t) v(t + τ)⟩. Unit: V². Say it: “capital R”.
t1t_{1} t one.
The first sampling time. Unit: s. Say it: “t one”.
t2t_{2} t two.
The second sampling time. Unit: s. Say it: “t two”.
XX X.
The position along the line on which events occur. Unit: m. Say it: “capital X”.
v1v_{1} v one.
The noise voltage at the first time. Unit: V. Say it: “v one”.
v2v_{2} v two.
The noise voltage at the second time. Unit: V. Say it: “v two”.
η\eta eta.
A dummy variable standing for a value of y. Say it: “eta”.
pxp_{x} p x.
The probability density of x alone. Say it: “p sub x”.
pyp_{y} p y.
The probability density of y alone. Say it: “p sub y”.
px,yp_{x,y} p x y.
The joint probability density of x and y. Say it: “p sub x y”.
Px,yP_{x,y} P x y.
The joint cumulative distribution of x and y. Say it: “capital P sub x y”.
ζ′\zeta' zeta prime.
A dummy integration variable for x. Say it: “zeta prime”.
η′\eta' eta prime.
A dummy integration variable for y. Say it: “eta prime”.
τc\tau_{c} tau c.
The correlation time of a noise signal. Unit: s. Say it: “tau sub c”.

Tap or click a symbol in a formula to see the same explanation. All symbols: symbols and notation.

Words on this page

Show the 39 words used here

New here

conditional density.
The probability, or probability density, of one quantity once the value of another is known.
statistically independent.
Of two random quantities: such that knowing one tells nothing about the other.
Bayes' theorem.
The rule for reversing a conditional probability: how likely A is given B, from how likely B is given A.
event.
One of the possible outcomes of a random process, or a set of them, to which a probability can be given.
shot noise.
Random fluctuation in a current that arises because charge arrives in separate units, the electrons, rather than as a smooth flow.
correlation time.
The time over which a fluctuating signal changes little; values much further apart in time are effectively unrelated.
random process.
A quantity that fluctuates randomly in time, such as a noise voltage, described by probabilities rather than by a formula.
correlation coefficient.
A number between −1 and 1 that measures how closely two random quantities rise and fall together.
correlation function.
A function that measures how strongly the value of a fluctuating quantity at one time or place is related to its value at another.

Also used

random variable.
A quantity whose value cannot be predicted from what is known, although its behaviour follows the rules of probability. Explained in Probability: one random variable.
velocity.
How fast and in which direction something moves: the change in position in each unit of time. Explained in Speed and velocity.
noise.
Random, unpredictable fluctuations in a signal such as a current, a voltage or a measurement, on top of the value we want. Explained in Brownian motion, the Einstein relation and noise.
voltage.
The difference in electric potential between two points, measured in volts: the energy each coulomb of charge gains or loses between them. Explained in Electric potential and voltage.
p..
Page, in a reference to a source; pp. means pages, as in pp. 3–5.
density.
How much of something (mass, charge, energy, particles or probability) there is in each unit of volume, area, length or other variable. Explained in Density and pressure.
integration.
Finding an integral: adding up very many small pieces, or finding an antiderivative. Explained in Differentials and antiderivatives.
proportional.
Of two quantities: always in the same ratio, so that doubling one doubles the other. Explained in Graphs, straight lines and slope.
uniform.
The same at every point, or unchanging in time: a uniform rod has the same density all along it. Explained in The electric field.
logarithm.
The power to which a fixed base must be raised to give a number: log₁₀ 1000 = 3 because 10³ = 1000. Explained in Exponentials and logarithms.
recursion.
A rule giving each term from the ones before it, or a method that solves a problem by applying itself to smaller copies of it. Explained in Complex matrices and the fast Fourier transform.
interval.
A stretch between two values or two moments; in maths, all the numbers between two end points. Explained in Time dilation, length contraction and the interval.
limit.
The value a quantity gets closer and closer to, as near as we like, as its input approaches some value, without having to reach it. Explained in Rates of change and area under a graph.
differentiation.
Finding a derivative: working out how fast a function changes. Explained in The derivative: slope of the tangent line and rate of change.
boundary condition.
A known value of the unknown function, or of its slope, at an edge or end, used to fix the constants in a solution. Explained in A rope with mass: differential analysis.
fluctuation.
A departure of a quantity from its average value, usually small and random, from moment to moment or from place to place. Explained in Zero-point energy, fluctuations and surprises.
statistics.
The mathematics of data and chance, or the averages, spreads and other numbers that describe how a random quantity behaves. Explained in Measuring structure: the power spectrum and the correlation function.
pressure.
The force pushing on a surface divided by the area of the surface, so the push on each square metre. Explained in Density and pressure.
field.
Something that has a value at every point of space, such as the temperature, the wind velocity or the electric field at each place. Explained in Newton's law of gravitation.
Gaussian.
The bell-shaped curve e to the minus x squared, or a quantity spread out with that shape; also called a normal distribution. Explained in Probability: sums of random variables and the central limit theorem.
ellipse.
An oval curve: the set of points whose distances from two fixed points, the foci, add up to the same total. Explained in Kepler's laws and orbits.
variance.
A measure of spread: the average of the squared distance of each value from the mean. Explained in Observables, the measurement postulate and uncertainty.
resonance.
The large response of an oscillating system when it is pushed at, or close to, its own natural frequency. Explained in Resonance.
frequency.
How often something repeats: the number of cycles, turns or waves each second, measured in hertz. Explained in Circular motion.
standard deviation.
A measure of how widely values are spread around their average, in the same units as the values: the square root of the variance. Explained in Probability: one random variable.
renormalization.
Rescaled so that its probabilities add up to one again.
independence.
Of random quantities or events: knowing one tells you nothing about the other, so their joint probability is the product of their separate probabilities.

Academic

carries over.
Still applies, with little change, in a new setting.
derive.
To obtain a result by reasoning or calculation from other known results.
yield.
To give or produce as a result.

Tap or click a word, here or in the text, for its meaning in this lesson. All words: the glossary. How many words are marked in the text: Reading options (the “Aa” button).

Where this leads

In cosmology

Pages that build on this

Practise

Check your understanding

  1. How is the density of xx alone found from the joint density p(x,y)p(x, y)?
  2. What does Bayes' theorem say?
  3. Points fall uniformly in a unit disk. Are their coordinates xx and yy statistically independent?
  4. Two noise voltages are jointly Gaussian with correlation coefficient ρ\rho. Given the first, what is the mean of the second?
0 of 4 answered

Flashcards

1 / 3