Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates


James Huntley


generates random variates from over 870 univariate distributions

dblray_pdf(x, mu, sigma)
% dblray_pdf.m - evaluates a Double Rayleigh Probability Density.
%   See "Continuous Univariate Distributions", Johnson, Kotz and Balakrishnan,
%   Vol.1, J. Wiley, 1995, p.480.
%  Created by Jim Huntley,  10/10/08

function [pdf] = dblray_pdf(x, mu, sigma)

%persistent coef

    coef = 1 / (2*sigma^2);

pdf = abs(x-mu) * exp((-(x-mu)^2).*coef) * coef;


Contact us