clear all
figure(1)
clf

for p=3.5:.001:4
    %r=3.99;        %the rate parameter range 0-4  nice 3.7
    n=2000;       %the number of point to generate
    y(1)=0.55;    %initial value for x
    for i=1:n-1
        y(i+1)=p*y(i)*(1-y(i));
    end
    y=y(end-1000:end);

    sd = std(y);
    y = (y-mean(y))/sd;

    r = 0.1 ; %since the stdDev is normalized to 1.0
    m = 2;


    [e,A,B]=sampencBRL(y,m,r);
    plot(p,e(end),'x','markersize',3);
    set(gca,'ylim',[0 1], 'xlim', [3.5 4])
    hold on
    drawnow
end

xlabel('logistic parameter')
ylabel('sample entropy')

