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

subbgeom_pdf(n, q)
% subbgeom_pdf.m - evaluates a Subcritical Geometric Probability Density.
%   See "Univariate Discrete Distributions", Johnson, Kemp, and Kotz,
%   J. Wiley, p.472, 2005. 
%
%  Created by Jim Huntley,  10/09/07
%

function [pdf] = subbgeom_pdf(n, q)

%persistent coef 

%if(isempty(coef))
    coef = (1 - q)^2;
%end

pdf = coef * q^(n-1) / ((1-q^n) * (1-q^(n+1)));

return


Contact us