Mercurial > forge
changeset 989:965d5b601b6f octave-forge
hack to skip NaNs in min(sig_nan). This is necessary because Octave returns NaN instead of X for min(NaN,X)
author | schloegl |
---|---|
date | Mon, 30 Jun 2003 16:03:56 +0000 |
parents | adda1f4aa84a |
children | 54cdb11c96be |
files | extra/NaN/corrcoef.m |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/extra/NaN/corrcoef.m Mon Jun 30 14:58:58 2003 +0000 +++ b/extra/NaN/corrcoef.m Mon Jun 30 16:03:56 2003 +0000 @@ -294,8 +294,10 @@ % remove diagonal elements, because these have not any meaning % nan_sig(isnan(nan_R)) = nan; -if any(nan_sig(:) < alpha), - fprintf(1,'CORRCOFF Warning: Missing Values (i.e. NaNs) are not independent of data (p-value=%f)\n', min(nan_sig(:))); +if any(nan_sig(:) < alpha), + tmp = nan_sig(:); % Hack to skip NaN's in MIN(X) + min_sig = min(tmp(tmp(~isnan(tmp)))); % Necessary, because Octave returns NaN rather than X for min(NaN,X) + fprintf(1,'CORRCOFF Warning: Missing Values (i.e. NaNs) are not independent of data (p-value=%f)\n', min_sig); fprintf(1,' Its recommended to remove all samples with any missing value (NaN).\n'); fprintf(1,' In the following combinations the null-hypotheses (NaNs are uncorrelated) must be rejected.\n'); [ix,iy] = find(nan_sig < alpha);