Christophe & Michael,
I know I didn't provide much context to my question hence it might seem weird.
But here is an example: I am trying to predict my response variable,
in a longitudinal set up,
y.pred[i] <- exp(b[1] + b[2]*treat[i] + W.pred[subject[i]] + U.pred[i])
where W.pred and U.pred are predicted values. Also we are assuming
that U.pred follows a mixture of uniforms.
I would have loved to provide the whole code and include data but I am
restricted in that sense. So I merely picked out the relevant parts.
Thanks for responding.
Regards,
Raphael
On Wed, Sep 26, 2012 at 8:18 AM, Christophe Saint-Jean
<
[log in to unmask]> wrote:
Hi Raphael,
Some weird question : Are you sure that a mixture of uniform is
identifiable (in the sense defined in the book "Finite Mixture Models") ?
Best,
Christophe.
Le 26 sept. 2012 à 12:02, Raphael Fraser a écrit :
Hi,
My goal is to sample from a mixture of uniforms but unless U[j] is observed
or u[j] is a number my code will not work. Is there an alternative? Can
anyone help?
Thanks,
Raphael
model {
for (j in 1:M) {
U[j] ~ dunif(-u[j],u[j])
K[j] ~ dcat(p[1:N])
u[j] <- r[K[j]]
for (i in 1:N) {
SC[j,i] <- equals(i,K[j])
}
}
for (i in 1:N) {
sumSC[i] <- sum(SC[,i])
cl[i] <- step(sumSC[i] - 1)
}
NC <- sum(cl[])
# Contructive DPP
for (k in 1:N) { r[k] ~ dgamma(1.5,tau.e) }
for (k in 1:(N-1)) { V[k] ~ dbeta(1,1) }
for (k in 2:N) { p[k] <- V[k]*(1-V[k-1])*p[k-1]/V[k-1] }
V[N] <- 1
p[1] <- V[1]
# priors
tau.e <- pow(2*pow(sig.e,2),-1)
sig.e ~ dunif(0,6)
}
#### INITS
list(sig.e=3.0)
#### DATA
list(M=10,N=5)
------------------------------------------------------------------- This
list is for discussion of modelling issues and the BUGS software. For help
with crashes and error messages, first mail [log in to unmask] To mail
the BUGS list, mail to [log in to unmask] Before mailing, please check the
archive at www.jiscmail.ac.uk/lists/bugs.html Please do not mail attachments
to the list. To leave the BUGS list, send LEAVE BUGS to
[log in to unmask] If this fails, mail [log in to unmask], NOT
the whole list
--------------------------------------------
Christophe Saint-Jean
Lab. MIA, Dép. Informatique
Université de La Rochelle
http://perso.univ-lr.fr/csaintje/
--------------------------------------------