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

tmix_pdf(x, nn, p, a)
% umix_pdf.m - evaluates a Binomial Mixture of Uniform Probability Density.
%   See "Continuous Univariate Distributions", v.2, Johnson, Kotz, & Balakrishnan, 
%   Wiley, 1995, p.421. 
%
%   Vector Form of PDF!!!
%
%  Created by Jim Huntley,  09/30/08
%

function[pdf] = tmix_pdf(x, nn, p, a)

for jx = 1:size(x,2)
    sum = 0;
    for jr = 1:nn+1
        r = jr - 1;
        sum = sum + binomial_coef(nn,r) * p^r * (1-p)^(nn-r) * x(jx)^r * ...
              (r+1) / a^(r+1);
    end
    pdf(jx) = sum;
end

return



Contact us