make.mask query

268 views
Skip to first unread message

jessica comley

unread,
Oct 27, 2015, 10:54:57 AM10/27/15
to secr

Hi There,


I have created the following two masks, the only difference being that BHmask4 includes a spacing value of 3000 (i based it on the fact that my camera traps are on average 3km apart), I'm not sure if this spacing value is correct or which mask to use to determine density estimates.



BHmask3 <- make.mask(traps(BH_left2, type ="polygon", poly = boundary, poly.habitat = TRUE))

plot(BHmask3)

 

BHmask4 <- make.mask(traps(BH_left2, spacing = 3000, type ="polygon", poly = boundary, poly.habitat = TRUE))

plot(BHmask4)


Rest of my code:

library(sp)


library(maptools)

Checking rgeos availability: TRUE


setwd("C:\\Users\\Jess\\Desktop\\R\\SECR")


boundary <- readShapePoly("boundary")


library(secr)

This is secr 2.9.5. For overview type ?secr


BH_left2 <-read.capthist('captfilebhleft2.csv', 'trapfile.csv', detector = "proximity", fmt="trapID", trapcovnames =c('road','predators', 'vegetation', 'elevation', 'slope'))

No errors found :-)


Any help or guidance will be greatly appreciated.


Kind regards,

Jess

Murray Efford

unread,
Oct 27, 2015, 3:27:32 PM10/27/15
to secr
You have a mis-placed parenthesis in the call to make.mask - should be traps(BH_left2) etc.

jessica comley

unread,
Oct 29, 2015, 3:43:29 PM10/29/15
to secr
Hi Murray,

I have gotten my mask to work, thank you for noticing the missing parenthesis. I am now running my various secr.fit models (g0~1, g0~b, g0~road, etc). How do you choose which model to select with regards to estimating the density? Is it based on the AIC? Also i have a really small population (roughly N=12) so do i use the AICc value?

Eric H

unread,
Oct 29, 2015, 4:16:59 PM10/29/15
to secr
Hi Jess,
You can use AICc to select among models.  If the sample size (in terms of the number of detections and the number of detections per animal) is small, AICc will appropriately favour simpler models.

Having looked at your code, I have a comment/question about how you're using some of your covariates.  By defining spatial covariates (I'm assuming this includes road, vegetation, elevation, and perhaps also predators and slope) as trap covariates and using g0~covaraite in the model formula, you are testing whether the probability of detecting an animal with an activity center at distance 0 from a trap is a function of the covariate.  Are you actually interested in whether density varies with road, vegetation, predators, etc?  If so, you would want to make those covariates of the mask, not of the traps, and use D~ in the model specification.  Also, if that's the case, I'd suggest closer spacing of points than 3000m in your mask, so that the mask represents the actual spatial variation in these covariates.

Best,
Eric

jessica comley

unread,
Oct 29, 2015, 5:10:29 PM10/29/15
to secr
Hi Eric,

Thank you for your reply.

I chose not to include a spacing value in my line of code for my mask - (BHmask <- make.mask(traps(BH_left2),type ="polygon", poly = boundary, poly.habitat = TRUE).


I think I am wanting to test whether the probability of detecting an animal with an activity center at distance 0 from a trap is a function of the covariate, instead of whether the density varies with regards to the covariates. 

I am wanting to determine whether the camera traps which where placed along roads instead of game paths for example influenced the captures of brown hyena.

Kind regards,
Jes

ardia...@wcs.org

unread,
Dec 1, 2015, 2:41:20 AM12/1/15
to secr
Hi all, 

I have a question related to habitat mask. I found an error that said "some traps are outside habitat polygon". I used forest cover as the habitat polygon, some of our camera traps were placed near to the perimeter boundary(100-200m to the boundary and one trap within the boundary. But when I made the habitat mask the error popped up. My question is: Do all the traps should be placed inside the habitat polygon? 

Here I attached a picture of the analysis and the error. Any help will be greatly appreciated. Thanks!

Salam,
Ardian 
SECR Habitat Mask Error.png

Murray Efford

unread,
Dec 1, 2015, 4:02:45 AM12/1/15
to ardia...@wcs.org, secr
That is a warning, not an error. You can place detectors outside the mask if you like, but this would be unusual, so a warning is issued. You do not seem to have a usable polygon, and should check the input file.
Murray

--
You received this message because you are subscribed to the Google Groups "secr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to secrgroup+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ardiantiono .

unread,
Dec 1, 2015, 6:00:03 AM12/1/15
to Murray Efford, secr
Thank you Mr Murray. I have tried to run the analysis, the N was not different compared to N from SPACECAP but the density was different because of the mask. So, I need to have a polygon that covers all the traps to get an useful mask? 
I wonder if we want, for example, check the animal density in the forest and disturbed area like plantations. How to pick a polygon that can cover all the traps? By combining the forest and plantation layer?. 

I'm still learning to use the secr, so thank you for the help Mr Murray. :)

Salam,
Ardian

Click here to report this email as spam.




--
   
Ardiantiono
Sumatra Database Support, Indonesia
Wildlife Conservation Society
tel: | skype: Ardiantiono -
web: www.wcs.org
twitter: www.twitter.com/thewcs

Murray Efford

unread,
Dec 1, 2015, 12:40:54 PM12/1/15
to Ardiantiono ., secr
I cannot make sense of your habitat mask - it looks a mess to me, so I assume there is something wrong with perimeter.csv.
Murray

Ardiantiono .

unread,
Dec 2, 2015, 8:53:42 AM12/2/15
to Murray Efford, secr
Dear Mr Murray,

I've already found the solution for it, I erased the small forest patch polygons inside and outside the national park boundary and edited the boundary to cover the traps. And it worked!   

I've run the analysis and for habitat mask with size of 100.000 ha, 580m spacing and 65 capture-recapture as the data input, it only took less than 10 minutes for the secr to run the analysis. I just want to confirm, does the analysis usually that fast Mr Murray? I also used SPACECAP to compare the results, and it took more than a half day to finished the analysis.

Thank you Mr Murray

Salam,
Ardian 

Murray Efford

unread,
Dec 2, 2015, 2:57:35 PM12/2/15
to Ardiantiono ., secr
I tried SPACECAP once and had the same experience.
Murray

Ardiantiono .

unread,
Dec 3, 2015, 12:49:12 AM12/3/15
to Murray Efford, secr
Thank you for the confirmation Mr Murray. I think I prefer to use secr for the future analysis. :)
Reply all
Reply to author
Forward
0 new messages