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

limpolya_pdf(x, a, c, d, bet, r)
% limpolya_pdf.m - evaluates a Limiting Polya-Type Power Probability Density.
%   See "Continuous Univariate Distributions", Johnson, Kotz and Balakrishnan,
%   1995, J. Wiley, v.1, p.56.
%
%   Vector Form of PDF !!!
%
%  Created by Jim Huntley,  1/24/08
%

function [pdf] = limpolya_pdf(x, a, c, d, bet, r)

%persistent coef

%if(isempty(coef))
    %coef = d * a^(c/d) * gamma(bet) * gamma(r-c/d) / ...
    %       (gamma(c/d)*gamma(r)*gamma(bet-c/d));
    coef = exp(log(d) + (c/d)*log(a) + gammaln(bet) + gammaln(r-c/d) - ...
            (gammaln(c/d) + gammaln(r) + gammaln(bet-c/d)));
%end

arg = -a .* x.^d;
pdf = coef .* x.^(c-1) .* KummerComplex(bet,r,arg);

return

Contact us