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, nu)
% tmix_pdf.m - evaluates a Binomial Mixture of T 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, nu)

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)^(2*r) / ...
              (beta(0.5+r,0.5*nu)*nu^(0.5+r)*(1+x(jx)*x(jx)/nu)^(0.5*(nu+1)+r));
    end
    pdf(jx) = sum;
end

return



Contact us