% file name: pareto_pdf.m
% created Oct. 23, 1999 by Fayez Elguibaly.
% Modified Jan. 18, 2000 by F. Elguibaly.
% The file requires specification of 
% Pareto parameters a and b and maximum value for x-axis.
% The file will produce a plot of the pdf.

a = input(...
   'Enter the value of position parameter (a) please:');
b1 = input(...
   'Enter the value of shape parameter (b) please:');
x_min=a;
x_max=input(...
   'Enter maximum value of x-axis please (must be > a):');
points=100;
step = (x_max-x_min)/(points-1);
distance = x_min;
for i=1:points,
   x(i)=distance;
   y(i)=(b1*a^b1)/(x(i))^(b1+1);
   distance=distance+step;
end
semilogy(x,y,'k-')
xlabel('x'),ylabel('Pareto pdf')
hold on	 
% now plot the pdf when b is doubled.
b2 = 2*b1
distance = x_min;
for i=1:points,
   x(i)=distance;
   y(i)=(b2*a^b2)/(x(i))^(b2+1);
   distance=distance+step;
end
semilogy(x,y,'k:')
xlabel('x'),ylabel('Pareto pdf')

