function propexpectedinbin = PropExpected(model,bincentre)
% This works out what proportion of events would be expected to fall into each bin, according to model

nbins = length(bincentre);

% To write this in Matlab way (fast)
CDF_array = zeros(1,nbins+1);
CDF_array(2:nbins) = BinomCDF(model, (bincentre(2:nbins)+bincentre(1:nbins-1))/2 );
CDF_array(nbins+1) = 1;
propexpectedinbin = CDF_array(2:nbins+1) - CDF_array(1:nbins);

