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

good2_pdf(n, q, ups)
% good2_pdf.m - evaluates a Good 2 Probability denisity.
%   See "Univariate Discrete Distributions", Johnson, Kemp, and Kotz,
%   Wiley, p.532, 2005.  
%
%   Created by  J. Huntley,  03/08/06.
%
%   Calls:  'lerch.m'
%

function [pdf] = good2_pdf(n, q, ups)

%persistent coef

%if(isempty(coef))
    coef = 1 / lerch(q, 1, ups);
%end

pdf = coef * q^(n-1) / (n+ups-1);


return


    

Contact us