removed a bug in the "old" slow calculation. (option) UseHistProxy=false

This commit is contained in:
R.J. Renken 2022-03-23 12:44:42 +01:00
parent 6c31374b1a
commit 2274e88690
1 changed files with 8 additions and 4 deletions

View File

@ -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