# SMM: Leveraging Metadata for Contextually Salient Multi-Variate Motif Discovery
## 4 SMM: Contextually Salient Multi-Variate Motif (CS-motif) Discovery
### Salient Multi-Variate Sub-Sequences (SMSs)
#### 4.1.1 Scale-Spaces of Multi-Variate Time Series  
Intuitively, each contextually salient feature \(f_{i}\) extracted from a multi-variate time series is a triple \(\langle T_{i},V_{i},D_{i}\rangle\), where \(T_{i}=[t_{i,start},t_{i,end}]\) is a time interval (i.e., temporal scope), \(V_{i}\) is a subset of the variates that make up the time series (i.e., variate scope) and \(D_{i}\) is a fixed-length vector describing the local gradient distribution as a function of the underlying metadata. The algorithm to identify these sub-sequences relies on a two-step process. The first stage identifies salient multi-variate sub-sequences across multiple scales (created in a way that takes into account the relationships among the variates). To achieve this, a scale-space representation of the multi-variate series is constructed through iterative smoothing (across time and metadata graph) which creates different resolutions of the input series (Figure 6); then, sub-sequences of interest with the largest variations with respect to their neighbors in both time and variates are located on this scale-space. Once these multi-variate sub-sequences are identified, a gradient histogram is associated to each sub-sequence as a descriptor to support indexing and search. \(\frac{1}{\sqrt{2\pi v}}e^{\frac{v_{l}^{2}}{2v^{2}}}\) for a smoothing parameter \(\sigma\)), the same cannot be said for smoothing across variates, because, while time is totally ordered (enabling convolution), the graph is not--therefore, convolution filters cannot be applied directly. We handle this by (a) defining, for each variate \(v_{l}\), two functions \(frwd_{G}(v_{l},\delta)\) and \(bkwd_{G}(v_{l},\delta)\), as the forward and backward neighbors of \(v_{l}\) at a distance at most \(\delta\) on the metadata graph; given these functions, which (partially) order the variates relative to \(v_{l}\), (b) we apply, for each \(v_{l}\), Gaussian smoothing across variates centered around \(v_{l}\) (the values of variates at the same distance from \(v_{l}\) are averaged). Given a multi-variate time series \(\mathbb{T}\) and a metadata graph \(C\), the smoothing process with temporal-smoothing parameter \(\sigma_{t}\) and variate smoothing parameter \(\sigma_{v}\) results into scale-space \(\mathcal{M}\), where the entry \(\mathcal{M}[s_{t},s_{v}](t_{i},v_{j})\) corresponds to the series at time \(t_{i}\) for variate \(v_{j}\), smoothed \(s_{t}\) times temporally and \(s_{v}\) times across variates of graph \(C\). Increasing the smoothing rates along time and along variates reduces the details in the time series by taking into account the available metadata (Figure 7). Once the scale space is created, the contextually salient \(\langle s_{t},s_{v}t_{i},v_{j}\rangle\) quadruples can be identified by comparing \(\mathcal{M}[s_{t},s_{v}](t_{i},v_{j})\) to its neighbors (across time, variates and both) and by selecting the quadruples with the largest differences from their neighbors. In Section 4.1.2, we further discuss how these contextually salient subsequences are identified. Descriptor Creation for Multi-variate Sub-Sequences  
Note that each quadruple \(\langle s_{t},s_{v},t_{i},v_{j}\rangle\) represents a temporal interval (i.e., temporal scope, \([t_{i}-3\times s_{t}\times\sigma_{t},t_{i}+3\times s_{t}\times\sigma_{t}]\)) centered around time instance \(t_{i}\) and a set of variates (i.e., variate scope) centered around variate \(v_{j}\)--in other words, each quadruple can be considered as a contextually salient multi-variate sub-sequence of the input time series \(\mathbb{T}\). Once these contextually salient sub-sequences are identified, the next step is to create a descriptor for the sub-sequences to enable their comparisons.