Theory 1 - Binary testing, MAP and ML

Binary hypothesis test

Ingredients of a binary hypothesis test:

  • H0 and H1 — Complementary hypotheses
    • Maybe also know the prior probabilities P[H0] and P[H1]
    • Goal: determine which case we are in, H0 or H1
  • A0 and A1 — Complementary events of the Decision Rule
    • Directionality: given H0, A0 is likely; given H1, A1 is likely
    • Decision Rule: outcome A0, accept H0; outcome A1, accept H1
    • Usually: Ai written in terms of decision statistic X using a design
    • We cover three designs:
      • MAP and ML (minimize ‘error probability’)
      • MC (minimizes ‘error cost’)
    • Designs use PX|H0 and PX|H1 (or fX|H0, fX|H1) to construct A0 and A1

MAP design

Suppose we know:

  • P[H0] and P[H1]
    • Both prior probabilities
  • PX|H0(x) and PX|H1(x) (or fX|H0(x) and fX|H1(x))
    • Both conditional distributions

The maximum a posteriori probability (MAP) design for a decision statistic X:

A0=set of x for which:

Discrete case:

PX|H0(x)P[H0]PX|H1(x)P[H1]

Continuous case:

fX|H0(x)P[H0]fX|H1(x)P[H1]

And A1={x|xA0}.

The MAP design minimizes the total probability of error.

ML design

Suppose we don’t know the priors, we know only:

  • PX|H0(x) and PX|H1(x) (or fX|H0(x) and fX|H1(x))
    • Both conditional distributions

The maximum likelihood (ML) design for X:

A0=set of x for which:PX|H0(x)PX|H1(x)(discrete)fX|H0(x)fX|H1(x)(continuous)

ML is a simplified version of MAP. (Set P[H0] and P[H1] to 0.5.)


The false alarm error rate is called PFA. The miss error rate is called PMiss.

PFA=P[A1|H0]PMiss=P[A0|H1]

Total probability of error:

PERR=P[A1|H0]P[H0]+P[A0|H1]P[H1]

Wrong meanings of PFA

Suppose A1 sets off a smoke alarm, and H0 is ‘no fire’ and H1 is ‘yes fire’.

Then PFA is the odds that we get an alarm assuming there is no fire.

This is not the odds of experiencing a false alarm (no context). That would be P[A1H0].

This is not the odds of a given alarm being a false one. That would be P[H0|A1].

Theory 2 - MAP criterion proof

Explanation of MAP criterion - discrete case

First, we show that the MAP design selects for A0 all those x which render H0 more likely than H1. This will be used in the next step to show that MAP minimizes probability of error.

Observe this calculation:

P[Hi|X=x]=P[X=x|Hi]P[Hi]P[X](Bayes’ Rule)=PX|Hi(x)P[Hi]P[X](Conditional PMF)

Recall the MAP criterion:

PX|H0(x)P[H0]PX|H1(x)P[H1]

Divide both sides by P[X] and apply the above Calculation in reverse:

P[H0|X=x]P[H1|X=x]

This is what we sought to prove.


Next, we verify that the MAP design minimizes the total probability of error.

The total probability of error is:

PERR=P[A1|H0]P[H0]+P[A0|H1]P[H1]

Expand this with summation notation (assuming the discrete case):

xA1PX|H0(x)P[H0]+xA0PX|H1(x)P[H1]

Now, how do we choose the set A0 (and thus A1=A0c) in such a way that this sum is minimized?

Since all terms are positive, and any x may be placed in A1 or in A0 freely and independently of all other choices, the total sum is minimized when we minimize the impact of placing each x.

So, for each x, we place it in A0 if:

PX|H0(x)P[H0]PX|H1(x)P[H1]

That is equivalent to the MAP criterion.

Theory 3 - MC design

  • Write C10 for cost of false alarm, i.e. cost when H0 is true but decided H1.
    • Probability of incurring cost C10 is PFAP[H0].
  • Write C01 for cost of miss, i.e. cost when H1 is true but decided H0.
    • Probability of incurring cost C01 is PMissP[H1].

Expected value of cost incurred

E[C]=P[A1|H0]P[H0]C10+P[A0|H1]P[H1]C01

MC design

Suppose we know:

  • Both prior probabilities P[H0] and P[H1]
  • Both conditional distributions PX|H0(x) and PX|H1(x) (or fX|H0(x) and fX|H1(x))

The minimum cost (MC) design for a decision statistic X:

A0=set of x for which:

Discrete case:

PX|H0(x)P[H0]C10PX|H1(x)P[H1]C01

Continuous case:

fX|H0(x)P[H0]C10fX|H1(x)P[H1]C01

Then A1={x|xA0}.

The MC design minimizes the expected value of the cost of error.

MC minimizes expected cost

Inside the argument that MAP minimizes total probability of error, we have this summation:

PERR=xA1PX|H0(x)P[H0]+xA0PX|H1(x)P[H1]

The expected value of the cost has a similar summation:

E[C]=xA1PX|H0(x)P[H0]C10+xA0PX|H1(x)P[H1]C01

Following the same reasoning, we see that the cost is minimized if each x is placed into A0 precisely when the MC design condition is satisfied, and otherwise it is placed into A1.