function [NPV, prob, averageSeverity, numofclaims] = pricing(premium, ELR, commission, XOL, numoflob)
% ELR = 0.8; % 20% %
% premium = 10000000;
% commission = 0.05; % 5%
% XOL = 500000;
lossPick = ELR*premium;
%Four lines of business ISO parameters for these businesses.
B = [26611.630; 13652.428; 11867.602; 34202.847];
Q = [1.350; 1.050; 1.050; 1.450];
P = [0.9080886; 0.9073123; 0.9250959; 0.9138433];
S = [2723.451; 2136.538; 2148.400; 2721.200];
T = [10000; 10000; 10000; 10000];
[loss, averageSeverity, numofclaims] = model_loss_process(premium, lossPick, B, Q, P, S, T);
loss = overimpose_the_structure(premium, XOL, loss, lossPick, commission);
%Calculating probablities of each loss
inc = 100/length(loss);
prob = 0+ inc : inc: 100;
%Calculating the Net Present Value from each loss
NPV = premium - loss;
% figure;
% plot(NPV)
%Plotting NPV histogram and CDF
% figure;
% plot(prob, fliplr(sort(NPV)));
% title('CDF of Net Present Value');
% xlabel('Percentage (%)');
% ylabel('NPV ($$)');
% grid on;
% figure;
% hist(NPV)
%Plot the CDF for NPV
% loss = sum(loss);
% prob = 100/length(loss);
% prob = 0+prob : prob: 100;
% plot(prob, premium-sort(loss));