5

I have two different time series both length = 100 and I need to know what is the best test (non-parametric, if possible), that return how much these two series are same or similar shapes.

Here are two examples: first one the two series are very similar shape, not matching perfectly but overall trends and tops and bottoms match.

enter image description here

Second example, these two serie are different both for tops, bottoms and trends

enter image description here

Edit: I am testing my series with Spearman's correlation coefficient, but I am not sure if this test can suits my need since Spearman test use a monotonic function, while my series are non-monotonic.

Am I correct?

2 Answers2

3

One thing I might do is some sort of local smoothing? I assume the smallest jitter would be noise that you don't want to influence your analysis. Not sure if scaling both series or subtracting out their means might help too.

I'd follow up computing their cross correlation perhaps?

curious_cat
  • 1,043
  • 10
  • 28
  • 1
    Hi, I have drawn both series by hand as a visual example that's the reason for some noise appearing. I did try to emulate my series that are a sum of sine-cosine function without noise – Alberto acepsut Apr 08 '13 at 06:39
  • @Albertoacepsut: Ok, got it. – curious_cat Apr 08 '13 at 07:32
  • 1
    Yes, scaling the location (and potentially variance) of the series is a good idea before any type of clustering procedure (although for correlations it should make no difference). See [*Vertically Shifted Mixture Models for Clustering Longitudinal Data by Shape*](http://biostats.bepress.com/ucbbiostat/paper308) for some example discussion. – Andy W Apr 08 '13 at 12:31
3

check out the EDMA (euclidean distance matrix analysis), it's used for biological shape comparison and uses a nonparametric bootstrap of the differences in the coordinates between shapes, here is a link to the author's site about the text on the subject http://getahead.psu.edu/purplebook_new.html

and the actual software package

http://www.getahead.psu.edu/EDMA_new.asp

alternatively, there are methods of procrustes fitting of shapes to see differences in them, googleing procrustes in R, I see

http://cc.oulu.fi/~jarioksa/softhelp/vegan/html/procrustes.html

kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467
Corey Sparks
  • 824
  • 6
  • 8
  • 2
    This is interesting advice, but since the OP stated that both time-series have the same length, I assume there is a one-to-one mapping of time events between the two series. These approaches might match coordinates that are not the same. Similar advice though extends to time series that don't have matching coordinates, see [Dynamic time warping](http://en.wikipedia.org/wiki/Dynamic_time_warping). – Andy W Apr 08 '13 at 12:25