Search for Discord

find_discord(.mp, ...)

# S3 method for MatrixProfile
find_discord(
  .mp,
  data,
  n_discords = 1,
  n_neighbors = 3,
  radius = 3,
  exclusion_zone = NULL,
  ...
)

# S3 method for PMP
find_discord(
  .mp,
  data,
  n_discords = 1,
  n_neighbors = 3,
  radius = 3,
  exclusion_zone = NULL,
  ...
)

Arguments

.mp

a MatrixProfile object.

...

further arguments to be passed to class specific function.

data

the data used to build the Matrix Profile, if not embedded.

n_discords

an int. Number of discords to find. (Default is 1).

n_neighbors

an int. Number of neighbors to find. (Default is 3).

radius

an int. Set a threshold to exclude matching neighbors with distance > current discord distance * radius. (Default is 3).

exclusion_zone

if a number will be used instead of embedded value. (Default is NULL).

Value

For class MatrixProfile, returns the input .mp object with a new name discord. It contains: discord_idx, a vectorof discords found

For class PMP, returns the input .mp object with a new name discord. It contains: discord_idx, a vector` of discords found

Examples

# Single dimension data
w <- 50
data <- mp_gait_data
mp <- tsmp(data, window_size = w, exclusion_zone = 1 / 4, verbose = 0)
mp <- find_discord(mp)
#> Error in UseMethod("find_discord", .mp): no applicable method for 'find_discord' applied to an object of class "list"
pan <- tsmp(mp_gait_data, window_size = 20:30, mode = "pmp")
#> Error in binary_split(length(window_sizes)): could not find function "binary_split"
mp <- find_discord(pan)
#> Error in .mp$pmp[[row]]: subscript out of bounds