Question: In Bayesian Inference , how do I calculate the numerical Integration in R . Below is the question Consider again the problem considered in HW4.
In Bayesian Inference , how do I calculate the numerical Integration in R . Below is the question
Consider again the problem considered in HW4. In January 1986, the space shuttle Challenger exploded shortly after launch. An investigation was done to nd the cause of the crash and attention focused on the rubber O-ring seals in the rocket boosters. At lower temperatures, rubber becomes more brittle and is a less eective sealant. At the time of the launch, the temperature was 31oF. Could the failure of the O-rings have been predicted? In the 23 previous shuttle missions for which data exists, some evidence of damage due to blow by and erosion was recorded on some O-rings. Each shuttle had two boosters, each with three O-rings. For each mission, we know the number of O-rings out of six showing some damage and the launch temperature. Let y denotes the number of damaged O-rings and x the launch temperature. The data can be downloaded from the R library faraway (use data(orings)). Assume the following Bayesian model: yi|0,1 ind. Binomial(6,p(xi)), i = 1,,23, log p(xi) 1p(xi) = 0 + 1xi, p(0,1) 1. Obtain a sample from the posterior distribution of 0 and 1 using (i) rejection sampling, (ii) SIR, (iii) mined, and (iv) Metropolis-Hastings algorithm. Plot the marginal distributions along with those obtained using numerical integration
How do I calculate the true density ?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
