Error in secr.fit - too few values in session 1

questions concerning anlysis/theory using program DENSITY and R package secr. Focus on spatially-explicit analysis.

Error in secr.fit - too few values in session 1

Postby KerryK » Tue Feb 24, 2015 11:40 am

Hello

I am totally new to both R and secr, so there may be an obvious answer to my question that I just can't see on the forum, but hopefully you can assist!

I have been using secr to analyse some camera trap data. It was all going pretty well until I tried to analyse a subset of my data and the following error appeared "Error in secr.fit(WILDCATcapt, model = g0 ~ 1, mask = WILDCAThabitatmask: too few values in session 1 to determine start; set manually".

The number of individuals and recaptures I have for this subset is similar to another subset of data that ran successfully so I don't think the issue is the size of the dataset but a lot of the recaptures occurred towards the end of the survey period. Is this what is causing the error? And if so, what's the best way to rectify it?

Also, I'm not really sure what "setting the start manually" would involve?

Thanks in advance for your help!

Kerry
KerryK
 
Posts: 17
Joined: Sun Jul 20, 2014 10:56 am

Re: Error in secr.fit - too few values in session 1

Postby murray.efford » Tue Feb 24, 2015 2:07 pm

Kerry
You can get a summary of the data subset with
Code: Select all
summary(WILDCATcapt, terse = TRUE)
. This would show us just how few detections you have in the first session. I think the error message means what it says.

With the current version of 'secr' you can set starting values with
Code: Select all
secr.fit(..., start = list(D=0.000, g0 = 0.1, sigma = 1000), ...)
or whatever is appropriate to your animal.
Murray
murray.efford
 
Posts: 712
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: Error in secr.fit - too few values in session 1

Postby murray.efford » Tue Feb 24, 2015 2:31 pm

It's a good idea to set a non-zero density! I meant D = 0.0001.
murray.efford
 
Posts: 712
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: Error in secr.fit - too few values in session 1

Postby KerryK » Wed Feb 25, 2015 6:44 am

Hi Murray

Many thanks for the quick response. your suggestion worked.

Probably a silly question, but if I wanted to use sigma and go values from a previous model for example, would I use the real parameters or the Beta values?

Thanks again!

Kerry
KerryK
 
Posts: 17
Joined: Sun Jul 20, 2014 10:56 am

Re: Error in secr.fit - too few values in session 1

Postby murray.efford » Wed Feb 25, 2015 3:04 pm

Hi Kerry

It's good to hear you're on track.

There are three different ways to specify starting values. Either of your suggestions is OK: 'start' may be a numeric vector of coefficients ('beta') values on the link scale, or a list of predicted ('real') values (using vector and list in their R sense). If you have previously fitted a similar but different model then there is a far simpler way: just give the unquoted name of that fitted model object as the value of the 'start' argument; 'secr' extracts relevant beta values and discards those that are not relevant.

Murray
murray.efford
 
Posts: 712
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: Error in secr.fit - too few values in session 1

Postby KerryK » Sun Mar 08, 2015 7:01 am

Hi Murray

Thanks so much for your reply, and apologies for the delayed response.

I'll give this a go.

Best wishes

Kerry
KerryK
 
Posts: 17
Joined: Sun Jul 20, 2014 10:56 am

Re: Error in secr.fit - too few values in session 1

Postby KerryK » Sat Mar 14, 2015 10:40 am

Hello Murray

I'm afraid I need to pick your brains again! Following your suggestions regarding starting values, I have run into two problems. I suspect the issues are to do with a small dataset but just wanted to double check this was indeed likely to be the problem!

With one of my datasets, the models appear to run fine but when I look at the AIC table I get lots of NA's e:g

model detectfn npar logLik AIC AICc dAICc AICcwt
CATsecrBASE g0~1 sigma~1 halfnormal 2 -66.88285 137.766 149.766 NA NA
CATsecrTRP g0~b sigma~1 halfnormal 3 -60.68822 127.376 NA NA NA
CATsecrTRN g0~B sigma~1 halfnormal 3 -66.61068 139.221 NA NA NA

It still occurs, if I vary the starting values slightly. Presumably this shouldn't be happening?

With another dataset, using starting values again, the models give me the following error;
Warning message:
In secr.fit(CATcapt, model = g0 ~ b, mask = CAThabitatmask, : at least one variance calculation failed

If I then look at the output, it looks like the issue lies with the esa calculation?

Is there any obvious solution to these errors, or should I just accept my dataset is too small?

Many thanks for your thoughts.

All the best

Kerry
KerryK
 
Posts: 17
Joined: Sun Jul 20, 2014 10:56 am


Return to analysis help

Who is online

Users browsing this forum: No registered users and 2 guests