1. A method for comparing a first data sequence with a second data sequence, comprising: constructing a cross-correlation matrix of distances between all possible pairs of values of the first and second data sequences; determining a minimum cost path between diagonally opposing corners of the cross-correlation matrix; projecting the minimum cost path onto a transfer function that maps between the first data sequence and the second data sequences; and projecting the minimum cost path onto a deformation function that corresponds to a similarity between the first data sequence and the second data sequence.