ML test: Smoke detector

Suppose that a smoke detector sensor is configured to produce 8V when there is smoke, and 0V otherwise. But there is background noise with distribution 𝒩(0,32).

Design an ML test for the detector electronics to decide whether to activate the alarm.

What are the three error probabilities? (Type I, Type II, Total.)

Solution

First, establish the conditional distributions:

X|H0𝒩(0,32)X|H1𝒩(8,32)

Density functions:

fX|H0=12π9e12(x03)2fX|H1=12π9e12(x83)2

The ML condition becomes:

12π9e12(x03)2?12π9e12(x83)212(x03)2?12(x83)2x2?(x8)2x4

Therefore, A0 is x4, while A1 is x>4.

The decision rule is: activate alarm when x>4.


Type I error:

PFA=P[A1|H0]P[X>4|H0]1P[X0343|H0]1P[Z1.3333]0.0912

Type II error:

PMiss=P[A0|H1]P[X4|H1]P[X83483|H1]P[Z1.3333]0.0912

Total error:

PERR=PFA0.5+PMiss0.50.0912

MAP test: Smoke detector

Suppose that a smoke detector sensor is configured to produce 8V when there is smoke, and 0V otherwise. But there is background noise with distribution 𝒩(0,32).

Suppose that the background chance of smoke is 5%. Design a MAP test for the alarm.

What are the three error probabilities? (Type I, Type II, Total.)

Solution

First, establish priors:

P[H0]=0.95P[H1]=0.05

The MAP condition becomes:

12π9e12(x03)20.95?12π9e12(x83)20.05e12(x03)2?e12(x83)20.050.9512(x03)2?12(x83)2+ln(0.050.95)x2?(x8)218ln(0.050.95)x7.31

Therefore, A0 is x7.31, while A1 is x>7.31.

The decision rule is: activate alarm when x>7.31.


Type I error:

PFA=P[A1|H0]P[X>7.31|H0]1P[Z2.4367]0.007411

Type II error:

PMiss=P[A0|H1]P[X7.31|H1]P[Z0.23]0.4090

Total error:

PERR=PFA0.95+PMiss0.050.02749

MC Test: Smoke detector

Suppose that a smoke detector sensor is configured to produce 8V when there is smoke, and 0V otherwise. But there is background noise with distribution 𝒩(0,32).

Suppose that the background chance of smoke is 5%. Suppose the cost of a miss is 50× the cost of a false alarm. Design an MC test for the alarm.

Compute the expected cost.

Solution

We have priors:

P[H0]=0.95P[H1]=0.05

And we have costs:

C10=1C01=50

(The ratio of these numbers is all that matters in the inequalities of the condition.)

The MC condition becomes:

12π9e12(x03)20.951?12π9e12(x83)20.0550e12(x03)2?e12(x83)22.50.9512(x03)2?12(x83)2+ln(2.50.95)x2?(x8)218ln(2.50.95)x2.91

Therefore, A0 is x2.91, while A1 is x>2.91.

The decision rule is: activate alarm when x>2.91.


Type I error:

PFA=P[A1|H0]P[X>2.91|H0]0.1660

Type II error:

PMiss=P[A0|H1]P[X2.91]0.04488

Total error:

PERR=PFA0.95+PMiss0.050.1599

PMF of total cost:

PC(c)={0.002244c=500.1577c=10.840056c=0

Therefore E[C]=0.27.