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

lagbeta_cdf(x, n, alpha, bet, r)
% lagbeta_cdf.m - evaluates a Lagrangian Beta Cumulative Distribution.
%   See "Continuous Univariate Distributions", v.2, Johnson, Kotz, & Balakrishnan
%   J. Wiley, 1995, 255. 
%
%  Created by Jim Huntley,  7/03/07
%

function [cdf] = lagbeta_cdf(x, n, alpha, bet, r)

arg = alpha * x;

sum1 = 0;
for jj = 1:r-1
    bc = binomial_coef(n+bet*(jj-1),jj-1);
    sum1 = sum1 + bc * arg^(jj-1) * (1-arg)^(n+bet*(jj-1)-jj+1) / (n+bet*(jj-1));
end
cdf = 1 - n * sum1;
    
return

Contact us