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

genpears7_pdf(x, m, c, xi)
% genpears7_pdf.m - evaluates the Generalized Pearson 7 Probability Density.  
% See "Continuous Univariate Distributions", Johnson, Kotz, & Balakrishnan,
% Wiley, Vol. 2, p. 396, 1995.
%
%  Created by:   Jim Huntley,  02/14/07.
%
%  Vector form of the PDF !!!
%

function [pdf] = genpears7_pdf(x, m, c, xi)

%persistent gamm t1 gammmoh lrtpi

%if(isempty(gamm))
    gamm = gammaln(m);
    t1 = log(c^(2*m-1));
    gammmoh = gammaln(m-0.5);
    lrtpi = log(sqrt(pi));
%end

%pdf = gamma(m) * c^(2*m-1) ./ ((c^2 + (x-xi).^2).^m * gamma(m-0.5) * sqrt(pi));
pdf = exp(gamm + t1 - (log((c^2 + (x-xi).^2).^m) + gammmoh + lrtpi));

return

Contact us