# Dynamic Time Warping in Julia

**URL:** <https://discourse.julialang.org/t/dynamic-time-warping-in-julia/13426>\
**Category:** Signal and Image Processing\
**Created:** [August 14, 2018, 9:40am UTC](https://discourse.julialang.org/t/dynamic-time-warping-in-julia/13426 "2018-08-14T09:40:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Moses](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@Moses](https://discourse.julialang.org/u/Moses)\
**Post date:** [August 14, 2018, 9:41am UTC](https://discourse.julialang.org/t/dynamic-time-warping-in-julia/13426/1 "2018-08-14T09:41:00Z")

</div>

Hello everybody.

I hope, I am in the right domain for this question.

I am looking for an implemantation of dynamic time warping in `julia`. Obviously, there has been some work on this already: [here](https://github.com/ahwillia/TimeWarp.jl) and [here](https://github.com/joefowler/DynamicTimeWarp.jl). However, both packages seem to be unmaintained or discontinued and I cannot find any documentation.

I tried to work myself through the examples in `TimeWarp.jl`. However, most of them fail, because parts of the package cannot be compiled (error messages like “undefined methods”). Some methods seem to be stubs.

Does anybody use dynamic time warping? If so, do you have any implementations in julia, that you could share?

Thanks in advance

Moses

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [August 15, 2018, 6:02am UTC](https://discourse.julialang.org/t/dynamic-time-warping-in-julia/13426/2 "2018-08-15T06:02:26Z")

</div>

From the CI logs it looks like

[https://github.com/ahwillia/TimeWarp.jl](https://github.com/ahwillia/TimeWarp.jl)

did work on some pre-v0.7 versions, so perhaps it would need little more than fixing deprecations to transition to Julia v0.7/v1.0.

If you need this functionality and the original maintainer is not interested in supporting the package, then forking and fixing things could be a good learning experience. It is polite to ask the original maintainer first about it though, eg by opening an issue.

---

<div class="post-metadata">

**Author:** ![Moses](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@Moses](https://discourse.julialang.org/u/Moses)\
**Post date:** [August 15, 2018, 11:16am UTC](https://discourse.julialang.org/t/dynamic-time-warping-in-julia/13426/3 "2018-08-15T11:16:23Z")

</div>

> [@Tamas\_Papp](#):
>
> If you need this functionality and the original maintainer is not interested in supporting the package, then forking and fixing things could be a good learning experience. It is polite to ask the original maintainer first about it though, eg by opening an issue.

I already asked the original author for some help or documentation, but haven’t got any reply, yet. I was just hoping, that somebody else already forked the package or build one for personal use.

My problem is that I do not know, whether or not time warping is the correct method for my purpose (I want to cluster time series data from fluorescence microscopy experiments, especially ratiometric FRET experiments). As interesting as it would be to fork and develop that package, it might just turn out to be a huge investment into the wrong direction, especially since I am neither a trained programmer nor mathematician.

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [August 15, 2018, 11:30am UTC](https://discourse.julialang.org/t/dynamic-time-warping-in-julia/13426/4 "2018-08-15T11:30:10Z")

</div>

> [@Moses](#):
>
> I already asked the original author for some help or documentation, but haven’t got any reply, yet.

Did you open an issue in the github repository?

---

<div class="post-metadata">

**Author:** ![Moses](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@Moses](https://discourse.julialang.org/u/Moses)\
**Post date:** [August 15, 2018, 11:36am UTC](https://discourse.julialang.org/t/dynamic-time-warping-in-julia/13426/5 "2018-08-15T11:36:50Z")

</div>

Not yet. I send him an email.

---

<div class="post-metadata">

**Author:** ![Seanny123](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/seanny123/32/5271_2.png) [@Seanny123](https://discourse.julialang.org/u/Seanny123)\
**Post date:** [November 8, 2018, 8:45pm UTC](https://discourse.julialang.org/t/dynamic-time-warping-in-julia/13426/6 "2018-11-08T20:45:10Z")

</div>

I’m also interested in this. Specifically, an implementation of the [UCR Suite of DTW optimizations](https://blog.acolyer.org/2016/05/11/searching-and-mining-trillions-of-time-series-subsequences-under-dynamic-time-warping/). Currently, I’ve only been able to [find C-libraries with Python bindings](https://github.com/Seanny123/pydtw).

On the topic of clustering, you may want to consider [Matrix Profile](https://www.cs.ucr.edu/~eamonn/MatrixProfile.html), which is specialized for clustering time-series.

---

<div class="post-metadata">

**Author:** ![Seanny123](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/seanny123/32/5271_2.png) [@Seanny123](https://discourse.julialang.org/u/Seanny123)\
**Post date:** [February 13, 2019, 3:50pm UTC](https://discourse.julialang.org/t/dynamic-time-warping-in-julia/13426/7 "2019-02-13T15:50:03Z")

</div>

I just open-sourced my [Julia implementation of the UCR Suite of DTW optimizations](https://discourse.julialang.org/t/ann-ucrdtw-jl-a-fast-implementation-of-dynamic-time-warping/20750)!

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [April 24, 2020, 10:35am UTC](https://discourse.julialang.org/t/dynamic-time-warping-in-julia/13426/8 "2020-04-24T10:35:42Z")

</div>

For those who stumble into this thread looking for this functionality, here’s a reworked fork of TimeWarp.jl

> **[GitHub - baggepinnen/DynamicAxisWarping.jl: Dynamic Time Warping (DTW) and...](https://github.com/baggepinnen/DynamicAxisWarping.jl)**
>
> Dynamic Time Warping (DTW) and related algorithms in Julia, at Julia speeds - GitHub - baggepinnen/DynamicAxisWarping.jl: Dynamic Time Warping (DTW) and related algorithms in Julia, at Julia speeds

with some performance improvements and some feature additions etc.
