Detecting change points in animal ranging data

change_point_test_pvalue_xyt(
  x,
  y,
  time,
  q_max = 6,
  n = 1000,
  min_move_dist = 0,
  ...
)

Arguments

x

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

y

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.

q_max

maximum number of q to be tested

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

a matrix of pvalues with dimension n x q_max, where n is the number of observation determined by the length of x. Indistinguishable positions are set to NA.

Examples


cpt_pvalues <- change_point_test_pvalue_xyt(cpttestdata[, "x"],
                             cpttestdata[, "y"],
                             cpttestdata[, "t"],
                             n = 500)
tail(cpt_pvalues)
#>          q=1 q=2 q=3 q=4 q=5 q=6
#> [145,]    NA  NA  NA  NA  NA  NA
#> [146,]    NA  NA  NA  NA  NA  NA
#> [147,]    NA  NA  NA  NA  NA  NA
#> [148,] 0.406  NA  NA  NA  NA  NA
#> [149,]    NA  NA  NA  NA  NA  NA
#> [150,]    NA  NA  NA  NA  NA  NA