From e6e9e593a451d6e01094c45fb22a15d465ed415b Mon Sep 17 00:00:00 2001 From: Remco Renken Date: Thu, 24 Nov 2022 14:10:27 +0100 Subject: [PATCH] see previous comment --- TestCREClass.m | 61 ++++++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/TestCREClass.m b/TestCREClass.m index 70ed77b..ba3e425 100644 --- a/TestCREClass.m +++ b/TestCREClass.m @@ -2,31 +2,36 @@ % show some default behaviour % and test the error handling. %% set some constants -A=randn(100); +% A=randn(1000,1); +% A=rand(1000,1); +A=cat(1,randn(1000,1),randn(200,1)+10); %% create instance of CRE class -S1=CREClass; -%% Calculate by setting labda equal to each of the (unique) values in the data. -S1.UseHistProxyFlag=false; -S1.EqualSizeBinFlag=false; -S1.Data=A;% set gaussian data -S1.Calc; -disp(S1) -%% use histogram aproximation with unequal bin sizes in the histogram -S2=CREClass; -S2.UseHistProxyFlag=true; -S2.EqualSizeBinFlag=false; -S2.Data=A;% set gaussian data -S2.nBin=numel(A); % set nbin to npoints; This is fine as we use the cummulative distribution and the formulas as defined in Zografos -S2.Calc -disp(S2) -%% use histogram aproximation with equal bin sizes in the histogram -S3=CREClass; -S3.UseHistProxyFlag=true; -S3.EqualSizeBinFlag=false; -S3.Data=A;% set gaussian data -S3.nBin=numel(A); % set nbin to npoints; This is fine as we use the cummulative distribution and the formulas as defined in Zografos -S3.Calc -disp(S3) +% % % S1=CREClass; +% % % %% Calculate by setting labda equal to each of the (unique) values in the data. +% % % S1.UseHistProxyFlag=false; +% % % S1.EqualSizeBinFlag=false; +% % % S1.Data=A;% set gaussian data +% % % S1.Calc; %get RB based on the CRE +% % % S1.CalcRBShannon; %% get RB based on shannon entropy +% % % disp(S1) +% % % %% use histogram aproximation with unequal bin sizes in the histogram +% % % S2=CREClass; +% % % S2.UseHistProxyFlag=true; +% % % S2.EqualSizeBinFlag=false; +% % % S2.Data=A;% set gaussian data +% % % S2.nBin=numel(A); % set nbin to npoints; This is fine as we use the cummulative distribution and the formulas as defined in Zografos +% % % S2.Calc +% % % S2.CalcRBShannon; +% % % disp(S2) +% % % %% use histogram aproximation with equal bin sizes in the histogram +% % % S3=CREClass; +% % % S3.UseHistProxyFlag=true; +% % % S3.EqualSizeBinFlag=false; +% % % S3.Data=A;% set gaussian data +% % % S3.nBin=numel(A); % set nbin to npoints; This is fine as we use the cummulative distribution and the formulas as defined in Zografos +% % % S3.Calc +% % % S3.CalcRBShannon; +% % % disp(S3) %% Check recalculation of edges S4=CREClass; S4.UseHistProxyFlag=true; @@ -34,13 +39,15 @@ S4.EqualSizeBinFlag=true; S4.Data=A;% set gaussian data S4.nBin=numel(A); % set nbin to npoints; This is fine as we use the cummulative distribution and the formulas as defined in Zografos S4.Calc +S4.CalcRBShannon; disp(S4) -S4.nBin=numel(A)/10; +S4.nBin=round(numel(A)/10); S4.CalcEdges ; % force a recalculation of the edges S4.Calc; +S4.CalcRBShannon; disp(S4) - - +%% +return; %% Show effect of scaling or ofsett the data % Scale S.Data=100*A;