RSF error

13 views
Skip to first unread message

Stella Uiterwaal

unread,
Aug 14, 2026, 9:27:43 AMAug 14
to ctmm R user group

Hi Chris,

I’m using rsf.select() and am running into an error code for a handful of my individuals. The error suggests that there are NA values for some sampled points. I confirmed that the rasters adequately cover the akde, so NAs are not being extracted from the raster.

I looked through the code for the rsf.select() and rsf.fit() functions to try and understand what is happening.

If I understand correctly, rsf.select() tries various models using the parameters from the previous model to inform the next model. What seems to be happening is that, in some cases, a model ends up with estimates of NaN or Inf for various parameters, and importantly for mu. This results in NaNs for x and y in DATA within rsf.select() and triggers the warning.

Does this interpretation sound correct? If so, do you have a recommendation for handling this? Would it be reasonable to select the best performing model from the ones that did work and didn’t result in NaNs or Inf? 

Thank you for your help!

-Stella


check <- rsf.select(data_i, UD = wAKDE_i, R = R_ib, integrator = "Riemann", verbose = FALSE) Fitting RSF model isotropic ~ 0 Fitting RSF model isotropic ~ hfp Fitting RSF model isotropic ~ dem Fitting RSF model isotropic ~ slope Fitting RSF model isotropic ~ tpi Fitting RSF model isotropic ~ veg Fitting RSF model isotropic ~ hfp+dem Fitting RSF model isotropic ~ hfp+slope Fitting RSF model isotropic ~ hfp+tpi Fitting RSF model isotropic ~ hfp+veg Fitting RSF model isotropic ~ hfp+dem+veg Fitting RSF model isotropic ~ hfp+slope+veg Fitting RSF model isotropic ~ hfp+tpi+veg Fitting RSF model isotropic ~ hfp+dem+slope+veg Fitting RSF model isotropic ~ hfp+dem+tpi+veg Fitting RSF model isotropic ~ hfp+dem+slope+tpi+veg Fitting RSF model isotropic ~ dem+slope+tpi+veg Fitting RSF model isotropic ~ hfp+slope+tpi+veg Fitting RSF model isotropic ~ hfp+dem+slope+tpi Fitting RSF model isotropic ~ dem+tpi+veg Fitting RSF model isotropic ~ hfp+dem+tpi Fitting RSF model isotropic ~ dem+tpi
Error in rsf.fit(data, UD, R = R, formula = FORM[[i]], trace = max(trace - : NA values in sampled variables slope,tpi,veg,rr at points 1,2,3,4,5,6,...

Jesse Alston

unread,
Aug 15, 2026, 1:29:34 AM (14 days ago) Aug 15
to Stella Uiterwaal, ctmm R user group
Hi Stella,

I have run into this error with the Riemann integrator, but if you switch to Monte Carlo, it usually resolves (just takes longer and more RAM). While Chris fixes this issue, you might try with the individuals that failed.

Jesse

Sent via mobile--I apologize for excess brevity

On Aug 14, 2026, at 6:27 AM, Stella Uiterwaal <stellau...@gmail.com> wrote:


--
You received this message because you are subscribed to the Google Groups "ctmm R user group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ctmm-user+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ctmm-user/4e40ec33-336e-4594-9d1e-3aaeb0ed8030n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages