MurrayEfford / secr

Spatially Explicit Capture-Recapture
3 stars 1 forks source link

secr.fit failed initial values not found #1

Closed madmonarch09 closed 1 year ago

madmonarch09 commented 1 year ago

Hello, I am trying to fit a secr model to some camera trap data and I've tried a few different inputs I found when trying to find a solution and they all yield the same error/warning :

library(secr) CH <- read.capthist(captfile = "DEC21cap2.txt",trapfile = "DEc21trap.txt", skip=1, detector = "proximity",covnames = NULL,binary.usage=TRUE) No errors found :-) my_traps <- traps(CH) my_mask <- make.mask(my_traps, buffer = 3500, spacing = 1200, type = "trapbuffer") m0<-secr.fit(CH,detectfn = "HHN", mask = my_mask, model = list(D=~1, lambda0=~1, sigma=~1)) Checking data Preparing detection design matrices Preparing density design matrix Finding initial parameter values... Warning messages: 1: In autoini(capthist = ch, mask = msk, binomN = tempbinomN, adjustg0 = details$binomN[1] == : 'dbar' close to zero; using detector spacing instead 2: In makeStart(start, parindx, capthist, mask, detectfn, link, details, : 'secr.fit' failed because initial values not found (data sparse?); specify transformed values in 'start'

initialsigma <-RPSV(captdata, CC=TRUE)[[1]] cat("Quick and biased estimate of sigma=", initialsigma, "m/n") Quick and biased estimate of sigma= 25.62888 m/n fit <- secr.fit(CH, buffer = 4*initialsigma, trace = FALSE) Warning messages: 1: In autoini(capthist = ch, mask = msk, binomN = tempbinomN, adjustg0 = details$binomN[1] == : 'dbar' close to zero; using detector spacing instead 2: In makeStart(start, parindx, capthist, mask, detectfn, link, details, : 'secr.fit' failed because initial values not found (data sparse?); specify transformed values in 'start'

library(secr)

ftraps<-read.csv("DEC21trap.csv") names(ftraps)[2:3]<-c('x','y') qtraps<-read.traps(data = ftraps, detector = "proximity") cap<-read.csv("DEC21cap2.csv") Dcap<-cap[,c(1,2,3,4)] CH<-make.capthist(Dcap,qtraps,fmt = "trapID",noccasions = 38) summary(CH, terse = TRUE) Occasions Detections Animals Detectors 38 38 22 103 mask<-make.mask(qtraps,spacing = 1200) Cats.secr0<-secr.fit(CH,model = list(D~1,g0~1,sigma~1),mask = mask) Checking data Preparing detection design matrices Preparing density design matrix Finding initial parameter values... Warning messages: 1: In autoini(capthist = ch, mask = msk, binomN = tempbinomN, adjustg0 = details$binomN[1] == : 'dbar' close to zero; using detector spacing instead 2: In makeStart(start, parindx, capthist, mask, detectfn, link, details, : 'secr.fit' failed because initial values not found (data sparse?); specify transformed values in 'start' DEC21trap.csv DEC21cap2.csv

MurrayEfford commented 1 year ago

Please use the online list that you know is available

madmonarch09 commented 1 year ago

I’m sorry but what online list? I feel like i’ve searched everything and not found something that works.

On Mon, Oct 10, 2022 at 3:12 AM MurrayEfford @.***> wrote:

Closed #1 https://github.com/MurrayEfford/secr/issues/1 as completed.

— Reply to this email directly, view it on GitHub https://github.com/MurrayEfford/secr/issues/1#event-7549737867, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3MAOAREPIVL7IYQ7V2HJR3WCMDI5ANCNFSM6AAAAAARAZD2YQ . You are receiving this because you authored the thread.Message ID: @.***>

MurrayEfford commented 1 year ago

Your attempt a few hours ago to register for secrgroup was rejected because you hid your identity

madmonarch09 commented 1 year ago

??? It automatically shows name from gmail doesn’t it? When I was inputting the i for my full name was right there.

On Mon, Oct 10, 2022 at 6:59 AM MurrayEfford @.***> wrote:

Your attempt a few hours ago to register for secrgroup was rejected because you hid your identity

— Reply to this email directly, view it on GitHub https://github.com/MurrayEfford/secr/issues/1#issuecomment-1272636553, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3MAOAXVIMQVQGWLKMZ56H3WCM52TANCNFSM6AAAAAARAZD2YQ . You are receiving this because you authored the thread.Message ID: @.***>

MurrayEfford commented 1 year ago

No