Search for Spatial-time Motifs

Amin Bazaz, Heraldo Borges, Eduardo Ogasawara

2018-11-09

The purpose of this documentation is to understand the second step of CSA data minig process correspond to SearchSTMotifs function. In this function, the spatial-time dataset DS is partitioned into blocks, created based on sb (spatial block size) and tb (temporal block size).

Blocks creation

Blocks creation

All subsequences inside each block are combined into a single time series called combined series (cs).

Combine the spatial-time series into each block

Combine the spatial-time series into each block

Analysing the cs, all subsequences of size w are evaluated. If the number of occurrences of each sequence is greater than sigma and the number of distinct spatial-time series for them are greater or equal to kappa, then his position are registered at a list of stmotifs.

All motifs that are identified inside a block are local block motifs. These motifs are merged such that all occurrences of each motif are grouped as long as they occur in neighbor blocks. In the end, each motif has as information: * isaxcode: Motif sequences in character format * recmatrix: Matrix giving as information the blocks containing this motif * vectst: Coordinate of the start positions of the motif in the original dataset

Example

head(SearchSTMotifs(STMotif::example_dataset,NormSAX(STMotif::example_dataset,7),3,7,10,10,3,10))
#> $aaa
#> $aaa$isaxcod
#> [1] "aaa"
#> 
#> $aaa$recmatrix
#>       [,1] [,2] [,3] [,4] [,5]
#>  [1,]    0    0    0    0    0
#>  [2,]    0    0    0    0    0
#>  [3,]    0    0    0    0    0
#>  [4,]    0    0    0    0    0
#>  [5,]    0    0    0    0    0
#>  [6,]    0    0    0    0    0
#>  [7,]    0    0    0    0    0
#>  [8,]    1    0    0    0    0
#>  [9,]    0    0    0    0    0
#> [10,]    0    0    0    0    0
#> 
#> $aaa$vecst
#>     s  t
#> 1   1 73
#> 2   2 74
#> 3   3 74
#> 4   4 75
#> 5   5 76
#> 6   6 77
#> 7   7 77
#> 8   8 77
#> 9   9 78
#> 10 10 78
#> 
#> 
#> $aaa
#> $aaa$isaxcod
#> [1] "aaa"
#> 
#> $aaa$recmatrix
#>       [,1] [,2] [,3] [,4] [,5]
#>  [1,]    0    0    0    0    0
#>  [2,]    0    0    0    0    0
#>  [3,]    0    0    0    0    0
#>  [4,]    0    0    0    0    0
#>  [5,]    0    0    0    0    0
#>  [6,]    0    0    0    0    0
#>  [7,]    0    0    0    0    0
#>  [8,]    0    0    0    0    0
#>  [9,]    0    0    2    2    2
#> [10,]    0    0    0    0    0
#> 
#> $aaa$vecst
#>     s  t
#> 11 21 86
#> 12 22 87
#> 13 23 87
#> 14 24 87
#> 15 25 87
#> 16 26 86
#> 17 27 85
#> 18 28 85
#> 19 29 85
#> 20 30 85
#> 21 31 85
#> 22 32 85
#> 23 33 84
#> 24 34 84
#> 25 35 83
#> 26 35 84
#> 27 36 83
#> 28 37 83
#> 29 38 83
#> 30 39 83
#> 31 40 83
#> 32 41 83
#> 33 42 83
#> 34 43 82
#> 35 44 82
#> 36 45 82
#> 37 46 82
#> 38 47 82
#> 39 48 82
#> 40 49 82
#> 41 50 82
#> 
#> 
#> $ggg
#> $ggg$isaxcod
#> [1] "ggg"
#> 
#> $ggg$recmatrix
#>       [,1] [,2] [,3] [,4] [,5]
#>  [1,]    0    0    0    0    0
#>  [2,]    0    0    0    0    0
#>  [3,]    0    0    0    0    0
#>  [4,]    0    0    0    0    0
#>  [5,]    0    0    0    0    0
#>  [6,]    0    0    0    0    0
#>  [7,]    0    0    0    0    0
#>  [8,]    0    0    0    0    0
#>  [9,]    0    0    1    0    0
#> [10,]    0    0    0    0    0
#> 
#> $ggg$vecst
#>     s  t
#> 1  21 81
#> 2  21 82
#> 3  21 83
#> 4  22 81
#> 5  22 82
#> 6  22 83
#> 7  23 82
#> 8  23 83
#> 9  23 84
#> 10 24 82
#> 11 24 83
#> 12 24 84
#> 13 25 82
#> 14 25 83
#> 15 26 81
#> 16 26 82
#> 17 26 83
#> 18 27 81
#> 19 27 82
#> 20 28 81
#> 21 28 82
#> 22 29 81
#> 23 29 82
#> 24 30 81
#> 
#> 
#> $ggg
#> $ggg$isaxcod
#> [1] "ggg"
#> 
#> $ggg$recmatrix
#>       [,1] [,2] [,3] [,4] [,5]
#>  [1,]    0    0    0    0    0
#>  [2,]    0    0    0    0    0
#>  [3,]    0    0    0    0    0
#>  [4,]    0    0    0    0    0
#>  [5,]    0    0    0    0    0
#>  [6,]    0    0    0    0    0
#>  [7,]    0    0    0    0    0
#>  [8,]    0    0    0    0    2
#>  [9,]    0    0    0    0    0
#> [10,]    0    0    0    0    0
#> 
#> $ggg$vecst
#>     s  t
#> 25 41 77
#> 26 41 78
#> 27 42 77
#> 28 42 78
#> 29 43 76
#> 30 43 77
#> 31 43 78
#> 32 44 76
#> 33 44 77
#> 34 44 78
#> 35 45 76
#> 36 45 77
#> 37 45 78
#> 38 46 77
#> 39 46 78
#> 40 47 76
#> 41 47 77
#> 42 47 78
#> 43 48 76
#> 44 48 77
#> 45 48 78
#> 46 49 76
#> 47 49 77
#> 48 49 78
#> 49 50 76
#> 50 50 77
#> 51 50 78