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

wtgeom_pdf(n, p)
% wtgeom_pdf.m - evaluates a Weighted Geometric Probability Density.
%   See "Lagrangian Probability Distributions", P.C. Consul & F. Famoye,
%   Birkhauser, 2006, Table 1.1.
%
%  Created by Jim Huntley,  11/24/08
%

function [pdf] = wtgeom_pdf(n, p)

q = 1 - p;
pdf = n * p^2 * q^(n-1);

return

Contact us