Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit


MTH6102 (2021)

MTH6102: Bayesian Statistical Methods


Question 1 [25 marks].

Suppose that we have data y = (y1 , . . . ,yn). Each data-point yi is assumed to be generated by a distribution with the following probability density function:

The unknown parameter is n, with k assumed to be known, and n, k 3 0.




(a) Write down the likelihood for n given y. Find an expression for the maximum

likelihood estimate (MLE) .

(b) A Gamma(c,8) distribution is chosen as the prior distribution for n. Show that the posterior distribution is also a gamma distribution with parameters that you should determine.

(c) We would like to choose the gamma prior distribution parameters such that the prior mean is (B + 10)/100, where B is the second-to-last digit of your ID number, and the prior coecient of variation (standard deviation divided by the mean) is 0.5. Find the values of c and 8 that are needed.

(d) The data are y = (2, 7, 5, 3,C + 1), where C is the last digit of your ID number, with n = 5. Set k = 2.

(i) What is the MLE ?

[6]

[6]

[4]

[3]



(ii) Using the prior distribution from part (c), what are the parameters of the posterior

distribution for n?                                                                                                   [3] (iii) What are the posterior mean and standard deviation for n?                                       [3]


Question 2 [16 marks].

Suppose that the data y = (y1 , . . . ,yn) are a sample from a normal distribution with unknown  mean 9 and known standard deviation r = 2. Our prior distribution p(9) is normal with mean 0 and standard deviation r0 .




(a) For an uninformative prior, do we need a large or small value for r0 ?

(b) We want the prior probability P(|9| s A + 10) to be 0.95, where A is the third-to-last digit of your ID number. What value for r0 should we choose?

(c) A colleague prefers a Cauchy distribution as a prior. What is a possible reason for this preference?

Let the sample mean be B + 1, where B is the second-to-last digit of your ID number, and the sample size be n = 20. Use the prior distribution found in part (b).

(d) What is the posterior distribution for 9, p(9 | y)? Based on this posterior distribution, find a point estimate for 9.

[2] [4] [2]

[5]



(e) Suppose that we want to find the posterior probability P(9 s 0 | y). Write an expression        for this probability in terms of ←, the cumulative distribution function for the standard         normal distribution.                                                                                                        [3]





Question 3 [20 marks].

The data are y = (y1 , . . . ,yn), a sample from a negative binomial distribution with parameters q and r, where r is assumed to be known. A Beta(c,8) prior distribution is assigned to q.     Apart from part (c), the answers do not need any numerical calculations.

In the following R code, the data y is denoted by y in the code, r is the known parameter, and alpha and beta are the prior parameters. The posterior distribution for q is Beta(a, b).

r  =  2

alpha  =  4

beta  =  4

a  =  r*length(y)  +  alpha

b  =  sum(y)  +  beta

qbeta(0.5,  shape1=a,  shape2=b)

qbeta(c(0.025,  0.975),  shape1=a,  shape2=b)




(a) In statistical terms, what will the second-to-last line of code output?

(b) In statistical terms, what will the last line of code output?

(c) Let B and C be the second-to-last and last digits of your ID number, respectively.