5. Bayesian Inference on Normal Distribution
Normal Likelihood
Likelihood:
Assuming that
proportional to a Normal with mean
Thus,
Example
Suppose we take a random sample of four observations from a Normal distribution having mean μ and known variance σ2 = 1.
The observations are 3.2, 2.2, 3.6, and 4.1. The possible value of μ are 2.0, 2.5, 3.0, 3.5, and 4.0. We will use a prior that gives them all equal weight. We want to use Bayes’ Theorem to find our posterior belief about μ given the whole random sample.
x=c(3.2, 2.2, 3.6, 4.1);
mu = c(2, 2.5, 3, 3.5, 4);
mu.prior = rep(1/5, 5); ## [1/5,1/5,1/5,1/5,1/5]
likelihood = dnorm(mean(x),mean=mu, sd = 1/sqrt(4));
posterior = mu.prior*likelihood/sum(mu.prior*likelihood);
posterior;
## [1] 0.01579107 0.12266347 0.35052941 0.36850143
## [5] 0.14251462
Flat Prior
Take
Which is not a proper distribution so it is improper, however the posterior will integrate to 1 thus it will be proper.
Posterior
Parameter:
Likelihood:
Assumption:
Normal Prior Single Observation
Parameter:
Likelihood:
Assumption:
Prior:
Posterior
One Observation:
Parameter:
Likelihood:
Assumption:
Prior:
mean
Updating Rules
Precision: 1/Variance
Normal Prior Multiple Observations
Parameter:
Likelihood:
Prior:
Posterior:
Equivalent Sample Size
or
Example
Arnie and Barb are going to estimate the mean length of one-year-old rainbow trout in a stream. Previous studies in other streams have shown the length of yearling rainbow trout to be Normally distributed with known standard deviation of 2 cm. Arnie decides his prior mean is 30 cm. He decides that he doesn’t believe it is possible for a yearling rainbow to be less than 18 cm or greater than 42 cm. Thus his prior standard deviation is 4 cm. Thus he will use a Normal(30, 4) prior. Barb doesn’t know anything about trout, so she decides to use the “flat” prior.
They take a random sample of 12 yearling trout from the stream and find the sample mean ̄y = 32 cm. Arnie and Barb find their posterior distributions using the simple updating rules for the Normal conjugate family.
Example
The standard process for making a polymer has mean yield 35%. A
chemical engineer has developed a modified process. She runs the
process on 10 batches and measures the yield (in percent) for each
batch. They are:
38.7 40.4 37.2 36.6 35.9
34.7 37.6 35.1 37.5 35.6
Assume that yield is Normal(μ, σ2) where the standard deviation
σ = 3 is known.
Example
Of those women who are diagnosed to have early-stage breast cancer, one-third eventually die of the disease. Suppose a community public health department instituted a screening program to provide for the early detection of breast cancer and to increase the survival rate π of those diagnosed to have the disease. A random sample of 27 women was selected from among those who were periodically screened by the program and who were diagnosed to have the disease. Let y represent the number of those in the sample who survive the disease.
Answer each of the following questions. You have to show all your work to get full credit.
a) If you wish to detect whether the community screening program has been effective, state the null hypothesis that should be tested.
b) State the alternative hypothesis.
c) If 20 women in the sample of 27 survive the disease, find the posterior distribution of π. Use a Beta(2, 1) prior for π. Provide parameters of posterior distribution, explicitly.
d) Using parts a), b) and c), can you conclude that the community screening program was
effective? Test at the 5% level of significance in a Bayesian manner. Show all your work
and explain the practical conclusions from your test.
Want