[e8158a]: classic-bugs / vol1 / litters / litters.bug  Maximize  Restore  History

Download this file

31 lines (25 with data), 700 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
Beta-binomial model for litters data.
Approximate uniform shrinkage prior
with uniform prior for mu
We need to truncate the beta distribution of p[i] to avoid a
singularity at 1 when b[i] < 1. This slows down the calculation
considerably as it requires calculation of the incomplete beta
function.
*/
model {
for (i in 1:G)
{
for (j in 1:N)
{
r[i,j] ~ dbin(p[i,j], n[i,j]);
p[i,j] ~ dbeta(a[i], b[i]) T(,0.9999);
}
a[i] <- nbar[i] * mu[i] * phi[i];
b[i] <- nbar[i] * (1 - mu[i]) * phi[i];
mu[i] ~ dunif(0, 1);
phi[i] <- nbar[i] * theta[i] / (1 - theta[i]);
theta[i] ~ dunif(0, 1);
nbar[i] <- mean(n[i,]);
}
}

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks