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

qbetageom_pdf(n, rho, u, m)
% qbetageom_pdf.m - evaluates a q-Beta Geometric Probability Density.
%   See "Univariate Discrete Distributions", Johnson, Kemp, and Kotz,
%   J. Wiley, 2005, p.474.    
%
%  Created by Jim Huntley,  9/24/07
%

function [pdf] = qbetageom_pdf(n, rho, u, m)

prodn = 1 - rho;
prodd = 1 - rho/u;
if(n == 1)
    pdf = prodn / prodd;
end
if(n > 1)
    for jx = 2:n
        prodn = prodn * (1-m^(jx-2)/u);
        prodd = prodd * (1-m^(jx-1)*rho/u);
    end
    pdf = prodn * rho^(n-1) / prodd;
end

return

Contact us