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

exbert3_pdf(n, nn, alpha, bet)
% exbert3_pdf.m - evaluates an EXBERT Model 3 Probability Density.
%   See "Univariate Discrete Distributions", Johnson, Kemp & Kotz,
%   J. Wiley, p.154, 2005.
%
%   NOTE:  This distribution is not normalized!!!
%
%  Created by Jim Huntley,  01/04/07
%

function [pdf] = exbert3_pdf(n, nn, alpha, bet)

sum1 = 0;
for jj = 1:nn-n+1
    pik = 1;
    if(jj > 1)
        pik = bet + (1-bet)*alpha^(n+jj-1);
    end
    sum1 = sum1 + binomial_coef(nn-n,jj-1) * (-1)^(jj-1) * pik;
end
pdf = binomial_coef(nn,n) * sum1;

return


Contact us