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

mixbint_pdf(x, nn, p, nu)
% mixbint_pdf.m - evaluates a Mixed Binomial T Probability Density.
%   See "Continuous Univariate Distributions", v.2, Johnson, Kotz, & Balakrishnan,
%   J. Wiley, 1995, p.421.
%
%   Vector Form of PDF !!!
%
%  Created by Jim Huntley,  7/11/07
%

function [pdf] = mixbint_pdf(x, nn, p, nu)

sum1 = 0;
for jx = 1:nn+1
    r = jx - 1;
    sum1 = sum1 + binomial_coef(nn,r) .* p^r .* (1-p).^(nn-r) .* x.^(2*r) ./ ...
           (beta(r+0.5,0.5*nu).*nu^(r+0.5).*(1+x.^2./nu).^(0.5*(nu+1)+r));
end
pdf = sum1;

return

Contact us