## model "Single" used in: ## Extracting More out of Relocation Data: Building Movement Models as Mixtures of Random Walks ## Juan Manuel Morales, Daniel T. Haydon, Jacqui Frair, Kent E. Holsinger and John M. Fryxell ## contact juan.morales@uconn.edu model{ ## priors b ~ dgamma(0.01,0.01) ## shape parameter for step length distribution a ~ dgamma(0.01, 0.01) ## scale parameter for step length distribution rho ~ dunif(0,1) ## mean cosine of turns mu ~ dunif(-3.14159265359, 3.14159265359) ## mean direction of turns Pi <- 3.14159265359 ## define pi for (t in 1:npts) { ## likelihood for steps l[t] ~ dweib(b[t], a[t]) # Weibull distriution for step length ## likelihood for turns. ## use the “ones” trick (see WinBUGS manual) to sample from the Wrapped Cauchy distribution ones[t] <- 1 ones[t] ~ dbern(wC[t]) ## below is the pdf for Wrapped Cauchy distribution, divided by 500 (arbitrary) to ensure that wC[t] will be less than one wC[t] <- ( 1/(2*Pi)*(1-rho[t]*rho[t])/(1+rho[t]*rho[t]-2*rho[t]*cos(theta[t]-mu[t])) )/500 } }