## Description

## Assignment A4.1 (7.2 in Textbook):

Unit information prior: Letting = ≠1, show that a unit information prior for (◊, ) is

given by ◊ | ≥ multivariate normal !

y, ≠1″ and ≥ Wishart !

p + 1, S≠1″

, where S = q (yi ≠ y) (yi ≠ y)

T /n. This can be done by mimicking the procedure outlined in Exercise 5.6

as follows:

• Reparameterize the multivariate normal model in terms of the precision matrix = ≠1.

Write out the resulting log likelihood, and find a probability density pU (◊, ) = pU (◊ |

)pU () such that log p(◊, ) = l(◊, | Y)/n + c, where c does not depend on ◊ or .

Hint: Write (yi ≠ ◊) as (yi ≠ y + y ≠ ◊), and note that q aT

i Bai can be written as tr(AB),

where A = q aiaT

i .

• Let pU () be the inverse-Wishart density induced by pU (). Obtain a density pU (◊, | y1,…, yn) Ã

pU (◊ | )pU ()p (y1,…, yn | ◊, ). Can this be interpreted as a posterior distribution for

◊ and ?

## Assignment A4.2 (7.3 in Textbook):

JAustralian crab data: The files bluecrab. dat and orangecrab. dat contain measurements of

body depth (Y1) and rear width (Y2), in millimeters, made on 50 male crabs from each of two

species, blue and orange. We will model these data using a bivariate normal distribution.

• For each of the two species, obtain posterior distributions of the population mean ◊ and

covariance matrix as follows: Using the semiconjugate prior distributions for ◊ and , set

µ0 equal to the sample mean of the data, 0 and S0 equal to the sample covariance matrix

and ‹0 = 4.

Obtain 10,000 posterior samples of ◊ and . Note that this “prior” distribution

loosely centers the parameters around empirical estimates based on the observed data (and

is very similar to the unit information prior described in the previous exercise). It cannot be

considered as our true prior distribution, as it was derived from the observed data. However,

it can be roughly considered as the prior distribution of someone with weak but unbiased

information.

• Plot values of ◊ = (◊1, ◊2)

Õ for each group and compare. Describe any size dierences

between the two groups.

• From each covariance matrix obtained from the Gibbs sampler, obtain the corresponding correlation coecient. From these values, plot posterior densities of the correlations flblue and florange for the two groups. Evaluate dierences between the two species

by comparing these posterior distributions. In particular, obtain an approximation to

Pr 1

flblue < florange | yblue , yorange 2

. What do the results suggest about dierences between the two populations?

Page 1 of 2

## Assignment A4.3 (7.5 in Textbook):

Imputation: The file interexp. dat contains data from an experiment that was interrupted before

all the data could be gathered. Of interest was the dierence in reaction times of experimental

subjects when they were given stimulus A versus stimulus B.

Each subject is tested under one

of the two stimuli on their first day of participation in the study, and is tested under the other

stimulus at some later date. Unfortunately the experiment was interrupted before it was finished,

leaving the researchers with 26 subjects with both A and B responses, 15 subjects with only A

responses and 17 subjects with only B responses.

• Calculate empirical estimates of ◊A, ◊B, fl, ‡2

A, ‡2

B from the data using the commands mean,

cor and var.

Use all the A responses to get ˆ◊A and ‡ˆ2

A, and use all the B responses to get ˆ◊B and ‡ˆ2

B. Use only the complete data cases to get flˆ.

• For each person i with only an A response, impute a B response as

yˆi,B = ˆ◊B +

1

yi,A ≠ ˆ◊A

2

flˆ

Ò

‡ˆ2

B/‡ˆ2

A

For each person i with only a B response, impute an A response as

yˆi,A = ˆ◊A +

1

yi,B ≠ ˆ◊B

2

flˆ

Ò

‡ˆ2

A/‡ˆ2

B

You now have two “observations” for each individual. Do a paired sample t-test and obtain

a 95% confidence interval for ◊A ≠ ◊B.

• Using either Jereys’ prior or a unit information prior distribution for the parameters,

implement a Gibbs sampler that approximates the joint distribution of the parameters

and the missing data.

Compute a posterior mean for ◊A ≠ ◊B as well as a 95% posterior

confidence interval for ◊A ≠ ◊B. Compare these results with the results from b ) and discuss.

Sheet 4 is due on Nov. 25th.. Submit your solutions before Nov. 25th., 5:00 pm.

Page 2 of 2