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

otter_pdf(n, p)
% otter_pdf.m - tests an Otter Probability Density.
%   See "Lagrangian Probability Distributions", P.C. Consul & F. Famoye,
%   Birkhauser, 2006, Table 2.1.
%
%   Doesn't normalize for p <~0.5 !!!
%
%  Created by Jim Huntley,  11/10/08
%

function [pdf] = otter_pdf(n, p)

q = 1 - p;

pdf = (binomial_coef(n,(n-1)/2) * p^((n+1)/2) * q^((n-1)/2)) / n;

end

Contact us