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

shlogzero_pdf(n, theta, k)
% shlogzero_pdf.m - evaluates a Shifted Log Zero Probability Density.
%   See "Univariate Discrete Distributions", Johnson, Kemp, & Kotz, 
%   J. Wiley, 2005, 318. 
%
%  Created by Jim Huntley,  7/06/07
%

function [pdf] = shlogzero_pdf(n, theta, k)

%persistent lomthet 

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

pdf =  theta^(n-k+1) / ((k-n-1) * lomthet);
    
return

Contact us