removed a bug in the "old" slow calculation. (option) UseHistProxy=false
This commit is contained in:
parent
6c31374b1a
commit
2274e88690
12
CREClass.m
12
CREClass.m
@ -1,7 +1,7 @@
|
|||||||
classdef CREClass < handle
|
classdef CREClass < handle
|
||||||
properties
|
properties
|
||||||
Data; % the data set to get the CRE off
|
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
|
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
|
UseHistProxy=true; % set this to get a proxy of the survival function using the hist function
|
||||||
end
|
end
|
||||||
@ -104,7 +104,7 @@ classdef CREClass < handle
|
|||||||
LogFC=log(FC);
|
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
|
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 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
|
%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
|
%as the CRE of a delta function is 0, enforce this outcome
|
||||||
obj.CRE=0;
|
obj.CRE=0;
|
||||||
@ -119,8 +119,12 @@ classdef CREClass < handle
|
|||||||
obj.P_RB=FC(ind);
|
obj.P_RB=FC(ind);
|
||||||
obj.RB=bin(ind);
|
obj.RB=bin(ind);
|
||||||
else
|
else
|
||||||
SortData=sort(obj.Data);
|
% SortData=sort(obj.Data);
|
||||||
obj.RB=SortData(ind);
|
% 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);
|
obj.P_RB=FC(ind);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user