


function [S]=similarity(A)
%A contains [point estimate, CV, point estimate, CV]
t1=A(:,1);
sd1=abs(A(:,1).*A(:,2)/100);
t2=A(:,3);
sd2=abs(A(:,3).*A(:,4)/100);
n=size(A,1);


N=3000;
clear a b
p=length(t1);
for t=1:N;
    a(t,:)=-ones(1,p);
    b(t,:)=-ones(1,p);
    for i=1:p;
        while a(t,i)<0;
            a(t,i)=t1(i)+sd1(i)*randn;
        end
        while b(t,i)<0;
            b(t,i)=t2(i)+sd2(i)*randn;
        end
    end
end

for i=1:N;
    for j=1:n;
        dist(j)=abs(a(i,j)-b(i,j))/(a(i,j)+b(i,j))*2; 
    end
    acc3(i)=mean(dist);
end
%

S=1-mean(acc3)^2/(0.5^2+mean(acc3)^2);


%%%%%%%%%%%%

