Learn R Programming

dtwSat (version 0.2.8)

plotCostMatrix: Plotting paths

Description

Method for plotting low cost paths in the TWDTW cost matrix.

Usage

plotCostMatrix(
  x,
  timeseries.labels = NULL,
  patterns.labels = NULL,
  matrix.name = "costMatrix"
)

Value

A ggplot object.

Arguments

x

An object of class twdtwMatches.

timeseries.labels

The label or index of the time series. Default is 1.

patterns.labels

A vector with labels of the patterns. If not declared the function will plot one alignment for each pattern.

matrix.name

A character. The name of the matrix to plot, "costMatrix" for accumulated cost, "localMatrix" for local cost, or "timeWeight" for time-weight. Default is "costMatrix".

Author

Victor Maus, vwmaus1@gmail.com

References

Maus:2019dtwSat

Maus:2016dtwSat

See Also

twdtwMatches-class, twdtwApply, plotAlignments, plotPaths, plotMatches, and plotClassification.

Examples

Run this code
log_fun = logisticWeight(-0.1, 100)
ts = twdtwTimeSeries(MOD13Q1.ts.list)
patt = twdtwTimeSeries(MOD13Q1.patterns.list)
mat1 = twdtwApply(x=ts, y=patt, weight.fun=log_fun, keep=TRUE, legacy=TRUE)

plotCostMatrix(mat1, matrix.name="costMatrix")

plotCostMatrix(mat1, matrix.name="localMatrix")

plotCostMatrix(mat1, matrix.name="timeWeight")

Run the code above in your browser using DataLab