plot.rundtw {IncDTW} | R Documentation |
Plot
Description
Plot the results from rundtw
.
Usage
## S3 method for class 'rundtw'
plot(x, knn = TRUE, minima = TRUE,
scale = c("none", "01", "z"),
selDim = 1, lix = 1, Q = NULL, C = NULL, normalize = c("none", "01", "z"), ...)
Arguments
x |
output from |
knn |
logical, if TRUE ( = default) and the k nearest neighbors were found by |
minima |
logical, if TRUE ( = default) and |
scale |
character, one of c("none", "01", "z"). If "01" or "z" then the detected minima and knn are normed and plotted. |
selDim |
integer vector, default = 1. Set the dimensions to be plotted for multivariate time series |
lix |
list index, integer, default = 1. If |
Q |
time series, default = NULL, either passed as list entry of |
C |
time series, default = NULL, either passed as list entry of |
normalize |
deprecated, use |
... |
additional arguments passed to ggplot() |
Details
Only for those subsequences for which the calculations were finished by rundtw
, the distances are plotted (see the parameters threshold
, k
and early_abandon
of rundtw
).
See Also
Examples
#--- Simulate a query pattern Q and a longer time series C,
# and detect rescaled versions of Q in C
set.seed(123)
Q <- sin(seq(0, 2*pi, length.out = 20))
Q_rescaled <- Q * abs(rnorm(1)) + rnorm(1)
C <- c(rnorm(20), Q_rescaled , rnorm(20))
# Force rundtw to finish all calculations and plot the vector of DTW distances
ret <- rundtw(Q, C, threshold = NULL, lower_bound = FALSE)
ret
plot(ret)
# Allow early abandoning and lower bounding, and also plot C
ret <- rundtw(Q, C, return_QC = TRUE, ws = 5)
ret
plot(ret)
# Get 1 nearest neighbor -> allow early abandon and lower bounding,
# and plot C and also plot the scaled detected nearest neighbors
ret <- rundtw(Q, C, ws = 5, k = 1, return_QC = TRUE)
ret
plot(ret, scale = "01")
#--- See the help page of rundtw() for further examples.