Advice for running RSFs for multiple individuals across multiple sites

14 views
Skip to first unread message

Philipp Maleko

unread,
Feb 23, 2026, 6:34:07 PM (2 days ago) Feb 23
to ctmm R user group
Hello dear CTMM community,

Hope you are all well!

I would greatly appreciate some advice with running RSFs using the CTMM package. 

I have extensive tracking data for a few dozen shorebirds, all of the same species, across a very large and heterogeneous coastal study area. I trapped these birds at a few different sites (where they retain range residency), with each site separated by ~50 km. My goal is to run a RSF for each individual bird, then find the mean population RSF, and ultimately make a suitability map for the region. While i would like to run the RSFs with landcover classes from the entire coastal study area as the list (thus encapsulating all occupied and unoccupied areas), the analysis takes up too much memory and fails - forcing me to run the analysis on a limited extent for each individual bird. 

My questions are: 
1) If I conduct RSF analysis on these birds at different sites with different extents for each site, does that mean the rsf outputs from different sites are not comparable?

2) Is it still appropriate to find the mean rsf on all birds or should I separate the mean analysis by each site? 

3) Is the method only appropriate if i can use the same exact list and extent for each bird?

Thanks very much for your help!

Philipp


Alex Brunswick

unread,
Feb 23, 2026, 7:02:43 PM (2 days ago) Feb 23
to Philipp Maleko, ctmm R user group
Hi Philipp, just a quick idea. If you don’t have any time-dependent covariates, you can run rsf.select with integrator = “Riemann” (default integrator = “MonteCarlo”). That speeds up processing immensely and might allow you to put in more data at once! 


From: ctmm...@googlegroups.com <ctmm...@googlegroups.com> on behalf of Philipp Maleko <male...@gmail.com>
Sent: Tuesday, February 24, 2026 7:34:07 AM
To: ctmm R user group <ctmm...@googlegroups.com>
Subject: [ctmm-user] Advice for running RSFs for multiple individuals across multiple sites
 
--
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/a35a1247-992c-4042-9245-03e56c21cc62n%40googlegroups.com.

Philipp Maleko

unread,
Feb 24, 2026, 4:02:31 PM (18 hours ago) Feb 24
to Alex Brunswick, ctmm R user group
Hi Alex,

Thanks very much for your suggestion. Unfortunately, I already had the integrator = “Riemann” argument and the function still fails over my large study area. My R  = list in the rsf.select function is 5 elements (landcovers) totalling 40GB... Below is a simplified example of my current code which fails, with the following error and warning messages included.

However, when I run the same exact code, but crop the study area (what i use to build the list) to something like : Z00_cropped_10 = crop( Classified_Map   , extent(Z00_mv) * 10), (e.g., still 5 elements but totalling 600MB) the RSF works fine... Thus my curiosity if it would be appropriate to run cropped RSFs for each individual across different study area extents followed by mean to find population RSFs... 

The failed code:

#My study area tif
Classified_Map <- rast(".../Classified_Map.tif")

#Factorizing
Classified_Map_factor = as.factor( Classified_Map   )

#making the list
Classified_Map_factor_list_selected <- list("bare_soil" = raster::raster( Classified_Map_factor   $prediction == 1),
                                                  "mudflats" = raster::raster( Classified_Map_factor   $prediction == 2),
                                                  "urban" = raster::raster( Classified_Map_factor   $prediction == 4),
                                                  "vegetation" = raster::raster( Classified_Map_factor   $prediction == 5),
                                                  "wetlands" = raster::raster( Classified_Map_factor  $prediction == 6) )

#loading all rasters in list to memory
Classified_Map_factor_list_selected <-lapply( Classified_Map_factor_list_selected   , raster::readAll)

#Minimum example with an individual named Z00
#Extracting individual points

Z00_Pts = points_telem$Z00

#loading AKDE
Z00_akde_phreml_weighted <- readRDS(here::here("Z00_akde_phreml_weighted.rds"))

 
start_time <- Sys.time()

Z00_RSF <- rsf.select(Z00_Pts,  Z00_akde_phreml_weighted   , level.UD = 0.95,
                                          R =  Classified_Map_factor_list_selected   , integrator = "Riemann")
Sys.time() - start_time

Fitting RSF model isotropic ~ 0
Fitting RSF model isotropic ~ bare_soil
Error in eigen(sigma) : infinite or missing values in 'x'
In addition: 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 .local(x, ...) : This function is only useful for Raster* objects with a longitude/latitude coordinates 4: In .rasterFromRasterFile(grdfile, band = band, objecttype, ...) : size of values file does not match the number of cells (given the data type)

Thanks again for your help, dearest CTMM community!!

Philipp
--
Philipp N. Maleko
Ph.D. candidate | University of Wisconsin | Madison, WI 53706
M.S. | University of Florida | Gainesville, FL 32601
B.S. | University of California | Davis, CA 95616

Jesse Alston

unread,
12:47 AM (9 hours ago) 12:47 AM
to Philipp Maleko, Alex Brunswick, ctmm R user group
Hi Philipp,

Cropping the raster for each individual should help make your data set computationally more tractable. You are doing third order habitat selection analysis, so the raster values outside your home ranges don’t matter.

Jesse

Sent via mobile--I apologize for excess brevity

On Feb 25, 2026, at 12:02 AM, Philipp Maleko <male...@gmail.com> wrote:


Reply all
Reply to author
Forward
0 new messages