Description
Q1
Suppose data is generated from the model yi
| µ
iid∼ N(µ, 1) for i = 1, . . . , n. Consider a mixture normal
prior:
µ ∼ .5N(−1, 1) + .5N(1, 1)
that is,
p(µ) = .5
√
2π
e
− 1
2
(µ+1)2
+
.5
√
2π
e
− 1
2
(µ−1)2
Suppose we have observed y = 1. Find the posterior distribution of µ.
1. Start by using Bayes theorem: p(µ | y) ∝ p(y | µ)p(µ) = p(y | µ){.5ϕ(µ; −1, 1) + .5ϕ(µ; 1, 1)} and
simplify the two components using the following result.
ϕ
x; µ1, σ2
1
ϕ
x; µ2, σ2
2
= ϕ
x;
µ1/σ2
1 + µ2/σ2
2
1/σ2
1 + 1/σ2
2
,
1
1/σ2
1 + 1/σ2
2
ϕ
µ1 − µ2; 0, σ2
1 + σ
2
2
where ϕ
x; µ, σ2
is the density of a normal distribution with mean µ and variance σ
2
.
2. The posterior is going to be a mixture of two normal distributions. So you will only need to identify
the two mean and variance parameters as well as the weights for the two normal distributions.
Q2
Engineering system of type k-out-of-n is operational if at least k out of n components are operational.
Otherwise, the system fails. Suppose that a k-out-of-n system consists of n identical and independent
elements for which the lifetime has Weibull distribution with parameters r and λ. More precisely, if T is a
lifetime of a component,
P(T ≥ t) = e
−λtr
, t ≥ 0.
Time t is in units of months, and consequently, rate parameter λ is in units (month)
−1
. Parameter r is
dimensionless.
Assume that n = 10, k = 7, r = 1.3 and λ = 1/20.
1. Find the probability that a k-out-of-n system is still operational when checked at time t
2. At the check up at time t = 6 the system was found operational. What is the probability that at that
time exactly 7 components were operational?
3. At the check up at time t = 6, the system was found operational. What is the probability that the
system would still be operational at the time t = 9?
Hint: The probability that a k-out-of-n system is operational corresponds to the tail probability of binomial
distribution: P(X ≥ k), where X is the number of components working. You can do exact binomial
calculations or use binocdf in Octave/MATLAB (or dbinom in R, or scipy.stats.binom.cdf in Python).
Be careful with ≤ and <, because of the discrete nature of the binomial distribution. Part 2 is straightforward
Bayes formula. Part 3 is the total probability with hypotheses whose probabilities are obtained as in (b).
Q3
From the first page of Rand’s book A Million Random Digits with 100,000 Normal Deviates.
31060 10805 45571 82406 35303 42614 86799 07439 23403 09732
85269 77602 02051 65692 68665 74818 73053 85247 18623 88579
63573 32135 05325 47048 90553 57548 28468 28709 83491 25624
73796 45753 03529 64778 35808 34282 60935 20344 35273 88435
98520 17767 14905 68607 22109 40558 60970 93433 50500 73998
The second 50 five-digit numbers form the Rand’s “A Million Random Digits with 100,000 Normal Deviates”
book (shown above) are rescaled to [0, 1] (by dividing by 100,000 ) and then all numbers < 0.7 are retained.
We can consider the n = 35 retained numbers as a random sample from uniform U(0, 0.7) distribution.
0.3106 0.10805 0.45571 0.35303 0.42614 0.07439 0.23403
0.09732 0.02051 0.65692 0.68665 0.18623 0.63573 0.32135
0.05325 0.47048 0.57548 0.28468 0.28709 0.25624 0.45753
0.03529 0.64778 0.35808 0.34282 0.60935 0.20344 0.35273
0.17767 0.14905 0.68607 0.22109 0.40558 0.60970 0.50500
Pretend now that the threshold 0.7 is not known to us, that is, we are told that the sample is from uniform
U(0, θ) distribution, with θ to be estimated.
Let M be the maximum of the retained sample u1, . . . , u35, in our case M = 0.68665. The likelihood is
f (u1, . . . , u35 | θ) = Y
35
i=1
1
θ
1 (θ > ui) = θ
−351(θ > M)
where 1(A) is 1 if A is true, and 0 if A is false.
Assume noninformative (Jeffreys’) prior on θ,
π(θ) = 1
θ
1(θ > 0)
2
Figure 1: First page of RAND’s book.
Posterior depends on data via the maximum M and belongs to the Pareto family, Pa(c, α), with a density
αcα
θ
α+1 1(θ > c)
1. What are α and c?
2. Estimate θ in Bayesian fashion. Then calculate the 95% equi-tailed credible set. Is the true value of
parameter (0.7) in the credible set?
3. Plot the posterior PDF, adding marks for the regions bound by the above credible set, along with your
point estimate, for each plot.
4. Experiment by replacing the Jeffrey’s prior with increasingly informative Pareto priors. Start with
c < M and very small α. Report what happens to the posterior when varying the Pareto prior
parameters and compare them to the Jeffrey’s prior model.