trying simple secr.fit but not working

177 views
Skip to first unread message

Joanna Burgar

unread,
Nov 26, 2017, 9:30:18 PM11/26/17
to secr
Hello,

I am trying to analyse data from 3-4 occasions within multiple sessions of individuals caught in traps but when I try to run secr.fit I receive the following error messages:

> fsecr1 <- secr.fit(capturedata, model = list(D ~ 1, g0 ~ 1, sigma ~ 1), buffer = 10000, mask=grid)
Checking data 
Preparing detection design matrices 
Preparing density design matrix 
Finding initial parameter values... 
Warning messages:
1: In autoini(ch, msk, binomN = details$binomN, ignoreusage = details$ignoreusage) :
  could not calculate 'dbar'; using detector spacing
2: In secr.fit(capturedata, model = list(D ~ 1, g0 ~ 1, sigma ~ 1),  :
  'secr.fit' failed because initial values not found (data sparse?); specify transformed values in 'start'

I'm at a loss at to what to do but imagine it is something quite simple.  Has anyone else run into this issue? I have attached my capturedata and grid files (x and y, respectively, in quenda_data.RData) as well as my code (SCR_quenda_BAJ.R).

Any help is much appreciated!

Thanks,
Joanna
quenda_data.RData
SCR_quenda_BAJ.R

Murray Efford

unread,
Nov 27, 2017, 12:57:50 AM11/27/17
to secr
Hi
Please work on providing a clean example - it's frustrating to trace where your data and habitat mask come from. I suspect your mask is wrong. Why not use make.mask?
Murray

Murray Efford

unread,
Nov 27, 2017, 12:58:27 AM11/27/17
to Joanna Burgar, secr
Also, please be sure you are using the current version of secr.

--
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.

Murray Efford

unread,
Nov 28, 2017, 3:52:18 PM11/28/17
to secr
As far as I can tell, you have only 2 recaptures in the entire study, and none in first 5 sessions (autoini uses session 1 by default). Time to give up?

A lot of your code is not needed.
library(secr) # to run ML density in secr
ftraps
<- read.csv("TDF.csv") # read in Trap Deployment File as data frame
names
(ftraps)[2:3] <- c('x','y')  # not easting, northing
qtraps
<- read.traps(data = ftraps)  # DEFAULT detector = "multi"
EDF
<- read.csv("EDF.csv") # read in Encounter Data File
head
(EDF) # view structure of EDF file
quendaEDF
<- EDF[,c(1,4,2,3)]    # reorder columns; NOTE COMMA; already dataframe
quendacapt
<- make.capthist(quendaEDF, qtraps, fmt="trapID", noccasions = 51)
summary
(quendacapt, terse = TRUE) #17 sessions
## only 2 recaptures, in sessions 6, 17
mask
<- make.mask(qtraps, spacing = 20) # DEFAULT buffer = 100; use traps object as template
quenda
.secr0 <- secr.fit(quendacapt, model=list(D~1, g0~1, sigma~1), mask=mask)
Reply all
Reply to author
Forward
0 new messages