openCR

questions concerning anlysis/theory using program DENSITY and R package secr. Focus on spatially-explicit analysis.

openCR

Postby Tracey » Wed Oct 03, 2018 9:59 pm

Hi

I am trying to look at wild dog density over multiple sessions (16). I have used camera traps along roads to identify individuals wild dogs over 16 months. I am trying to look at the changes in their density around control programs. I have used secr to analyse the data so far and that was successful. However, secr assumes closed populations and wild dog populations are open. I am trying to use openCR to analyse the data now but I am having issues. I am only trying to analyse the first session of the 16 at the moment. I have not worked out how to run multiple sessions.

Reading in my data, creating trap histories and so forth works fine. When I run the model I get the following error: Error in autoini(subset(capthist, occasions = primarysession == details$autoini), :
too few values for autoini

Here is my code:
dog_traps = read.traps("Ktraps.txt",
detector="count",
markocc=rep(0, 31 ))
dog_traps

#extract identified individuals
dogCapt=read.csv("Dogssess1.csv")
Knowndogs = dogCapt[-which(dogCapt$ID=="Unknown"),]

#make capture history
Kdogs = make.capthist(
captures = Knowndogs,
traps = dog_traps,
noccasions=31)
summary(Kdogs)

head(Kdogs, n=10)
summary (Kdogs)

#Tu matrix
Unknowndogs = dogCapt[which(dogCapt$ID=="Unknown"),]
Tu_dogs = matrix(data=NA, ncol=31, nrow=88)
rownames(Tu_dogs) = rownames(dog_traps)

for(j in 1:88){
for(i in 1:31){
Tu_dogs[j, i] = dim(Unknowndogs[
Unknowndogs$occasion==i &
Unknowndogs$trap==rownames(Tu_dogs)[j],])[1]
}#close i loop
}#close j loop

#unknowndogs=read.csv("DogsUsess1.csv", header=TRUE)
#Tu_dogs = matrix(data=unknowndogs, ncol=31 , nrow=213)
#rownames(Tu_dogs)=rownames(dogTraps)

#The Tm Matrix marked but unreadable tags
Tm_dogs = matrix(0,nrow(Tu_dogs),ncol(Tu_dogs))

Knowndogs = addSightings(Kdogs, Tu_dogs, Tm_dogs)
summary(Knowndogs)

#make mask
transectmask = make.mask(dog_traps, buffer = 500, type = "trapbuffer")

##model1
dog1 = openCR.fit (Knowndogs,
detectfn="HHN",
buffer = 2700,
mask=transectmask,
type="JSSAsecrD",
model=list(D~1, lambda~1, phi~1, sigma~1, z~1),
movementmodel = 'expon',
fixed = list(pID = 1.0))
coefficients(dog1)
predict(dog1)

Here is the data for the captures:

#Session ID Occasion Detector
1 Trevor 8 T3P1K
1 Julie 10 T3P4K
1 Ted 12 T3P8K
1 Hans 22 T1P19K
1 Hans 23 T1P20K
1 BT1 24 T1P10K
1 Julie 24 T3P1K
1 Trevor 24 T3P1K
1 Shortsocks 24 T3P1K
1 Trevor 31 T3P1K
1 Shortsocks 31 T3P1K
1 Julie 31 T3P4K
1 Trevor 31 T3P4K
1 Shortsocks 31 T3P4K
1 Unknown 5 T3P18K
1 Unknown 5 T3P18K
1 Unknown 7 T3P19K
1 Unknown 7 T3P4K
1 Unknown 7 T3P4K
1 Unknown 8 T2P19K
1 Unknown 8 T2P2K
1 Unknown 8 T3P4K
1 Unknown 10 T3P17K
1 Unknown 10 T3P17K
1 Unknown 10 T3P17K
1 Unknown 12 T1P2K
1 Unknown 12 T3P1K
1 Unknown 14 T3P8K
1 Unknown 19 T3P1K
1 Unknown 19 T3P1K
1 Unknown 21 T3P2K
1 Unknown 21 T3P2K
1 Unknown 23 T3P18K
1 Unknown 24 T3P1K
1 Unknown 25 T2P20K
1 Unknown 29 T3P8K
1 Unknown 29 T3P8K

Do I simply have too few detections in this session to create value?

Any help would be appreciated. If required I can post the trap values as well.

Thanks

Tracey
Tracey
 
Posts: 2
Joined: Wed Oct 03, 2018 1:41 am

Re: openCR

Postby murray.efford » Thu Oct 04, 2018 12:58 am

Key problem is probably that openCR does not model mark-resight data. autoini problems in openCR.fit can usually be overcome by specifying start values (perhaps a previously fitted non-spatial model) or nominating a different session with e.g., details=list(autoini = 2), Obviously you can't estimate open-population parameters (survival, recruitment) from a single session - I'm not sure what you were thinking. [Incidentally, sampling along roads raises a red flag - SECR estimates may be very biased if home ranges are stretched in the direction of roads, or if density relates to distance-from-road. Perhaps OK in your case, but expect some push back].
murray.efford
 
Posts: 686
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: openCR

Postby Tracey » Thu Oct 11, 2018 10:50 pm

My apologies. I obviously wasn't thinking. I have re-run it all using all 16 sessions and it works. I have also played around with specifying start values. Thank you for your help. Much appreciated.
Tracey
 
Posts: 2
Joined: Wed Oct 03, 2018 1:41 am


Return to analysis help

Who is online

Users browsing this forum: No registered users and 16 guests