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

hyperbola_pdf(x, alpha, bet)
% hyperbola_pdf.m - evaluates a Hyperbola Probability Density.
%   See "Non-Uniform Random Deviates", L. Devroye, Chapter 9.
%
%  Created by Jim Huntley,  08/18/06
%
%  Vector Form of the PDF!!!
%

function [pdf] = hyperbola_pdf(x, alpha, bet)

sx = size(x,2);
zeta = sqrt(alpha^2 - bet^2);
coef = 0.5 / besselk(0,zeta);

for jx = 1:sx
    pdf(jx) = coef * exp(-alpha*sqrt(1+(x(jx))^2)+bet*x(jx)) / sqrt(1+(x(jx))^2);
end

return

Contact us