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

logzeros_pdf(n, omega, theta)
% logzeros_pdf.m - evaluates a Logarithmic with Zeros Probability Density.
%   See "Univariate Discrete Distributions", Johnson, Kemp, & Kotz, 
%   J. Wiley, 2005, 355. 
%
%  Created by Jim Huntley,  7/06/07
%

function [pdf] = logzeros_pdf(n, omega, theta)

%persistent omomeg lomthet

%if(isempty(omomeg))
    omomeg = 1 - omega;
    lomthet = log(1-theta);
%end

pdf = omega;
if(n > 0)
    pdf =  omomeg * theta^n / (-n * lomthet);
end
    
return

Contact us