Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

James Huntley (view profile)

 

generates random variates from over 870 univariate distributions

pearson4_pdf(x, m, nu, a, lambda)
% pearson4_pdf.m - evaluates a Pearson Type IV Probability Density.
%   See "A Guide to the Pearson Type IV Distribution", J. Heinrich, U. PA, 1/8/04.
%
%  Created by Jim Huntley,  8/18/04
%

function [pdf] = pearson4_pdf(x, m, nu, a, lambda)

%persistent k

%if(isempty(k))
    k = 2^(2*m-2) * (abs(cgamma(m + 1i*nu*0.5)))^2 / (pi*a*exp(gammaln(2*m - 1)));
%end

argx = (x - lambda) ./ a;
pdf = k .* (1 + argx.^2).^(-m) .* exp(-nu.*atan(argx));

return

Contact us