Basic Statistics and Probability Theory Based on Foundations of - - PowerPoint PPT Presentation

basic statistics and probability theory
SMART_READER_LITE
LIVE PREVIEW

Basic Statistics and Probability Theory Based on Foundations of - - PowerPoint PPT Presentation

0. Basic Statistics and Probability Theory Based on Foundations of Statistical NLP C. Manning & H. Sch utze, ch. 2, MIT Press, 2002 Probability theory is nothing but common sense reduced to calculation. Pierre Simon,


slide-1
SLIDE 1

Basic Statistics and Probability Theory

Based on “Foundations of Statistical NLP”

  • C. Manning & H. Sch¨

utze, ch. 2, MIT Press, 2002

“Probability theory is nothing but common sense reduced to calculation.” Pierre Simon, Marquis de Laplace (1749-1827)

0.

slide-2
SLIDE 2

PLAN

  • 1. Elementary Probability Notions:
  • Sample Space, Event Space, and Probability Function
  • Conditional Probability
  • Bayes’ Theorem
  • Independence of Probabilistic Events
  • 2. Random Variables:
  • Discrete Variables and Continuous Variables
  • Mean, Variance and Standard Deviation
  • Standard Distributions
  • Joint, Marginal and and Conditional Distributions
  • Independence of Random Variables

1.

slide-3
SLIDE 3

PLAN (cont’d)

  • 3. Limit Theorems
  • Laws of Large Numbers
  • Central Limit Theorems
  • 4. Estimating the parameters of probabilistic models from

data

  • Maximum Likelihood Estimation (MLE)
  • Maximum A Posteriori (MAP) Estimation
  • 5. Elementary Information Theory
  • Entropy; Conditional Entropy; Joint Entropy
  • Information Gain / Mutual Information
  • Cross-Entropy
  • Relative Entropy / Kullback-Leibler (KL) Divergence
  • Properties: bounds, chain rules, (non-)symmetries,

properties pertaining to independence

2.

slide-4
SLIDE 4
  • 1. Elementary Probability Notions
  • sample space: Ω (either discrete or continuous)
  • event: A ⊆ Ω

– the certain event: Ω – the impossible event: ∅ – elementary event: any {ω}, where ω ∈ Ω

  • event space: F = 2Ω (or a subspace of 2Ω that contains ∅ and is closed

under complement and countable union)

  • probability function/distribution: P : F → [0, 1] such that:

– P(Ω) = 1 – the “countable additivity” property: ∀A1, ..., Ak disjoint events, P(∪Ai) = P(Ai) Consequence: for a uniform distribution in a finite sample space: P(A) = #favorable elementary events #all elementary events

3.

slide-5
SLIDE 5

Conditional Probability

  • P(A | B) = P(A ∩ B)

P(B)

Note: P(A | B) is called the a posteriory probability of A, given B.

  • The “multiplication” rule:

P(A ∩ B) = P(A | B)P(B) = P(B | A)P(A)

  • The “chain” rule:

P(A1 ∩ A2 ∩ . . . ∩ An) = P(A1)P(A2 | A1)P(A3 | A1, A2) . . . P(An | A1, A2, . . . , An−1)

4.

slide-6
SLIDE 6
  • The “total probability” formula:

P(A) = P(A | B)P(B) + P(A | ¬B)P(¬B)

More generally: if A ⊆ ∪Bi and ∀i = j Bi ∩ Bj = ∅, then P(A) =

i P(A | Bi)P(Bi)

  • Bayes’ Theorem:

P(B | A) = P(A | B) P(B) P(A)

  • r P(B | A) =

P(A | B) P(B) P(A | B)P(B) + P(A | ¬B)P(¬B)

  • r ...

5.

slide-7
SLIDE 7

Independence of Probabilistic Events

  • Independent events: P(A ∩ B) = P(A)P(B)

Note: When P(B) = 0, the above definition is equivalent to P(A|B) = P(A).

  • Conditionally independent events:

P(A ∩ B | C) = P(A | C)P(B | C), assuming, of course, that P(C) = 0. Note: When P(B ∩ C) = 0, the above definition is equivalent to P(A|B, C) = P(A|C).

6.

slide-8
SLIDE 8
  • 2. Random Variables

2.1 Basic Definitions

