
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Due: Mon., 10/24 in class
starting point until an event occurs. The probability density function for a randomvariable Y drawn from an exponential distribution with parameter
λ^
is
p(y
|^ λ
λ e
−λy
0 < y <
Researchers wish to compare 5 medications that reduce fever.
These medications
are all different formulations of the same drug (capsule, liquid, tablet, etc.).
The
experiment involves 30 patients, each with a temperature of at least 102 degrees. Sixpatients are randomly assigned to medication 1, six patients to medication 2, etc.After the patient takes the medication assigned to him, his temperature is monitoredcontinuously.
The outcome variable of interest is the time in hours from when the
medication is taken until the patient’s temperature goes below 99.5 degrees.Let
yij
denote this time for patient
j^
who received medication
i.
The researchers will carry out a Bayesian analysis.
They assume that all the times
for patients receiving the same medication, say
i, follow an exponential distribution
with the same parameter
λi
.^ They believe that the
λs for different treatments are
different, but they have no idea of which ones will be larger or smaller.Below is WinBUGS code for fitting a 3-stage hierarchical model to their data. model {for (i in 1:N) {
for (j in 1:M) {
Y[i,j] ~ dexp( lambda[i])
lambda[i] ~ dgamma( alpha, beta) }alpha ~ dgamma( 1,1)beta ~ dgamma(1,1)overall <- alpha / beta}^ (a) Draw a directed graph for this model.
You may either do this by hand or use
DoodleBUGS or any graphing software that you know. (b) Derive expressions proportional to the full conditional distributions for lambda[i],
alpha, and beta.
If any of them are standard distributions, identify them by
family and parameters. If any of them are not standard distributions, say so.
model {for (i in 1:N) {
for (j in 1:M) {
Y[i,j] ~ dexp( lambda[i])
lambda[i] ~ dgamma( alpha, beta) } alpha ~ dgamma( a1, b1)beta ~ dgamma(a2, b2 )a1 ~ dexp(2)b1 ~ dexp(2)a2 ~ dexp(2)b2 ~ dexp(2)overall <- alpha / beta}^ (a) Will the full conditionals for the lambda[i]s change? Why or why not?(b) Derive expressions proportional to the full conditionals for alpha, beta, a1, and
b1. If possible, identify them as standard distributions.