Mean occurrence

130 views
Skip to first unread message

Lorenzo Frangini

unread,
Apr 30, 2025, 6:49:19 AMApr 30
to ctmm R user group
Hi Chris,

I have old telemetry data on 5 bears which hibernated. Monitoring periods for each bear are very variable (from 1 month to 7-8 months), as long as gps schedule (from 1 fix every 5 hours to 1 fix per day) with also some temporal gaps due to failure in GPS acquisition.
I split GPS locations before and after hibernation for 4 bears which hibernated. Therefore from 5 individuals I have 9 datasets.

I want to perform habitat selection analysis.

Unfortunately, most of them do not show resident behaviour (even sub-sampling GPS locations for each individual), therefore I cannot estimate AKDE neither run iRSF.

Therefore, I was thinking to perform a "classic" RSF at the population level, using occurrences distribution as areas where to sample the pseudo-absences. My idea was to perform something similar to pkde() with occurences. I calculated the 0.95 occurrences distributions for each individual (see in the image attatched), created a list where I grouped all of them and I was thinking to do mean().
Does it make sense? If yes, why it is not working. Or do you suggest me something different (last chance is using a MCP for all individuals).

Here a minimum example code:

bears<-as.telemetry(bears) #multpile animals in bears dataset
bear1<-bears[[1]] GUESS1 <- ctmm.guess(bear1, interactive = FALSE) FIT1_pHREML <- ctmm.select(bear1, GUESS1, method = 'pHREML') occ_bear1<-occurrence(bear1,FIT1_pHREML, level.UD = .95)

#then do the same for all the other bears occurrences<-list(bear1,bear1_pre_hibernation,bear2,bear2_pre_hibernation, etc........)  

plot(occurrences) #see the attatched image

MEAN<-mean(occurrences) #it runs, I paste here just the final part of the verbose with the error * Model selection for autocovariance distribution. ΔAIC E[major,minor,angle,tau position,tau velocity] VAR[major,minor,angle,tau position,tau velocity] 0.00000 E[major,minor,angle,tau position,tau velocity] COV[major,minor,angle,tau position,tau velocity] 10.68373 E[major,minor,angle,tau position,tau velocity] VAR[minor,angle,tau position,tau velocity] 11.89799 E[major,minor,angle,tau position,tau velocity] VAR[major,minor,angle,tau position] 31.52709 E[major,minor,angle,tau position,tau velocity] VAR[minor,angle,tau position] 43.48678 E[major,minor,angle,tau position,tau velocity] VAR[major,tau position,tau velocity] 281.04463 E[major,minor,angle,tau position,tau velocity] VAR[tau position,tau velocity] 293.95581 E[major,minor,angle,tau position,tau velocity] VAR[major,tau position] 319.99667 E[major,minor,angle,tau position,tau velocity] VAR[tau position] 332.84131 E[major,tau position,tau velocity] VAR[tau position] 332.84131 E[major,minor,angle,tau position,tau velocity] VAR[major,minor,angle,tau velocity] 478.03442 E[major,minor,angle,tau position,tau velocity] VAR[minor,angle,tau velocity] 493.67199 E[major,tau position,tau velocity] VAR[tau velocity] 785.10914 E[major,minor,angle,tau position,tau velocity] VAR[minor,angle] 1062.03104 E[major,tau position,tau velocity] VAR[major] 1343.69113 E[major,tau position,tau velocity] VAR[] 1356.98824 E[major,minor,angle,tau position,tau velocity] VAR[] 1356.98824 Error in grid.union(x) : Inconsistent grid resolutions. Best
Lorenzo


occurences.jpeg

Lorenzo Frangini

unread,
Apr 30, 2025, 6:52:43 AMApr 30
to ctmm R user group
Sorry, the code is not easy to read. Here a better visualization


bears<-as.telemetry(bears) #multpile animals in bears dataset
bear1<-bears[[1]]
GUESS1 <- ctmm.guess(bear1, interactive = FALSE)
FIT1_pHREML <- ctmm.select(bear1, GUESS1, method = 'pHREML')
occ_bear1<-occurrence(bear1,FIT1_pHREML, level.UD = .95)

#then do the same for all the other bears

occurrences<-list(bear1,bear1_pre_hibernation,bear2,bear2_pre_hibernation, etc........)
  

plot(occurrences) #see the attatched image

MEAN<-mean(occurrences) #it runs, I paste here just the final part of the verbose with the error

