Parameterizing the cost function of Dynamic Time Warping with application to time series classification