Assignment 2
Assignment 2
All questions carry equal marks but are not equally difficult, so you may want to strategize accordingly.
Problem 1 In this problem, we will empirically verify the ROC curve and the Bayes risk. Consider the
following hypothesis problem: H0 : Y ∼ N (0, 1) versus H1 : Y ∼ N (m, 1). Assume uniform costs and the
priors are given by P0 and P1 .
(a) Compute the Bayes test. Also specify the expressions of PD , PF and the Bayes risk J in terms of the SNR
parameter d.
(b) Consider three different values of P0 = {0.1, 0.25, 0.4} and different values of d = {0, 0.1, 0.2, · · · , 2}. For
each value of P0 and d, generate 105 random observation points Y according to the appropriate prior and
conditional distributions (you can use Matlab functions for this). Perform the Bayes test on the observations
and compute the empirical Bayes risk by averaging the risks over all the observations.
(c) Plot the theoretical Bayes risk as a continuous function of d ∈ [0, 2]. In the same figure, mark discrete
points (in different color) corresponding to the empirical Bayes risk for d = {0, 0.1, 0.2, · · · , 2}. Repeat the
same exercise in the same figure for all three values of P0 = {0.1, 0.25, 0.4}. Comment on what you observe.
1
(d) For each value of d = {1, 2, 3}, plot the theoretical ROC curve. On the same curve, mark discrete points
(in different color) corresponding to empirical values of PD and PF for each value of P0 = {0.1, 0.25, 0.4}.
Comment on what you observe.
(e) You will have to also submit the Matlab code file. The file should run without errors and generate the two
plots in parts (c) and (d). Properly label all the axes, the title of the plot and the legend of the plot. Include
these two figures in the pdf file as well.
Problem 5 Consider the following testing problem: H0 : f (y/H0 ) = 21 e−|y| versus H1 : f (y/H1 ) = e−2|y| ,
where y ∈ R. Consider the following three tests: δ1 (y) = 0 for all y, δ2 (y) = 1 for all y. The third test δ3 (y)
is a randomized test given by:
1 with probability 0.5 if y < 0,
δ3 (y) = 1 if 0 ≤ y ≤ τ,
0 if y > τ,
Problem 6 Consider the following testing problem: H0 : f (y/H0 ) = (1 − β0 )β0y versus H1 : f (y/H1 ) =
(1 − β1 )β1y for y = 0, 1, 2, · · · . Let 0 < β0 < β1 < 1.
(a) Find the Bayes rule for uniform costs and equal priors.
(b) Find the minmax rule for uniform costs.
(c) Find the N-P rule with PF = α. Find PD as a function of α and sketch the ROC curve.
2
Problem 7 Consider the following testing problem: H0 : Y = W versus H0 : Y = m + W , where W is a
zero-mean multivariate Gaussian random variable with E[Wk Wl ] = σ 2 ρ|k−l| , for 1 ≤ k, l, ≤ N and |ρ| < 1.
(a) Show that the N-P test is of the form
N
X H1
bk x k ≷ η
H0
k=1
m1 y1 mk − ρmk−1 yk − ρyk−1
where b1 = , x1 = , bk = p , xk = p for k = 2, 3, · · · , N .
σ σ σ 1−ρ 2 σ 1 − ρ2
(b) Find η such that PF = α.
(c) Find PD as a function of α and sketch the ROC curve.