Ask Statistics and Probability Expert

TEXTBOOK - COMPUTATIONAL STATISTICS SECOND EDITION By GEOF H. GIVENS AND JENNIFER A. HOETING

Problem 1-

Consider the data set "Rat_data.csv" (Read the data using the function read.csv()) in R. Each data point represents the weight of a rat at a certain age. More specifically, weights of 30 rats (in grams) were measured at five time points of x1 = 8, x2 = 15, x3 = 22, x4 = 29, x5 = 36(weeks). For example, weight of rat 3 in week 15 was 214 grams. Let yij denote the weight of rat i at age xj, and consider the following model for the yij

Yij ~ N(αi + βi(xj - x-), σ2) for i = 1, . . . , 30 and j = 1, . . . , 5 and x- = 22  

(a) Obtain the maximum likelihood estimate of αi, βi and σ2. Show your work, and compute the final estimates.

(b) Now consider a Bayesian analysis of this model, where we assume the following priors

αi ~ N(α, 100) with hyperprior     α ~ N(0,10000)

βi ~ N(β, 1)    with hyperprior       β~ N(0,10000)

?? = (1/σ2) ~ gamma(10-3, 10-3)

where ~αi, βi and ?? are assumed to be independent. Our aim here is to use the Gibbs sampling method to generate values from the posterior distribution of (α1, . . . , α30, β1, . . . , β30, τ).

(i) State all the required conditionals. Show your derivation very briefly. 

(ii) Write a complete algorithm for this Gibbs sampling algorithm, specific to this problem and code your algorithm, using R.

(iii) Run the chain for 50,000 iterations, and burn-in the first 10,000 generated values. Plot the chain (trace) after the burn-in for α1, β1, α15, β15, τ against the iteration number, and comment on the mixing. 

(iv) Draw the histograms for the posterior distribution of α1, β1, α15, β15, τ and provide a point estimate for each parameter.

(c) Obtain a 95% credible interval for each of the parameters α1, β1. Interpret your intervals in the context of the problem. 

(d) In the prior, we assumed that α1, β1 and τ are independent. Does the posterior support this assumption? Justify your answer.

Problem 2-

Consider simulation of the bivariate normal distribution with μ = (1, 2)T and covariance matrix

393_Figure.png

using Metropolis-Hastings algorithm with random walk generating density. Specifically, let x = x(t)+ε, where ε ~ N2(0, D) with D being a diagonal matrix with diagonal elements δ1 and δ2. Note that δ1 and δ2 control the spread of values generated along the first and second coordinate axis, respectively.

(a) Give the M-H algorithm, and code it in R. 

(b) Choose δ1 = 0.001 and δ2 = 0.001, and generate a chain, starting at x(0) = (0, 0)t, of size 10,000 using the M-H algorithm.

(i) Compute the acceptance rate, and comment on the acceptance rate. 

(ii) Burn 1000, and draw a trace plot and the density plot for the chain for each of the variables. Comment on mixing and the density plots. 

(iii) Draw 9000 pairs generated from multivariate normal with μ = (1, 2)T and covariance matrix

393_Figure.png

Plot these pairs on a scatterplot overlaying it with the last 9000 points obtained from the M-H chain; use different color for those generated from MH and those directly generated from the target (choosing an alpha-level for color transparency is helpful). Do the M-H generated values match the target? Explain why or why not. 

(c) Choose appropriate δ1 and δ2 so that the M-H algorithm would generate values that meet the target requirement. Draw a similar scatter-plot as in part a(ii) for this case. 

(d) How do you expect the acceptance rate would change, if you choose δ1 and δ2 to be very large? Briefly explain why?

I will need the assignment along with the R codes. R codes are extremely important in this course, please have some explanation in R file. Please try to avoid using built in packages if possible.

Attachment:- rats_data.rar

Statistics and Probability, Statistics

  • Category:- Statistics and Probability
  • Reference No.:- M91780222
  • Price:- $150

Guranteed 48 Hours Delivery, In Price:- $150

Have any Question?


Related Questions in Statistics and Probability

Introduction to epidemiology assignment -assignment should

Introduction to Epidemiology Assignment - Assignment should be typed, with adequate space left between questions. Read the following paper, and answer the questions below: Sundquist K., Qvist J. Johansson SE., Sundquist ...

Question 1 many high school students take the ap tests in

Question 1. Many high school students take the AP tests in different subject areas. In 2007, of the 144,796 students who took the biology exam 84,199 of them were female. In that same year,of the 211,693 students who too ...

Basic statisticsactivity 1define the following terms1

BASIC STATISTICS Activity 1 Define the following terms: 1. Statistics 2. Descriptive Statistics 3. Inferential Statistics 4. Population 5. Sample 6. Quantitative Data 7. Discrete Variable 8. Continuous Variable 9. Qualit ...

Question 1below you are given the examination scores of 20

Question 1 Below you are given the examination scores of 20 students (data set also provided in accompanying MS Excel file). 52 99 92 86 84 63 72 76 95 88 92 58 65 79 80 90 75 74 56 99 a. Construct a frequency distributi ...

Question 1 assume you have noted the following prices for

Question: 1. Assume you have noted the following prices for paperback books and the number of pages that each book contains. Develop a least-squares estimated regression line. i. Compute the coefficient of determination ...

Question 1 a sample of 81 account balances of a credit

Question 1: A sample of 81 account balances of a credit company showed an average balance of $1,200 with a standard deviation of $126. 1. Formulate the hypotheses that can be used to determine whether the mean of all acc ...

5 of females smoke cigarettes what is the probability that

5% of females smoke cigarettes. What is the probability that the proportion of smokers in a sample of 865 females would be greater than 3%

Armstrong faber produces a standard number-two pencil

Armstrong Faber produces a standard number-two pencil called Ultra-Lite. The demand for Ultra-Lite has been fairly stable over the past ten years. On average, Armstrong Faber has sold 457,000 pencils each year. Furthermo ...

Sppose a and b are collectively exhaustive in addition pa

Suppose A and B are collectively exhaustive. In addition, P(A) = 0.2 and P(B) = 0.8. Suppose C and D are both mutually exclusive and collectively exhaustive. Further, P(C|A) = 0.7 and P(D|B) = 0.5. What are P(C) and P(D) ...

The time to complete 1 construction project for company a

The time to complete 1 construction project for company A is exponentially distributed with a mean of 1 year. Therefore: (a) What is the probability that a project will be finished in one and half years? (b) What is the ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As