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

zipfman_pdf(n, q, nn, s)
% zipfman_pdf.m - evaluates a Zipf-Mandelbrot Probability Density.
%   See "Univariate Discrete Distributions", Johnson, Kemp & Kotz,
%   J. Wiley, p. 530, 2005.
%
%  Created by Jim Huntley,  11/6/07
%
%   Calls:  'lerch.m'
%

function [pdf] = zipfman_pdf(n, q, nn, s)

%persistent H

%if(isempty(H))
    H = 0;
    for ji = 1:nn
        H = H + (ji+q)^(-s);
    end
%end

pdf = 1 / (H * (n+q)^s);

return

Contact us