Let Ω be a sample space, and P : 2Ω → [0, 1] a probability function.

  • A random variable of distribution P is a function

X : Ω → Rn

  • For now, let us consider n = 1.
  • The cumulative distribution function of X is F : R → [0, ∞) defined by

F(x) = P(X ≤ x) = P({ω ∈ Ω | X(ω) ≤ x})

7.

slide-9
SLIDE 9

2.2 Discrete Random Variables

Definition: Let P : 2Ω → [0, 1] be a probability function, and X be a random variable of distribution P.

  • If Val (X) is either finite or unfinite countable, then

X is called a discrete random variable.

  • For such a variable we define the probability mass function (pmf)

p : R → [0, 1] as p(x)

not.

= p(X = x)

def.

= P({ω ∈ Ω | X(ω) = x}). (Obviously, it follows that

xi∈V al(X) p(xi) = 1.)

Mean, Variance, and Standard Deviation:

  • Expectation / mean of X:

E(X)

not.

= E[X] =

x xp(x) if X is a discrete random variable.

  • Variance of X: Var(X)

not.

= Var[X] = E((X − E(X))2).

  • Standard deviation: σ =
  • Var(X).

Covariance of X and Y , two random variables of distribution P:

  • Cov(X, Y ) = E[(X − E[X])(Y − E[Y ])]

8.

slide-10
SLIDE 10

Exemplification:

  • the Binomial distribution: b(r; n, p) = Cr

n pr(1 − p)n−r for r = 0, . . . , n

mean: np, variance: np(1 − p)

  • the Bernoulli distribution: b(r; 1, p)

mean: p, variance: p(1 − p), entropy: −p log2 p − (1 − p) log2(1 − p)

10 20 30 40 0.00 0.05 0.10 0.15 0.20 0.25

r b(r ; n, p)

10 20 30 40 0.00 0.05 0.10 0.15 0.20 0.25

Binomial probability mass function

p = 0.5, n = 20 p = 0.7, n = 20 p = 0.5, n = 40 10 20 30 40 0.0 0.2 0.4 0.6 0.8 1.0

r F(r)

10 20 30 40 0.0 0.2 0.4 0.6 0.8 1.0

Binomial cumulative distribution function

p = 0.5, n = 20 p = 0.7, n = 20 p = 0.5, n = 40

9.

slide-11
SLIDE 11

2.3 Continuous Random Variables

Definitions: Let P : 2Ω → [0, 1] be a probability function, and X : Ω → R be a random variable of distribution P.

  • If Val (X) is unfinite non-countable set, and

F, the cumulative distribution function of X is continuous, then X is called a continuous random variable. (It follows, naturally, that P(X = x) = 0, for all x ∈ R.)

  • If there exists p : R → [0, ∞) such that F(x) =

x

−∞ p(t)dt,

then X is called absolutely continuous. In such a case, p is called the probability density function (pdf) of X.

  • For B ⊆ R for which
  • B p(x)dx exists, P(X−1(B)) =
  • B p(x)dx,

where X−1(B)

not.

= {ω ∈ Ω | X(ω) ∈ B}. In particular, +∞

−∞ p(x)dx = 1.

  • Expectation / mean of X: E(X)

not.

= E[X] =

  • xp(x)dx.

10.

slide-12
SLIDE 12

Exemplification:

  • Normal (Gaussean) distribution: N(x; µ, σ) =

1

√ 2πσe

−(x − µ)2

2σ2

mean: µ, variance: σ2

  • Standard Normal distribution: N(x; 0, 1)
  • Remark:

For n, p such that np(1 − p) > 5, the Binomial distributions can be approximated by Normal distributions.

11.

slide-13
SLIDE 13

−4 −2 2 4 0.0 0.2 0.4 0.6 0.8 1.0

x Nµ,σ2(X=x)

−4 −2 2 4 0.0 0.2 0.4 0.6 0.8 1.0

Gaussian probability density function

µ = 0, σ = 0.2 µ = 0, σ = 1.0 µ = 0, σ = 5.0 µ = −2, σ = 0.5 −4 −2 2 4 0.0 0.2 0.4 0.6 0.8 1.0

x φµ,σ2(x)

−4 −2 2 4 0.0 0.2 0.4 0.6 0.8 1.0

Gaussian cumulative distribution function

