The figure below shows the plot of two different signals which I am aiming to compare. The blue signal is the actual signal and the red signal is the prediction of the same signal. I have also attached signals a and b as mat files.
I have following questions:
  1. How do I compare both the signals? Is there anything like Pearson coefficient for these type of signals?
  2. I believe that applying Pearson coefficient for this signal is not right as the two signals are quite non-linear (I observed this by scatter-plotting both together).
Thank you in advance. Stay safe and healthy

Antworten (1)

Alan Stevens
Alan Stevens am 10 Okt. 2020

0 Stimmen

I don't see why you shouldn't use a Pearson r correlation:
A = a - mean(a);
B = b - mean(b);
r = A*B'/ (norm(A)*norm(B));

8 Kommentare

Praveen Kumar Pakkirisamy
Praveen Kumar Pakkirisamy am 10 Okt. 2020
On plotting both the data together, there is no linear realtionship(see the figure below). That is why I am wondering if I still can apply Pearson.
Alan Stevens
Alan Stevens am 10 Okt. 2020
I guess it's not a perfect measure here, as you could get r = 1 if the two curves were each asymmetrical but perfect horizontal reflections of each other, for example.
However, if the prediction is a small(ish) perturbation about the actual, Pearson probably serves as a reasonable measure in choosing between different sets of model parameters (or model structures).
Praveen Kumar Pakkirisamy
Praveen Kumar Pakkirisamy am 10 Okt. 2020
I understand, but the figure I showed has actually a good estimation of the actual signal and this is not the case everytime. Sometimes, it is really bad and when I plot them together, I see that they are highly non-linear. That is why I was wondering if Pearson still holds.
Alan Stevens
Alan Stevens am 10 Okt. 2020
What do you get for the r value in the "bad" cases? If it's small then it's giving you the right information!
Praveen Kumar Pakkirisamy
Praveen Kumar Pakkirisamy am 11 Okt. 2020
I get lower values for bad cases however, I am worried about the signigicance of the result.
How about using the correlation coefficient on the cumulative areas:
load('a.mat')
load('b.mat')
a1 = cumsum(a);
b1 = cumsum(b);
A = a1-mean(a1);
B = b1-mean(b1);
r = A*B'/(norm(A)*norm(B));
x = 1:numel(a);
disp('Correlation coefficient')
disp(r)
subplot(2,1,1)
plot(a1,b1,'o'),grid
title('cumsum(A) vs cumsum(B)')
subplot(2,1,2)
plot(x,a1,'b',x,b1,'r'),grid
legend('cumsum(a)','cumsum(b)')
Praveen Kumar Pakkirisamy
Praveen Kumar Pakkirisamy am 15 Okt. 2020
Sorry, I don't understand what is happening. Only on cumulative areas, you mean only till a certain data point?. Is there a reference/study material for this method as I want to be certain of what method I am using. Thank you.
Alan Stevens
Alan Stevens am 15 Okt. 2020
It's just a suggestion of a way of ranking your different models!

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by