* Model selection for autocovariance distribution.
E[major,minor,angle,tau position,tau velocity] VAR[major,minor,angle,tau position,tau velocity] 0.00000 E[major,minor,angle,tau position,tau velocity] COV[major,minor,angle,tau position,tau velocity] 10.68373 E[major,minor,angle,tau position,tau velocity] VAR[minor,angle,tau position,tau velocity] 11.89799 E[major,minor,angle,tau position,tau velocity] VAR[major,minor,angle,tau position] 31.52709 E[major,minor,angle,tau position,tau velocity] VAR[minor,angle,tau position] 43.48678 E[major,minor,angle,tau position,tau velocity] VAR[major,tau position,tau velocity] 281.04463 E[major,minor,angle,tau position,tau velocity] VAR[tau position,tau velocity] 293.95581 E[major,minor,angle,tau position,tau velocity] VAR[major,tau position] 319.99667 E[major,minor,angle,tau position,tau velocity] VAR[tau position] 332.84131 E[major,tau position,tau velocity] VAR[tau position] 332.84131 E[major,minor,angle,tau position,tau velocity] VAR[major,minor,angle,tau velocity] 478.03442 E[major,minor,angle,tau position,tau velocity] VAR[minor,angle,tau velocity] 493.67199 E[major,tau position,tau velocity] VAR[tau velocity] 785.10914 E[major,minor,angle,tau position,tau velocity] VAR[minor,angle] 1062.03104 E[major,tau position,tau velocity] VAR[major] 1343.69113 E[major,tau position,tau velocity] VAR[] 1356.98824 E[major,minor,angle,tau position,tau velocity] VAR[] 1356.98824 Error in grid.union(x) : Inconsistent grid resolutions. 


Best
Lorenzo

Christen Fleming

unread,
May 22, 2025, 10:43:19 AMMay 22
to ctmm R user group
Hi Lorenzo,

When the distribution is not stationary, I would recommend step-selection functions (SSF), which you can use the amt package for. Unlike location-based RSFs, SSFs do not assume a stationary distribution.

Best,
Chris

Lorenzo Frangini

unread,
May 28, 2025, 12:11:13 PMMay 28
to ctmm R user group
Hi Chris,

thanks for your suggestion. Unfortunately, my data are not regular in time to apply a SSF. I'll try to apply a classic RSF with MCPs.

Best
Lorenzo

Jesse Alston

unread,
May 28, 2025, 2:10:11 PMMay 28
to Lorenzo Frangini, ctmm R user group
Hi Lorenzo,

Bears being non-resident also violates the assumptions of classical RSFs. Something you could do but I have not seen done yet is to calculate the most likely path between sampled locations using ctmm, then sample from that path at a regular interval so the data can be fit to an SSF.

Jesse

--
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/91b3fada-c419-45a3-8100-6e1459407df1n%40googlegroups.com.


--

Lorenzo Frangini

unread,
Jun 5, 2025, 7:02:16 AMJun 5
to ctmm R user group
Hi Jesse,

thank you, it seems really interesting as method and I would love to try it. Just a question: how much debatable may be a method like this? I mean, I know that the path calculation is based on empirical data and path 's characteristics, but it is still "simulated". Therefore, when I use SSF I think it may be criticized by a referee if I'm gonna present results on animal choices to move across the landscape when part of them are calculated and not observed. 

One more question, forgive me if this is not the place to ask it: I know a lot can be found on the web, but I'm still confused on the difference between RSF and SSF. Regardless their assumptions, I can see in scientific literature they are used sometimes for the same objective (i.e., habitat selection and suitability), sometimes not. Indeed, If RSFs are most commoly used for habitat suitability prediction over a larger areas, SSFs are used for the same objective or to build a resistance (friction) map where to apply a connectivity model (this second option is more "logical" to me). Could you explain me what's the difference and why RSFs and SSFs are used? Again, I'm sorry if this is note the right forum where to ask it.

Best
Lorenzo

Christen Fleming

unread,
Jul 18, 2025, 1:58:05 PMJul 18
to ctmm R user group
Hi Lorenzo,

Location-based RSFs assume a stationary process (animal moving within a fixed area). Regular location-based RSFs assume independently sampled data. ctmm's RSFs do not assume independence.
SSFs do not assume a stationary process in the wide sense, but do assume independently sample steps (data can't be too finely sampled) and they require evenly sampled data.

If your data do not meet either criteria, then you are going to have to make some approximations.
Imputation is valid if you propagate the uncertainty.

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