A recap of the probability and statistics needed for simulation: probability axioms, random variables, convergence modes, stochastic processes, and estimation of means and variances.
2.1. Axioms of Probability
Sample spaceΩ: the collection of all outcomes of a random experiment. Each element ω∈Ω is called a sample point.
Event: any subset of the sample space, A⊆Ω.
Probability: a function that assigns to each event A a number P(A). It is not an arbitrary function; it must satisfy the following axioms:
0≤P(A)≤1
P(Ω)=1
If A1,A2,… are pairwise disjoint (Ai∩Aj=∅ for i=j), then P(⋃i=1∞Ai)=∑i=1∞P(Ai).
2.2. Random Variables and Their Properties
A random variable is a function that assigns to each ω∈Ω a numerical value: X:Ω→(−∞,∞).
The cumulative distribution function (c.d.f.) is
F(x)=P(X≤x)=P({ω:X(ω)≤x}).
Properties:
F is non-decreasing in x, and right-continuous with left limits. At a jump, the value at the point equals the value after the jump: F(x0)=F(x0+).
limx→∞F(x)=1, limx→−∞F(x)=0
P(a<X≤b)=F(b)−F(a)
2.2.1. Two types of random variables
Discrete: X takes a countable number of different values. A discrete r.v. is described by its probability mass function (p.m.f.)pX(x)=P(X=x):
0≤pX(x)≤1
∑all xpX(x)=1
F(x)=P(X≤x)=∑y≤xpX(y)
pX(x)=F(x)−F(x−) (value right after the jump minus value right before the jump)
Continuous: there exists a function f (the probability density function, p.d.f.) such that F(x)=∫−∞xf(y)dy:
If X and Y are independent, then cov(X,Y)=0, i.e. E[XY]=E[X]E[Y].
The converse fails in general: cov(X,Y)=0⇒ independence. But if (X,Y) is jointly normal, then cov(X,Y)=0⟺X and Y are independent.
cov>0: positively correlated — when X is above its mean, Y tends to be above its mean (and below with below).
cov<0: negatively correlated — when X is above its mean, Y tends to be below its mean.
Correlation coefficient
corr(X,Y)=Var(X)Var(Y)cov(X,Y)∈[−1,1].
2.4. Convergence Modes
Let X1,X2,… be a sequence of r.v.s. Each Xn is a functionXn(ω), so “converge to X∗(ω)” is not the ordinary limit of a sequence of numbers like limn→∞1/n=0; we need to say in what sense the functions converge.
Convergence with probability 1 (a.s. convergence, strong convergence).
Here Xn is still a random variable, so the statement is a probability:
P({ω:n→∞limXn(ω)=X∗(ω)})=1.
For almost every sampled ω, plugging it into Xn gives a sequence of numbers that converges to X∗(ω). The equality may fail on a set of ω of probability zero (e.g. on Ω=[0,1] with the uniform measure, failing only at ω=0.5 still gives probability 1).
Convergence in distribution (weak convergence).
Let Fn be the c.d.f. of Xn and F∗ the c.d.f. of X∗. These are ordinary functions, not random, so we take the limit directly:
n→∞limFn(x)=F∗(x)at all continuity points x of F∗.
Theorem (Strong Law of Large Numbers, SLLN).
Let X1,X2,… be i.i.d. with E∣X1∣<∞ and E[X1]=μ. Let Xˉn=n1∑i=1nXi. Then Xˉn→μwith probability 1:
P({ω:n→∞limn1i=1∑nXi(ω)=μ})=1.
This is exactly the first mode, with limit X∗≡μ a constant random variable. The only assumption is that the mean exists; the variance may be infinite.
(Contrast the Weak LLN, which only gives convergence in probability: P(∣Xˉn−μ∣>ε)→0 for each fixed ε>0. This is weaker — it does not say that any individual sample path settles down.)
Theorem (Central Limit Theorem, CLT).
Let X1,X2,… be i.i.d. with E[X1]=μ and 0<Var(X1)=σ2<∞. Define
Zn=σ/nXˉn−μ,Fn(x)=P(Zn≤x).
Then Zn→N(0,1)in distribution:
n→∞limFn(x)=Φ(x)for all x,
where Φ is the N(0,1) c.d.f. (Since Φ is continuous everywhere, every x is a continuity point.)
Why these two are the canonical examples. Same setup, two different questions, two different modes:
SLLN
CLT
object
Xˉn itself
rescaled fluctuation n(Xˉn−μ)/σ
mode
with probability 1 (strong)
in distribution (weak)
limit
constant μ
N(0,1)
needs
E∣X1∣<∞
Var(X1)<∞
SLLN says the average lands on μ; CLT says how it wobbles on the way in — at scale 1/n. CLT cannot be strengthened to a.s. convergence: for any fixed ω, Zn(ω) does not settle down but keeps oscillating forever. Only its distribution stabilizes. This illustrates that weak convergence is genuinely weaker, not just a technical relaxation.
2.5. Stochastic Processes
A stochastic process is a collection of r.v.s {X(t):t∈T} indexed by t, which usually represents time.
If T is discrete / continuous, we have a discrete-time / continuous-time process.
If the values X(t) take are discrete / continuous, we have a discrete-state / continuous-state process.
Example: single-server FCFS queue. Interarrival times X1,X2,… are i.i.d. and service times Y1,Y2,… are i.i.d. Let Di be the delay of the i-th customer. Then D1=0 and
Dn+1=max{Dn+Yn−Xn+1,0}(Lindley’s equation).
For instance D2=max{Y1−X2,0}: customer 2 waits only if customer 1’s service outlasts the gap between the two arrivals. {Dn} is a discrete-time, continuous-state process.
Example: Poisson process. Let Sn be the arrival time of the n-th customer, S0=0, and let the interarrival times Xn=Sn−Sn−1 be i.i.d. Exp(λ), so Sn=∑i=1nXi. The number of arrivals up to time t is
N(t)=max{n:Sn≤t}.
{N(t):t≥0} is a continuous-time, discrete-state process, called a Poisson process with rate λ.
2.6. Estimation of Means and Variances
Let X1,…,Xn be i.i.d. with mean μ and variance σ2.
Sample mean
Xˉ(n)=nX1+X2+⋯+Xn,E[Xˉ(n)]=μ,
so Xˉ(n) is an unbiased estimator of μ.
Sample variance
S2(n)=n−11i=1∑n(Xi−Xˉ(n))2,E[S2(n)]=σ2,
so S2(n) is an unbiased estimator of σ2.
Both Xˉ(n) and S2(n) are point estimators, and both are themselves random variables.
Idea. Replace the point estimator by an interval estimator (confidence interval), so that one can assert with a certain degree of confidence that the interval contains the true mean μ.
2.6.1. Confidence Intervals
Case 1. Population distribution arbitrary, σ2 known.
Notation. Let Z∼N(0,1) and define the upper α-quantile zα by
P(Z>zα)=α.
By symmetry of the standard normal, P(Z<−zα)=α, and hence
P(−zα/2≤Z≤zα/2)=1−α.
Derivation. By the Central Limit Theorem, for large n,
Conclusion. An approximate 100(1−α)% confidence interval for μ is
[Xˉ(n)−zα/2nσ,Xˉ(n)+zα/2nσ].
Case 2. Population normal, σ2 unknown.
Notation. Let T∼tn−1 (Student’s t with n−1 degrees of freedom) and define tα,n−1 by
P(T>tα,n−1)=α.
Since the t distribution is symmetric about 0,
P(−tα/2,n−1≤T≤tα/2,n−1)=1−α.
Derivation. Let X1,…,Xn∼i.i.d.N(μ,σ2) with σ2 unknown, and estimate σ2 by S2(n). Replacing σ by S(n) in the standardized mean gives
S(n)/nXˉ(n)−μ∼tn−1
exactly (not just approximately), because Xˉ(n) and S2(n) are independent under normality, with σ2(n−1)S2(n)∼χn−12. Hence
P(−tα/2,n−1≤S(n)/nXˉ(n)−μ≤tα/2,n−1)=1−α,
and rearranging as in Case 1 gives:
Conclusion. An exact 100(1−α)% confidence interval for μ is
[Xˉ(n)−tα/2,n−1nS(n),Xˉ(n)+tα/2,n−1nS(n)].
Comparison of the two intervals.
For every n and every α∈(0,1),
tα/2,n−1>zα/2,
because the tn−1 distribution has heavier tails than N(0,1). Consequently the t-interval is wider than the z-interval with the same S(n): the extra width is the price of estimating σ from the data rather than knowing it.
As n→∞, tn−1→N(0,1) and so tα/2,n−1↓zα/2; the two intervals coincide in the limit. In practice the difference is negligible for n≳30.
Which is “better” depends on what is known:
σ2 known (Case 1): use zα/2. The interval is narrower, but only approximately at level 1−α unless the population is normal.
σ2 unknown and population normal (Case 2): use tα/2,n−1. The interval is exactly at level 1−α; substituting zα/2 here would give an interval that is too narrow and under-covers μ, especially for small n.
2.6.2. Hypothesis Testing Concerning the Mean
Goal: determine whether a claim about μ is true or not.
Specify the significance level α: the maximum allowed type I error probability, P(reject H0∣H0 true)≤α.
Accept H0
Reject H0
H0 is true
correct
type I error
H1 is true
type II error
correct
Choose the test statistic and the rejection region.
For a normal population with σ2 unknown, use
tn=S(n)/nXˉ(n)−μ0,
which has a tn−1 distribution under H0. The rejection region is {∣tn∣>tα/2,n−1}, so that P(reject H0∣H0)=α.
Substitute the observed values into the test statistic and make the decision:
if ∣tn∣>tα/2,n−1, reject H0;
if ∣tn∣≤tα/2,n−1, do not reject H0.
Remark. Rejecting H0 is equivalent to μ0∈/[Xˉ(n)±tα/2,n−1S(n)/n], the CI from Case 2. If instead σ2 is known (Case 1), replace S(n) by σ and tα/2,n−1 by zα/2.