calculate_motifs function

Computes the relative frequency of motifs in a categorical time series

Computes the relative frequency of motifs in a categorical time series

calculate_motifs computes the motifs of a categorical time series UTF-8

calculate_motifs(series, motif_length)

Arguments

  • series: An object of type tsibble (see R package tsibble), whose column named Value contains the values of the corresponding CTS. This column must be of class factor and its levels must be determined by the range of the CTS.
  • motif_length: The length of the motif.

Returns

Returns an array with the relative frequency of motifs in a categorical time series.

Details

Given a CTS of length TT with range V={1,2,,r}\mathcal{V}=\{1, 2, \ldots, r\}, Xt={X1,,XT}\overline{X}_t=\{\overline{X}_1,\ldots, \overline{X}_T\}, and a motif length LL, the function returns an array of rLr^L elements, with the element in the position (i1,i2,,ir)(i_1, i_2, \ldots, i_r) being the relative frequency of the motif ``i1i2iri_1i_2 \cdots i_r'' in the corresponding time series.

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

References

Rdpack::insert_ref(key="lonardi2002finding",package="ctsfeatures")

Author(s)

Ángel López-Oriona, José A. Vilar

  • Maintainer: Angel Lopez-Oriona
  • License: GPL-2
  • Last published: 2024-01-29

Useful links