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

log_pdf(n, p)
% log_pdf.m - evaluates a Logarithmic (Series) Probability Density.
%   See Wikipedia 
%
%  Created by Jim Huntley,  8/30/07
%

function [pdf] = log_pdf(n, p)

%persistent coef

%if(isempty(coef))
    coef = -1 / log(1-p);
%end

pdf =  coef * p^n / n;
    
return

Contact us