Subject: Help with ctmm fractal fits and speed() errors on deer telemetry
Dear Chris,
I hope you’re doing well. I’m a PhD student using ctmm (v1.2.0) to estimate smoothed average speeds (km/day) for White-tailed Deer from AI-derived camera-trap coordinates, and I’ve run into a few roadblocks. Below is a concise summary of my workflow, the errors/warnings I’m seeing, and the specific guidance I’m hoping you could provide.
1. My current workflow
Data prep: Read and merge two CSVs (merged_results_pilot.csv + sequences_pilot.csv), filter to common_name == "White-tailed Deer", parse timestamps with mdy_hms(), rename AI outputs to longitude/latitude, and drop duplicates by (sequence_id, timestamp).
Telemetry object: Thin the data to one fix every 5 s, then call
tel5 <- as.telemetry(
df_thin5,
timeformat = "auto",
timezone = "UTC",
projection = "+proj=utm +zone=12 +datum=WGS84 +units=m +north"
)
Model fitting loop: For each track in tel5, I do
GUESS <- ctmm.guess(tel_i, CTMM = ctmm(error = 1.19), interactive = FALSE)
FIT <- ctmm.fit (tel_i, GUESS)
spd <- speed (tel_i, CTMM = FIT, dt.max = 86400, robust = TRUE)
speed_results[[id]] <- spd$CI["speed (kilometers/day)", "est"]
2. What’s happening
ctmm.fit() often fails with warnings like
pREML failure: indefinite ML Hessian or divergent REML gradient
MLE is near a boundary or optimizer failed
Movement model is fractal.
When a fit returns an IID/fractal model, speed() errors out:
Movement model is fractal.
subscript out of bounds
no applicable method for 'speed' applied to an object of class "logical"
Even when I force an OU fit and then call
spd_ou <- ctmm::speed(
tel_i,
CTMM = ou_fit,
dt.max = 86400,
robust = TRUE
)
# Warning: Movement model is fractal.
I still get Warning: Movement model is fractal. and no km/day estimate.
3. What I need help with
Forcing or reliably fitting an OU or OUF model (with finite range and/or velocity autocorrelation) so that speed() will return meaningful km/day estimates.
Best practice for excluding the fractal/IID family—should I specify model="OU" or model="OUF" in ctmm.guess(), or supply a custom CTMM = list(...) to ctmm.select()?
Tuning suggestions for UERE settings, optimizer controls (e.g. control=list(maxit=…)), or ctmm.guess() parameters to avoid boundary/divergence issues.
Any pointers to code examples, CTMM internals, or vignette sections would be hugely appreciated. Thank you for your time and for developing this fantastic package!
Best regards,
Sierra McMurry
PhD Candidate, Dept. of Wildlife Biology