function LL = LL_SHM_B(params,y)
%% Syntax: function LL = LL_SHM_B(params,y)
% params|C x M -- where C is the no of MCMC chains
% M is the number of parameters
% y is the data -- 1: None (> R00); 2: Slight (0.9-1.0 R00); 
% 3: Moderate (0.8-0.9 R00); 4: High (0.7-0.8 R00); 5: Very High (< 0.7
% R00)

data_lnX = params(:,1);

R00 = 2.5;
am0 = R00;
am1 = 0.9*R00;
am2 = 0.8*R00;
am3 = 0.7*R00;

LF = ones(size(data_lnX));
vect_am = [inf, am0, am1, am2, am3, -inf];

function int_bounds = function_bounds(yy)
    int_bounds = [vect_am(yy), vect_am(yy+1)]; % Upper and lower bound
end



for i = 1:length(data_lnX)
    for j = 1:length(y)
        bounds = function_bounds(y(j));
        bounds(bounds>0) = log(bounds(bounds>0));
        y(j);
        int_value = normcdf(bounds, data_lnX(i),0.0495);
        LF(i) = LF(i)*(int_value(1)-int_value(2));
    end
    
end
LL = log(LF);
end