µ = 0, σ = 0.2 µ = 0, σ = 1.0 µ = 0, σ = 5.0 µ = −2, σ = 0.5

12.

slide-14
SLIDE 14

2.4 Basic Properties of Random Variables

Let P : 2Ω → [0, 1] be a probability function, X : Ω → Rn be a random discrete/continuous variable of distribution P.

  • If g : Rn → Rm is a function, then g(X) is a random variable.

If g(X) is discrete, then E(g(X)) =

x g(x)p(x).

If g(X) is continuous, then E(g(X)) =

  • g(x)p(x)dx.
  • If g is non-linear ⇒ E(g(X)) = g(E(X)).
  • E(aX) = aE(X).
  • E(X + Y ) = E(X) + E(Y ), therefore E[n

i=1 aiXi] = n i=1 aiE[Xi].

  • Var(aX) = a2Var(X).
  • Var(X + a) = Var(X).
  • Var(X) = E(X2) − E2(X).
  • Cov(X, Y ) = E[XY ] − E[X]E[Y ].

13.

slide-15
SLIDE 15

2.5 Joint, Marginal and Conditional Distributions

Exemplification for the bi-variate case: Let Ω be a sample space, P : 2Ω → [0, 1] a probability function, and V : Ω → R2 be a random variable of distribution P. One could naturally see V as a pair of two random variables X : Ω → R and Y : Ω → R. (More precisely, V (ω) = (x, y) = (X(ω), Y (ω)).)

  • the joint pmf/pdf of X and Y is defined by

p(x, y)

not.

= pX,Y (x, y) = P(X = x, Y = y) = P(ω ∈ Ω | X(ω) = x, Y (ω) = y).

  • the marginal pmf/pdf functions of X and Y are:

for the discrete case: pX(x) =

y p(x, y),

pY (y) =

x p(x, y)

for the continuous case: pX(x) =

  • y p(x, y) dy,

pY (y) =

  • x p(x, y) dx
  • the conditional pmf/pdf of X given Y is:

pX|Y (x | y) = pX,Y (x, y) pY (y)

14.

slide-16
SLIDE 16

2.6 Independence of Random Variables

Definitions:

  • Let X, Y be random variables of the same type (i.e. either discrete or

continuous), and pX,Y their joint pmf/pdf. X and Y are said to be independent if pX,Y (x, y) = pX(x) · pY (y) for all possible values x and y of X and Y respectively.

  • Similarly, let X, Y and Z be random variables of the same type, and p

their joint pmf/pdf. X and Y are conditionally independent given Z if pX,Y |Z(x, y | z) = pX|Z(x | z) · pY |Z(y | z) for all possible values x, y and z of X, Y and Z respectively.

15.

slide-17
SLIDE 17

Properties of random variables pertaining to independence

  • If X, Y are independent, then

Var(X + Y ) = Var(X) + Var(Y ).

  • If X, Y are independent, then

E(XY ) = E(X)E(Y ), i.e. Cov(X, Y ) = 0.

  • Cov(X, Y ) = 0 ⇒ X, Y are independent.
  • The covariance matrix corresponding to a vector of random variables

is symmetric and positive semi-definite.

  • If the covariance matrix of a multi-variate Gaussian distribution is

diagonal, then the marginal distributions are independent.

16.

slide-18
SLIDE 18
  • 3. Limit Theorems

[ Sheldon Ross, A first course in probability, 5th ed., 1998 ] “The most important results in probability theory are limit theo-

  • rems. Of these, the most important are...

laws of large numbers, concerned with stating conditions under which the average of a sequence of random variables converges (in some sense) to the expected average; central limit theorems, concerned with determining the conditions under which the sum of a large number of random variables has a probability distribution that is approximately normal.”

17.

slide-19
SLIDE 19

Two Probability Bounds

Markov’s inequality:

If X is a random variable that takes only non-negative values, then for any value a > 0, P(X ≥ a) ≤ E[X] a

Chebyshev’s inequality:

If X is a random variable with finite mean µ and variance σ2, then for any value a > 0, P(| X − µ |≥ a) ≤ σ2 a2 . Note: As Chebyshev’s inequality is valid for all distributions of the random variable X, we cannot expect the bound of the probability to be very close to the actual probability in most cases. (See ex. 2b, pag. 397 in Ross’ book.)

