calculate_motifs {ctsfeatures} | R Documentation |
Computes the relative frequency of motifs in a categorical time series
Description
calculate_motifs
computes the motifs of a categorical time series
Usage
calculate_motifs(series, motif_length)
Arguments
series |
An object of type |
motif_length |
The length of the motif. |
Details
Given a CTS of length with range
,
, and a motif length
,
the function returns an array of
elements, with the element
in the position
being the relative frequency
of the motif “
” in the corresponding time series.
Value
Returns an array with the relative frequency of motifs in a categorical time series.
Author(s)
Ángel López-Oriona, José A. Vilar
References
Lonardi JLEKS, Patel P (2002). “Finding motifs in time series.” In Proc. of the 2nd Workshop on Temporal Data Mining, 53–68.
Examples
sequence_1 <- GeneticSequences[which(GeneticSequences$Series==1),]
calculate_motifs(sequence_1, motif_length = 3)
# Computing the relative frequencies of motifs of length 3 for the first
# series in dataset GeneticSequences