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

wilhil_pdf(x, alpha, theta)
% wilhil_pdf.m - evaluatess a Wilson Hilferty Probability Density.
%   See "The Amoroso Distribution", G. E. Crooks, Tech. Note 003v5 (2010-01-14)
%   http://threeplusone.com/pubs/technote/CrooksTechNote003.pdf.
%
%   Vector form of the PDF!!!
%
%  Created by Jim Huntley,  02/18/10
%

function [pdf] = wilhil_pdf(x, alpha, theta)

%persistent coef

%if(isempty(coef))
    coef = 3 / (gamma(alpha)*theta);
%end

argx = x ./ theta;
%pdf = coef .* argx.^(3*alpha-1) .* exp(-(argx.^3));
pdf = 3.* exp((3*alpha-1).*log(argx) - argx.^3 - log(theta) - gammaln(alpha));

return

Contact us