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

trunlerch_pdf(n, a, b, z, s, ups)
% trunlerch_pdf.m - evaluatess a Truncated Lerch Probability Density.
%   See Auxiliary Information for Article, "Some Properties of the Lerch Family of Discrete Distributions", 
%   S.V. Askenov and M.A. Savageau, preprint submitted to Elsevier Science,
%   1 February, 2008.
%
%  Created by Jim Huntley,  12/16/08
%

function [pdf] = trunlerch_pdf(n, a, b, z, s, ups)

%persistent c

%if(isempty(c))
    c1 = z^a * lerch(z, s, ups+a);
    c = 1 / (c1 - z^(b+1) * lerch(z,s,ups+b+1));
%end

pdf = c * z^n / (ups+n)^s;

return

Contact us