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

zeta_cdf(n, alpha)
% zeta_cdf.m - evaluates a Cumulative Zeta (Zipf) Distribution.
%   See FORTRAN code: prob_f90, John Burkhardt, 12/19/99.
%
%  Translated/Modified by Jim Huntley,  03/04/04
%
%

function [cdf] = zeta_cdf(n, alpha)

if(n < 1)
    cdf = 0;
    return
else
    c = zeta(alpha);        
    cdf = 0;
    for jy = 1:n
        pdf = (1/jy^alpha)/c;
        cdf = cdf + pdf;
    end
end

return

Contact us