( change: if you directly answer the question about the values โโof R, see below)
One way to get close to this is to use cross-correlation. Keep in mind that you need to normalize the amplitudes and fix the delays: if you have signal S1 and signal S2 is identical in shape, but half the amplitude and delay by 3 samples, they are still perfectly correlated.
For instance:
>> t = 0:0.001:1; >> y = @(t) sin(10*t).*exp(-10*t).*(t > 0); >> S1 = y(t); >> S2 = 0.4*y(t-0.1); >> plot(t,S1,t,S2);

They should have an ideal correlation coefficient. A way to calculate this is to use maximum cross-correlation:
>> f = @(S1,S2) max(xcorr(S1,S2)); f = @(S1,S2) max(xcorr(S1,S2)) >> disp(f(S1,S1)); disp(f(S2,S2)); disp(f(S1,S2)); 12.5000 2.0000 5.0000
The maximum xcorr() value provides a time delay between signals. As for the amplitude adjustment, you can normalize the signals so that their self-correction is equal to 1.0, or you can reset this equivalent step to the following:
& rho; 2 = f (S1, S2) 2 / (f (S1, S1) * f (S2, S2);
In this case, & rho; 2 = 5 * 5 / (12.5 * 2) = 1.0
You can decide for & rho; himself, i.e. & rho; = f (S1, S2) / sqrt (f (S1, S1) * f (S2, S2)), just keep in mind that both 1.0 and -1.0 are perfectly correlated (-1.0 has the opposite sign)
Try according to your signals!
as to which threshold to use for acceptance / rejection, it really depends on what signals you have. 0.9 and above is pretty good, but can be misleading. I would consider the remaining signal that you get after you subtract the correlated version. You can do this by looking at the time index of the maximum xcorr () value:
>> t = 0:0.001:1; >> y = @(a,t) sin(a*t).*exp(-a*t).*(t > 0); >> S1=y(10,t); >> S2=0.4*y(9,t-0.1); >> f(S1,S2)/sqrt(f(S1,S1)*f(S2,S2)) ans = 0.9959
This looks pretty good for correlation. But try setting S2 with a scaled / shifted multiple of S1:
>> [A,i]=max(xcorr(S1,S2)); tshift = i-length(S1); >> S2fit = zeros(size(S2)); S2fit(1-tshift:end) = A/f(S1,S1)*S1(1:end+tshift); >> plot(t,[S2; S2fit]); % fit S2 using S1 as a basis

>> plot(t,[S2-S2fit]); % residual

The residual energy has some energy in it; To understand how much you can use:
>> S2res=S2-S2fit; >> dot(S2res,S2res)/dot(S2,S2) ans = 0.0081 >> sqrt(dot(S2res,S2res)/dot(S2,S2)) ans = 0.0900
This suggests that the remainder has about 0.81% of the energy (9% rms amplitude) of the original signal S2. (the dot product of the 1D signal itself will always be equal to the maximum value of the mutual correlation of this signal with itself.)
I donโt think there is a silver bullet to answer how the two signals are similar to each other, but I hope I have given you some ideas that may be applicable to your circumstances.