Learn R Programming

dtwSat (version 0.2.8)

twdtwMatches-class: class "twdtwMatches"

Description

Class for Time-Weighted Dynamic Time Warping results.

Usage

# S4 method for ANY
twdtwMatches(timeseries = NULL, patterns = NULL, alignments = NULL)

# S4 method for twdtwMatches index(x)

# S4 method for twdtwMatches length(x)

# S4 method for twdtwMatches as.list(x)

# S4 method for twdtwRaster as.list(x)

# S4 method for twdtwMatches,ANY,ANY,ANY [(x, i, j, drop = TRUE)

# S4 method for twdtwMatches,numeric,ANY [[(x, i, j, drop = TRUE)

# S4 method for twdtwMatches labels(object)

# S4 method for twdtwMatches show(object)

# S4 method for ANY is.twdtwMatches(x)

Arguments

timeseries

a twdtwTimeSeries object.

patterns

a twdtwTimeSeries object.

alignments

an object of class list with the TWDTW results with the same length as timeseries or a list of twdtwMatches.

x

an object of class twdtwMatches.

i

indices of the time series.

j

indices of the pattern.

drop

if TRUE returns a data.frame, if FALSE returns a list. Default is TRUE.

object

an object of class twdtwMatches.

labels

a vector with labels of the time series.

Methods (by generic)

  • twdtwMatches(ANY): Create object of class twdtwMatches.

  • is.twdtwMatches(ANY): Check if the object belongs to the class twdtwMatches.

Slots

timeseries:

An object of class twdtwTimeSeries-class with the satellite time series.

pattern:

An object of class twdtwTimeSeries-class with the temporal patterns.

alignments:

A list of TWDTW results with the same length as the timeseries. Each element in this list has the following results for each temporal pattern in patterns:
from: a vector with the starting dates of each match in the format "YYYY-MM-DD",
to: a vector with the ending dates of each match in the format "YYYY-MM-DD",
distance: a vector with TWDTW dissimilarity measure, and
K: the number of matches of the pattern.

This list might have additional elements:

if keep=TRUE in the twdtwApply call the list is extended to include internal structures used during the TWDTW computation:
costMatrix: cumulative cost matrix,
directionMatrix: directions of steps that would be taken from each element of matrix,
startingMatrix: the starting points of each element of the matrix,
stepPattern: stepPattern used for the computation, see package dtw,
N: the length of the pattern,
M: the length of the time series timeseries,
timeWeight: time weight matrix,
localMatrix: local cost matrix,
matching: A list whose elements have the matching points for each match between pattern the time series, such that:
--index1: a vector with matching points of the pattern, and
--index2: a vector with matching points of the time series.

Author

Victor Maus, vwmaus1@gmail.com

References

Maus:2019dtwSat

Maus:2016dtwSat

See Also

twdtwApply, twdtwTimeSeries-class, and twdtwRaster-class

Examples

Run this code
ts = twdtwTimeSeries(timeseries=MOD13Q1.ts.list)
patterns = twdtwTimeSeries(timeseries=MOD13Q1.patterns.list)
matches = twdtwApply(x = ts, y = patterns, keep=TRUE, legacy=TRUE)
class(matches)
length(matches)
matches 
# Creating objects of class twdtwMatches 
ts  = twdtwTimeSeries(MOD13Q1.ts.list)
patt = twdtwTimeSeries(MOD13Q1.patterns.list)
mat = twdtwApply(ts, patt, weight.fun = logisticWeight(-0.1, 100), 
                 keep=TRUE, legacy=TRUE)
mat = twdtwMatches(ts, patterns=patt, alignments=mat)
mat

Run the code above in your browser using DataLab