This package STSMotifs
allows to perform a research of motif into spatial time series. The main purpose is to find a way to handle the issue of large amouts of data. The package offers a way to do this research quickly and efficiently. To find the motifs, the Combined Series Approach (CSA)
is used. The process is decomposed by several steps :
To use functions of this package, some inputs are needed. The quality of outputs depends strongly by these parameters, the user has to pay attention.
dataset
: Dataframe which contains numerics valuesThe dataset contain only numerics values. Columns represent the space and rows the time.
#> 1 2 3 4 5 6 7 8 9 10
#> 360 737 1350 869 750 1138 758 1006 1095 99 -83
#> 361 283 565 504 317 1849 944 -80 -895 -936 906
#> 362 -118 -375 -564 -803 870 472 -922 -1009 -698 741
#> 363 -696 -844 -654 -1303 -474 -591 -262 1034 1012 376
#> 364 -251 -622 -14 -587 -1108 -1401 404 1545 1696 247
#> 365 645 -10 -4 411 -858 -1261 -574 -329 -367 -680
alpha
: The number of letters to do the encode of numerics values
window_size
: The lengths of the motifs
tslice
and sslice
: Allows you to control the shape of the blocks
A part of the process is applied into blocks (subset of the original dataset). With the tslice (“Time slice” number of rows in each block) and sslice (“Space slice” number of columns in each block), the user can specify a block shape (vertical rectangle, square or horizontal rectangle).
kappa
and sigma
: Thresholds to check the quality of each motifKappa (Spacial Occurence) represents the minimal number of motif occurences in the different columns. Sigma (Global Occurence) represents the minimal number of motif occurences in the throughout the dataset.
This step create blocks. After that, all this process is adapted in a single time series. Thereby each columns of the block are combined to create a single big time series. The output of this step are information about each blocks :
This step requires the candidates and the kappa and sigma thresholds. All information about motifs are extracted and manipulated At the end, the motifs that passed the restriction of the 2 thresholds are stored into a list of motif. Each pattern has as information :
Once these motifs created, a filtering is applied.
The previous step has created a list of motifs with all information about them. These motifs are ranked by their occurences. The ouput is the same as the previous step but a classification is added
There is 3 ways to visualize the result.
Plot the intensity of values and highlight one motifs or the top 5
Plot the spatial-time series by select a range of columns in the dataset and highlight one motifs
Run an application to have an interactive interface to visualize the result
To see an example of output : Output Example