Hi there,
I have a frustrating problem with a relatively simple state-space model
that I am trying to fit to location data (Lat-Lon) with known error
variances. The purpose is to estimate means and variances (process errors)
for direction and distance moved during day-time versus night-time for
migrating turtles. The relevant model code is below.
I have experimented with various prior specifications but frequently get
the following kinds of messages on the status line: "cannot bracket
slice for node r" (or other stochastic nodes). Even when the model runs
without error it is _extremely_ slow (1 sample/30s).
I believe the problem lies in the logical nodes Y[t+1,1] & Y[t+1,2], which
have both logical nodes (Y[t,1], Y[t,2]) and stochastic nodes as parents.
A simpler model where the Y[t+1,]'s are stochastic nodes (ie, process
error is associated with the locations, not the move directions &
distances) works perfectly. If someone is able to point out why the model
below doesn't work, and/or provide a suitable alternative structure, I
would really appreciate it!
Thanks,
Ian
_______________________________
Ian Jonsen, Postdoctoral Fellow
Biology Dept, Dalhousie University, Halifax, NS, CAN
Phone: 902 494 3910; Fax: 902 494 3736
[log in to unmask]
## priors on process uncertainty; 1=day, 2=night
isigma.phi[1]~dlnorm(0,0.01)
isigma.phi[2]~dlnorm(0,0.01)
isigma.r[1]~dlnorm(0,0.01)
isigma.r[2]~dlnorm(0,0.01)
## priors for phi (headings) & r (distances moved); 1=day, 2=night
mu.phi[1]~dunif(0,pi2)
mu.phi[2]~dunif(0,pi2)
mu.r[1]~dlnorm(0,0.01)
mu.r[2]~dlnorm(0,0.01)
## Prior for first location
for(j in 1:2){
Y[1,j]~dnorm(Y2[1,j],itau2[1,j])
}
## Transition equation
for(t in 1:(RegN-1)){
phi[t]~dnorm(mu.phi[day[t]],isigma.phi[day[t]])
r[t]~dlnorm(mu.r[day[t]],isigma.r[day[t]])
Y[t+1,1]<-Y[t,1]+sin(phi[t])*r[t]
Y[t+1,2]<-Y[t,2]+cos(phi[t])*r[t]
}
## Measurement equation
for(t in 1:RegN){ ## loops over regular time intervals (t)
for(i in offset[t]:(offset[t+1]-1)){ ## loops over irregular obs
for(j in 1:2){ ## loops over lat & lon
Y1[i,j]~dnorm(Y[t,j],itau[i,j])
}
}
}
Y1, Y2, itau, itau2 & day are observed.
-------------------------------------------------------------------
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
|