Dear WinBUGS Users,
I would appreciate your help to solve the following
problem. I am working on a multinomial GLM problem
(similar to the Alligator example). (I am using
WinBUGS 1.2 beta). The data consist of a predictor
variable x and the response variable is the observed
number of three (or more) algae species. I made up a
data set (Data 1) and the results look reasonable.
However, when I reduce the size of data (Data 2), the
model was stopped by "traps." Thanks in advance.
Song Qian
Environmental Sciences and Resource
Portland State University
Portland, OR 97207-0751
model{
# PRIORS
alpha[J] <- 0;
beta[J] <- 0;
for (k in 1 : (J-1)) {
alpha[k] ~ dnorm(0, 0.00001);
beta[k] ~ dnorm(0, 0.00001);
} # vague priors
# LIKELIHOOD
for (i in 1 : I) { # loop around sizes
lambda[i] ~ dnorm(0, 0.00001); # vague priors
for (j in 1 : J) { # loop around species
y[i, j] ~ dpois(mu[i, j]);
log(mu[i, j]) <- lambda[i] + alpha[j] +
beta[j] *x[i];
p[i,j] <- mu[i,j]/sum(mu[i,]);
}
}
}
Data 1
list(I = 20, J = 3,
x = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20),
y = structure(.Data =
c(95, 90, 86, 81, 76, 71, 67, 62, 57, 52, 48, 43, 38,
33, 29, 24, 19, 14, 10, 5,
5, 10, 14, 19, 24, 29, 33, 38, 43, 48, 52, 57, 62,
67, 71, 76, 81, 86, 90, 95,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5), .Dim = c(20, 3)))
Data 2
list(I = 10, J = 3,
x = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
y = structure(.Data =
c(95, 90, 86, 81, 76, 71, 67, 62, 57, 52,
5, 10, 14, 19, 24, 29, 33, 38, 43, 48,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5), .Dim =
c(10, 3)))
__________________________________________________
Do You Yahoo!?
Send online invitations with Yahoo! Invites.
http://invites.yahoo.com
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|