Referring to Example 6.3: 1. Use the candidate given in this example to generate a sample (a (i) ,…
Referring to Example 6.3:
1. Use the candidate given in this example to generate a sample (a(i), b(i), c(i) ), i = 1,…, 500 with a Metropolis–Hastings algorithm. The data is from the dataset cars.
2. Monitor convergence and check autocorrelations for each parameter across iterations.
3. Make histograms of the posterior distributions of the coefficient estimates, and provide 95% confidence intervals.
Example 6.3
The cars dataset relates braking distance (y) to speed (x) in a sample of cars. Figure 6.6 shows the data along with a fitted quadratic curve that is given by the R function lm. The model posited for this dataset is a quadratic model
where we assume that εij ∼ N(0, σ2) and independent.
Needs help with similar assignment?
We are available 24x7 to deliver the best services and assignment ready within 3-8hours? Order a custom-written, plagiarism-free paper
Get Answer Over WhatsApp Order Paper Now