function [bin_prob] = f_QR3(X,params,bin_edges)
    
    n = size(X,1);
    if n>1
        bin_prob = zeros(n,length(bin_edges)-1);
        for i = 1:n
            yforeq            = X(i,:)*params;
            samples           = QR1_adjusted(0.05:0.05:0.95,yforeq);
            raw_prob(i,:)     = ksdensity(samples,bin_edges(2:end),'Function','cdf')-ksdensity(samples,bin_edges(1:end-1),'Function','cdf');
            bin_prob(i,:)     = smooth_bin_probabilities_adaptive(raw_prob(i,:), 5, 0.5, 2.0);
        end
    else
        yforeq            = X*params;
        samples           = QR1_adjusted(0.05:0.05:0.95,yforeq);
        raw_prob = ksdensity(samples,bin_edges(2:end),'Function','cdf')-ksdensity(samples,bin_edges(1:end-1),'Function','cdf');

        bin_prob = smooth_bin_probabilities_adaptive(raw_prob, 3, 0.5, 2.0);
    end
end