18.

slide-20
SLIDE 20

The weak law of large numbers

[ Bernoulli; Khintchine ]

Let X1, X2, . . . , Xn be a sequence of independent and identically distributed random variables, each having a finite mean E[Xi] = µ. Then, for any value ǫ > 0, P

  • X1 + . . . + Xn

n − µ

  • ≥ ǫ
  • → 0 as n → ∞.

19.

slide-21
SLIDE 21

The central limit theorem for i.i.d. random variables

[ Pierre Simon, Marquis de Laplace; Liapunoff in 1901-1902 ] Let X1, X2, . . . , Xn be a sequence of independent random variables, each having finite mean µ and finite variance σ2. Then the distribution of X1 + . . . + Xn − nµ σ √n tends to be the standard normal (Gaussian) as n → ∞. That is, for −∞ < a < ∞, P X1 + . . . + Xn − nµ σ √n ≤ a

1 √ 2π a

−∞

e−x2/2dx as n → ∞

20.

slide-22
SLIDE 22

The central limit theorem for independent random variables

Let X1, X2, . . . , Xn be a sequence of independent random variables having respective means µi and variances σ2

i .

If (a) the variables Xi are uniformly bounded, i.e. for some M ∈ R+ P(| Xi |< M) = 1 for all i, and (b) ∞

i=1 σ2 i = ∞,

then P n

i=1(Xi − µi)

n

i=1 σ2 i

≤ a

  • → Φ(a) as n → ∞

where Φ is the cumulative distribution function for the standard normal (Gaussian) distribution.

21.

slide-23
SLIDE 23

The strong law of large numbers

Let X1, X2, . . . , Xn be a sequence of independent and identically distributed random variables, each having a finite mean E[Xi] = µ. Then, with probability 1, X1 + . . . + Xn n → µ as n → ∞ That is, P

  • lim

n→∞(X1 + . . . + Xn)/n = µ

  • = 1

22.

slide-24
SLIDE 24

Other Probability Bounds

One-sided Chebyshev inequality: If X is a random variable with mean 0 and finite variance σ2, then for any a > 0, P(X ≥ a) ≤ σ2 σ2 + a2 Corollary: If E[X] = µ, Var(X) = σ2, then for a > 0 P(X ≥ µ + a) ≤ σ2 σ2 + a2 P(X ≤ µ − a) ≤ σ2 σ2 + a2

23.

slide-25
SLIDE 25

Other Probability Bounds (cont’d)

Chernoff bounds: If X is a random variable, then M(t)

not

= E[etX], is called the moment generating function of X. It can be shown that P(X ≥ a) ≤ e−taM(t) for all t > 0 P(X ≤ a) ≤ e−taM(t) for all t < 0. Chernoff bounds for the standard normal distribution: If Z is a standard normal random variable, then M(t)

not.

= E[etX]

calculus

= et2/2. It can be shown that P(Z ≥ a) ≤ e−a2/2 for all a > 0 P(Z ≤ a) ≤ e−a2/2 for all a < 0.

24.

slide-26
SLIDE 26

Other Probability Bounds (cont’d)

Hoeffding bounds: Let X1, . . . , Xn be some independent random variables, each Xi being bounded by the interval [ai, bi]. If ¯ X

not.

=

1 n

n

i=1 Xi, then it follows that

for any t ≥ 0 P( ¯ X − E[ ¯ X] ≥ t) ≤ exp

2n2t2 n

i=1 (bi − ai)2

  • P(E[ ¯

X] − ¯ X ≥ t) ≤ exp

2n2t2 n

i=1(bi − ai)2

  • ⇒ P(| ¯

X − E[ ¯ X]| ≥ t) ≤ 2 exp

2n2t2 n

i=1(bi − ai)2

  • .

25.

slide-27
SLIDE 27
  • 4. Estimation/inference of the parameters of

probabilistic models from data

(based on [Durbin et al, Biological Sequence Analysis, 1998],

  • p. 311-313, 319-321)

A probabilistic model can be anything from a simple distribution to a complex stochastic grammar with many implicit probability

  • distributions. Once the type of the model is chosen, the parame-

ters have to be inferred from data. We will first consider the case of the categorical distribution, and then we will present the different strategies that can be used in general.

26.

slide-28
SLIDE 28

