CORR_TO_REAL Maps correlations to reals. t = corr_to_real(s) maps the correlation s in [-1,1] to the real number t. Works as the inverse function of real_to_corr, hence corr_to_real(real_to_corr(x)) is (nearly) equal to x. See also REAL_TO_CORR. created by Benedikt Rudolph DATE: 20-Aug-2012
0001 function t = corr_to_real(s) 0002 %CORR_TO_REAL Maps correlations to reals. 0003 % 0004 % t = corr_to_real(s) maps the correlation s in [-1,1] to the real number t. 0005 % Works as the inverse function of real_to_corr, hence 0006 % corr_to_real(real_to_corr(x)) is (nearly) equal to x. 0007 % 0008 % See also REAL_TO_CORR. 0009 % 0010 % created by Benedikt Rudolph 0011 % DATE: 20-Aug-2012 0012 0013 t = zeros(size(s)); 0014 idx = (s>=0); 0015 t(idx) = 1./(1-s(idx))-1; 0016 t(~idx) = 1+1./(-1-s(~idx)); 0017 end