Learn R Programming

dtwSat (version 0.1.0)

twdtw: Multidimensional Time-Weighted DTW Alignment

Description

This function performs a multidimensional Time-Weighted DTW analysis and retrieves the alignments of a query within a time series.

Usage

twdtw(query, template, weight = NULL, dist.method = "Euclidean", theta = NULL, alpha = NULL, beta = NULL, n.alignments = NULL, span = NULL, step.matrix = symmetric1, keep = FALSE, query.name = NULL)

Arguments

query
A zoo object with a query time series.
template
A zoo object with a template time series similar to query. The template must have the same number of attributes and be equal to or longer than the query, i.e. nrow(query)<=nrow(template)< code="">.
weight
A character. ''linear'' for linear weight or ''logistic'' for logistic weight. Default is NULL that runs the original dtw method, i.e. without time weight.
dist.method
A character. Method to derive the local cost matrix. Default is ''Euclidean'' See dist in package proxy.
theta
A number. Parameter for ''linear'' time weight. For theta=1 the time weight is equal to the number of elapsed days.
alpha
A number. The steepness of logistic weight.
beta
A number. The midpoint of logistic weight.
n.alignments
An integer. The maximun number of alignments to perform. NULL will return all possible alignments.
span
Span between two points of minimum in days, i.e. the minimum interval between two alignments, for details see [1]
step.matrix
see stepPattern in package dtw [2]
keep
preserves the cost matrix, inputs, and other internal structures. Default is FALSE
query.name
A query identification.

Value

An object of class dtwSat-class

References

[1] M\"uller, M. (2007). Dynamic Time Warping. In Information Retrieval for Music and Motion (pp. 79-84). London: Springer London, Limited.

[2] Giorgino, T. (2009). Computing and Visualizing Dynamic Time Warping Alignments in R: The dtw Package. Journal of Statistical Software, 31, 1-24.

See Also

mtwdtw, dtwSat-class

Examples

Run this code
names(query.list)
query.name = "Soybean"
alig = twdtw(query.list[[query.name]], template, weight = "logistic",
       alpha = 0.1, beta = 100, n.alignments=4, query.name=query.name)
alig

Run the code above in your browser using DataLab