Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need ans in R 6.2 Mixture model: The file glucose.dat contains the plasma glucose concentration of 532 females from a study on diabetes (see

I need ans in R

6.2 Mixture model: The file glucose.dat contains the plasma glucose concentration of 532 females from a study on diabetes (see Exercise 7.6). a) Make a histogram or kernel density estimate of the data. Describe how this empirical distribution deviates from the shape of a normal distribution.

b) Consider the following mixture model for these data: For each study participant there is an unobserved group membership variable Xi which is equal to 1 or 2 with probability p and 1 - p. If Xi = 1 then Yi ~ normal(?1, s2 1 ), and if Xi = 2 then Yi ~ normal(?2, s2 2 ). Let p ~ beta(a, b), ?j ~ normal(0, t 2 0 ) and 1/sj ~ gamma(?0/2, ?0s 2 0/2) for both j = 1 and j = 2. Obtain the full conditional distributions of (X1, . . . , Xn), p, ?1, ?2, s 2 1 and s 2 2 . c) Setting a = b = 1, 0 = 120, t 2 0 = 200, s 2 0 = 1000 and ?0 = 10, implement the Gibbs sampler for at least 10,000 iterations. Let ? (s) (1) = min{? (s) 1 , ?(s) 2 } and ? (s) (2) = max{? (s) 1 , ?(s) 2 }. Compute and plot the autocorrelation functions of ? (s) (1) and ? (s) (2), as well as their effective sample sizes. d) For each iteration s of the Gibbs sampler, sample a value x ~ binary(p (s) ), then sample Y? (s) ~ normal(? (s) x , s 2(s) x ). Plot a histogram or kernel density estimate for the empirical distribution of Y? (1) , . . . , Y? (S) , and compare to the distribution in part a). Discuss the adequacy of this two-component mixture model for the glucose data

image text in transcribed
6.2 Mixture model: The file glucose. dat contains the plasma glucose con- centration of 532 females from a study on diabetes (see Exercise 7.6). a) Make a histogram or kernel density estimate of the data. Describe how this empirical distribution deviates from the shape of a normal distribution. b) Consider the following mixture model for these data: For each study participant there is an unobserved group membership variable X which is equal to 1 or 2 with probability p and 1 - p. If X, = 1 then Y; ~ normal(01, of), and if X, = 2 then Y ~ normal(02, o;). Let p ~ beta(a, b), 0; ~ normal(Mo, To) and 1/0; ~ gamma(vo/2, voog/2) for both j = 1 and j = 2. Obtain the full conditional distributions of (X1, . . ., Xn), P, 01, 02, 0; and 07. c) Setting a = b = 1, /o = 120, To = 200, of = 1000 and vo = 10, implement the Gibbs sampler for at least 10,000 iterations. Let 01 = min{0,"),0,5 } and 05) = max(0,"),0," }. Compute and plot the autocorrelation functions of of, and of), (2): as well as their effective sample sizes. d) For each iteration s of the Gibbs sampler, sample a value I binary(p($)), then sample Y($) ~ normal(0,"), ', Of ). Plot a his- togram or kernel density estimate for the empirical distribution of y(1), ...,Y(5), and compare to the distribution in part a). Discuss the adequacy of this two-component mixture model for the glucose data

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Linear Algebra and Its Applications

Authors: Gilbert Strang

4th edition

30105678, 30105676, 978-0030105678

More Books

Students also viewed these Mathematics questions

Question

Explain the concept of going concern value in detail.

Answered: 1 week ago

Question

Define marketing.

Answered: 1 week ago

Question

What are the traditional marketing concepts? Explain.

Answered: 1 week ago

Question

Define Conventional Marketing.

Answered: 1 week ago