Hi,
I try to rework the code on page 26 of "BUGS Book"
model
{
for(i in 1:20)
{
y[i] ~ dgamma(4, 0.04)
}
cum[1] <- y[1]
for(i in 2:20)
{
cum[i] <- cum[i-1] + y[i]
}
for(i in 1:20)
{
cum.step[i] <- i * step(1000 - cum[i])
}
n <- ranked(cum.step[], 20)
c <- equals(cum.step[20],0)
}
using "rank" function. ("rank(v, s) - number of components of v less than or equal to s").
model
{
for(i in 1:20)
{
y[i] ~ dgamma(4, 0.04)
}
cum[1] <- y[1]
for(i in 2:20)
{
cum[i] <- cum[i-1] + y[i]
}
m <- rank(cum[], 1000)
c <- step(sum(y[]) - 1000)
}
The second version compiles, but when "updated", (Open)BUGS says "Sorry something went wrong in procedure Rank.Evaluate in module GraphRanks".
Can anyone advise?
Thank you.
-------------------------------------------------------------------
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
|