Leverage Turing Intelligence capabilities to integrate AI into your operations, enhance automation, and optimize cloud migration for scalable impact.
Advance foundation model research and improve LLM reasoning, coding, and multimodal capabilities with Turing AGI Advancement.
Access a global network of elite AI professionals through Turing Jobs—vetted experts ready to accelerate your AI initiatives.
Dynamic Time warping (DTW) is a method to calculate the optimal matching between two usually temporal sequences that failed to sync up perfectly. It compares the time series data dynamically that results from the plethora of natural and man-made time-series events occurring worldwide. The list can include temperature, school grades, kinetics, kinematic variables, and other variables.
It was originally used to compare distinct speech patterns. But, in the present era, it finds applications in domains like the financial markets, data mining, speech recognition, and others. We observed its significant use in data mining, where it measures the distance between the two time series. It has also coped with different speeds and time deformations linked with time-dependent data automatically.
In this article, we are going to dig deep into the importance of dynamic time warping by considering its different applications and examples.
Let’s understand how the dynamic time warping algorithms help businesses plan a better marketing campaign strategy for brilliant results.
Let’s consider a business that ran a marketing campaign for one year (Jan 2019 - Jan 2020) in a particular market. They termed it an ideal market because of the highly successful output involving incremental leads.
The business plans to run the same campaign in the new markets because of its highly successful results. However, they were unsure about the ideal markets for their marketing campaign. The cost concern stretching over the period of one year also added to the second thoughts.
The dilemma was to look for an approach that would help in identifying which market was an ideal market for the business so that the same marketing campaign could bring the same results at the end of the year.
Dynamic time warping (DTW) helped the business in recognizing which market meets the status of the ideal market. Here’s how the issue was dealt with and the solution followed.
The marketing campaign that ran successfully from Jan 2019 to Jan 2020 was taken into consideration for 6 other prospect or candidate markets for the same marketing campaign.
The leads and campaign data was available for these six markets for a period of Feb 2020 to July 2020. Later, this data from candidate markets was compared with the ideal market using the dynamic time warping algorithm.
Note: The DTW distance refers to the distance between two-time series or arrays with distinct lengths.
After utilizing the dynamic time warping algorithm on the data of the candidate market, the candidate markets that had the lowest distance to the ideal market were selected for implementation of the marketing campaign.
These were the candidate markets B, C and E. Only three out of the six candidate markets were considered, showing similar results to that of the ideal market. And the business continued to start the marketing campaign for the three shortlisted markets.
This way, instead of running the campaign on all the candidate markets, the business was able to use their investment precisely with the results from the dynamic time warping algorithm.
Later, the business was able to incur incremental leads of 5%, 9%, and 6% from the candidate markets B, C, and E respectively. The solution from DTW helped the business in netting a greater number of leads by correctly identifying the markets similar to its ideal market, thereby cutting down the cost of investment in marketing.
Biomechanics includes the academic focus on human movements and time series data such as kinetic, kinematics variables, and spatiotemporal variables that are analyzed frequently to describe and explain human movement. To put it simply, gait research is a systematic approach to studying human motion using the brain and the eye of the observer.
In such research, evaluating the pattern similarity is a challenging task. The visual method may be convenient, but meeting the objectives of the study causes a compromise in the process. For instance, if one has to identify the direction and degree to which the left and right foot of a person in gait diverge from each other, the results are better attained by analyzing the pattern similarity of time series data using mathematical and statistical calculation.
Let’s understand it with a practical example to discover how dynamic time warping can be helpful.
Let’s consider 16 participants in this study in which we have an equal number of males and females. The below-given table illustrates the anthropometric data of the participants.
In this case, we would use three conditions to find the optimal alignment. These are listed below.
In the above conditions,
The optimum walking path is discovered by transforming two sequences into a matrix. Further, it calculates the distinct value of each element of two sequences, which we refer to as local cost that helps us in finding the optimal warping path.
Note: The smallest sum of these local costs defines the optimal warping path and the sum of local costs is called the global cost.
Here’s how you can find it mathematically.
In the above given mathematical formulations, d represents the distance between every element of the two sequences. γ represents the distance accumulated of the warping path. So when the difference between two sequences is null, the resulting warping path comes as the diagonal of the matrix.
However, the symmetry index is used traditionally for evaluating the similarity in gait research. It is done using the following formula.
For a value of SI < 10%, the symmetry is accepted.
In the study that we have considered, we will compare the results of the symmetry index and dynamic time warping.
The results achieved from the implementation of the data into DTW and SI gave rise to the following result.
Here, the picture on the left shows the alignment and warping path of data sequences when we compare the left and right foot evaluations to those similar in SI and DTW.
Another case where the evaluations were non-similar in the case of SI and DTW showed a different picture.
Another case also came into the picture where the evaluations were similar in SI but were non-similar in DTW, as given below.
This study was done to understand the effectiveness of dynamic time warping in gait research. As per the results achieved, DTW has confirmed its applicability for gait research by showing different results from SI which is a basic test to test the similarity of gait. To put it simply, the results achieved have pointed out the fact that dynamic time warping can be used for similarity tests of gait research.
It’s no secret that a dynamic time warping algorithm is a powerful distance metric to have in one’s toolbox. It comes in handy when one works with two non-linear sequences, exceptionally when one of them is a shrunk or non-linear version of the other. From comparing the stock trading data over similar time frames to accurately calculating the speed of the walker, it is a great technique that data scientists and data analysts must be familiar with in order to work with time series data.
Srishti is a competent content writer and marketer with expertise in niches like cloud tech, big data, web development, and digital marketing. She looks forward to grow her tech knowledge and skills.