A case study: Estimation of the parameters of a categorical distribution from data

Assume that the observations — for example, when rolling a die about which we don’t know whether it is fair or not, or when counting the number

  • f times the amino acid i occurs in a column of a multiple sequence align-

ment — can be expressed as counts ni for each outcome i (i = 1, l . . . , K), and we want to estimate the probabilities θi of the underlying distribution.

Case 1:

When we have plenty of data, it is natural to use the maximum likeli-

hood (ML) solution, i.e. the observed frequency θML

i

= ni

  • j nj

not.

= ni N . Note: it is easy to show that indeed P(n | θML) > P(n | θ) for any θ = θML.

ln P(n | θML) P(n | θ) = ln Πi(θML

i

)ni Πiθni

i

=

  • i

ni ln θML

i

θi = N

  • i

θML

i

ln θML

i

θi > 0

The inequality follows from the fact that the relative entropy is always positive except when the two distributions are identical.

27.

slide-29
SLIDE 29

Case 2:

When the data is scarce, it is not clear what is the best estimate. In general, we should use prior knowledge, via Bayesian statistics. For instance, one can use the Dirichlet distribution with parameters α.

P(θ | n) = P(n | θ)D(θ | α) P(n)

It can be shown (see calculus on R. Durbin et. al. BSA book, pag. 320) that the posterior mean estimation (PME) of the parameters is θPME

i def.

=

  • θP(θ | n)dθ =

ni + αi N +

j αj

The α′s are like pseudocounts added to the real counts. (If we think of the α′s as extra observations added to the real ones, this is precisely the ML estimate!) This makes the Dirichlet regulariser very intuitive. How to use the pseudocounts: If it is fairly obvious that a certain residue, let’s say i, is very common, than we should give it a very high pseudocount αi; if the residue j is generaly rare, we should give it a low pseudocount.

28.

slide-30
SLIDE 30

Strategies to be used in the general case

  • A. The Maximum Likelihood (ML) Estimate

When we wish to infer the parameters θ = (θi) for a model M from a set

  • f data D, the most obvious strategy is to maximise P(D | θ, M) over all

possible values of θ. Formally: θML = argmax

θ

P(D | θ, M) Note: Generally speaking, when we treat P(x | y) as a function of x (and y is fixed), we refer to it as a probability. When we treat P(x | y) as a function of y (and x is fixed), we call it a likelihood. Note that a likelihood is not a probability distribution or density; it is simply a function of the variable y. A serious drawback of maximum likelihood is that it gives poor results when data is scarce. The solution then is to introduce more prior knowl- edge, using Bayes’ theorem. (In the Bayesian framework, the parameters are themselves seen as random variables!)

29.

slide-31
SLIDE 31
  • B. The Maximum A posteriori Probability (MAP) Estimate

θMAP

def.

= argmax

θ

P(θ | D, M) = argmax

θ

P(D | θ, M)P(θ | M) P(D | M) = argmax

θ

P(D | θ, M)P(θ | M)

The prior probability P(θ | M) has to be chosen in some reasonable manner, and this is the art of Bayesian estimation (although this freedom to choose a prior has made Bayesian statistics controversial at times...).

  • C. The Posterior Mean Estimator (PME)

θPME =

  • θP(θ | D, M)dθ

where the integral is over all probability vectors, i.e. all those that sum to

  • ne.
  • D. Yet another solution is to use the posterior probability P(θ | D, M) to

sample from it (see [Durbin et al, 1998], section 11.4) and thereby locate

regions of high probability for the model parameters.

30.

slide-32
SLIDE 32
  • 5. Elementary Information Theory

Definitions:

Let X and Y be discrete random variables.

  • Entropy:

H(X)

def.

=

  • x p(x) log2

1 p(x) = −

x p(x) log2 p(x)

= Ep[− log2 p(X)].

Convention: if p(x) = 0 then we shall consider p(x) log2 p(x) = 0.

  • Specific Conditional entropy: H(Y | X = x)

def.

= −

y∈Y p(y | x) log2 p(y |

x).

  • Average conditional entropy:

H(Y | X)

def.

=

x∈X p(x)H(Y | X = x) imed.

= −

x∈X

  • y∈Y p(x, y) log2 p(y | x).
  • Joint entropy:

H(X, Y )

def.

