The lifetimes of electronic components can be modelled via an exponential distribution with unknown rate parameter, .
Question:
The lifetimes of electronic components can be modelled via an exponential distribution with unknown rate parameter, . Lifetimes of a random sample of 20 such components, y1,...,y20, were observed and their sum was found to be 20i=1yi=942 hours. Suppose you wish to estimate the unknown rate parameter , and assume a Gamma prior with parameters a and b. You also happen to know that a previous batch of such components had an average lifetime of 50 hours. a) Write down the likelihood of the data and the prior on the unknown parameter in the form of a probability density function.
b) Explain how you would choose the hyperparameter values aand b in the context of this problem and provide a reasonable value for each. Points will be awarded for the quality of the argument you make. Use R to plot your prior density [Note: when using the dgamma function in R, be sure to specify the parameters as follows dgamma(x, shape = a, rate = b )]. Next, use R to plot the posterior density that you would obtain under your choice of hyperparameters [Note: you may use posterior derivation that we did in class without proof].
c) Now assume that a=1 and b=1.
State the posterior distribution of the rate parameter (i.e. state its name and the numerical value of the parameters). You do not need to derive the posterior if you know how to look this up in the class notes. Plot the posterior density using R. Provide an estimator of the rate parameter. Provide a 95% credible interval for the unknown parameter. What is the posterior probability that rate is less than 0.02?