数学|FIT3154 Assignment 1 2022

Question 1 (17 marks)
Background: The Gamma Distribution
In this question we will be looking at the gamma distribution. This is a distribution frequently used in the analysis of non-negative real numbers. This is introduced in Lecture 6, but here we will be using a difffferent (but equivalent) form parameterised instead in terms of the mean μ and shape φ with probability density p(y | μ, φ) =1Γ(φ) φμ φ yφ1 exp φy μ . where Γ(·) is known as the “gamma function”. Figure 1 shows several example gamma distributions.
The following facts about the gamma distribution will prove very helpful for answering the questions.
If Y ~ Ga(μ, φ) is a random variable following a gamma distribution with mean μ and shape φ then
E [Y ] = μ, and V [Y ] =μ2φ
so that μ controls the mean, and φ inversely scales the variance. Given a sample y = (y1, . . . , yn) the maximum likelihood estimate, and Fisher information, for μ are well known to be μ = ˉy and Jn(μ) =nφ μ2
(1)respectively, where yˉ = (1/n)P n i=1yi is the sample mean. The estimates for φ are complicated, so
initially we will proceed assumingφ is known; we will later relax this assumption.
Bayesian Analysis of the Gamma Distribution with Known φ
Let us now consider a Bayesian analysis of the gamma distribution with known φ using the hierarchy:
yi | μ ~ Ga(μ, φ), i = 1, . . . , n
μ | a, b ~ IG(a, b)
where IG(a, b) denotes an inverse-gamma distribution with shape a and scale b1 . A useful fact is that if Y ~ IG(a, b) and a > 1 then E [Y ] =b a 1.
One reason people use the inverse-gamma distribution as a prior for the mean of the gamma distribution is that it is flflexible; Figure 2 demonstrates several possible difffferent inverse-gamma distributions. It is also convenient, as the posterior distribution is then also an inverse gamma distribution of the form μ | y, φ, a, b ~ IG (nφ + a, nφyˉ + b).
The posterior mean of μ is then given by
E [μ | y] ≡ μa,b =φnyˉ + b φn + (a 1).
(2)which can be used as an estimate (best guess) of the unknown population μ. You should install the R package invgamma. This gives you access to the functions dinvgamma(), pinvgamma() and qinvgamma() which will be crucial in answering some questions.
Consider using (2) as an estimate of the unknown population μ from a sample of data y = (y1, . . . , yn) coming from a gamma distribution with mean μ and shape φ. The bias and variance of this estimator is biasμ(μa,b) =(1 a)μ + b nφ + a 1, Vμ [μa,b] =nμ2φ (nφ + a 1)2
(3)Please answer the following questions. Provide appropriate working/mathematical justifification.