= −

x,y p(x, y) log2 p(x, y) dem.

= H(X)+H(Y |X)

dem.

= H(Y )+H(X |Y ).

  • Information gain (or: Mutual information):

IG(X; Y )

def.

= H(X) − H(X | Y )

imed.

= H(Y ) − H(Y | X)

imed.

= H(X, Y ) − H(X | Y ) − H(Y | X) = IG(Y ; X).

31.

slide-33
SLIDE 33

Exemplification: Entropy of a Bernoulli Distribution

H(p) = −p log2 p − (1 − p) log2(1 − p)

0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0

p

0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0

32.

slide-34
SLIDE 34

Basic properties of Entropy, Conditional Entropy, Joint Entropy and Information Gain / Mutual Information

  • 0 ≤ H(p1, . . . , pn) ≤ H

1 n, . . . , 1 n

  • = log2 n;

H(X) = 0 iff X is a constant random variable.

  • IG(X; Y ) ≥ 0;

IG(X; Y ) = 0 iff X and Y are independent; IG(X; X) = H(X).

  • H(X | Y ) ≤ H(X)

H(X | Y ) = H(X) iff X and Y are independent.

  • H(X, Y ) ≤ H(X) + H(Y );

H(X, Y ) = H(X) + H(Y ) iff X and Y are independent; H(X, Y |A) = H(X|A) + H(Y |A) (a conditional form).

  • a chain rule: H(X1, . . . , Xn) = H(X1)+H(X2|X1)+. . .+H(Xn|X1, . . . , Xn−1).

33.

slide-35
SLIDE 35

The Relationship between Entropy, Conditional Entropy, Joint Entropy and Information Gain

H(X|Y) H(Y|X) H(X,Y) H(X) H(Y)

IG(X;Y)

34.

slide-36
SLIDE 36

Other definitions

  • Let X be a discrete random variable, p its pmf and q another pmf

(usually a model of p). Cross-entropy: CH(X, q) = −

  • x∈X

p(x) log2 q(x) = Ep

  • log2

1 q(X)

  • Let X and Y be discrete random variables, and p and q their respective

pmf’s. Relative entropy (or, Kullback-Leibler divergence): KL(p || q) = −

  • x∈X

p(x) log2 q(x) p(x) = Ep

  • log2

p(X) q(X)

  • =

CH(X, q) − H(X).

35.

slide-37
SLIDE 37

The Relationship between Entropy, Conditional Entropy, Joint Entropy, Information Gain,

Cross-Entropy and Relative Entropy (or KL divergence)

X

H(p ) CH(X, p )

Y

CH(Y, p )

X X

KL(p || p )

Y Y

H(p )

Y

KL(p || p )

X

H(X|Y) H(Y|X) H(X,Y)

Y XY X

IG(X,Y) = KL(p || p p )

36.

slide-38
SLIDE 38

Basic properties of cross-entropy and relative entropy

  • CH(X, q) ≥ 0
  • KL(p || q) ≥ 0 for all p and q;

KL(p || q) = 0 iff p and q are identical.

  • [Consequence:]

If X is a discrete random variable, p its pmf, and q another pmf, then CH(X, q) ≥ H(X) ≥ 0. The first of these two inequations is also known as Gibbs’ inequation: − n

i=1 pi log2 pi ≤ − i pi log2 qi.

  • Unlike H of a discrete n-ary variable, which is bounded by log2 n, there

is no (general) upper bound for CH. (However, KL is upper-bounded.)

  • Unlike H(X, Y ), which is symmetric in its arguments, CH and KL are

not! Therefore KL is NOT a distance metric! (See the next slide.)

  • IG(X; Y ) = KL(pX,Y || pX pY ) = −

x

  • y p(x, y) log2

p(x)p(y) p(x, y)

  • .

37.

slide-39
SLIDE 39

Remark

  • The quantity

V I(X, Y )

def

= H(X, Y ) − IG(X; Y ) = H(X) + H(Y ) − 2IG(X; Y ) = H(X | Y ) + H(Y | X) known as variation of information, is a distance metric, i.e. it is nonengative, symmetric, implies indiscernability, and satisfies the tri- angle inequality.

  • Consider M(p, q) = 1

