Conducting rsf.fit () and suitability() over a very large categorical raster list

25 views
Skip to first unread message

Philipp Maleko

unread,
Nov 24, 2025, 3:52:46 PMNov 24
to ctmm R user group
Hello Chris,

Big fan of the CTMM Initiative and all of your team's hard work! 

I am hoping to get your advice on running the rsf.fit() and ultimately suitability() over a large area. A goal of my present work is to map suitabile areas for shorebirds in the Inner Gulf of Thailand (5km buffer across the whole coastal region) by using shorebird tracking data in conjunction with categorical landcover variables to ultimately create AKDE-informed RSFs and suitability maps. While i can run the rsf.fit() and suitability() over a relatively small area, when trying to run it across the entire Inner Gulf region I get the following warning messages:
Warning messages:  
1: In .local(x, ...) :
This function is only useful for Raster* objects with a longitude/latitude coordinates 2: In .rasterFromRasterFile(grdfile, band = band, objecttype, ...) : size of values file does not match the number of cells (given the data type) 3: In cov.loglike(hess, grad) : MLE is near a boundary or optimizer failed.

and all the rsf.fit confidence intervals turn into -Inf NaN Inf, despite all rasters being as.factorized, removing all NAs, loading all my rasters into memory, and selecting only 4 landover classes. 

Do you have suggestions for running rsf.fit() and suitability() over a large area? Would it be appropriate to run the rsf.fit() over a smaller area, then break the larger study area into tiles and run a suitability() loop, ultimately stitching the tiles back together? 

Very much appreciate your help!

Philipp

Christen Fleming

unread,
Dec 2, 2025, 3:23:26 PMDec 2
to ctmm R user group
Hi  Philipp,

The first two warning messages are from raster and not from ctmm. I'm actually not familiar with them, but they don't sound good.

For running rsf.fit(), the area only needs to go a bit beyond the home range to be valid. Using a larger area will only slow that part down. The fitted model can then be used to run suitability on different sized rasters from what was used in the fitting. I don't think this will fix the issue though.

If you can't figure out the raster issue, you can create a minimal working example (MWE) in a shared folder for me and I can take a look at it.

Best,
Chris
Reply all
Reply to author
Forward
0 new messages