Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

James Huntley (view profile)

 

generates random variates from over 870 univariate distributions

betaratio_cdf(x,a,b,lambda,bet)
% betaratio_cdf.m - compute Beta Product Cumulative Distribution Function.
%   See "On the Product and Ratio of Gamma and Beta Random Variables", 
%   S. Nadrajah & S. Kotz, Allgemeines Statistisches Archiv 89, 435, 11/05. 
%
%  Created by Jim Huntley,  09/25/08
%
%   Note:  Vector form of the CDF!!!
%

function [cdf] = betaratio_cdf(x,a,b,lambda,bet)

% Integrate PDF to get CDF.
dx = x(2) - x(1);
pdf = betaratio_pdf(x,a,b,lambda,bet);
for jx = 1:size(x,2)
    cdf(jx) = trapz(pdf(1:jx)) * dx;
end

return



Contact us