New to SECR (trying to use for masters thesis)

349 views
Skip to first unread message

Nikolis Gualco

unread,
Aug 6, 2016, 5:21:11 PM8/6/16
to secr
Hello,

First off, I am sorry if my questions are below the expertise level of this group. Any tips/help/direction though would be much appreciated.

With that said, I have 2 years of population data for an aquatic species of freshwater turtle. My research team and I collected specimens primarily through hand capture during perimeter surveys (up to 100m from shoreline) of our focal sites (ponds). My major focus thus far has been in testing habitat selection preferences and afterwards creating habitat raster maps in GIS. I have already conducted population estimates using closed and open population modeling, but want to use SECR to compare estimates with a spatial population model as well as to evaluate any possible effect of habitat (using rasters) on seasonal shifts in population assemblages, etc. 

As my subject line indicates, I am new to SECR, but I have read many of the articles and instruction manuals. I originally wanted to use the  area search 'polygon' detector type, but kept running into errors with my trap file. Furthermore, since we only survey 100m from shoreline, most of my polygons had 'holes' in them and as I understand it won't work in SECR. Any thoughts on this? Should I continue down this path? Any resources you would suggest?

I also tried to create 'trap bins' (divided up the survey area for a pond using a fishnet grid and assigned all captures within cell-x the cell value, i.e. 'trap number' which corresponded to a centroid 'xy'). This proved more successful as I was able to get density values using secr.fit, however I get this error message:

Error in integrate(integrand2, lower = trapspacing/2^0.5, upper = Inf) : 
  the integral is probably divergent

Finally (and thank you for bearing with me), any helpful tips on how to format my habitat data (use covariate approach in trap file OR create a raster mask)? 

I would be happy to provide more detail/upload a file/copy script if that would be helpful.

Thanks,

Nik

For reference:

Trap file header (using the grid cell approach described above):

# detector X Y
1 268437 850112
2 268508 850099
3 268570 850131
4 268437 850194
5 268510 850194
6 268586 850192
7 268825 850222
8 268871 850227
9 268441 850262

Capture file header (using the grid cell approach described above):

# session id occasion detector
GreatSouth 595AB5E       7         5
GreatSouth 595AB85       2 10
GreatSouth 599CC91       1         9
GreatSouth 599CC91       2        10
GreatSouth 599CC91       5 81




Murray Efford

unread,
Aug 6, 2016, 6:09:16 PM8/6/16
to Nikolis Gualco, secr
Hi Nikolis

You're very welcome to post on any SECR-related topic here! SECR refers to the set of methods and secr to the particular R package.

I am not familiar with the biology of your turtles. Does each one concentrate its activity in part of a pond? If not then SECR may not be appropriate.

Discretizing 2-D space as you have done seems a good way to go.

The particular error message you are getting comes from a non-essential and not relevant bias check that is conducted after a model is fitted using the buffer width option - an alternative to setting a mask manually. (In your case as I understand it the pond limits the habitat, so you should instead be defining a mask with that extent, not using buffer argument). You can also suppress the check using bias.limit=NA in the call to secr.fit.

I hope this helps.
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nikolis Gualco

unread,
Aug 10, 2016, 2:59:56 PM8/10/16
to secr, nagu...@gmail.com
Thanks Murray. You helped me resolve the majority of my issues. Before I get into my followup questions, to answer your question, these turtles mostly concentrate their activity in specific parts of the pond, but these aggregations shift seasonally. I hypothesize that these shifts are in response to biological conditions (breeding, nesting, etc.) as well as changing environmental conditions (vegetation growth, etc.). Finally, movement between ponds has been recorded, but is not that common in the time scale of a year of two.

I now have calculated density and population estimates for 5 of my 7  focus ponds (plus a metapopulation grouping of 3 of the ponds together) as well as corresponding density surfaces. However, 2 of my ponds are giving me an issue (density appears to be constant throughout the entire mask). 

