Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

 

generates random variates from over 870 univariate distributions

wirelength_pdf(x, a)
% wirelength_pdf.m - evaluates a Wire Length probaility density.
%   See " The Analytical Form of the Length Distribution Function 
%   for Computer Interconnects", J. E. Cotter and P. Christie,
%   IEEE Trans. on Circuits and Systems, Vol. 38, No. 3, March, 1991.
%
%   Created by: J. Huntley,  10/20/06
%

function [pdf] = wirelength_pdf(x, a)

coef = 1/(18*a^4);

if(x <= a)
    pdf = coef * (-3*x^3 + 12*a*x^2 + 3*x);
elseif(x > a && x <= 2*a)
    pdf = coef * (5*x^3 - 36*a*x^2 + (72*a^2-5)*x - 32*a^3 + 8*a);
else
    pdf = coef * (-x^3 + 12*a*x^2 - (48*a^2-1)*x + 64*a^3 - 4*a);
end

pdf = max(pdf,0);

return;

Contact us