Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Statistics and Probability Expert

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

??ij~??(α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~??(α, 100) with hyperprior α~??(0,10000)

βi~??(β, 1) with hyperprior β~??(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 αi , βi and Τ are independent. Does the posterior support this assumption? Justify your answer.

Problem 2

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

Σ = (1    0.9)

      (0.9   1)

using Metropolis-Hastings algorithm with random walk generating density. Specifically, let x* = x(t) + ∈ where ∈~??2(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 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)?? and covariance matrix

Σ = (1    0.9)

      (0.9   1)

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 plots as in part b(ii) and b(iii) 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?

Attachment:- rats_data.csv

Statistics and Probability, Statistics

  • Category:- Statistics and Probability
  • Reference No.:- M91783692
  • Price:- $80

Guranteed 48 Hours Delivery, In Price:- $80

Have any Question?


Related Questions in Statistics and Probability

The diameters of tennis balls are distributed normally the

The diameters of tennis balls are distributed normally. The mean is 2.7 inches and the standard deviation is 0.3 inches. Find the probability that the diameter of a selected bearing is greater than 3 inches. (Round your ...

The acme insurance company has two types of customers

The ACME Insurance Company has two types of customers, careful and reckless. A careful customer has an accident during the year with probability 0.01. A reckless customer has an accident during the year with probability ...

The weights of bags of peas are normally distributed with a

The weights of bags of peas are normally distributed with a mean of 12.08 ounces and a standard deviation of 1.03 ounces. Bags in the upper 4% are too heavy and must be repackaged. What is the most that bag and weigh and ...

A lot contains 15 items and 6 are defective if two items

A lot contains 15 items and 6 are defective. If two items are drawn at random from the lot, without replacement, what is the probability there is exactly one non-defective? (Hint: You have to use both Multiplication and ...

Suppose a soccer team wins each of its games with

Suppose a soccer team wins each of its games with probability 0.4, loses with probability 0.4, and ties with probability 0.2, with each game's outcome independent. Their season starts, and they play a game every day.Let  ...

A logging truck sales representative will phone either one

A logging truck sales representative will phone either one or two potential buyers per day with probabilities of 0.25 and 0.75, respectively. Each contact will result in either no sale or a $75,000 sale with probabilitie ...

Use the information below to answer the questions that

Use the information below to answer the questions that follow : While the Mars candy company no longer reports the percentages of each color M&M that are produced, they had previously reported the following: 13% brown  1 ...

In a survey of 3439 adults 1418 say they have started

In a survey of 3439 adults, 1418 say they have started paying bills online in the last year. Construct a? 99% confidence interval for the population proportion. Interpret the results.

Describe the theoretical problems of ethics 3 the

Describe the theoretical problems of ethics (3), the objectives to solving them.

A tire company measures the tread on newly-produced tires

A tire company measures the tread on newly-produced tires and finds that they are normally distributed with a mean depth of 0.99mm and a standard deviation of 0.35mm. Find the probability that a randomly selected tire wi ...

  • 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