compute: Computes the Matrix Profile or Pan-Matrix Profile

View source: R/compute.R

computeR Documentation

Computes the Matrix Profile or Pan-Matrix Profile

Description

Main API Function

Usage

compute(
  ts,
  windows = NULL,
  query = NULL,
  sample_pct = 1,
  threshold = 0.98,
  n_jobs = 1L
)

Arguments

ts

a matrix or a vector. The time series to analyze.

windows

an int or a vector. The window(s) to compute the Matrix Profile. Note that it may be an int for a single matrix profile computation or a vector of int for computing the Pan-Matrix Profile.

query

a matrix or a vector. Optional The query to analyze. Note that when computing the Pan-Matrix Profile the query is ignored!

sample_pct

a numeric. A number between 0 and 1 representing how many samples to compute for the Matrix Profile or Pan-Matrix Profile. When it is 1, the exact algorithm is used. (default is 1.0).

threshold

a numeric. Correlation threshold. See details. (Default is 0.98).

n_jobs

an int. The number of cpu cores to use when computing the MatrixProfile. (default is 1).

Details

Computes the exact or approximate Matrix Profile based on the sample percent specified. Currently, MPX and SCRIMP++ are used for the exact and approximate algorithms respectively. See details for more information about the arguments combinations.

When a single windows is given, the Matrix Profile is computed. If a query is provided, AB join is computed. Otherwise the self-join is computed. When multiple windows or none are given, the Pan-Matrix Profile is computed. If a threshold is set (it is, by default), the upper bound will be computed and the given windows or a default range (when no windows), below the upper bound will be computed.

Value

The profile computed.

References

Website: http://www.cs.ucr.edu/~eamonn/MatrixProfile.html

See Also

Other Main API: analyze(), discords(), motifs(), visualize()

Examples


# Matrix Profile
result <- compute(mp_toy_data$data[, 1], 80)

# Pan-Matrix Profile
result <- compute(mp_toy_data$data[, 1])


tsmp documentation built on Aug. 21, 2022, 1:13 a.m.