Skip to contents

This function fits continuous-time movement models to simulated location data using the ctmm package. It estimates movement parameters for each simulated trajectory, optionally running in parallel for efficiency.

Usage

fitting_model(
  obj,
  set_target = c("hr", "ctsd"),
  .dur = NULL,
  .dti = NULL,
  .tau_p = NULL,
  .tau_v = NULL,
  .check_sampling = FALSE,
  .rerun = FALSE,
  .parallel = TRUE,
  .trace = FALSE
)

Arguments

obj

A list of simulated movement datasets.

set_target

A character vector indicating the research target(s). Options:

  • "hr" - Home range estimation.

  • "ctsd" - Speed and distance estimation.

.dur

Numeric, sampling duration of the simulated data (required if .check_sampling = TRUE).

.dti

Numeric, sampling interval of simulated data (required if .check_sampling = TRUE).

.tau_p

List, position autocorrelation timescale (optional).

.tau_v

List, velocity autocorrelation timescale (optional).

.check_sampling

Logical; if TRUE, checks if the sampling schedule is optimal for ctmm.fit().

.rerun

Logical; if TRUE, re-runs model selection if effective sample sizes fall below threshold.

.parallel

Logical; if TRUE, enables parallel computation for efficiency. Default is TRUE.

.trace

Logical; if TRUE, prints additional information.

Value

A list of fitted movement models, one per simulation.

Details

The function first generates initial parameter estimates using ctmm::ctmm.guess(). It then selects the best movement model for each simulation using par.ctmm.select(). The function ensures that each fitted model is centered at the origin (x = 0, y = 0) before returning.