Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / STA 640 2021 Fall Final Problems Instructions: Write down your answers clearly for each problem; You need to explain the meaning of the R outputsinstead of directly copying and pasting it as your answers

STA 640 2021 Fall Final Problems Instructions: Write down your answers clearly for each problem; You need to explain the meaning of the R outputsinstead of directly copying and pasting it as your answers

Statistics

STA 640 2021 Fall Final Problems

Instructions:

  1. Write down your answers clearly for each problem; You need to explain the meaning of the R outputsinstead of directly copying and pasting it as your answers.
  2. Attach the corresponding programming code used for each problem.
  3. You are required to finish the final exam independently. Plagiarized assignment will receive zero credit.So we are expected to see different coding practice and answers from each student.
  4. It is open book but you are restricted to access our slides, notes, and textbooks.

Good Luck!

Problem 1. Suppose that X is the number of pregnant women arriving at a hospital at Hayward, CA, to deliver their babies during a given month. The discrete count nature of the data and its natural interpretation as an arrival rate suggest adopting a Poisson likelihood,

 

.

 

To implement a Bayesian analysis, a prior distribution is required for θ having support on the positive real line. A reasonable flexible choice is provided by the gamma distribution

 

,

 

or saying θ Gamma(α,β), where the values of α and β are known.

Questions:

(1.1) Use Bayes’ Theorem to obtain the posterior density function of θ.

(Hint: Use the proportional argument and identify the corresponding distributional kernel function.) (1.2) (Yes/No question) Based on (1.1), is the gamma the conjugate family for the Poisson likelihood?

    1. Suppose we observe x = 42 moms arriving at our hospital to deliver babies during December 2017. Suppose we adopt the prior as Gamma(5,6), which has mean 5(6)=30 and variance 5(6*6)=180, reflecting the hospital’s totals for the past 12 months, which have been slightly less busy on average. Use R, plot the posterior and prior density functions in one Figure together.
    2. Based on (1.3), calculate the exact 95% equal tail credible interval for the parameter θ.

1

    1. Based on (1.3), use R packages ”JAGS”, ”rJAGS”, and ”coda” to obtain the 95% equal tail credible interval for the parameter θ using the simulated samples generated by Gibbs sampler, a basic MCMC algorithm. (Set up the model tuning parameters, e.g., burn in period, iterations by yourself and attach your r-code at the end of your homework.)

Problem 2. Let X be a binomial(n,p) random variable representing the number of days in which the sun has risen out of n days with a sunrise probability p in one day, where n is known and p is unknown. Suppose we have no information about p , thus we assign a noninformative prior to p, that is, the prior density of p is f(p) = 1, where 0 ≤ p ≤ 1, a uniform density function.

Questions:

    1. Apply Bayesian statistics to find the posterior density function of p given X = x.
    2. Find the posterior mean formula of p given X = x which is an Bayes estimator (prediction) of the sunrise probability e.g., Ef(p|X)[p] = R pf(p|x)dp.
    3. If we have observed the sun to rise on 6 out of 6 days, what is the value of posterior mean calculated using the formula derived in 1.2.

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE