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

kummer_pdf(x, alpha, bet, gamm, delta)
% kummer_pdf.m - evaluatess a Kummer Probability Density.
%   See "Continuous Univariate Distributions", Johnson, Kotz, and Balakrishnan,
%   J. Wiley, v.2, 1995, 648. 
%
%   Vector Form of the PDF!!!
%
%  Created by Jim Huntley,  6/22/07
%

function [pdf] = kummer_pdf(x, alpha, bet, gamm, delta)

%persistent Cinv

%if(isempty(Cinv))
    nt = 250;
    tmax = 25;
    dt = tmax/(nt-1);
    t = eps:dt:tmax;
    kernt = exp(-(bet/delta).*t) .* t.^(alpha-1) .* (1+t).^(-gamm);
    Cinv = trapz(kernt) * dt / delta^alpha;
%end

pdf = exp(-bet.*x) .* x.^(alpha-1) ./ (Cinv .*(1+delta.*x).^gamm); 

return

Contact us