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

genray_pdf(x, k, theta)
% genray_pdf.m - evaluates a generalize Rayleigh Probability Density.
%   See "Continuous Univariate Distributions", v.1, Johnson, Kotz, & Balakrishnan, 
%   J. Wiley, 1995, p.479.
%
%   Vector Form of PDF !!!
%
%  Created by Jim Huntley,  6/21/07
%

function [pdf] = genray_pdf(x, k, theta)

%pdf = 2 .* theta^(k+1) .* x.^(2*k+1) .* exp(-theta.*x.^2) ./ gamma(k+1);
pdf = exp(log(2 * theta^(k+1)) + (2*k+1).*log(x) - theta.*x.^2 - gammaln(k+1));

return

Contact us