From 2274e88690be495c1226e3c99d09ebc92918af26 Mon Sep 17 00:00:00 2001 From: Remco Renken Date: Wed, 23 Mar 2022 12:44:42 +0100 Subject: [PATCH] removed a bug in the "old" slow calculation. (option) UseHistProxy=false --- CREClass.m | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/CREClass.m b/CREClass.m index 22c4c46..f9d4eec 100644 --- a/CREClass.m +++ b/CREClass.m @@ -1,7 +1,7 @@ classdef CREClass < handle properties Data; % the data set to get the CRE off - nBin; %number of bins for the reference + nBin; %number of bins Monitor=true; %set to true to get intermediat results/figures UseHistProxy=true; % set this to get a proxy of the survival function using the hist function end @@ -104,7 +104,7 @@ classdef CREClass < handle LogFC=log(FC); LogFC(~isfinite(LogFC))=0;%the log of 0 is -inf. however in Fc.*logFc it should end up as 0. to avoid conflicts removing the -inf if any(isnan(FC));error('something went wrong');end %catch a posible error. - if transpose(dl)*FC==0; + if transpose(dl)*FC==0 %if only one value in the most left bin in the distribution I may get a 0 divided by 0 %as the CRE of a delta function is 0, enforce this outcome obj.CRE=0; @@ -119,8 +119,12 @@ classdef CREClass < handle obj.P_RB=FC(ind); obj.RB=bin(ind); else - SortData=sort(obj.Data); - obj.RB=SortData(ind); +% SortData=sort(obj.Data); +% obj.RB=SortData(ind); + % I think the two lines above are a bug. I should not use + % "SortData but rather q itsself. Some numbers may be in + % the data multiple times + obj.RB=q(ind); obj.P_RB=FC(ind); end end