2(p + q). The function JSD(p||q) = 1 2KL(p||M) + 1 2KL(q||M) is called the Jensen- Shannon divergence. One can prove that

  • JSD(p||q) defines a distance metric (the Jensen-

Shannon distance).

38.

slide-40
SLIDE 40
  • 6. Recommended Exercises
  • From [Manning & Sch¨

utze, 2002 , ch. 2:] Examples 1, 2, 4, 5, 7, 8, 9 Exercises 2.1, 2.3, 2.4, 2.5

  • From [Sheldon Ross, 1998 , ch. 8:]

Examples 2a, 2b, 3a, 3b, 3c, 5a, 5b

39.

slide-41
SLIDE 41

Addenda: Other Examples of Probabilistic Distributions

40.

slide-42
SLIDE 42

Multinomial distribution:

generalises the binomial distribution to the case where there are K inde- pendent outcomes with probabilities θi, i = 1, . . . , K such that K

i=1 θi = 1.

The probability of getting ni occurrence of outcome i is given by P(n | θ) = n! ΠK

i=1(ni!)ΠK i=1θni i ,

where n = n1 + . . . + nK, and θ = (θ1, . . . , θK).

Note: The particular case n = 1 represents the categorical distribu-

  • tion. This is a generalisation of the Bernoulli distribution.

Example: The outcome of rolling a die n times is described by a categor-

ical distribution. The probabilities of each of the 6 outcomes are θ1, . . . , θ6. For a fair die, θ1 = . . . = θ6, and the probability of rolling it 12 times and getting each outcome twice is: 12! (2!)6 1 6 12 = 3.4 × 10−3

41.

slide-43
SLIDE 43

Poisson distribution (or, Poisson law of small numbers):

p(k; λ) = λk k! · e−λ, with k ∈ N and parameter λ > 0. Mean = variance = λ.

5 10 15 20 0.0 0.1 0.2 0.3 0.4 k P(X=k) 5 10 15 20 0.0 0.1 0.2 0.3 0.4

Poisson probability mass function λ = 1 λ = 4 λ = 10

5 10 15 20 0.0 0.2 0.4 0.6 0.8 1.0 k P(X ≤ k) 5 10 15 20 0.0 0.2 0.4 0.6 0.8 1.0

Poisson cumulative distribution function λ = 1 λ = 4 λ = 10

42.

slide-44
SLIDE 44

Exponential distribution (a.k.a. negative exponential distribution):

p(x; λ) = λe−λx for x ≥ 0 and parameter λ > 0. Mean = λ−1, variance = λ−2.

1 2 3 4 5 0.0 0.5 1.0 1.5

x p(x)

1 2 3 4 5 0.0 0.5 1.0 1.5

Exponential probability density function

λ = 0.5 λ = 1 λ = 1.5

1 2 3 4 5 0.0 0.2 0.4 0.6 0.8 1.0

x P(X ≤ x)

1 2 3 4 5 0.0 0.2 0.4 0.6 0.8 1.0

Exponential cumulative distribution function

λ = 0.5 λ = 1 λ = 1.5

Note: The Exponential distribution is a particular case of the Gamma distribution (take k = 1 in the next slide).

43.

slide-45
SLIDE 45

Gamma distribution:

p(x; k, θ) = xk−1 e−x/θ Γ(k)θk for x ≥ 0 and parameters k > 0 (shape) and θ > 0 (scale). Mean = kθ, variance = kθ2. The gamma function is a generalisation of the factorial function to real values. For any positive real number x, Γ(x + 1) = xΓ(x). (Thus, for integers Γ(n) = (n − 1)!.)

5 10 15 20 0.0 0.1 0.2 0.3 0.4 0.5

x p(x)

5 10 15 20 0.0 0.1 0.2 0.3 0.4 0.5

Gamma probability density function

k = 1.0, θ = 2.0 k = 2.0, θ = 2.0 k = 3.0, θ = 2.0 k = 5.0, θ = 1.0 k = 9.0, θ = 0.5 k = 7.5, θ = 1.0 k = 0.5, θ = 1.0

5 10 15 20 0.0 0.2 0.4 0.6 0.8 1.0

x P(X ≤ x)

5 10 15 20 0.0 0.2 0.4 0.6 0.8 1.0

Gamma cumulative distribution function

