TS_PlotDataMatrix
) or a low-dimensional representation of it (TS_PlotLowDim
), sometimes it can be more interesting to retrieve and visualize relationships between a set of nearest neighbors to a particular time series of interest.TS_SimSearch
function, specifying the id of the time series of interest (i.e., the ID
field of the TimeSeries
structure) with the first input and the number of neighbors with the 'numNeighbors' input specifier (default: 20). By default, data is loaded from HCTSA_N.loc
, but a custom source can be specified using the 'whatDataFile'
input specifier (e.g., TS_SimSearch('whatDataFile','HCTSA_custom.mat')
).TS_SimSearch
outputs the list of neighbors and their distances to screen, and the function also provides a range of plotting options to visualize the neighbors. The plots to produce are specified as a cell using the 'whatPlots' input.'matrix'
option of the TS_SimSearch
function. An example output using a publicly-available EEG dataset, retrieving 14 neighbors from the time series with ID = 1
, as TS_SimSearch(1,'whatPlots',{'matrix'},'numNeighbors',14)
, is shown below:ID = 1
) is shown as a white star, and all 14 neighbors are shown, as labeled on the left of the plot with their respective IDs, and a 100-sample subset of their time traces.TS_LabelGroups
as: TS_LabelGroups({'seizure','eyesOpen','eyesClosed'})
), the function shows these class assignments using color labels to the left of the plot (purple, green, and orange in this case).HCTSA*.mat
file using TS_PairwiseDist
for custom distance metrics (which is done by default in TS_Cluster
for datasets containing fewer than 1000 objects). TS_SimSearch
checks for this information in the specified input data (containing the ts_clust
or op_clust
structure), and uses it to retrieve neighbors. If distances have not previously been computed, distances from the target are computed as euclidean distances (time series) or absolute correlation distances (operations) between feature vectors within TS_SimSearch
.