elec 303 – random signals
DESCRIPTION
ELEC 303 – Random Signals. Lecture 17 – Hypothesis testing 2 Dr. Farinaz Koushanfar ECE Dept., Rice University Nov 2, 2009. outline. Reading: 8.2,9.3 Bayesian Hypothesis testing Likelihood Hypothesis testing. Four versions of MAP rule. discrete, X discrete discrete, X continuous - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/1.jpg)
ELEC 303 – Random Signals
Lecture 17 – Hypothesis testing 2Dr. Farinaz Koushanfar
ECE Dept., Rice UniversityNov 2, 2009
![Page 2: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/2.jpg)
outline
• Reading: 8.2,9.3• Bayesian Hypothesis testing• Likelihood Hypothesis testing
![Page 3: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/3.jpg)
Four versions of MAP rule
• discrete, X discrete
• discrete, X continuous
• continuous, X discrete
• continuous, X continuous
)|x(p)(p |X
)|x(f)(p |X
)|x(p)(f |X
)|x(f)(f |X
![Page 4: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/4.jpg)
Example – spam filter
• Email may be spam or legitimate• Parameter , taking values 1,2, corresponding to
spam/legitimate, prob p(1), P(2) given• Let 1,…, n be a collection of special words,
whose appearance suggests a spam• For each i, let Xi be the Bernoulli RV that denotes
the appearance of i in the message• Assume that the conditional prob are known• Use the MAP rule to decide if spam or not.
![Page 5: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/5.jpg)
Bayesian Hypothesis testing• Binary hypothesis: two cases• Once the value x of X is observed, Use the Bayes
rule to calculate the posterior P|X(|x)• Select the hypothesis with the larger posterior• If gMAP(x) is the selected hypothesis, the correct
decision’s probability is P(= gMAP(x)|X=x)• If Si is set of all x in the MAP, the overall
probability of correct decision is P(= gMAP(x))=i P(=i,XSi)
• The probability of error is: i P(i,XSi)
![Page 6: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/6.jpg)
Multiple hypothesis
![Page 7: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/7.jpg)
Example – biased coin, single toss
• Two biased coins, with head prob. p1 and p2
• Randomly select a coin and infer its identity based on a single toss
• =1 (Hypothesis 1), =2 (Hypothesis 2) • X=0 (tail), X=1(head)• MAP compares P(1)PX|(x|1) ? P(2)PX|(x|2)• Compare PX|(x|1) and PX|(x|2) (WHY?)• E.g., p1=.46 and p2 =.52, and the outcome tail
![Page 8: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/8.jpg)
Example – biased coin, multiple tosses
• Assume that we toss the selected coin n times• Let X be the number of heads obtained• ?
![Page 9: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/9.jpg)
Example – signal detection and matched filter
• A transmitter sending two messages =1,=2• Massages expanded: – If =1, S=(a1,a2,…,an), if =2, S=(b1,b2,…,bn)
• The receiver observes the signal with corrupted noise: Xi=Si+Wi, i=1,…,n
• Assume WiN(0,1)
![Page 10: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/10.jpg)
Likelihood Approach to Binary Hypothesis Testing
![Page 11: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/11.jpg)
BHT and Associated Error
![Page 12: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/12.jpg)
Likelihood Approach to BHT (Cont’d)
![Page 13: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/13.jpg)
Likelihood Approach to BHT (Cont’d)
![Page 14: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/14.jpg)
Binary hypothesis testing
• H0: null hypothesis, H1: alternative hypothesis
• Observation vector X=(X1,…,Xn)
• The distribution of the elements of X depend on the hypothesis
• P(XA;Hj) denotes the probability that X belongs to a set A, when Hj is true
![Page 15: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/15.jpg)
Rejection/acceptance
• A decision rule:– A partition of the set of all possible values of the
observation vector in two subsets: “rejection region” and “acceptance region”
• 2 possible errors for a rejection region:– Type I error (false rejection): Reject H0, even
though H0 is true
– Type II error (false acceptance): Accept H0, even though H0 is false
![Page 16: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/16.jpg)
Probability of regions
• False rejection:– Happens with probability
(R) = P(XR; H0)
• False acceptance:– Happens with probability
(R) = P(XR; H1)
![Page 17: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/17.jpg)
Analogy with Bayesian
• Assume that we have two hypothesis =0 and =1, with priors p(0) and p(1)
• The overall probability of error is minimized using the MAP rule:– Given observations x of X, =1 is true if– p(0) pX|(x|0) < p(1) pX|(x|1) – Define: = p(0) / p(1)– L(x) = pX|(x|1) / pX|(x|0)
• =1 is true if the observed values of x satisfy the inequality: L(x)>
![Page 18: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/18.jpg)
More on testing
• Motivated by the MAP rule, the rejection region has the form R={x|L(x)>}
• The likelihood ratio test– Discrete:
L(x)= pX(x;H1) / pX(x;H0)
– Continuous:L(x) = fX(x;H1) / fX(x;H0)
![Page 19: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/19.jpg)
Example
• Six sided die• Two hypothesis
• Find the likelihood ratio test (LRT) and probability of error
![Page 20: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/20.jpg)
Error probabilities for LRT
• Choosing trade-offs between the two error types, as increases, the rejection region becomes smaller– The false rejection probability (R) decreases – The false acceptance probability (R) increases
![Page 21: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/21.jpg)
LRT
• Start with a target value for the false rejection probability
• Choose a value such that the false rejection probability is equal to :
P(L(X) > ; H0) =
• Once the value x of X is observed, reject H0 if L(x) >
• The choices for are 0.1, 0.05, and 0.01
![Page 22: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/22.jpg)
Requirements for LRT
• Ability to compute L(x) for observations X• Compare the L(x) with the critical value • Either use the closed form for L(x) (or log L(x))
or use simulations to approximate
![Page 23: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/23.jpg)
Example
• A camera checking a certain area• Recording the detection signal• X=W, and X=1+W depending on the presence
of the intruders (hypothesis H0 and H1)
• Assume W~N(0,)• Find the LRT and acceptance/rejection region
![Page 24: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/24.jpg)
Example
![Page 25: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/25.jpg)
Example
![Page 26: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/26.jpg)
Example
![Page 27: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/27.jpg)
Example (Cont’d)
![Page 28: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/28.jpg)
Example (Cont’d)
![Page 29: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/29.jpg)
Error Probabilities
![Page 30: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/30.jpg)
Example: Binary Channel
![Page 31: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/31.jpg)
Example: Binary Channel
![Page 32: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/32.jpg)
Example: Binary Channel
![Page 33: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/33.jpg)
Example: More on BHT
![Page 34: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/34.jpg)
Example: More on BHT
![Page 35: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/35.jpg)
Example: More on BHT
![Page 36: ELEC 303 – Random Signals](https://reader036.vdocument.in/reader036/viewer/2022062810/56815a6d550346895dc7c9b8/html5/thumbnails/36.jpg)
Example: More on BHT