Error message

announcements (new versions, changes, bugs, installation problems...) related to program DENSITY and the R package secr

Error message

Postby FTvM » Fri Sep 30, 2011 1:33 pm

I'm using SECR/R with a DNA-based dataset of black bear captures (307 detections of 44 different bears). I'm using habitat covariates for the density parameter (i.e., habitat measures associated with each point in the mask) in a full likelihood model. For several models the following error is returned:

"Error: NA/NaN/Inf in foreign function call (arg 17)".

This seems to happen with more complex models (5 or more habitat covariates) and for several simpler models that include a 'distance to roads' variable.

I realize this is a fairly generic R error message but I would appreciate any insights regarding this error.

Thanks,

Frank
FTvM
 
Posts: 6
Joined: Tue Aug 19, 2008 3:59 pm
Location: Bozeman, MT

Re: Error message

Postby murray.efford » Fri Sep 30, 2011 9:05 pm

Frank

Argument 17 in the call to the external C code that computes the secr likelihood comprises the mask-point-specific densities computed under the model. Non-permissable values may arise if the optimisation function (nlm by default) goes to a crazy part of the parameter space. I'm not quite sure why this is not trapped by the software before it sends it to the external function - maybe this is a bug.

There are two ways that may give satisfaction with the existing code. Try a different optimiser (setting method = 'Nelder-Mead' in secr.fit should be more robust, if slightly slower). Or think about the link scale you are using for density - link=list(D='identity') could be worth a try, and may even make more sense for your problem than the default log scale.

Otherwise, there may be something screwy about your model specification. We don't have much working experience with these spatial trend models, beyond a sense that they demand a lot of data.

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

Re: Error message

Postby FTvM » Thu Oct 06, 2011 8:41 pm

Murray,

Thanks for the suggestions. It took me a little while to test out various options. Using the
Nelder-Mead method helped and I was able to obtain parameter estimates. However, for at least one
of the problem variables, variance could not be estimated. So I explored several other options,
including re-scaling of the habitat covariates to a 0 to 1 scale, which worked.

I have another question about habitat covariates for density but will post it under analysis help.

Many thanks,

Frank
FTvM
 
Posts: 6
Joined: Tue Aug 19, 2008 3:59 pm
Location: Bozeman, MT


Return to software problems/news

Who is online

Users browsing this forum: No registered users and 1 guest