k = 1.0, θ = 2.0 k = 2.0, θ = 2.0 k = 3.0, θ = 2.0 k = 5.0, θ = 1.0 k = 9.0, θ = 0.5 k = 7.5, θ = 1.0 k = 0.5, θ = 1.0

44.

slide-46
SLIDE 46

χ2 distribution:

p(x; ν) = 1 Γ(ν/2) 1 2 ν/2 xν/2−1e− 1

2 x for x ≥ 0 and ν a positive integer.

It is obtained from Gamma distribution by taking k = ν/2 and θ = 2. Mean = ν, variance = 2ν.

2 4 6 8 0.0 0.1 0.2 0.3 0.4 0.5

x p(x)

2 4 6 8 0.0 0.1 0.2 0.3 0.4 0.5

Chi Squared probability density function

k = 1 k = 2 k = 3 k = 4 k = 6 k = 9

2 4 6 8 0.0 0.2 0.4 0.6 0.8 1.0

x P(X ≤ x)

2 4 6 8 0.0 0.2 0.4 0.6 0.8 1.0

Chi Squared cumulative distribution function

k = 1 k = 2 k = 3 k = 4 k = 6 k = 9

45.

slide-47
SLIDE 47

Laplace distribution:

p(x; µ, θ) = 1 2θe

−|µ − x|

θ , with θ > 0. Mean = µ, variance = 2θ2.

−10 −5 5 10 0.0 0.1 0.2 0.3 0.4 0.5

x p(x)

−10 −5 5 10 0.0 0.1 0.2 0.3 0.4 0.5

Laplace probability density function

µ = 0, θ = 1 µ = 0, θ = 2 µ = 0, θ = 4 µ = −5, θ = 4

−10 −5 5 10 0.0 0.2 0.4 0.6 0.8 1.0

x P(X ≤ x)

−10 −5 5 10 0.0 0.2 0.4 0.6 0.8 1.0

Laplace cumulative density function

µ = 0, θ = 1 µ = 0, θ = 2 µ = 0, θ = 4 µ = −5, θ = 4

46.

slide-48
SLIDE 48

Student’s distribution:

p(x; ν) = Γ ν + 1 2

  • √νπ Γ

ν 2

  • 1 + x2

ν −ν + 1 2 for x ∈ R and ν > 0 (the “degree of freedom” param.) Mean = 0 for ν > 1, otherwise undefined. Variance = ν ν − 2 for ν > 2, ∞ for 1 < ν ≤ 2, otherwise undefined. The probability density function and the cumulative distribution function:

Note [from Wiki]: The t-distribution is symmetric and bell-shaped, like the normal distribution, but it has havier tails, meaning that it is more prone to producing values that fall far from its mean.

47.

slide-49
SLIDE 49

Beta distribution:

p(θ; α, β) = θα−1(1 − θ)β−1 B(α, β) , where B(α, β) is the Beta function

  • f arguments α, β ∈ R+

B(α, β) = Γ(α)Γ(β) Γ(α + β) , with Γ(x) = (x − 1)! for any x ∈ N∗.

Beta distribution: p.d.f.

48.

slide-50
SLIDE 50

Dirichlet distribution:

D(θ | α) = 1 Z(α)ΠK

i=1θαi−1 i

δ(K

i=1 θi − 1)

where α = α1, . . . , αK with αi > 0 are the parameters, θi satisfy 0 ≤ θi ≤ 1 and sum to 1, this being indicated by the delta function term δ(

i θi − 1), and

the normalising factor can be expressed in terms of the gamma function: Z(α) =

  • ΠK

i=1θαi−1 i

δ(

i −1)dθ = ΠiΓ(αi)

Γ(

i αi)

Mean of θi: αi

  • j αj

. For K = 2, the Dirichlet distribution reduces to the Beta distribution.

49.

slide-51
SLIDE 51

Remark:

Concerning the multinomial and Dirichlet distributions:

The algebraic expression for the parameters θi is similar in the two distri- butions. However, the multinomial is a distribution over its exponents ni, whereas the Dirichlet is a distribution over the numbers θi that are exponentiated. The two distributions are said to be conjugate distributions and their close formal relationship leads to a harmonious interplay in many estima- tion problems. Similarly, the Beta distribution is the conjugate of the Bernoulli distribution, and the Gamma distribution is the conjugate of the Poisson distribution.

50.