Description
The DTW function performs dynamic time warping (DTW), which measures the similarity (warp distance) between two time series that vary in time or speed. You can use DTW to analyze any data that can be represented linearly, for example, video, audio, and graphics.
Usage
td_dtw_mle (
data = NULL,
template.data = NULL,
mapping.data = NULL,
input.columns = NULL,
template.columns = NULL,
timeseries.id = NULL,
template.id = NULL,
radius = 10,
dist.method = "EuclideanDistance",
warp.path = FALSE,
data.sequence.column = NULL,
template.data.sequence.column = NULL,
mapping.data.sequence.column = NULL,
data.partition.column =NULL,
mapping.data.partition.column = NULL,
data.order.column = NULL,
template.data.order.column = NULL,
mapping.data.order.column = NULL
)
Arguments
data |
Required Argument. |
data.partition.column |
Required Argument. |
data.order.column |
Required Argument. |
template.data |
Required Argument. |
template.data.order.column |
Required Argument. |
mapping.data |
Required Argument. |
mapping.data.partition.column |
Required Argument. |
mapping.data.order.column |
Optional Argument. |
input.columns |
Required Argument. |
template.columns |
Required Argument. |
timeseries.id |
Required Argument. |
template.id |
Required Argument. |
radius |
Optional Argument. |
dist.method |
Optional Argument.
Types: character |
warp.path |
Optional Argument. |
data.sequence.column |
Optional Argument. |
template.data.sequence.column |
Optional Argument. |
mapping.data.sequence.column |
Optional Argument. |
Value
Function returns an object of class "td_dtw_mle" which is a named list containing objects of class "tbl_teradata". Named list member can be referenced directly with the "$" operator using name: result.
Examples
# Get the current context/connection
con <- td_get_context()$connection
# Load example data.
loadExampleData("dtw_example", "timeseriesdata", "templatedata", "mappingdata")
# Create object(s) of class "tbl_teradata".
timeseriesdata <- tbl(con, "timeseriesdata")
templatedata <- tbl(con, "templatedata")
mappingdata <- tbl(con, "mappingdata")
# Example 1 -
# This example compares multiple time series to both a common template and each other.
# Each time series represents stock prices and the template represents a series
# of stock index prices.
td_dtw_mle_out <- td_dtw_mle(data = timeseriesdata,
data.partition.column = c("timeseriesid"),
data.order.column = c("timestamp1"),
template.data = templatedata,
template.data.order.column = c("timestamp2"),
mapping.data = mappingdata,
mapping.data.partition.column = c("timeseriesid"),
input.columns = c("stockprice", "timestamp1"),
template.columns = c("indexprice", "timestamp2"),
timeseries.id = "timeseriesid",
template.id = "templateid"
)