Solution 3 Problem 1: Let X
Solution 3 Problem 1: Let X
Solution 3 Problem 1: Let X
391J
Statistics for Engineers and Scientists March 9
MIT, Spring 2006 Handout #7
Solution 3
Problem 1: Let X1 , X2 , . . . , Xn be a random sample from the uniform p.d.f.
f (x|θ) = 1/θ, for 0 < x < θ and for some unknown parameter θ > 0.
(a) Find a maximum likelihood estimator of θ, say Tn .
Tn = max{X1 , X2 , . . . , Xn }.
1
L(θ)
θ
max{X1 , X2 , . . . , Xn }
Figure 1: The likelihood function for problem 5(a) is non-zero when θ >
max{X1 , X2 , . . . , Xn }.
Differentiating both sides of the equations (for each case of the range for
x) yields the pdf
nxn−1 , for 0 < x < θ;
θn
fTn (x) =
0, otherwise.
2
(d) [Extra Credit] By construction and by a property of the variance, we
derive a relation
n + 1
Var {Wn } = Var Tn
n
n + 1 2
= Var {Tn }
n
> Var {Tn } .
3
Let any > 0 be given. Then,
The last equality follows from the cdf of Tn in equation (1). Taking the
limit both sides of the equation (for each case of the range for ), we have
(b) Suppose that n = 131 and that X1 , X2 , . . . , X131 are taken to be the
average temperature observed at Boston, MA, since the 1872 that are given
in Table 1. Use MATLAB to find the numerical values of the estimator of
(µ, σ 2 ) for this data set.
Solution
1 n (Xi −µ)2
L(µ, σ) = √ e− i=1 2σ 2 ,
(σ 2π)n
for a real number −∞ < µ < ∞ and a positive number σ > 0. We want to
find µ and σ that maximize the likelihood function, or equivalently, that
maximize the log-likelihood function,
n
n (Xi − µ)2
ln L(µ, σ) = − ln(2π) − n ln σ − .
2 i=1
2σ 2
4
with two unknowns, µ and σ:
n
(Xi − µ)
∂
0= ln L(µ, σ) = , (2)
∂µ i=1
σ2
n
∂ n (Xi − µ)2
0= ln L(µ, σ) = − + . (3)
∂σ σ i=1 σ3
Solving for µ∗ and σ ∗ that satisfy those two equations yield the solution
n
∗ Xi
µ = i=1 Xn
n
n 2
∗ i=1 (Xi − X n )
σ = .
n
= Xn
µ
n 2
2 = i=1 (Xi − X n ) ,
σ
n
where the second equality follows from invariance property of a MLE.
∂2f
< 0,
∂x2
∂2f
< 0, and (4)
∂y 2
∂ 2 f ∂ 2 f ∂ 2 f 2
· − > 0.
∂x2 ∂y 2 ∂x∂y
Note that
∂2 n
2
ln L(µ, σ) = − 2
∂µ σ
n
∂2 n 3 i=1 (Xi − µ)2
ln L(µ, σ) = 2 −
∂σ 2 σ
σ4
2 n
∂ 2 i=1 (Xi − µ)
ln L(µ, σ) = − .
∂µ∂σ σ3
5
Substituting µ∗ and σ ∗ to the above partial derivatives yields the relations
∂2
n
2
ln L(µ, σ) =− ∗ 2 < 0,
∂µ ∗
µ=µ ,σ=σ ∗ (σ )
∂2
2n
2
ln L(µ, σ) =− ∗ 2 < 0, and
∂σ ∗
µ=µ ,σ=σ ∗ (σ )
∂2 2n2
ln L(µ, σ) = > 0.
∂µ∂σ µ=µ∗ ,σ=σ ∗ (σ ∗ )4
Therefore, µ∗ and σ ∗ maximize the likelihood function.
2 for this data set
and σ
(b) The MATLAB code to compute estimators µ
yields
= 50.64
µ and 2 = 2.34.
σ
0.35
0.3
normalized frequency
0.25
0.2
0.15
0.1
0.05
0
35 40 45 50 55 60 65
Temperature (F)
6
Problem 4: A one-bit analog-to-digital (A/D) converter is defined by a
single threshold α and has two outputs, 0 and 1. Suppose a random variable X
with probability density function fX (.) is input to this A/D and the output is
defined as Y .
(b) The output of the A/D is input to a binary symmetric channel character-
ized by a single parameter 0 ≤ p ≤ 1. Let Z be the output of the channel,
with the following conditional pdf:
p, z = y
pZ|Y (z|y) =
1 − p, z = y
(c) For the special cases of p = 0, p = 1 and p = 0.5, interpret the results of
part (b).
Solution
(a) The MMSE estimator x̂(y) directly follows from the following:
∞
x̂(y) = xfX|Y (x|y)dx
−∞
∞
pY |X (y|x)fX (x)
= x dx
−∞ pY (y)
∞
1
= xpY |X (y|x)fX (x)dx (5)
pY (y) −∞
and pY |X is simply:
1, for x ≤ α
pY |X (y = 0|x) =
0, for x > α
7
0, for x ≤ α
pY |X (y = 1|x) =
1, for x > α
∞
1
x̂(y = 1) = xpY |X (y = 1|x)fX (x)dx
pY (1) −∞
∞
xfX (x)dx
= α∞
α
fX (x)dx
p, z=0
pZ|Y (z|y = 1) =
1 − p, z = 1
The pmf for Z is:
(1 − p)P {Y = 0} + pP {Y = 1} , z = 0
pZ (z) =
pP {Y = 0} + (1 − p)P {Y = 1} , z = 1
α ∞
(1 − p) −∞ fX (x)dx + p α fX (x)dx, z = 0
= α ∞
p −∞ fX (x)dx + (1 − p) α fX (x)dx, z = 1
and similarly,
p, x≤α
pZ=|X (z = 1|x) =
1 − p, x > α
8
∞
x̂(z) = xfX|Z (x|z)dx
−∞
∞
pZ|X (z|x)fX (x)
= x dx
−∞ pZ (z)
∞
1
= xpZ|X (z|x)fX (x)dx
pZ (z) −∞
Similarly, for z = 1,
∞
1
x̂(z = 1) = xpZ|X (z = 1|x)fX (x)dx
pZ (1) −∞
α ∞
1 1
= xpfX (x)dx + x(1 − p)fX (x)dx
pZ (1) −∞ pZ (1) α
α ∞
p −∞ xfX (x)dx + (1 − p) α xfX (x)dx
= α ∞
p −∞ fX (x)dx + (1 − p) α fX (x)dx
9
Z = F x + g is also Gaussian (because F and g are known constants which only
scale and shift the distribution of X). Hence,
µZ = E {Z} = E {F X + g}
= F E {X} + g
= F µX + g
Variance of estimation error is available from the derivation of the MMSE. Recall
that the distribution of X|Y in case of jointly Gaussian X and Y is normal. Its
mean is the MMSE x̂(y) and its variance is the variance of estimation error, i.e,
Var {x − x̂}. Therefore, for ẑ, variance of estimation error is: ΣZ −ΣTZY ΣY ΣZY .
Where,
ΣZ = F ΣX F T (7)
Therefore, using (6) and (7), the variance of estimation error of ẑ:
F ΣX F T − ΣTXY (F T ΣY F )ΣXY
10
Table 1: Average temperatures (in F ) at Boston, MA. (source: National
Weather Service Eastern Region)
11
Table 1: (Continued)
12