Dynamic time warping is an algorithm for comparing two different time series by minimizing the distance between time series. This project explores how dynamic time warping can be applied to the number of Covid-19 cases in 2021 in Ohio and Illinois.
The functions associated with dynamic time warping were created and tested in R using data acquired from the Johns Hopkins Coronavirus Resource Center. A distance matrix was constructed with elements representing the Euclidean distance from a point to every other point in the opposing time series. Using this matrix, we constructed an accumulated distance matrix where each point is the value of the distance matrix plus the minimum value of the three neighboring elements of the accumulated distance matrix. Three warping paths were constructed that add the minimum neighbor in the accumulated distance matrix, although each path moves differently when more than one neighbor’s value represents the minimum. We refer to this as a tie. When there was a tie between two neighbors, the first path added the neighbor with the lesser neighbor itself, while the other two paths added the opposing neighbor. When all three neighbors shared the same value, the first path added the diagonal neighbor, the second path added the neighbor with the lesser neighbor itself, and the third path added the neighbor that hadn’t yet been selected.
We found that the warping path for the number of cumulative cases follows the border of the ADM, while the warping path for the number of new cases moves diagonally through the ADM. Moving forward, we plan on including more states in the analysis as well as exploring different measures of distance. This experience has been helpful in that I have learned about a new algorithm in comparing time series data.
Author: Danny Morrissey
Faculty Advisor: Tatjana Miljkovic, Department of Statistics


You must be logged in to post a comment.