pID | R Documentation |
This function produces the posterior that left individual X is right individual Y. For complete identity individuals, left individual X = right individual X with probability 1.
pID(data, ID_Lout, ID_Rout, swapped = FALSE)
data |
a list produced by sim2side or in the same format |
ID_Lout |
the M x niter posterior of ID_L |
ID_Rout |
the M x niter posterior of ID_R |
swapped |
TRUE if mcmc2side swapped L and R sides before MCMC sampling, FALSE otherwise |
a list with elements pIDL and pIDR, which are also lists. Element X of pIDL corresponds to left individual X and contains the right individuals it was matched with on at least one MCMC iteration and the posterior for each match. Similarly for pIDR.
Ben Augustine
## Not run:
N=50
p01=0.13
p02=0.2
lam01=-log(1-p01)
lam02=-log(1-p02)
sigma=0.50
K=5
buff=2
xlim<- c(1,10)
ylim<- c(1,10)
X<- expand.grid(3:8,3:8) #6x6 trapping array
X=cbind(X,1) #add number of cameras at each trap
X[which(X[,2]%in%c(4,7)),3]=2 #switch the second and fifth row of traps to double cameras
#Simulate some data
data=sim2side(N=N,lam01=lam01,lam02=lam02,sigma=sigma,K=K,X=X,buff=buff)
inits=list(psi=0.5,lam01=lam01,lam02=lam02,sigma=sigma)
store=mcmc.2sideRcpp(data,niter=niter,nburn=nburn,nthin=nthin, M = 100,inits=inits,swap=10,keepACs=TRUE)
b=Sys.time()
pID(data,store$ID_L,store$ID_R)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.