# Similarity measure for multivariate time series with heterogeous length and content

I am interested in clustering multivariate N time series of T'values' each(different lengths) using python. Each variable have many trends and values which are simultaneously numeric and nominal.

A sample $$T_{i}$$ in the dataset has the following format:

TimeStamp       | Sensor0 | Sensor1| Sensor2
2015-02-05 11:30|<Min     | On     | off
2015-02-05 11:31|<Min     | on     | off
2015-02-05 11:32| Action2 | 10     | 0.0001
2015-02-07 11:33| Action2 | 10     | 0.00012
2015-02-07 11:34| Action2 | 10     | 0.00012
2015-02-07 11:35| Action2 | 20     | 0.00015


Another sample $$T_{j}$$ in the dataset has the following format:

TimeStamp       | Sensor0 | Sensor1| Sensor2
2015-10-05 11:30| Action2 | 11     | off
2015-10-05 11:31| Action1 | 11     | off
2015-10-05 11:32| Action2 | NAN    | 0.0001
2015-10-07 11:33| Action3 | NAN    | 0.00012
2015-10-07 11:34| <Min    | 10     | 0.00012
2015-10-07 11:35| <Min    | 15     | on


For the missing values (not numeric), they were not collected by the sensors so my idea was to replace them by minimum values., given that all values are strictly positive. Otherwise, they would be considered as missing values. In which case the problem would be of finding a similiraty measure that can compare missing values (off,on..) and numeric values.

I am wondering if there is a similarity / distance measure already exist in the litterature to compare such multivariate timeseries, with hetergonuos lengths, and whether this kind of problem has already been formulated in the papers, books or else for R and python.

• Fit the time series to a model, and cluster the model parameters.
– Emre
Aug 16, 2016 at 19:45
• @ emre thank you for your response. I just can't seem to find a way of finding the right modeling framework for such context. So you have a specific method in mind? Aug 16, 2016 at 21:48
• I'd use a neural network.
– Emre
Aug 16, 2016 at 21:51
• That's indeed a very good paper. I am a newbie to deep learning. It will be difficult for me to implement it in python. Do you know of good resources for a beginner(books moods github..)? Aug 16, 2016 at 22:24
• Start here, then try these time series tutorials.
– Emre
Aug 16, 2016 at 23:03