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

betaratio_pdf(x, a, b, lambda, bet)
% betaratio_pdf.m - evaluatess a Beta Ratio Probability Density.
%   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 PDF!!!
%

function[pdf] = betaratio_pdf(x, a, b, lambda, bet)

coef = exp(bet*log(lambda) + log(beta(bet+a,b)) - gammaln(bet) - log(beta(a,b)));

for jx = 1:size(x,2)
    pdf(jx) = coef * x(jx)^(bet-1) * real(pfq(bet+a,bet+a+b,-lambda*x(jx)));
end

return





Contact us