% 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:');
b = 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)=(b*a^b)/(x(i))^(b+1);
   distance=distance+step;
end
semilogy(x,y)
xlabel('x'),ylabel('Pareto pdf')

 


Go back to book Homepage Go back to book's matlab Homepage Go back to book's Chapter 1 Homepage

Copyright � 2001 Northstar Digital Design, Inc.