Print

Print


Seems p2-E can be negative, hence zip is negative, hence non positive integer powers of zip are a problem

John

On 31 Aug, 2014, at 7:54 am, Andras Farkas <[log in to unmask]> wrote:

> Dear All,
> 
> wonder if you came across the following error message before: Sorry something went wrong in procedure Power in module Math .i got as far as to find that something may be off when the pow function is called, but not exactly sure. Here is my model file:
> 
> model<-function() {
>  for (i in 1:53) {    
>    y[i] ~ dnorm(res[i], tau)
>    res[i] <- dosea[i]/p1*v[i]+doseb[i]/p6*m[i]+p5*dosea[i]*doseb[i]/p1*p6*s[i]
>    zip[i]<-E[i]/(p2-E[i])
>    v[i] <-pow(zip[i],a)
>    m[i] <-pow(zip[i],b)
>    s[i] <-pow(zip[i],c)
>    }
>  p1 ~ dnorm(100, 0.001) 
>  p2  ~ dnorm(8, 0.1) 
>  tau ~ dgamma(0.01, 0.833333)
>  p6~ dnorm(100, 0.001)
>  p~dgamma(1.5,0.001) 
>  p3<- 0.5+p
>  p4<- 0.5+p
>  p5<- 0.5+p
>  sigma <- 1 / sqrt(tau)
>  a <-1/p3
>  b <-1/p4
>  c <-0.5/p3+0.5/p4
> }
> 
> trying to run it in OpenBUGS via R2OpenBUGS.
> 
> here is the data: 
> 
> dosea <-c(0.25, 0.5, 1, 2, 4, 8, 16, 32, 0, 0, 0, 0, 0, 0.25, 0.5, 1, 
> 2, 4, 8, 16, 32, 0.25, 0.5, 1, 2, 4, 8, 16, 32, 0.25, 0.5, 1, 
> 2, 4, 8, 16, 32, 0.25, 0.5, 1, 2, 4, 8, 16, 32, 0.25, 0.5, 1, 
> 2, 4, 8, 16, 32)
> doseb <-c(0, 0, 0, 0, 0, 0, 0, 0, 4, 8, 16, 32, 64, 4, 4, 4, 4, 4, 4, 
> 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16, 16, 16, 
> 32, 32, 32, 32, 32, 32, 32, 32, 64, 64, 64, 64, 64, 64, 64, 64
> )
> y <-rep(1,53)
> E <-c(8.189004879, 8.296015219, 8.148108652, 8.137053286, 8.132227742, 
> 7.94879612, 7.841586151, 8.065011288, 8.263787868, 7.96335484, 
> 7.563621459, 6.866906071, 5.759881692, 8.17530815, 8.098609845, 
> 8.022389512, 8.094218559, 8.035721912, 7.879374711, 7.869121077, 
> 8.065954382, 8.075274364, 8.044717977, 7.864651455, 7.883696085, 
> 7.841586151, 7.696719683, 7.492158568, 7.716120677, 7.637781904, 
> 7.512843167, 7.488613287, 7.466711446, 7.393980931, 7.245003953, 
> 7.175598237, 8.738112368, 6.725252455, 6.721339865, 6.989731448, 
> 6.705327195, 6.363719326, 6.831792451, 5.541973424, 0.001, 6.895461531, 
> 6.607396513, 7.068912694, 6.487092426, 0.001, 1.301, 1.301, 0.001
> )
> 
> res <- bugs(list(dosea = dosea,doseb = doseb,E = E, y =y), model.file = model, inits = NULL, parameters.to.save=c("p1","p2","p3","p4","p5","p6"), n.chains=6, n.iter=10000,debug=TRUE)
> 
> any thoughts on what I am doing wrong?
> 
> thnaks for the input,
> 
> Andras
> 
> -------------------------------------------------------------------
> 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

-------------------------------------------------------------------
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