Let X be a real-valued random variable. The expectation or meanE[X] of X is the average of its values weighted by their probabilities. If X is discrete with pmf pX and state space S then
E[X]:=x∈S∑xpX(x)
and if X is continuous with pdf fX then
E[X]:=∫−∞∞xfX(x)dx,
in each case provided the sum or improper integral is absolutely convergent. Otherwise the expectation does not exist. The expectation is a property of the probability distribution of X, is often written μ, and need not be a value that X can take.
The law of the unconscious statistician states that the expectation of a transformation g(X) can be computed from the distribution of X without finding the distribution of g(X).
E[g(X)]=x∈S∑g(x)pX(x),E[g(X)]=∫−∞∞g(x)fX(x)dx
For a random vector X and g:Rn→R the same holds with the joint pmf or pdf, E[g(X)]=∫Rng(x)fX(x)dx.
Let X,Y be random variables with finite expectations, a,b,c∈R and A be an event with indicator random variable 1A, which is 1 if A occurs and 0 otherwise. The expectation has the following properties:
The first property of the second line is linearity, which holds whether or not X and Y are independent. A statement about random variables holds almost surely (a.s.) if it holds with probability one.
Let X have finite mean μ. The variance of X is the expected squared deviation from the mean, and the standard deviationσ is its square root.
var[X]:=E[(X−μ)2]=E[X2]−μ2σ:=var[X]
The variance is finite if and only if E[X2] is finite. It satisfies var[X]≥0 with equality if and only if X=μ almost surely, and for a,b∈R
var[aX+b]=a2var[X].
The variance is measured in squared units of X whereas the standard deviation is measured in the units of X.
Let k∈N. The k-th moment of X is E[Xk], the k-th central moment is E[(X−μ)k] and the k-th standardised moment is E[(σX−μ)k]. The mean is the first moment and the variance is the second central moment. If the k-th moment is finite then every lower moment is finite. The skewness of X is its third standardised moment and measures the asymmetry of its distribution, being zero for a distribution symmetric about its mean. The kurtosis of X is its fourth standardised moment and measures the weight of its tails relative to its centre, and the excess kurtosis is the kurtosis minus 3. The standardisation of X is the random variable Z=σX−μ, which has mean 0 and variance 1.
Let X and Y be random variables with finite variances and means μX and μY. The covariance of X and Y is the expected product of their deviations from their means.
cov[X,Y]:=E[(X−μX)(Y−μY)]=E[XY]−μXμY
The covariance satisfies the following properties for a,b,c,d∈R:
X and Y are uncorrelated if and only if cov[X,Y]=0, in which case the variance of their sum is the sum of their variances. Independent random variables are uncorrelated, but uncorrelated random variables need not be independent; for example, if X is symmetric about 0 with finite third moment then X and X2 are uncorrelated but not independent.
The correlation of X and Y is their covariance scaled by their standard deviations, which makes it free of units.
ρX,Y:=σXσYcov[X,Y]=cov[σXX−μX,σYY−μY]
The correlation satisfies −1≤ρX,Y≤1, with ∣ρX,Y∣=1 if and only if Y=aX+b almost surely for some a=0 with the sign of a equal to the sign of ρX,Y. Correlation measures linear dependence only.
Let X=(X1,…,Xn) be a random vector whose components have finite variances. The mean vectorμ=E[X] is the vector of component means and the covariance matrixΣ=cov[X]∈Rn×n is the matrix of pairwise covariances.
The covariance matrix is symmetric and positive semi-definite, since a⊺Σa=var[a⊺X]≥0 for every a∈Rn, and is positive definite unless some linear combination of the components is almost surely constant. Its diagonal holds the variances of the components. For A∈Rm×n and b∈Rm the affine transformation AX+b has
E[AX+b]=Aμ+bcov[AX+b]=AΣA⊺.
The correlation matrix has entries ρXi,Xj, so has ones on its diagonal, and is the covariance matrix of the standardised components.
Let (X,Y) be a random vector and x be a value with pX(x)>0 or fX(x)>0. The conditional expectation of Y given X=x is the expectation of the conditional distribution of Y given X=x.
This is a function h(x)=E[Y∣X=x] of x, and the conditional expectation E[Y∣X]:=h(X) is the random variable obtained by evaluating it at X. The law of total expectation or tower property states that averaging the conditional expectation over X recovers the expectation of Y.
E[E[Y∣X]]=E[Y]
Conditional expectation is linear in Y, satisfies E[g(X)Y∣X]=g(X)E[Y∣X] for any function g, equals E[Y] if X and Y are independent and, among all functions of X with finite variance, minimises the expected squared error E[(Y−g(X))2], so it is the best predictor of Y from X in mean square. The conditional variance of Y given X is the variance of the conditional distribution,
var[Y∣X]:=E[(Y−E[Y∣X])2∣X],
and the law of total variance decomposes the variance of Y into the expected variance within values of X plus the variance of the conditional means between values of X.
var[Y]=E[var[Y∣X]]+var[E[Y∣X]]
Let X be a discrete random variable with state space {0,1,2,…}. The probability generating function (pgf) of X is the power series whose coefficients are the pmf.
GX(s):=E[sX]=k=0∑∞pX(k)sk,∣s∣≤1
The pgf satisfies GX(1)=1 and determines the distribution of X, since pX(k)=k!1GX(k)(0). Its derivatives at s=1 give the factorial momentsE[X(X−1)⋯(X−k+1)]=GX(k)(1), so that
E[X]=GX′(1),var[X]=GX′′(1)+GX′(1)−GX′(1)2.
If X and Y are independent then GX+Y(s)=GX(s)GY(s), which makes the pgf the standard tool for sums of independent counts.
Let X be a random variable. The moment generating function (mgf) of X is
MX(t):=E[etX]
provided this expectation is finite for all t in some open interval containing 0; otherwise the mgf does not exist. When it exists every moment of X is finite and is obtained by differentiating at 0, since the series expansion of the exponential gives
MX(t)=k=0∑∞k!E[Xk]tk,E[Xk]=MX(k)(0).
The mgf satisfies MX(0)=1 and MaX+b(t)=ebtMX(at), and if X and Y are independent then MX+Y(t)=MX(t)MY(t). The uniqueness theorem states that two random variables whose mgfs exist and agree on an open interval containing 0 have the same distribution, which allows distributions of sums and transformations to be identified from their mgfs. The cumulant generating function is KX(t):=logeMX(t) and its derivatives at 0 are the cumulantsκk=KX(k)(0), of which κ1=μ,κ2=σ2 and κ3 is the third central moment. Cumulants of independent random variables add.
Let X be a random variable and i be the imaginary unit. The characteristic function of X is
φX(t):=E[eitX]=E[cos(tX)]+iE[sin(tX)]∀t∈R.
Unlike the mgf the characteristic function exists for every random variable, since ∣eitX∣=1, and it satisfies φX(0)=1,∣φX(t)∣≤1,φaX+b(t)=eitbφX(at) and φX+Y=φXφY for independent X and Y. If the k-th moment of X is finite then E[Xk]=i−kφX(k)(0). The inversion theorem states that the characteristic function determines the distribution of X uniquely, so two random variables have the same distribution if and only if they have the same characteristic function. The characteristic function is the tool used to prove limit theorems about sums of random variables. When the mgf exists, φX(t)=MX(it).