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

shenton_pdf(n, nn, p, m)
% shenton_pdf.m - evaluates a Shenton Probability Density.
%   See "Lagrangian Probability Distributions", P.C. Consul & F. Famoye,
%   Birkhauser, 2006, Table 2.3.
%
%   Won't normalize properly if p >~0.5 OR m*p >~ 0.5 !!!
%
%  Created by Jim Huntley,  11/20/08
%

function [pdf] = shenton_pdf(n, nn, p, m)

q = 1 - p;

argn = nn + m * n;
nd2 = n / 2;
pdf = nn * binomial_coef(argn,nd2) * p^nd2 * q^(argn-nd2) / argn; 

return

Contact us