Detects significant change points in animal movement trajectory data using a permutation-based approach. This function identifies locations where the movement pattern significantly changes, which can represent behavioral transitions or responses to environmental stimuli.

change_point_test_xyt(
  easting,
  northing,
  time,
  alpha = 0.05,
  q = 4,
  n = 1000,
  min_move_dist = 0,
  ...
)

Arguments

easting

a numeric vector of x-coordinates (easting) of the trajectory backwards in time.

northing

a numeric vector of y-coordinates (northing) of the trajectory backwards in time.

time

a vecor inheriting from numeric or POSIXt or Date containing the timestamps corresponding to the easting and northing coordinates.

alpha

a numeric value specifying the significance level for detecting change points.

q

an integer specifying the minimum segment length between potential change points.

n

an integer specifying the number of random permutations for thepermutation test. Higher values provide more accurate p-values but increase computation time.

min_move_dist

a numeric value specifying the minimum distance between two positions to be distinguishable. Points with movements smaller than this threshold will be considered stationary.(tol parameter in original code)

...

additional arguments passed to methods.

Value

An augmented data frame containing the original data with additional columns:

Examples


library("cpt")
cpttestdata <- cpt::cpttestdata
cpt <- change_point_test_xyt(cpttestdata[, "x"],
                             cpttestdata[, "y"],
                             cpttestdata[, "t"],
                             alpha = 0.05,
                             q = 3,
                             n = 500)
summary(cpt)
#>                 first                last     east    north
#> 1 2025-01-01 00:38:00 2025-01-01 00:38:00 588443.2 703275.0
#> 2 2025-01-01 00:54:00 2025-01-01 00:54:00 587898.1 703728.7