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

betaprod_cdf(x,a,b,lambda,bet)
% betaprod_cdf.m - compute Beta Produst 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. 
%
%               Vector Form of CDF !!!
%
%  Created by:  Jim Huntley,  11/13/06.
%

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

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

return



Contact us