This script I have included below is the basic script-template I use for all of my sites, so if you see anything that is not right, please let me know as I will need to fix this on the others. 

Finally, the last aspect of the spatial analysis I want to calculate is the effect habitat covariates have on detection and density. I have chosen to omit these questions (for now), however I wonder if you recommend I ask you these in this post OR create a new post for the sake of keeping topics organized? This will be the final set of questions I have. Thanks again for all your help so far!

Here is my script:

library(secr)
library(maptools)

#setwd(Users/Niko/Documents/PSRU Project/PSRU 2015/Thesis/4. Population Chapter/secr_data)
gspCH <- read.capthist('gsp_captures.txt','gsp_detectors1.txt',detector = 'proximity', 
                       fmt = c("trapID", "XY"), noccasions = NULL, covnames = NULL, trapcovnames = NULL, cutval = NULL, verify = TRUE, noncapt = "NONE")
summary(gspCH)

gspPoly<-readShapePoly("gsp_pond.shp")
plot(gspPoly)

#here I am trying to play with different mask settings to see if one will work...
gspMASKpoly<-make.mask(traps(gspCH),spacing = 100,
                       type = "polygon", poly = gspPoly, poly.habitat = TRUE)
gspMASKpoly50<-make.mask(traps(gspCH),spacing = 50,
                       type = "polygon", poly = gspPoly, poly.habitat = TRUE)
gspMASK100<-make.mask(traps(gspCH),spacing = NULL,
                    buffer = 100, type = "trapbuffer", poly = gspMASK1)
gspMASK500<-make.mask(traps(gspCH),spacing = NULL,
                    buffer = 500, type = "trapbuffer", poly = gspMASK1)

gsp_secr100poly <- secr.fit(gspCH, mask = 'gspMASKpoly',model = g0 ~ 1, trace = TRUE, verify = TRUE)
gsp_secr50poly <- secr.fit(gspCH, mask = 'gspMASKpoly50',model = g0 ~ 1, trace = TRUE, verify = TRUE)
gsp_secr100 <- secr.fit(gspCH, mask = 'gspMASK100',model = g0 ~ 1, trace = TRUE, verify = TRUE)
gsp_secr500 <- secr.fit(gspCH, mask = 'gspMASK500',model = g0 ~ 1, trace = TRUE, verify = TRUE)

AIC(gsp_secr100poly,gsp_secr50poly)

# WHICH AIC Value is lowest? Neither, so I will use 'sp_secr50poly' becuase it 
#extends the area to the whole pond.

#density estimate:
predict(gsp_secr50poly)

#population estimate:
gspRegion50<-region.N(gsp_secr50poly,region = NULL, spacing = NULL, session = NULL,group = NULL, se.N = TRUE, alpha = 0.05, loginterval = TRUE,
        keep.region = FALSE, nlowerbound = TRUE, RN.method = "poisson",pooled.RN = FALSE)

gspRegion50


#Perdictive surface density plot:
tmp <- fx.total(gsp_secr50poly)
## to plot we must name one of the covariates:
## the Dsurface default 􏰀D.0􏰀 causes an error
plot(tmp,covariate = 'D.sum', col=terrain.colors(16), plottype='shaded')
plot(tmp, covariate = 'D.sum', col = 'white', add = TRUE, plottype = 'contour')
spotHeight(tmp,prefix = 'D.sum')
fxsurface <- fx.total(gsp_secr1, sessnum = 1,mask=NULL)
plot(fxsurface, covariate = 'D.sum')

#I cannot seem to get the surface density to work for this pond...
To unsubscribe from this group and stop receiving emails from it, send an email to secrgroup+...@googlegroups.com.
gsp_captures.txt
gsp_pond.shx
gsp_pond.txt.xml
gsp_detectors1.txt
gsp_pond.cpg
gsp_pond.dbf
gsp_pond.prj
gsp_pond.sbn
gsp_pond.sbx
gsp_pond.shp
gsp_pond.shp.xml
Reply all
Reply to author
Forward
0 new messages