We'll start with a data structure and model that is simpler than spatial CMR, but that has many of its elements. The basic elements are:
Data arise as stochastic outcomes referenced to a 2-d coordinate system (aka, a "map")
Probability of the outcome at (x,y) depends on distance from some central point (call it a "home range centre").
These elements can be illustrated by a simple example involving observations of a single animal with a known home range centroid (x0,y0). A distance function is then specified over a map grid (x[i],y[j]), i=1,...n;j =1,...n based on a half-normal function:
f[i,j]<-exp(-d2[i,j])/(2*sigma^2)
where
d2[i,j]<-(x[i]-x0)^2 +(y[j]-y0)^2
and sigma is a scaling parameter related to home range size. A density (or "intensity") is then calculated for each map point, e.g,
lambda[i,j]<-lambda0*f[i,j]
where lamba0 is the density at the centroid. These values can then be used as parameters in a stochastic function such as the Poisson to generate counts or other observations
C[i,j]~Poisson(lambda[i,j]).
Mapped results for a small problem (21 * 21 grid with 100 m spacing) with lamba=20 and sigma=200
An even simpler version of this problem occurs when the data arise from binomial samples (say of k=5) at each point, in which case the data will be integer values 0 - 5. Assuming that binomial success is p0 when d =0, we have
p[i,j]<-p0*f[i,j]
C[i,j]~Binomial (k, p[i,j]).
Here is a mapping of simulated data for p0=0.3, k=5
The script here contains code for simulating the data, mapping the simulations, and the corresponding JAGS model for each form of the data. Again, note the close correspondence between the JAGS estimation code and the R simulation code. In both cases the resulting Bayesian estimates are fairly close to the true values used to simulate the data, but you will notice that the binomial results have very wide credible intervals-- not surprising since the data are fairly sparse (the example I just ran had 34 detections on 27/441 points).
Next: Bayesian closed models