I have a large number of time series data and I need to be able to compare the similarity of the curves to a reference curve. The reference curve in question is shown in red in the figure, and I'd like to compute a similarity metric for the blue curve that tells me that these things are highly similar.
The reason that I want these things to be similar is that they are both characterized by a largely monotonic rise, followed by a near plateau at some upper value, and then followed by a largely monotonic drop back down to the initial level. I have computed some similarity measures such as the Frechet distance and DTW distances, using the following snippets of code
sim_score = similaritymeasures.frechet_dist(Z, Zref)
sim_score2, _ = fastdtw(Z, Zref, dist=euclidean)
The problem is is that the scores computed using these techniques do not tell me that these curves are similar. For example, the fastdtw score is shown in the title of the figure, and this score is actually quite large when compared to other comparison scores for curves which I would judge by eye to be much more dissimilar. For example, the following curve has roughly half the fastdtw distance, despite it not having as similar of a shape.
The issue seems to be that the temporal overlap is still being weighted much more heavily then more shape-related attributes. Now it's perhaps possible that a more nuanced understanding of what's possible with DTW would give me the outcome I need, perhaps using a more fully-featured DTW package like https://pypi.org/project/dtw-python/, but I'm unfamiliar with many of the options available in that package. Or maybe there's another method that would be better suited. Of course, I could brute force this by creating a piecewise continuous curve with a bunch of variable parameters describing a step-like shape, optimize them against the target curve, and take the best error match as the distance metric. If the optimization doesn't get trapped in a local minima, then this should work, but it's more involved and messier than I'd like to do if I can avoid it.
Would appreciate any other ideas you all might be able to suggest. Thanks in advance!