Error in uniroot & Error in naivecap2

142 views
Skip to first unread message

Marie-lyne Després-Einspenner

unread,
Jun 16, 2015, 5:10:51 AM6/16/15
to secr...@googlegroups.com
Hi All,

When I try to estimate density using the secr.fit function, I get the following error message:

> taragree10 <- read.capthist ("char10.csv", "traptar10.csv", detector ="proximity",fmt = c("trapID"), noccasions =10, covnames =c("V5", "V6"), trapcovnames = NULL, cutval = NULL, verify = TRUE, noncapt = "NONE", binary.usage="TRUE")
No errors found :-)

> nullmodeltar10<-secr.fit(taragree10, model = list(D~1, g0~1, sigma~1), mask=HRmask, verify = TRUE)
Checking data
Preparing detection design matrices
Preparing density design matrix
Finding initial parameter values...
Error in uniroot(naiveRPSVcall, lower = obsRPSV/10, upper = obsRPSV *  :
  f() values at end points not of opposite sign
Error in naivecap2(0.001, sigma = tempsigma, cap = cpa) :
  NA/NaN/Inf in foreign function call (arg 3)


Does someone know what I am doing wrong?

Thank you!

Marie-Lyne

Marie-lyne Després-Einspenner

unread,
Jun 16, 2015, 5:15:55 AM6/16/15
to secr...@googlegroups.com
Here is a summary of my capthist object:

Object class      capthist
Detector type     proximity
Detector number   66
Average spacing   1067.094 m
x-range           688716 693430 m
y-range           641117 693630 m
Usage range by occasion
    1 2 3 4 5 6 7 8 9 10
min 0 0 0 0 0 0 0 0 0  0
max 1 1 1 1 1 1 1 1 1  1
Counts by occasion
                   1  2  3  4  5  6  7  8  9 10 Total
n                  0  0 10 14  7 14 12  7 17  6    87
u                  0  0 10 11  1  4  0  3  4  0    33
f                 10  8  6  4  3  2  0  0  0  0    33
M(t+1)             0  0 10 21 22 26 26 29 33 33    33
losses             0  0  0  0  0  0  0  0  0  0     0
detections         0  0 17 14  9 21 13 10 21  6   111
detectors visited  0  0  2  3  4  5  5  5  6  2    32
detectors used    10 24 31 36 43 54 57 56 56 54   421

Murray Efford

unread,
Jun 16, 2015, 7:00:03 PM6/16/15
to secr...@googlegroups.com, mlde...@gmail.com
Hello Marie-Lyne
The error you report is coming from the initial 'autoini' step, when secr.fit finds starting values for the likelihood maximization. I'm guessing your data are limited in some way (no recaptures at different sites?), or the mask is inappropriate; I admit the message is not informative. If you have checked the data and the mask (plotting is always helpful) the next step is to override the automatic starting values by specifying them yourself (e.g., start = list(D=2, g0=0.1, sigma=30) where D is in animals/ha and sigma is in metres).
Murray

P.S. The idea of covnames is to provide informative labels of your choice - perhaps you can do better than V5?

Marie-lyne Després-Einspenner

unread,
Jun 23, 2015, 7:25:45 AM6/23/15
to secr...@googlegroups.com, mlde...@gmail.com
Hello Murray,

Thanks a lot :) It was actually a mistake in my trap coordinates.... (!)

All the best,
ML
Reply all
Reply to author
Forward
0 new messages