1

I want to correlate two vectors not only in their shape but also considering their values in matlab. The functions i've searched (like, corrcoef/corr/corr2...) give the R-value, but that just consider the shape of the curve that the vectors represent, and i want to know also how close their values are. Is there any function that consider these both criteria(shape and values)?

Thank you so much in advance!

PingP
  • 17
  • 5
  • Your question is ill-defined. Correlations are _by definition_ measuring the similarity of fluctuations of two variables around their average value. There are of course many other quantities that define the distance between two vectors, but it's a completely different question. – Ratbert Mar 15 '15 at 15:58
  • @Ratbert - Yes I know, the problem is that if you compare two functions with the same shape, like 'sin(x)' and '2*sin(x)' or 'sin(x)' and '4*sin(x)', using the 'corr2' it will always give the R=1, no matter how close the values are. What i meant with my question was how can i have a function that tells me not only that '2*sin(x)' has the same (or close in the case of my vectors) shape but also that it is closer to my values than the vector '4*sin(x)'. I hope it has clarified your doubt about my question(: – PingP Mar 16 '15 at 10:53
  • I understand your question, and I maintain that it is ill-defined. There is no such quantity, because it would mix altogether two very different things. You want something that does not exist. – Ratbert Mar 16 '15 at 10:57
  • @Ratbert - And do you know any way that i could do that, even without using only a correlation function? Thank you for your help. – PingP Mar 16 '15 at 11:09
  • I think you need to use two different measures to compare these functions. One measure could compare their correlation. The other could compare the error in values. Typical error functions include distance functions such as L1-norm (hamming distance) and euclidean distance (L-2 norm), – Cecilia Mar 16 '15 at 16:49
  • Here are two other posts that may be of use http://stackoverflow.com/a/6723457/3303546 http://stats.stackexchange.com/questions/27861/similarity-measures-between-curves – Cecilia Mar 17 '15 at 14:30

0 Answers0