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

maxwell_pdf(x,a)
% maxwell_pdf.m - evaluates a Maxwellian Probability Density Function.
%   See FORTRAN code: prob_f90, John Burkhardt, 12/19/99.
%
%  Translated/Modified by Jim Huntley,  03/10/04
%

function [pdf] = maxwell_pdf(x,a)

y = x / a;
%pdf = exp(-0.5*y^2) * y^2 / (sqrt(2.0)*a*gamma(1.5));
pdf = exp(-0.5*y^2 + 2*log(y) - (log(sqrt(2.0)*a) + gammaln(1.5)));

return

Contact us