bugsMix_noResid.txt

Revision 1 - 8/17/08 at 7:40 am by eric.ward

Back to revision history for bugsMix_noResid.txt
This file is part of the project MixBUGS
model {


   p[1:numPrey] ~ ddirch(alpha[]);  # these are weights for means
   for(i in 1:numPrey) {
      p2[i] <- p[i]*p[i]; # these are weights for variances
   }

   # for each isotope, calculate the predicted mixtures
   for(i in 1:numIsotopes) {
      mix.mu[i] <- inprod(u[,i],p[]);
      mix.var[i] <- inprod(vars[,i],p2[]);
      mix.totalVar[i] <- mix.var[i];
      mix.prcsn[i] <- 1/(mix.totalVar[i]);
   }
   # This section does the likelihood / posterior, looping over N data points
   for(i in 1:N) {
      for(j in 1:numIsotopes) {
         X[i,j] ~ dnorm(mix.mu[j], mix.prcsn[j]);
      }
   }

}
Sculpin 0.2 | xhtml | problems or comments? | report bugs