CRE_RB_and_CCRE/TestCREClass.m

46 lines
743 B
Mathematica
Raw Normal View History

2019-04-04 08:35:34 +02:00
S=CREClass;
2020-02-20 18:14:55 +01:00
S.Data=randn(100,1);
2019-04-04 08:35:34 +02:00
S.nBin=(1000);
%% use histogram
S.UseHistProxy=true;
S.Calc;
S
%% Use my aproximation
S.UseHistProxy=false;
S.Calc;
S
std(S.Data)
%% multiply S
S.Data=100*S.Data;
S.UseHistProxy=true;
2020-02-20 18:14:55 +01:00
S.Calc;
2019-04-04 08:35:34 +02:00
S
std(S.Data)
%% ones again the "new" way
S.UseHistProxy=false;
2020-02-20 18:14:55 +01:00
S.Calc;
S
%% Test CCRE class
2020-02-21 08:42:07 +01:00
figure(1);clf;hold on
figure(2);clf;
figure(3);clf;hold on;
A=randn(100);
B=A;
B(:)=A(randperm(numel(A)))
2020-02-21 08:42:07 +01:00
for k=-1:0.1:1
CS=CCREClass;
CS.Data=1*(1-abs(k))*A+k*B;
CS.nBin=50;
2020-02-21 08:42:07 +01:00
CS.DataRef=B;
CS.nBinRef=500;
2020-02-21 08:42:07 +01:00
CS.Calc;
figure(1);
2020-02-21 08:42:07 +01:00
plot(k,CS.CCRE,'o')
plot(k,CS.CRE,'x');
figure(2);
scatter(CS.DataRef(:),CS.Data(:));
figure(3);
plot(k,CS.CCRE./CS.CRE,'d');
pause(0.01)
end
CS