Reference no: EM132232605
Assignment -
Definintion of a gamma random variable -
Let X be a random variable taking a gamma distribution with shape parameter α (α > 0) and rate parameter β (β > 0), denoted Ga(α, β). Let its probability density function be denoted fX(·) and its cumulative distribution function be denoted FX(·). Then
fX(x) = (βαxα-1exp(-βx)/Γ(α) for x > 0 (1)
In general FX(·) doesn't have a closed-form expression.
Definintion of a left truncated gamma random variable -
The random variable Y is said to take a left truncated Gat(α, β) distribution if, for t > 0
where X ∼ Ga(α, β).
1. Assuming that you have n iid realisations x1, ..., xn of a random variable Y ∼ Gat(α, β), derive a concise algebraic expression for the log-likelihood in terms of fX(xi) and FX(t).
The data in the data file recruits.RData are the heights in inches recorded for recruits to a (historical) military unit which accepted only those at least 66 inches in height. Assume that these heights are realisations of a Ga66(α, β) random variable.
2. Write a function that uses optim to find the maximum likelihood estimates of α and β for a random variable taking a Gat(α, β) distribution based on a set of realisations. Your function should also return approximate standard errors for your estimates. Your code should use the expression for the log-likelihood you derived in Question 1. Note that you should not make use of the R function tgamma since this function only handles right truncated gamma random variables.
3. Apply your function to the recruits data, report the parameter estimates and standard errors and do some checks that the estimates are sensible. Does the left truncated gamma distribution provide a good fit to the recruits data?
4. Let Y ∼ Ga3(α = 5, β = 2) and let α^n and β^n be the maximum likelihood estimates of α and β based on n realisations of Y. Use Monte Carlo simulation to estimate Pr(α^5 > 14, β^5 < 6).
5. How close is your estimate likely to be to the true probability?
Attachment:- Assignment Files.rar